@mui/x-data-grid-premium 7.26.0 → 7.27.1
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 +115 -0
- package/DataGridPremium/DataGridPremium.js +8 -0
- package/DataGridPremium/useDataGridPremiumComponent.js +2 -1
- package/esm/DataGridPremium/DataGridPremium.js +8 -0
- package/esm/DataGridPremium/useDataGridPremiumComponent.js +3 -2
- package/esm/hooks/features/aggregation/createAggregationLookup.js +1 -1
- package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +6 -4
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +2 -2
- package/esm/hooks/features/export/index.js +1 -1
- package/esm/hooks/features/export/serializer/excelSerializer.js +69 -180
- package/esm/hooks/features/export/serializer/setupExcelExportWebWorker.js +53 -0
- package/esm/hooks/features/export/serializer/utils.js +93 -0
- package/esm/hooks/features/export/useGridExcelExport.js +11 -5
- package/esm/hooks/features/rowGrouping/createGroupingColDef.js +5 -5
- package/esm/setupExcelExportWebWorker.js +1 -0
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/createAggregationLookup.js +1 -1
- package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +2 -2
- package/hooks/features/aggregation/wrapColumnWithAggregation.js +6 -4
- package/hooks/features/clipboard/useGridClipboardImport.js +2 -2
- package/hooks/features/export/index.d.ts +1 -1
- package/hooks/features/export/index.js +2 -2
- package/hooks/features/export/serializer/excelSerializer.d.ts +3 -31
- package/hooks/features/export/serializer/excelSerializer.js +74 -187
- package/hooks/features/export/serializer/setupExcelExportWebWorker.d.ts +2 -0
- package/hooks/features/export/serializer/setupExcelExportWebWorker.js +59 -0
- package/hooks/features/export/serializer/utils.d.ts +36 -0
- package/hooks/features/export/serializer/utils.js +106 -0
- package/hooks/features/export/useGridExcelExport.js +10 -3
- package/hooks/features/rowGrouping/createGroupingColDef.js +4 -4
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +8 -0
- package/modern/DataGridPremium/useDataGridPremiumComponent.js +3 -2
- package/modern/hooks/features/aggregation/createAggregationLookup.js +1 -1
- package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +6 -4
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +2 -2
- package/modern/hooks/features/export/index.js +1 -1
- package/modern/hooks/features/export/serializer/excelSerializer.js +69 -180
- package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.js +53 -0
- package/modern/hooks/features/export/serializer/utils.js +93 -0
- package/modern/hooks/features/export/useGridExcelExport.js +11 -5
- package/modern/hooks/features/rowGrouping/createGroupingColDef.js +5 -5
- package/modern/index.js +1 -1
- package/modern/setupExcelExportWebWorker.js +1 -0
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/setupExcelExportWebWorker.d.ts +1 -0
- package/setupExcelExportWebWorker.js +12 -0
- package/utils/releaseInfo.js +1 -1
|
@@ -5,7 +5,7 @@ import { useGridApiMethod, useGridLogger, useGridApiOptionHandler } from '@mui/x
|
|
|
5
5
|
import { useGridRegisterPipeProcessor, exportAs, getColumnsToExport, defaultGetRowsToExport } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { buildExcel, getDataForValueOptionsSheet, serializeColumns, serializeRowUnsafe } from "./serializer/excelSerializer.js";
|
|
7
7
|
import { GridExcelExportMenuItem } from "../../../components/index.js";
|
|
8
|
-
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
/**
|
|
10
10
|
* @requires useGridColumns (state)
|
|
11
11
|
* @requires useGridFilter (state)
|
|
@@ -13,7 +13,6 @@ import { GridExcelExportMenuItem } from "../../../components/index.js";
|
|
|
13
13
|
* @requires useGridSelection (state)
|
|
14
14
|
* @requires useGridParamsApi (method)
|
|
15
15
|
*/
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
export const useGridExcelExport = (apiRef, props) => {
|
|
18
17
|
const logger = useGridLogger(apiRef, 'useGridExcelExport');
|
|
19
18
|
const getDataAsExcel = React.useCallback((options = {}) => {
|
|
@@ -89,15 +88,22 @@ export const useGridExcelExport = (apiRef, props) => {
|
|
|
89
88
|
const valueOptionsData = await getDataForValueOptionsSheet(exportedColumns, valueOptionsSheetName, apiRef.current);
|
|
90
89
|
const serializedColumns = serializeColumns(exportedColumns, options.columnsStyles || {});
|
|
91
90
|
apiRef.current.resetColSpan();
|
|
92
|
-
const serializedRows =
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
const serializedRows = [];
|
|
92
|
+
for (let i = 0; i < exportedRowIds.length; i += 1) {
|
|
93
|
+
const id = exportedRowIds[i];
|
|
94
|
+
const serializedRow = serializeRowUnsafe(id, exportedColumns, apiRef, valueOptionsData, {
|
|
95
|
+
escapeFormulas: options.escapeFormulas ?? true
|
|
96
|
+
});
|
|
97
|
+
serializedRows.push(serializedRow);
|
|
98
|
+
}
|
|
95
99
|
apiRef.current.resetColSpan();
|
|
96
100
|
const columnGroupPaths = exportedColumns.reduce((acc, column) => {
|
|
97
101
|
acc[column.field] = apiRef.current.getColumnGroupPath(column.field);
|
|
98
102
|
return acc;
|
|
99
103
|
}, {});
|
|
100
104
|
const message = {
|
|
105
|
+
// workers share the pub-sub channel namespace. Use this property to filter out messages.
|
|
106
|
+
namespace: 'mui-x-data-grid-export',
|
|
101
107
|
serializedColumns,
|
|
102
108
|
serializedRows,
|
|
103
109
|
valueOptionsData,
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
const _excluded = ["leafField", "mainGroupingCriteria", "hideDescendantCount"],
|
|
4
4
|
_excluded2 = ["leafField", "mainGroupingCriteria", "hideDescendantCount"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { GRID_STRING_COL_DEF } from '@mui/x-data-grid-pro';
|
|
6
|
+
import { GRID_STRING_COL_DEF, gridRowIdSelector, gridRowTreeSelector } from '@mui/x-data-grid-pro';
|
|
7
7
|
import { isSingleSelectColDef } from '@mui/x-data-grid-pro/internals';
|
|
8
8
|
import { GridGroupingColumnFooterCell } from "../../../components/GridGroupingColumnFooterCell.js";
|
|
9
9
|
import { GridGroupingCriteriaCell } from "../../../components/GridGroupingCriteriaCell.js";
|
|
@@ -138,8 +138,8 @@ export const createGroupingColDefForOneGroupingCriteria = ({
|
|
|
138
138
|
return '';
|
|
139
139
|
},
|
|
140
140
|
valueGetter: (value, row, column, apiRef) => {
|
|
141
|
-
const rowId = apiRef.current.
|
|
142
|
-
const rowNode = apiRef
|
|
141
|
+
const rowId = gridRowIdSelector(apiRef.current.state, row);
|
|
142
|
+
const rowNode = gridRowTreeSelector(apiRef)[rowId];
|
|
143
143
|
if (!rowNode || rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
144
144
|
return undefined;
|
|
145
145
|
}
|
|
@@ -230,8 +230,8 @@ export const createGroupingColDefForAllGroupingCriteria = ({
|
|
|
230
230
|
}));
|
|
231
231
|
},
|
|
232
232
|
valueGetter: (value, row) => {
|
|
233
|
-
const rowId = apiRef.current.
|
|
234
|
-
const rowNode = apiRef
|
|
233
|
+
const rowId = gridRowIdSelector(apiRef.current.state, row);
|
|
234
|
+
const rowNode = gridRowTreeSelector(apiRef)[rowId];
|
|
235
235
|
if (!rowNode || rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
236
236
|
return undefined;
|
|
237
237
|
}
|
package/modern/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setupExcelExportWebWorker } from "./hooks/features/export/serializer/setupExcelExportWebWorker.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTc0MDQzODAwMDAwMA==";
|
|
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.27.1",
|
|
4
4
|
"description": "The Premium plan edition of the Data Grid Components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"exceljs": "^4.4.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^5.1.1",
|
|
43
|
-
"@mui/x-data-grid-pro": "7.
|
|
44
|
-
"@mui/x-
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-
|
|
43
|
+
"@mui/x-data-grid-pro": "7.27.1",
|
|
44
|
+
"@mui/x-data-grid": "7.27.1",
|
|
45
|
+
"@mui/x-internals": "7.26.0",
|
|
46
|
+
"@mui/x-license": "7.26.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setupExcelExportWebWorker } from './hooks/features/export/serializer/setupExcelExportWebWorker';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "setupExcelExportWebWorker", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _setupExcelExportWebWorker.setupExcelExportWebWorker;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _setupExcelExportWebWorker = require("./hooks/features/export/serializer/setupExcelExportWebWorker");
|
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 = "MTc0MDQzODAwMDAwMA==";
|
|
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
|