@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.
Files changed (49) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/DataGridPremium/DataGridPremium.js +8 -0
  3. package/DataGridPremium/useDataGridPremiumComponent.js +2 -1
  4. package/esm/DataGridPremium/DataGridPremium.js +8 -0
  5. package/esm/DataGridPremium/useDataGridPremiumComponent.js +3 -2
  6. package/esm/hooks/features/aggregation/createAggregationLookup.js +1 -1
  7. package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +6 -4
  8. package/esm/hooks/features/clipboard/useGridClipboardImport.js +2 -2
  9. package/esm/hooks/features/export/index.js +1 -1
  10. package/esm/hooks/features/export/serializer/excelSerializer.js +69 -180
  11. package/esm/hooks/features/export/serializer/setupExcelExportWebWorker.js +53 -0
  12. package/esm/hooks/features/export/serializer/utils.js +93 -0
  13. package/esm/hooks/features/export/useGridExcelExport.js +11 -5
  14. package/esm/hooks/features/rowGrouping/createGroupingColDef.js +5 -5
  15. package/esm/setupExcelExportWebWorker.js +1 -0
  16. package/esm/utils/releaseInfo.js +1 -1
  17. package/hooks/features/aggregation/createAggregationLookup.js +1 -1
  18. package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +2 -2
  19. package/hooks/features/aggregation/wrapColumnWithAggregation.js +6 -4
  20. package/hooks/features/clipboard/useGridClipboardImport.js +2 -2
  21. package/hooks/features/export/index.d.ts +1 -1
  22. package/hooks/features/export/index.js +2 -2
  23. package/hooks/features/export/serializer/excelSerializer.d.ts +3 -31
  24. package/hooks/features/export/serializer/excelSerializer.js +74 -187
  25. package/hooks/features/export/serializer/setupExcelExportWebWorker.d.ts +2 -0
  26. package/hooks/features/export/serializer/setupExcelExportWebWorker.js +59 -0
  27. package/hooks/features/export/serializer/utils.d.ts +36 -0
  28. package/hooks/features/export/serializer/utils.js +106 -0
  29. package/hooks/features/export/useGridExcelExport.js +10 -3
  30. package/hooks/features/rowGrouping/createGroupingColDef.js +4 -4
  31. package/index.js +1 -1
  32. package/modern/DataGridPremium/DataGridPremium.js +8 -0
  33. package/modern/DataGridPremium/useDataGridPremiumComponent.js +3 -2
  34. package/modern/hooks/features/aggregation/createAggregationLookup.js +1 -1
  35. package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +6 -4
  36. package/modern/hooks/features/clipboard/useGridClipboardImport.js +2 -2
  37. package/modern/hooks/features/export/index.js +1 -1
  38. package/modern/hooks/features/export/serializer/excelSerializer.js +69 -180
  39. package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.js +53 -0
  40. package/modern/hooks/features/export/serializer/utils.js +93 -0
  41. package/modern/hooks/features/export/useGridExcelExport.js +11 -5
  42. package/modern/hooks/features/rowGrouping/createGroupingColDef.js +5 -5
  43. package/modern/index.js +1 -1
  44. package/modern/setupExcelExportWebWorker.js +1 -0
  45. package/modern/utils/releaseInfo.js +1 -1
  46. package/package.json +5 -5
  47. package/setupExcelExportWebWorker.d.ts +1 -0
  48. package/setupExcelExportWebWorker.js +12 -0
  49. 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 = exportedRowIds.map(id => serializeRowUnsafe(id, exportedColumns, apiRef, valueOptionsData, {
93
- escapeFormulas: options.escapeFormulas ?? true
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.getRowId(row);
142
- const rowNode = apiRef.current.getRowNode(rowId);
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.getRowId(row);
234
- const rowNode = apiRef.current.getRowNode(rowId);
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v7.26.0
2
+ * @mui/x-data-grid-premium v7.27.1
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -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 = "MTczODg4MjgwMDAwMA==";
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.26.0",
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.26.0",
44
- "@mui/x-license": "7.26.0",
45
- "@mui/x-data-grid": "7.26.0",
46
- "@mui/x-internals": "7.26.0"
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");
@@ -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 = "MTczODg4MjgwMDAwMA==";
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