@mui/x-data-grid-premium 6.0.0-beta.2 → 6.0.0-beta.4
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 +164 -0
- package/components/GridGroupingCriteriaCell.js +6 -5
- package/hooks/features/export/serializer/excelSerializer.js +12 -11
- package/hooks/features/rowGrouping/createGroupingColDef.js +7 -4
- package/index.js +1 -1
- package/legacy/components/GridGroupingCriteriaCell.js +6 -5
- package/legacy/hooks/features/export/serializer/excelSerializer.js +12 -11
- package/legacy/hooks/features/rowGrouping/createGroupingColDef.js +7 -4
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/modern/components/GridGroupingCriteriaCell.js +5 -4
- package/modern/hooks/features/export/serializer/excelSerializer.js +12 -11
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +7 -4
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/components/GridGroupingCriteriaCell.js +5 -4
- package/node/hooks/features/export/serializer/excelSerializer.js +11 -10
- package/node/hooks/features/rowGrouping/createGroupingColDef.js +7 -4
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +6 -6
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,112 @@
|
|
|
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
|
+
## 6.0.0-beta.4
|
|
7
|
+
|
|
8
|
+
_Feb 16, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⚡️ Improve grid performance by reducing rerenders (#7857) @cherniavskii
|
|
13
|
+
- 📚 Documentation improvements
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v6.0.0-beta.4` / `@mui/x-data-grid-pro@v6.0.0-beta.4` / `@mui/x-data-grid-premium@v6.0.0-beta.4`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Add interface for `singleSelect` column (#7685) @m4theushw
|
|
21
|
+
- [DataGrid] Allow to pass props to the `TrapFocus` inside the panel wrapper (#7733) @Vivek-Prajapatii
|
|
22
|
+
- [DataGrid] Avoid unnecessary rerenders after `updateRows` (#7857) @cherniavskii
|
|
23
|
+
- [DataGridPro] Change cursor when dragging a column (#7725) @sai6855
|
|
24
|
+
- [DataGridPremium] Fix `leafField` to have correct focus value (#7950) @MBilalShafi
|
|
25
|
+
|
|
26
|
+
### `@mui/x-date-pickers@v6.0.0-beta.4` / `@mui/x-date-pickers-pro@v6.0.0-beta.4`
|
|
27
|
+
|
|
28
|
+
#### Changes
|
|
29
|
+
|
|
30
|
+
- [DateRangePicker] Fix slide transition by avoiding useless component re-rendering (#7874) @LukasTy
|
|
31
|
+
- [fields] Support Backspace key on `Android` (#7842) @flaviendelangle
|
|
32
|
+
- [fields] Support escaped characters on `Luxon` (#7888) @flaviendelangle
|
|
33
|
+
- [pickers] Prepare new pickers for custom fields (#7806) @flaviendelangle
|
|
34
|
+
|
|
35
|
+
### `@mui/x-codemod@v6.0.0-beta.4`
|
|
36
|
+
|
|
37
|
+
#### Changes
|
|
38
|
+
|
|
39
|
+
- [codemod] Fix import path (#7952) @LukasTy
|
|
40
|
+
|
|
41
|
+
### Docs
|
|
42
|
+
|
|
43
|
+
- [docs] Add an info callout specifying the current state of desktop time view (#7933) @LukasTy
|
|
44
|
+
- [docs] Add missing param in `useGridApiEventHandler` examples (#7939) @flaviendelangle
|
|
45
|
+
- [docs] Fix markdown table alignments (#7898) @oliviertassinari
|
|
46
|
+
- [docs] Improve `DataGrid` migration guide (#7861) @MBilalShafi
|
|
47
|
+
- [docs] Update `LocalizationProvider` `dateAdapter` with a link to the doc (#7872) @LukasTy
|
|
48
|
+
|
|
49
|
+
### Core
|
|
50
|
+
|
|
51
|
+
- [core] Run editing field tests on all major adapters (#7868) @flaviendelangle
|
|
52
|
+
|
|
53
|
+
## 6.0.0-beta.3
|
|
54
|
+
|
|
55
|
+
_Feb 9, 2023_
|
|
56
|
+
|
|
57
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
58
|
+
|
|
59
|
+
- ⬅️ Add right-to-left support for the data grid (#6580) @yaredtsy
|
|
60
|
+
- ⚡️ Improve grid resize performance (#7864) @cherniavskii
|
|
61
|
+
- ✨ New codemods for migrating to v6 @MBilalShafi
|
|
62
|
+
- 📚 Documentation improvements
|
|
63
|
+
- 🐞 Bugfixes
|
|
64
|
+
|
|
65
|
+
### `@mui/x-data-grid@v6.0.0-beta.3` / `@mui/x-data-grid-pro@v6.0.0-beta.3` / `@mui/x-data-grid-premium@v6.0.0-beta.3`
|
|
66
|
+
|
|
67
|
+
#### Changes
|
|
68
|
+
|
|
69
|
+
- [DataGrid] Add `BaseIconButton` component slot (#7329) @123joshuawu
|
|
70
|
+
- [DataGrid] Allow to customize the value displayed in the filter button tooltip (#6956) @ithrforu
|
|
71
|
+
- [DataGrid] Improve grid resize performance (#7864) @cherniavskii
|
|
72
|
+
- [DataGrid] Make `apiRef.current.getRowWithUpdatedValues` stable (#7788) @m4theushw
|
|
73
|
+
- [DataGrid] Support RTL (#6580) @yaredtsy
|
|
74
|
+
- [DataGrid] Improve query selectors for selecting cell element (#7354) @yaredtsy
|
|
75
|
+
- [l10n] Improve Brazilian Portuguese (pt-BR) locale (#7854) @ed-ateixeira
|
|
76
|
+
|
|
77
|
+
### `@mui/x-date-pickers@v6.0.0-beta.3` / `@mui/x-date-pickers-pro@v6.0.0-beta.3`
|
|
78
|
+
|
|
79
|
+
#### Changes
|
|
80
|
+
|
|
81
|
+
- [fields] Allow to select year 2000 on 2-digit year section (#7858) @flaviendelangle
|
|
82
|
+
- [fields] Fix year editing on `day.js` (#7862) @flaviendelangle
|
|
83
|
+
- [fields] Fix year editing on valid date (#7834) @flaviendelangle
|
|
84
|
+
- [fields] Reset query when pressing `Backspace` or `Delete` (#7855) @flaviendelangle
|
|
85
|
+
- [pickers] Clean Popper position on new pickers (#7445) @flaviendelangle
|
|
86
|
+
- [pickers] Ditch pickers `skipLibCheck` (#7808) @LukasTy
|
|
87
|
+
- [pickers] Improve JSDoc and resulting API docs pages (#7847) @LukasTy
|
|
88
|
+
|
|
89
|
+
### `@mui/x-codemod@v6.0.0-beta.3`
|
|
90
|
+
|
|
91
|
+
#### Changes
|
|
92
|
+
|
|
93
|
+
- [codemod] Add more cases to `rename-selectors-and-events` codemod (#7856) @MBilalShafi
|
|
94
|
+
- [codemod] Add warning message to the codemods and migration guide (#7813) @MBilalShafi
|
|
95
|
+
- [codemod] Add codemod to remove unnecessary `experimentalFeatures` flag (#7836) @MBilalShafi
|
|
96
|
+
- [codemod] Rename `GridFilterItem` props (#7483) @MBilalShafi
|
|
97
|
+
- [codemod] Rename `linkOperators` to `logicOperators` (#7707) @MBilalShafi
|
|
98
|
+
- [codemod] Replace `onCellFocusOut` prop for Data Grid (#7786) @MBilalShafi
|
|
99
|
+
|
|
100
|
+
### Docs
|
|
101
|
+
|
|
102
|
+
- [docs] Add a "Whats new in v6" page linked on the sidebar (#7820) @joserodolfofreitas
|
|
103
|
+
- [docs] Fix hydration crash in pickers (#7734) @oliviertassinari
|
|
104
|
+
- [docs] Remove no longer relevant range shortcuts section (#7840) @LukasTy
|
|
105
|
+
- [docs] Use `@next` tag in grid and pickers installation instructions (#7814) @cherniavskii
|
|
106
|
+
|
|
107
|
+
### Core
|
|
108
|
+
|
|
109
|
+
- [core] Remove `tslint` package leftovers (#7841) @LukasTy
|
|
110
|
+
- [test] Use `createDescribes` for `describeValue` and `describeValidation` (#7866) @flaviendelangle
|
|
111
|
+
|
|
6
112
|
## 6.0.0-beta.2
|
|
7
113
|
|
|
8
114
|
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
@@ -2073,6 +2179,64 @@ You can find more information about the new api, including how to set those tran
|
|
|
2073
2179
|
- [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
|
|
2074
2180
|
- [website] Improve security header @oliviertassinari
|
|
2075
2181
|
|
|
2182
|
+
## 5.17.24
|
|
2183
|
+
|
|
2184
|
+
_Feb 16, 2023_
|
|
2185
|
+
|
|
2186
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
2187
|
+
|
|
2188
|
+
- 🌍 Add Hungarian (hu-HU) locale
|
|
2189
|
+
- 🐞 Bugfixes
|
|
2190
|
+
|
|
2191
|
+
### `@mui/x-data-grid@v5.17.24` / `@mui/x-data-grid-pro@v5.17.24` / `@mui/x-data-grid-premium@v5.17.24`
|
|
2192
|
+
|
|
2193
|
+
#### Changes
|
|
2194
|
+
|
|
2195
|
+
- [DataGrid] Allow to pass props to the `TrapFocus` inside the panel wrapper (#7897) @Vivek-Prajapatii
|
|
2196
|
+
- [DataGrid] Avoid unnecessary rerenders after `updateRows` (#7945) @cherniavskii
|
|
2197
|
+
- [DataGridPro] Change cursor when dragging a column (#7878) @sai6855
|
|
2198
|
+
- [DataGridPremium] Fix `leafField` to have correct focus value (#7959) @MBilalShafi
|
|
2199
|
+
|
|
2200
|
+
### `@mui/x-date-pickers@v5.0.19` / `@mui/x-date-pickers-pro@v5.0.19`
|
|
2201
|
+
|
|
2202
|
+
#### Changes
|
|
2203
|
+
|
|
2204
|
+
- [l10n] Add Hungarian (hu-HU) locale (#7796) @noherczeg
|
|
2205
|
+
|
|
2206
|
+
## 5.17.23
|
|
2207
|
+
|
|
2208
|
+
_Feb 9, 2023_
|
|
2209
|
+
|
|
2210
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
2211
|
+
|
|
2212
|
+
- 🌍 Improve Brazilian Portuguese (pt-BR) locale
|
|
2213
|
+
- 🎉 Add banner and callouts to inform about MUI X v6 beta
|
|
2214
|
+
- 🐞 Bugfixes
|
|
2215
|
+
|
|
2216
|
+
### `@mui/x-data-grid@v5.17.23` / `@mui/x-data-grid-pro@v5.17.23` / `@mui/x-data-grid-premium@v5.17.23`
|
|
2217
|
+
|
|
2218
|
+
#### Changes
|
|
2219
|
+
|
|
2220
|
+
- [DataGrid] Allow to customize the value displayed in the filter button tooltip (#7816) @ithrforu
|
|
2221
|
+
- [DataGrid] Fix `getCellElement` method not working with pinned columns (#7844) @yaredtsy
|
|
2222
|
+
- [DataGrid] Fix stale rows issue in `unstable_replaceRows` (#7694) @MBilalShafi
|
|
2223
|
+
- [l10n] Improve Brazilian Portuguese (pt-BR) locale (#7850) @ed-ateixeira
|
|
2224
|
+
|
|
2225
|
+
### `@mui/x-date-pickers@v_5.0.18` / `@mui/x-date-pickers-pro@v_5.0.18`
|
|
2226
|
+
|
|
2227
|
+
#### Changes
|
|
2228
|
+
|
|
2229
|
+
- [pickers] Update pickers when new value has a distinct timezone (#7853) @alexfauquette
|
|
2230
|
+
|
|
2231
|
+
### Docs
|
|
2232
|
+
|
|
2233
|
+
- [docs] Add messages in v5 doc to inform people about v6 (#7838) @flaviendelangle
|
|
2234
|
+
- [docs] Fix 301 link @oliviertassinari
|
|
2235
|
+
|
|
2236
|
+
### Core
|
|
2237
|
+
|
|
2238
|
+
- [core] Upgrade monorepo (#7849) @cherniavskii
|
|
2239
|
+
|
|
2076
2240
|
## 5.17.22
|
|
2077
2241
|
|
|
2078
2242
|
_Feb 2, 2023_
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
3
|
-
import IconButton from '@mui/material/IconButton';
|
|
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';
|
|
@@ -18,7 +18,7 @@ const useUtilityClasses = ownerState => {
|
|
|
18
18
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
19
|
};
|
|
20
20
|
export function GridGroupingCriteriaCell(props) {
|
|
21
|
-
var _filteredDescendantCo;
|
|
21
|
+
var _filteredDescendantCo, _rootProps$components;
|
|
22
22
|
const {
|
|
23
23
|
id,
|
|
24
24
|
field,
|
|
@@ -69,16 +69,17 @@ export function GridGroupingCriteriaCell(props) {
|
|
|
69
69
|
},
|
|
70
70
|
children: [/*#__PURE__*/_jsx("div", {
|
|
71
71
|
className: classes.toggle,
|
|
72
|
-
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(
|
|
72
|
+
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
|
|
73
73
|
size: "small",
|
|
74
74
|
onClick: handleClick,
|
|
75
75
|
onKeyDown: handleKeyDown,
|
|
76
76
|
tabIndex: -1,
|
|
77
|
-
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
77
|
+
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
78
|
+
}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseIconButton, {
|
|
78
79
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
79
80
|
fontSize: "inherit"
|
|
80
81
|
})
|
|
81
|
-
})
|
|
82
|
+
}))
|
|
82
83
|
}), cellContent, !hideDescendantCount && filteredDescendantCount > 0 ? /*#__PURE__*/_jsxs("span", {
|
|
83
84
|
style: {
|
|
84
85
|
whiteSpace: 'pre'
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { buildWarning, isObject } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { buildWarning, isObject, isSingleSelectColDef } from '@mui/x-data-grid/internals';
|
|
4
4
|
const getExcelJs = async () => {
|
|
5
5
|
var _excelJsModule$defaul;
|
|
6
6
|
const excelJsModule = await import('exceljs');
|
|
@@ -56,38 +56,39 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
56
56
|
switch (cellParams.colDef.type) {
|
|
57
57
|
case 'singleSelect':
|
|
58
58
|
{
|
|
59
|
-
|
|
59
|
+
const castColumn = cellParams.colDef;
|
|
60
|
+
if (typeof castColumn.valueOptions === 'function') {
|
|
60
61
|
// If value option depends on the row, set specific options to the cell
|
|
61
62
|
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
62
|
-
const valueOptions =
|
|
63
|
+
const valueOptions = castColumn.valueOptions({
|
|
63
64
|
id,
|
|
64
65
|
row,
|
|
65
66
|
field: cellParams.field
|
|
66
67
|
});
|
|
67
|
-
const formattedValueOptions = getFormattedValueOptions(
|
|
68
|
-
dataValidation[
|
|
68
|
+
const formattedValueOptions = getFormattedValueOptions(castColumn, valueOptions, api);
|
|
69
|
+
dataValidation[castColumn.field] = {
|
|
69
70
|
type: 'list',
|
|
70
71
|
allowBlank: true,
|
|
71
72
|
formulae: [`"${formattedValueOptions.map(x => x.toString().replaceAll(',', 'CHAR(44)')).join(',')}"`]
|
|
72
73
|
};
|
|
73
74
|
} else {
|
|
74
75
|
// If value option is defined for the column, refer to another sheet
|
|
75
|
-
dataValidation[
|
|
76
|
+
dataValidation[castColumn.field] = {
|
|
76
77
|
type: 'list',
|
|
77
78
|
allowBlank: true,
|
|
78
|
-
formulae: [defaultValueOptionsFormulae[
|
|
79
|
+
formulae: [defaultValueOptionsFormulae[castColumn.field]]
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
|
-
const formattedValue = api.getCellParams(id,
|
|
82
|
+
const formattedValue = api.getCellParams(id, castColumn.field).formattedValue;
|
|
82
83
|
if (process.env.NODE_ENV !== 'production') {
|
|
83
84
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
84
85
|
warnInvalidFormattedValue();
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
if (isObject(formattedValue)) {
|
|
88
|
-
row[
|
|
89
|
+
row[castColumn.field] = formattedValue == null ? void 0 : formattedValue.label;
|
|
89
90
|
} else {
|
|
90
|
-
row[
|
|
91
|
+
row[castColumn.field] = formattedValue;
|
|
91
92
|
}
|
|
92
93
|
break;
|
|
93
94
|
}
|
|
@@ -241,7 +242,7 @@ export async function buildExcel(options, api) {
|
|
|
241
242
|
return (_column$headerName = column.headerName) != null ? _column$headerName : column.field;
|
|
242
243
|
}));
|
|
243
244
|
}
|
|
244
|
-
const columnsWithArrayValueOptions = columns.filter(column => column
|
|
245
|
+
const columnsWithArrayValueOptions = columns.filter(column => isSingleSelectColDef(column) && column.valueOptions && typeof column.valueOptions !== 'function');
|
|
245
246
|
const defaultValueOptionsFormulae = {};
|
|
246
247
|
if (columnsWithArrayValueOptions.length) {
|
|
247
248
|
const valueOptionsWorksheet = workbook.addWorksheet(valueOptionsSheetName);
|
|
@@ -4,6 +4,7 @@ const _excluded = ["leafField", "mainGroupingCriteria", "hideDescendantCount"],
|
|
|
4
4
|
_excluded2 = ["leafField", "mainGroupingCriteria", "hideDescendantCount"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { GRID_STRING_COL_DEF } from '@mui/x-data-grid-pro';
|
|
7
|
+
import { isSingleSelectColDef } from '@mui/x-data-grid-pro/internals';
|
|
7
8
|
import { GridGroupingColumnFooterCell } from '../../../components/GridGroupingColumnFooterCell';
|
|
8
9
|
import { GridGroupingCriteriaCell } from '../../../components/GridGroupingCriteriaCell';
|
|
9
10
|
import { GridGroupingColumnLeafCell } from '../../../components/GridGroupingColumnLeafCell';
|
|
@@ -49,7 +50,7 @@ const getLeafProperties = leafColDef => {
|
|
|
49
50
|
headerName: (_leafColDef$headerNam = leafColDef.headerName) != null ? _leafColDef$headerNam : leafColDef.field,
|
|
50
51
|
sortable: leafColDef.sortable,
|
|
51
52
|
filterable: leafColDef.filterable,
|
|
52
|
-
valueOptions: leafColDef.valueOptions,
|
|
53
|
+
valueOptions: isSingleSelectColDef(leafColDef) ? leafColDef.valueOptions : undefined,
|
|
53
54
|
filterOperators: (_leafColDef$filterOpe = leafColDef.filterOperators) == null ? void 0 : _leafColDef$filterOpe.map(operator => _extends({}, operator, {
|
|
54
55
|
getApplyFilterFn: (filterItem, column) => {
|
|
55
56
|
const originalFn = operator.getApplyFilterFn(filterItem, column);
|
|
@@ -75,7 +76,7 @@ const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
|
|
|
75
76
|
const properties = {
|
|
76
77
|
sortable: groupedByColDef.sortable,
|
|
77
78
|
filterable: groupedByColDef.filterable,
|
|
78
|
-
valueOptions: groupedByColDef.valueOptions,
|
|
79
|
+
valueOptions: isSingleSelectColDef(groupedByColDef) ? groupedByColDef.valueOptions : undefined,
|
|
79
80
|
sortComparator: (v1, v2, cellParams1, cellParams2) => {
|
|
80
81
|
// We only want to sort the groups of the current grouping criteria
|
|
81
82
|
if (cellParams1.rowNode.type === 'group' && cellParams1.rowNode.groupingField === groupedByColDef.field && cellParams2.rowNode.type === 'group' && cellParams2.rowNode.groupingField === groupedByColDef.field) {
|
|
@@ -133,7 +134,8 @@ export const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
133
134
|
if (params.rowNode.type === 'leaf') {
|
|
134
135
|
if (leafColDef) {
|
|
135
136
|
const leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
136
|
-
api: params.api
|
|
137
|
+
api: params.api,
|
|
138
|
+
hasFocus: params.hasFocus
|
|
137
139
|
});
|
|
138
140
|
if (leafColDef.renderCell) {
|
|
139
141
|
return leafColDef.renderCell(leafParams);
|
|
@@ -227,7 +229,8 @@ export const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
227
229
|
if (params.rowNode.type === 'leaf') {
|
|
228
230
|
if (leafColDef) {
|
|
229
231
|
const leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
230
|
-
api: params.api
|
|
232
|
+
api: params.api,
|
|
233
|
+
hasFocus: params.hasFocus
|
|
231
234
|
});
|
|
232
235
|
if (leafColDef.renderCell) {
|
|
233
236
|
return leafColDef.renderCell(leafParams);
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
3
|
-
import IconButton from '@mui/material/IconButton';
|
|
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';
|
|
@@ -16,7 +16,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
16
16
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
17
17
|
};
|
|
18
18
|
export function GridGroupingCriteriaCell(props) {
|
|
19
|
-
var _filteredDescendantCo;
|
|
19
|
+
var _filteredDescendantCo, _rootProps$components;
|
|
20
20
|
var id = props.id,
|
|
21
21
|
field = props.field,
|
|
22
22
|
rowNode = props.rowNode,
|
|
@@ -65,16 +65,17 @@ export function GridGroupingCriteriaCell(props) {
|
|
|
65
65
|
},
|
|
66
66
|
children: [/*#__PURE__*/_jsx("div", {
|
|
67
67
|
className: classes.toggle,
|
|
68
|
-
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(
|
|
68
|
+
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
|
|
69
69
|
size: "small",
|
|
70
70
|
onClick: handleClick,
|
|
71
71
|
onKeyDown: handleKeyDown,
|
|
72
72
|
tabIndex: -1,
|
|
73
|
-
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
73
|
+
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
74
|
+
}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseIconButton, {
|
|
74
75
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
75
76
|
fontSize: "inherit"
|
|
76
77
|
})
|
|
77
|
-
})
|
|
78
|
+
}))
|
|
78
79
|
}), cellContent, !hideDescendantCount && filteredDescendantCount > 0 ? /*#__PURE__*/_jsxs("span", {
|
|
79
80
|
style: {
|
|
80
81
|
whiteSpace: 'pre'
|
|
@@ -6,7 +6,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
6
6
|
var _defaultColumnsStyles;
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from '@mui/x-data-grid-pro';
|
|
9
|
-
import { buildWarning, isObject } from '@mui/x-data-grid/internals';
|
|
9
|
+
import { buildWarning, isObject, isSingleSelectColDef } from '@mui/x-data-grid/internals';
|
|
10
10
|
var getExcelJs = /*#__PURE__*/function () {
|
|
11
11
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
12
12
|
var _excelJsModule$defaul;
|
|
@@ -83,16 +83,17 @@ var serializeRow = function serializeRow(id, columns, api, defaultValueOptionsFo
|
|
|
83
83
|
switch (cellParams.colDef.type) {
|
|
84
84
|
case 'singleSelect':
|
|
85
85
|
{
|
|
86
|
-
|
|
86
|
+
var castColumn = cellParams.colDef;
|
|
87
|
+
if (typeof castColumn.valueOptions === 'function') {
|
|
87
88
|
// If value option depends on the row, set specific options to the cell
|
|
88
89
|
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
89
|
-
var valueOptions =
|
|
90
|
+
var valueOptions = castColumn.valueOptions({
|
|
90
91
|
id: id,
|
|
91
92
|
row: row,
|
|
92
93
|
field: cellParams.field
|
|
93
94
|
});
|
|
94
|
-
var formattedValueOptions = getFormattedValueOptions(
|
|
95
|
-
dataValidation[
|
|
95
|
+
var formattedValueOptions = getFormattedValueOptions(castColumn, valueOptions, api);
|
|
96
|
+
dataValidation[castColumn.field] = {
|
|
96
97
|
type: 'list',
|
|
97
98
|
allowBlank: true,
|
|
98
99
|
formulae: ["\"".concat(formattedValueOptions.map(function (x) {
|
|
@@ -101,22 +102,22 @@ var serializeRow = function serializeRow(id, columns, api, defaultValueOptionsFo
|
|
|
101
102
|
};
|
|
102
103
|
} else {
|
|
103
104
|
// If value option is defined for the column, refer to another sheet
|
|
104
|
-
dataValidation[
|
|
105
|
+
dataValidation[castColumn.field] = {
|
|
105
106
|
type: 'list',
|
|
106
107
|
allowBlank: true,
|
|
107
|
-
formulae: [defaultValueOptionsFormulae[
|
|
108
|
+
formulae: [defaultValueOptionsFormulae[castColumn.field]]
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
var formattedValue = api.getCellParams(id,
|
|
111
|
+
var formattedValue = api.getCellParams(id, castColumn.field).formattedValue;
|
|
111
112
|
if (process.env.NODE_ENV !== 'production') {
|
|
112
113
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
113
114
|
warnInvalidFormattedValue();
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
if (isObject(formattedValue)) {
|
|
117
|
-
row[
|
|
118
|
+
row[castColumn.field] = formattedValue == null ? void 0 : formattedValue.label;
|
|
118
119
|
} else {
|
|
119
|
-
row[
|
|
120
|
+
row[castColumn.field] = formattedValue;
|
|
120
121
|
}
|
|
121
122
|
break;
|
|
122
123
|
}
|
|
@@ -279,7 +280,7 @@ function _buildExcel() {
|
|
|
279
280
|
}));
|
|
280
281
|
}
|
|
281
282
|
columnsWithArrayValueOptions = columns.filter(function (column) {
|
|
282
|
-
return column
|
|
283
|
+
return isSingleSelectColDef(column) && column.valueOptions && typeof column.valueOptions !== 'function';
|
|
283
284
|
});
|
|
284
285
|
defaultValueOptionsFormulae = {};
|
|
285
286
|
if (columnsWithArrayValueOptions.length) {
|
|
@@ -5,6 +5,7 @@ var _excluded = ["leafField", "mainGroupingCriteria", "hideDescendantCount"],
|
|
|
5
5
|
_excluded2 = ["leafField", "mainGroupingCriteria", "hideDescendantCount"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { GRID_STRING_COL_DEF } from '@mui/x-data-grid-pro';
|
|
8
|
+
import { isSingleSelectColDef } from '@mui/x-data-grid-pro/internals';
|
|
8
9
|
import { GridGroupingColumnFooterCell } from '../../../components/GridGroupingColumnFooterCell';
|
|
9
10
|
import { GridGroupingCriteriaCell } from '../../../components/GridGroupingCriteriaCell';
|
|
10
11
|
import { GridGroupingColumnLeafCell } from '../../../components/GridGroupingColumnLeafCell';
|
|
@@ -50,7 +51,7 @@ var getLeafProperties = function getLeafProperties(leafColDef) {
|
|
|
50
51
|
headerName: (_leafColDef$headerNam = leafColDef.headerName) != null ? _leafColDef$headerNam : leafColDef.field,
|
|
51
52
|
sortable: leafColDef.sortable,
|
|
52
53
|
filterable: leafColDef.filterable,
|
|
53
|
-
valueOptions: leafColDef.valueOptions,
|
|
54
|
+
valueOptions: isSingleSelectColDef(leafColDef) ? leafColDef.valueOptions : undefined,
|
|
54
55
|
filterOperators: (_leafColDef$filterOpe = leafColDef.filterOperators) == null ? void 0 : _leafColDef$filterOpe.map(function (operator) {
|
|
55
56
|
return _extends({}, operator, {
|
|
56
57
|
getApplyFilterFn: function getApplyFilterFn(filterItem, column) {
|
|
@@ -78,7 +79,7 @@ var getGroupingCriteriaProperties = function getGroupingCriteriaProperties(group
|
|
|
78
79
|
var properties = {
|
|
79
80
|
sortable: groupedByColDef.sortable,
|
|
80
81
|
filterable: groupedByColDef.filterable,
|
|
81
|
-
valueOptions: groupedByColDef.valueOptions,
|
|
82
|
+
valueOptions: isSingleSelectColDef(groupedByColDef) ? groupedByColDef.valueOptions : undefined,
|
|
82
83
|
sortComparator: function sortComparator(v1, v2, cellParams1, cellParams2) {
|
|
83
84
|
// We only want to sort the groups of the current grouping criteria
|
|
84
85
|
if (cellParams1.rowNode.type === 'group' && cellParams1.rowNode.groupingField === groupedByColDef.field && cellParams2.rowNode.type === 'group' && cellParams2.rowNode.groupingField === groupedByColDef.field) {
|
|
@@ -135,7 +136,8 @@ export var createGroupingColDefForOneGroupingCriteria = function createGroupingC
|
|
|
135
136
|
if (params.rowNode.type === 'leaf') {
|
|
136
137
|
if (leafColDef) {
|
|
137
138
|
var leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
138
|
-
api: params.api
|
|
139
|
+
api: params.api,
|
|
140
|
+
hasFocus: params.hasFocus
|
|
139
141
|
});
|
|
140
142
|
if (leafColDef.renderCell) {
|
|
141
143
|
return leafColDef.renderCell(leafParams);
|
|
@@ -226,7 +228,8 @@ export var createGroupingColDefForAllGroupingCriteria = function createGroupingC
|
|
|
226
228
|
if (params.rowNode.type === 'leaf') {
|
|
227
229
|
if (leafColDef) {
|
|
228
230
|
var leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
229
|
-
api: params.api
|
|
231
|
+
api: params.api,
|
|
232
|
+
hasFocus: params.hasFocus
|
|
230
233
|
});
|
|
231
234
|
if (leafColDef.renderCell) {
|
|
232
235
|
return leafColDef.renderCell(leafParams);
|
package/legacy/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY3NjQ5ODQwMDAwMA==";
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
3
|
-
import IconButton from '@mui/material/IconButton';
|
|
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';
|
|
@@ -68,16 +68,17 @@ export function GridGroupingCriteriaCell(props) {
|
|
|
68
68
|
},
|
|
69
69
|
children: [/*#__PURE__*/_jsx("div", {
|
|
70
70
|
className: classes.toggle,
|
|
71
|
-
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(
|
|
71
|
+
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(rootProps.components.BaseIconButton, _extends({
|
|
72
72
|
size: "small",
|
|
73
73
|
onClick: handleClick,
|
|
74
74
|
onKeyDown: handleKeyDown,
|
|
75
75
|
tabIndex: -1,
|
|
76
|
-
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
76
|
+
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
77
|
+
}, rootProps.componentsProps?.baseIconButton, {
|
|
77
78
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
78
79
|
fontSize: "inherit"
|
|
79
80
|
})
|
|
80
|
-
})
|
|
81
|
+
}))
|
|
81
82
|
}), cellContent, !hideDescendantCount && filteredDescendantCount > 0 ? /*#__PURE__*/_jsxs("span", {
|
|
82
83
|
style: {
|
|
83
84
|
whiteSpace: 'pre'
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { buildWarning, isObject } from '@mui/x-data-grid/internals';
|
|
3
|
+
import { buildWarning, isObject, isSingleSelectColDef } from '@mui/x-data-grid/internals';
|
|
4
4
|
const getExcelJs = async () => {
|
|
5
5
|
const excelJsModule = await import('exceljs');
|
|
6
6
|
return excelJsModule.default ?? excelJsModule;
|
|
@@ -55,38 +55,39 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
55
55
|
switch (cellParams.colDef.type) {
|
|
56
56
|
case 'singleSelect':
|
|
57
57
|
{
|
|
58
|
-
|
|
58
|
+
const castColumn = cellParams.colDef;
|
|
59
|
+
if (typeof castColumn.valueOptions === 'function') {
|
|
59
60
|
// If value option depends on the row, set specific options to the cell
|
|
60
61
|
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
61
|
-
const valueOptions =
|
|
62
|
+
const valueOptions = castColumn.valueOptions({
|
|
62
63
|
id,
|
|
63
64
|
row,
|
|
64
65
|
field: cellParams.field
|
|
65
66
|
});
|
|
66
|
-
const formattedValueOptions = getFormattedValueOptions(
|
|
67
|
-
dataValidation[
|
|
67
|
+
const formattedValueOptions = getFormattedValueOptions(castColumn, valueOptions, api);
|
|
68
|
+
dataValidation[castColumn.field] = {
|
|
68
69
|
type: 'list',
|
|
69
70
|
allowBlank: true,
|
|
70
71
|
formulae: [`"${formattedValueOptions.map(x => x.toString().replaceAll(',', 'CHAR(44)')).join(',')}"`]
|
|
71
72
|
};
|
|
72
73
|
} else {
|
|
73
74
|
// If value option is defined for the column, refer to another sheet
|
|
74
|
-
dataValidation[
|
|
75
|
+
dataValidation[castColumn.field] = {
|
|
75
76
|
type: 'list',
|
|
76
77
|
allowBlank: true,
|
|
77
|
-
formulae: [defaultValueOptionsFormulae[
|
|
78
|
+
formulae: [defaultValueOptionsFormulae[castColumn.field]]
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
const formattedValue = api.getCellParams(id,
|
|
81
|
+
const formattedValue = api.getCellParams(id, castColumn.field).formattedValue;
|
|
81
82
|
if (process.env.NODE_ENV !== 'production') {
|
|
82
83
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
83
84
|
warnInvalidFormattedValue();
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
if (isObject(formattedValue)) {
|
|
87
|
-
row[
|
|
88
|
+
row[castColumn.field] = formattedValue?.label;
|
|
88
89
|
} else {
|
|
89
|
-
row[
|
|
90
|
+
row[castColumn.field] = formattedValue;
|
|
90
91
|
}
|
|
91
92
|
break;
|
|
92
93
|
}
|
|
@@ -231,7 +232,7 @@ export async function buildExcel(options, api) {
|
|
|
231
232
|
if (includeHeaders) {
|
|
232
233
|
worksheet.addRow(columns.map(column => column.headerName ?? column.field));
|
|
233
234
|
}
|
|
234
|
-
const columnsWithArrayValueOptions = columns.filter(column => column
|
|
235
|
+
const columnsWithArrayValueOptions = columns.filter(column => isSingleSelectColDef(column) && column.valueOptions && typeof column.valueOptions !== 'function');
|
|
235
236
|
const defaultValueOptionsFormulae = {};
|
|
236
237
|
if (columnsWithArrayValueOptions.length) {
|
|
237
238
|
const valueOptionsWorksheet = workbook.addWorksheet(valueOptionsSheetName);
|
|
@@ -4,6 +4,7 @@ const _excluded = ["leafField", "mainGroupingCriteria", "hideDescendantCount"],
|
|
|
4
4
|
_excluded2 = ["leafField", "mainGroupingCriteria", "hideDescendantCount"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { GRID_STRING_COL_DEF } from '@mui/x-data-grid-pro';
|
|
7
|
+
import { isSingleSelectColDef } from '@mui/x-data-grid-pro/internals';
|
|
7
8
|
import { GridGroupingColumnFooterCell } from '../../../components/GridGroupingColumnFooterCell';
|
|
8
9
|
import { GridGroupingCriteriaCell } from '../../../components/GridGroupingCriteriaCell';
|
|
9
10
|
import { GridGroupingColumnLeafCell } from '../../../components/GridGroupingColumnLeafCell';
|
|
@@ -46,7 +47,7 @@ const getLeafProperties = leafColDef => ({
|
|
|
46
47
|
headerName: leafColDef.headerName ?? leafColDef.field,
|
|
47
48
|
sortable: leafColDef.sortable,
|
|
48
49
|
filterable: leafColDef.filterable,
|
|
49
|
-
valueOptions: leafColDef.valueOptions,
|
|
50
|
+
valueOptions: isSingleSelectColDef(leafColDef) ? leafColDef.valueOptions : undefined,
|
|
50
51
|
filterOperators: leafColDef.filterOperators?.map(operator => _extends({}, operator, {
|
|
51
52
|
getApplyFilterFn: (filterItem, column) => {
|
|
52
53
|
const originalFn = operator.getApplyFilterFn(filterItem, column);
|
|
@@ -70,7 +71,7 @@ const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
|
|
|
70
71
|
const properties = {
|
|
71
72
|
sortable: groupedByColDef.sortable,
|
|
72
73
|
filterable: groupedByColDef.filterable,
|
|
73
|
-
valueOptions: groupedByColDef.valueOptions,
|
|
74
|
+
valueOptions: isSingleSelectColDef(groupedByColDef) ? groupedByColDef.valueOptions : undefined,
|
|
74
75
|
sortComparator: (v1, v2, cellParams1, cellParams2) => {
|
|
75
76
|
// We only want to sort the groups of the current grouping criteria
|
|
76
77
|
if (cellParams1.rowNode.type === 'group' && cellParams1.rowNode.groupingField === groupedByColDef.field && cellParams2.rowNode.type === 'group' && cellParams2.rowNode.groupingField === groupedByColDef.field) {
|
|
@@ -126,7 +127,8 @@ export const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
126
127
|
if (params.rowNode.type === 'leaf') {
|
|
127
128
|
if (leafColDef) {
|
|
128
129
|
const leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
129
|
-
api: params.api
|
|
130
|
+
api: params.api,
|
|
131
|
+
hasFocus: params.hasFocus
|
|
130
132
|
});
|
|
131
133
|
if (leafColDef.renderCell) {
|
|
132
134
|
return leafColDef.renderCell(leafParams);
|
|
@@ -216,7 +218,8 @@ export const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
216
218
|
if (params.rowNode.type === 'leaf') {
|
|
217
219
|
if (leafColDef) {
|
|
218
220
|
const leafParams = _extends({}, params.api.getCellParams(params.id, leafField), {
|
|
219
|
-
api: params.api
|
|
221
|
+
api: params.api,
|
|
222
|
+
hasFocus: params.hasFocus
|
|
220
223
|
});
|
|
221
224
|
if (leafColDef.renderCell) {
|
|
222
225
|
return leafColDef.renderCell(leafParams);
|
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 = "MTY3NjQ5ODQwMDAwMA==";
|
|
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
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.GridGroupingCriteriaCell = GridGroupingCriteriaCell;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var React = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _utils = require("@mui/utils");
|
|
10
|
-
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
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");
|
|
@@ -76,16 +76,17 @@ function GridGroupingCriteriaCell(props) {
|
|
|
76
76
|
},
|
|
77
77
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
78
|
className: classes.toggle,
|
|
79
|
-
children: filteredDescendantCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
79
|
+
children: filteredDescendantCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.components.BaseIconButton, (0, _extends2.default)({
|
|
80
80
|
size: "small",
|
|
81
81
|
onClick: handleClick,
|
|
82
82
|
onKeyDown: handleKeyDown,
|
|
83
83
|
tabIndex: -1,
|
|
84
|
-
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
84
|
+
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
85
|
+
}, rootProps.componentsProps?.baseIconButton, {
|
|
85
86
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
86
87
|
fontSize: "inherit"
|
|
87
88
|
})
|
|
88
|
-
})
|
|
89
|
+
}))
|
|
89
90
|
}), cellContent, !hideDescendantCount && filteredDescendantCount > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
90
91
|
style: {
|
|
91
92
|
whiteSpace: 'pre'
|
|
@@ -64,38 +64,39 @@ const serializeRow = (id, columns, api, defaultValueOptionsFormulae) => {
|
|
|
64
64
|
switch (cellParams.colDef.type) {
|
|
65
65
|
case 'singleSelect':
|
|
66
66
|
{
|
|
67
|
-
|
|
67
|
+
const castColumn = cellParams.colDef;
|
|
68
|
+
if (typeof castColumn.valueOptions === 'function') {
|
|
68
69
|
// If value option depends on the row, set specific options to the cell
|
|
69
70
|
// This dataValidation is buggy with LibreOffice and does not allow to have coma
|
|
70
|
-
const valueOptions =
|
|
71
|
+
const valueOptions = castColumn.valueOptions({
|
|
71
72
|
id,
|
|
72
73
|
row,
|
|
73
74
|
field: cellParams.field
|
|
74
75
|
});
|
|
75
|
-
const formattedValueOptions = getFormattedValueOptions(
|
|
76
|
-
dataValidation[
|
|
76
|
+
const formattedValueOptions = getFormattedValueOptions(castColumn, valueOptions, api);
|
|
77
|
+
dataValidation[castColumn.field] = {
|
|
77
78
|
type: 'list',
|
|
78
79
|
allowBlank: true,
|
|
79
80
|
formulae: [`"${formattedValueOptions.map(x => x.toString().replaceAll(',', 'CHAR(44)')).join(',')}"`]
|
|
80
81
|
};
|
|
81
82
|
} else {
|
|
82
83
|
// If value option is defined for the column, refer to another sheet
|
|
83
|
-
dataValidation[
|
|
84
|
+
dataValidation[castColumn.field] = {
|
|
84
85
|
type: 'list',
|
|
85
86
|
allowBlank: true,
|
|
86
|
-
formulae: [defaultValueOptionsFormulae[
|
|
87
|
+
formulae: [defaultValueOptionsFormulae[castColumn.field]]
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
|
-
const formattedValue = api.getCellParams(id,
|
|
90
|
+
const formattedValue = api.getCellParams(id, castColumn.field).formattedValue;
|
|
90
91
|
if (process.env.NODE_ENV !== 'production') {
|
|
91
92
|
if (String(cellParams.formattedValue) === '[object Object]') {
|
|
92
93
|
warnInvalidFormattedValue();
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
if ((0, _internals.isObject)(formattedValue)) {
|
|
96
|
-
row[
|
|
97
|
+
row[castColumn.field] = formattedValue?.label;
|
|
97
98
|
} else {
|
|
98
|
-
row[
|
|
99
|
+
row[castColumn.field] = formattedValue;
|
|
99
100
|
}
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
@@ -240,7 +241,7 @@ async function buildExcel(options, api) {
|
|
|
240
241
|
if (includeHeaders) {
|
|
241
242
|
worksheet.addRow(columns.map(column => column.headerName ?? column.field));
|
|
242
243
|
}
|
|
243
|
-
const columnsWithArrayValueOptions = columns.filter(column => column
|
|
244
|
+
const columnsWithArrayValueOptions = columns.filter(column => (0, _internals.isSingleSelectColDef)(column) && column.valueOptions && typeof column.valueOptions !== 'function');
|
|
244
245
|
const defaultValueOptionsFormulae = {};
|
|
245
246
|
if (columnsWithArrayValueOptions.length) {
|
|
246
247
|
const valueOptionsWorksheet = workbook.addWorksheet(valueOptionsSheetName);
|
|
@@ -9,6 +9,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _xDataGridPro = require("@mui/x-data-grid-pro");
|
|
12
|
+
var _internals = require("@mui/x-data-grid-pro/internals");
|
|
12
13
|
var _GridGroupingColumnFooterCell = require("../../../components/GridGroupingColumnFooterCell");
|
|
13
14
|
var _GridGroupingCriteriaCell = require("../../../components/GridGroupingCriteriaCell");
|
|
14
15
|
var _GridGroupingColumnLeafCell = require("../../../components/GridGroupingColumnLeafCell");
|
|
@@ -55,7 +56,7 @@ const getLeafProperties = leafColDef => ({
|
|
|
55
56
|
headerName: leafColDef.headerName ?? leafColDef.field,
|
|
56
57
|
sortable: leafColDef.sortable,
|
|
57
58
|
filterable: leafColDef.filterable,
|
|
58
|
-
valueOptions: leafColDef.valueOptions,
|
|
59
|
+
valueOptions: (0, _internals.isSingleSelectColDef)(leafColDef) ? leafColDef.valueOptions : undefined,
|
|
59
60
|
filterOperators: leafColDef.filterOperators?.map(operator => (0, _extends2.default)({}, operator, {
|
|
60
61
|
getApplyFilterFn: (filterItem, column) => {
|
|
61
62
|
const originalFn = operator.getApplyFilterFn(filterItem, column);
|
|
@@ -79,7 +80,7 @@ const getGroupingCriteriaProperties = (groupedByColDef, applyHeaderName) => {
|
|
|
79
80
|
const properties = {
|
|
80
81
|
sortable: groupedByColDef.sortable,
|
|
81
82
|
filterable: groupedByColDef.filterable,
|
|
82
|
-
valueOptions: groupedByColDef.valueOptions,
|
|
83
|
+
valueOptions: (0, _internals.isSingleSelectColDef)(groupedByColDef) ? groupedByColDef.valueOptions : undefined,
|
|
83
84
|
sortComparator: (v1, v2, cellParams1, cellParams2) => {
|
|
84
85
|
// We only want to sort the groups of the current grouping criteria
|
|
85
86
|
if (cellParams1.rowNode.type === 'group' && cellParams1.rowNode.groupingField === groupedByColDef.field && cellParams2.rowNode.type === 'group' && cellParams2.rowNode.groupingField === groupedByColDef.field) {
|
|
@@ -135,7 +136,8 @@ const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
135
136
|
if (params.rowNode.type === 'leaf') {
|
|
136
137
|
if (leafColDef) {
|
|
137
138
|
const leafParams = (0, _extends2.default)({}, params.api.getCellParams(params.id, leafField), {
|
|
138
|
-
api: params.api
|
|
139
|
+
api: params.api,
|
|
140
|
+
hasFocus: params.hasFocus
|
|
139
141
|
});
|
|
140
142
|
if (leafColDef.renderCell) {
|
|
141
143
|
return leafColDef.renderCell(leafParams);
|
|
@@ -226,7 +228,8 @@ const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
226
228
|
if (params.rowNode.type === 'leaf') {
|
|
227
229
|
if (leafColDef) {
|
|
228
230
|
const leafParams = (0, _extends2.default)({}, params.api.getCellParams(params.id, leafField), {
|
|
229
|
-
api: params.api
|
|
231
|
+
api: params.api,
|
|
232
|
+
hasFocus: params.hasFocus
|
|
230
233
|
});
|
|
231
234
|
if (leafColDef.renderCell) {
|
|
232
235
|
return leafColDef.renderCell(leafParams);
|
package/node/index.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 = "MTY3NjQ5ODQwMDAwMA==";
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-premium",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.4",
|
|
4
4
|
"description": "The Premium plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"directory": "packages/grid/x-data-grid-premium"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@babel/runtime": "^7.20.
|
|
35
|
-
"@mui/utils": "^5.11.
|
|
36
|
-
"@mui/x-data-grid": "6.0.0-beta.
|
|
37
|
-
"@mui/x-data-grid-pro": "6.0.0-beta.
|
|
38
|
-
"@mui/x-license-pro": "6.0.0-beta.
|
|
34
|
+
"@babel/runtime": "^7.20.13",
|
|
35
|
+
"@mui/utils": "^5.11.7",
|
|
36
|
+
"@mui/x-data-grid": "6.0.0-beta.4",
|
|
37
|
+
"@mui/x-data-grid-pro": "6.0.0-beta.4",
|
|
38
|
+
"@mui/x-license-pro": "6.0.0-beta.4",
|
|
39
39
|
"@types/format-util": "^1.0.2",
|
|
40
40
|
"clsx": "^1.2.1",
|
|
41
41
|
"exceljs": "^4.3.0",
|
package/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 = "MTY3NjQ5ODQwMDAwMA==";
|
|
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
|