@mui/x-data-grid-premium 8.0.0-alpha.12 → 8.0.0-alpha.13

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 (90) hide show
  1. package/CHANGELOG.md +299 -0
  2. package/DataGridPremium/DataGridPremium.js +51 -39
  3. package/DataGridPremium/useDataGridPremiumProps.js +2 -2
  4. package/components/GridAggregationHeader.d.ts +1 -1
  5. package/components/GridAggregationHeader.js +7 -11
  6. package/components/GridColumnMenuAggregationItem.js +4 -4
  7. package/components/GridDataSourceGroupingCriteriaCell.js +5 -6
  8. package/components/GridFooterCell.js +5 -6
  9. package/components/GridGroupingColumnFooterCell.js +2 -1
  10. package/components/GridGroupingColumnLeafCell.js +3 -9
  11. package/components/GridGroupingCriteriaCell.js +3 -8
  12. package/components/promptControl/GridToolbarPromptControl.js +34 -32
  13. package/esm/DataGridPremium/DataGridPremium.js +51 -39
  14. package/esm/DataGridPremium/useDataGridPremiumProps.js +2 -2
  15. package/esm/components/GridAggregationHeader.d.ts +1 -1
  16. package/esm/components/GridAggregationHeader.js +7 -11
  17. package/esm/components/GridColumnMenuAggregationItem.js +4 -4
  18. package/esm/components/GridDataSourceGroupingCriteriaCell.js +6 -7
  19. package/esm/components/GridFooterCell.js +5 -6
  20. package/esm/components/GridGroupingColumnFooterCell.js +2 -1
  21. package/esm/components/GridGroupingColumnLeafCell.js +3 -8
  22. package/esm/components/GridGroupingCriteriaCell.js +3 -8
  23. package/esm/components/promptControl/GridToolbarPromptControl.js +34 -32
  24. package/esm/hooks/features/aggregation/useGridAggregation.d.ts +1 -1
  25. package/esm/hooks/features/aggregation/useGridAggregation.js +6 -6
  26. package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +1 -1
  27. package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +6 -6
  28. package/esm/hooks/features/clipboard/useGridClipboardImport.js +3 -3
  29. package/esm/hooks/features/dataSource/models.d.ts +1 -1
  30. package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +3 -3
  31. package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
  32. package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +1 -1
  33. package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +3 -3
  34. package/esm/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
  35. package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
  36. package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
  37. package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +5 -5
  38. package/esm/index.d.ts +0 -6
  39. package/esm/index.js +1 -7
  40. package/esm/models/dataGridPremiumProps.d.ts +7 -8
  41. package/esm/utils/releaseInfo.js +1 -1
  42. package/hooks/features/aggregation/useGridAggregation.d.ts +1 -1
  43. package/hooks/features/aggregation/useGridAggregation.js +6 -6
  44. package/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +1 -1
  45. package/hooks/features/aggregation/useGridAggregationPreProcessors.js +6 -6
  46. package/hooks/features/clipboard/useGridClipboardImport.js +2 -2
  47. package/hooks/features/dataSource/models.d.ts +1 -1
  48. package/hooks/features/dataSource/useGridDataSourcePremium.js +3 -3
  49. package/hooks/features/rowGrouping/gridRowGroupingUtils.js +1 -1
  50. package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +1 -1
  51. package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +3 -3
  52. package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
  53. package/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
  54. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
  55. package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +5 -5
  56. package/index.d.ts +0 -6
  57. package/index.js +2 -11
  58. package/models/dataGridPremiumProps.d.ts +7 -8
  59. package/modern/DataGridPremium/DataGridPremium.js +51 -39
  60. package/modern/DataGridPremium/useDataGridPremiumProps.js +2 -2
  61. package/modern/components/GridAggregationHeader.d.ts +1 -1
  62. package/modern/components/GridAggregationHeader.js +7 -11
  63. package/modern/components/GridColumnMenuAggregationItem.js +4 -4
  64. package/modern/components/GridDataSourceGroupingCriteriaCell.js +6 -7
  65. package/modern/components/GridFooterCell.js +5 -6
  66. package/modern/components/GridGroupingColumnFooterCell.js +2 -1
  67. package/modern/components/GridGroupingColumnLeafCell.js +3 -8
  68. package/modern/components/GridGroupingCriteriaCell.js +3 -8
  69. package/modern/components/promptControl/GridToolbarPromptControl.js +34 -32
  70. package/modern/hooks/features/aggregation/useGridAggregation.d.ts +1 -1
  71. package/modern/hooks/features/aggregation/useGridAggregation.js +6 -6
  72. package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +1 -1
  73. package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +6 -6
  74. package/modern/hooks/features/clipboard/useGridClipboardImport.js +3 -3
  75. package/modern/hooks/features/dataSource/models.d.ts +1 -1
  76. package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +3 -3
  77. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
  78. package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +1 -1
  79. package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +3 -3
  80. package/modern/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
  81. package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
  82. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
  83. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +5 -5
  84. package/modern/index.d.ts +0 -6
  85. package/modern/index.js +1 -7
  86. package/modern/models/dataGridPremiumProps.d.ts +7 -8
  87. package/modern/utils/releaseInfo.js +1 -1
  88. package/package.json +5 -5
  89. package/tsconfig.build.tsbuildinfo +1 -1
  90. package/utils/releaseInfo.js +1 -1
@@ -40,14 +40,14 @@ export const useGridAggregation = (apiRef, props) => {
40
40
  getAggregationPosition: props.getAggregationPosition,
41
41
  aggregationFunctions: props.aggregationFunctions,
42
42
  aggregationRowsScope: props.aggregationRowsScope,
43
- isDataSource: !!props.unstable_dataSource
43
+ isDataSource: !!props.dataSource
44
44
  });
45
45
  apiRef.current.setState(state => _extends({}, state, {
46
46
  aggregation: _extends({}, state.aggregation, {
47
47
  lookup: aggregationLookup
48
48
  })
49
49
  }));
50
- }, [apiRef, props.getAggregationPosition, props.aggregationFunctions, props.aggregationRowsScope, props.unstable_dataSource]);
50
+ }, [apiRef, props.getAggregationPosition, props.aggregationFunctions, props.aggregationRowsScope, props.dataSource]);
51
51
  const aggregationApi = {
52
52
  setAggregationModel
53
53
  };
@@ -71,12 +71,12 @@ export const useGridAggregation = (apiRef, props) => {
71
71
  rulesOnLastRowHydration,
72
72
  rulesOnLastColumnHydration
73
73
  } = apiRef.current.caches.aggregation;
74
- const aggregationRules = props.disableAggregation ? {} : getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.unstable_dataSource);
74
+ const aggregationRules = props.disableAggregation ? {} : getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
75
75
 
76
76
  // Re-apply the row hydration to add / remove the aggregation footers
77
77
  if (!areAggregationRulesEqual(rulesOnLastRowHydration, aggregationRules)) {
78
- if (props.unstable_dataSource) {
79
- apiRef.current.unstable_dataSource.fetchRows();
78
+ if (props.dataSource) {
79
+ apiRef.current.dataSource.fetchRows();
80
80
  } else {
81
81
  apiRef.current.requestPipeProcessorsApplication('hydrateRows');
82
82
  applyAggregation();
@@ -87,7 +87,7 @@ export const useGridAggregation = (apiRef, props) => {
87
87
  if (!areAggregationRulesEqual(rulesOnLastColumnHydration, aggregationRules)) {
88
88
  apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
89
89
  }
90
- }, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.unstable_dataSource]);
90
+ }, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.dataSource]);
91
91
  useGridApiEventHandler(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
92
92
  useGridApiEventHandler(apiRef, 'columnsChange', checkAggregationRulesDiff);
93
93
  useGridApiEventHandler(apiRef, 'filteredRowsSet', applyAggregation);
@@ -1,4 +1,4 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
2
  import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
3
3
  import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
4
- export declare const useGridAggregationPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "aggregationFunctions" | "disableAggregation" | "getAggregationPosition" | "slotProps" | "slots" | "unstable_dataSource">) => void;
4
+ export declare const useGridAggregationPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "aggregationFunctions" | "disableAggregation" | "getAggregationPosition" | "slotProps" | "slots" | "dataSource">) => void;
@@ -10,7 +10,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
10
10
  // that the pre-processor is called it will already have been updated with the current rules.
11
11
  const rulesOnLastColumnHydration = React.useRef({});
12
12
  const updateAggregatedColumns = React.useCallback(columnsState => {
13
- const aggregationRules = props.disableAggregation ? {} : getAggregationRules(columnsState.lookup, gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.unstable_dataSource);
13
+ const aggregationRules = props.disableAggregation ? {} : getAggregationRules(columnsState.lookup, gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
14
14
  columnsState.orderedFields.forEach(field => {
15
15
  const shouldHaveAggregationValue = !!aggregationRules[field];
16
16
  const haveAggregationColumnValue = !!rulesOnLastColumnHydration.current[field];
@@ -32,9 +32,9 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
32
32
  rulesOnLastColumnHydration.current = aggregationRules;
33
33
  apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
34
34
  return columnsState;
35
- }, [apiRef, props.aggregationFunctions, props.disableAggregation, props.unstable_dataSource]);
35
+ }, [apiRef, props.aggregationFunctions, props.disableAggregation, props.dataSource]);
36
36
  const addGroupFooterRows = React.useCallback(value => {
37
- const aggregationRules = props.disableAggregation ? {} : getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.unstable_dataSource);
37
+ const aggregationRules = props.disableAggregation ? {} : getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
38
38
  const hasAggregationRule = Object.keys(aggregationRules).length > 0;
39
39
 
40
40
  // If we did not have any aggregation footer before, and we still don't have any,
@@ -49,7 +49,7 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
49
49
  getAggregationPosition: props.getAggregationPosition,
50
50
  hasAggregationRule
51
51
  });
52
- }, [apiRef, props.disableAggregation, props.getAggregationPosition, props.aggregationFunctions, props.unstable_dataSource]);
52
+ }, [apiRef, props.disableAggregation, props.getAggregationPosition, props.aggregationFunctions, props.dataSource]);
53
53
  const addColumnMenuButtons = React.useCallback((columnMenuItems, colDef) => {
54
54
  if (props.disableAggregation || !colDef.aggregable) {
55
55
  return columnMenuItems;
@@ -57,13 +57,13 @@ export const useGridAggregationPreProcessors = (apiRef, props) => {
57
57
  const availableAggregationFunctions = getAvailableAggregationFunctions({
58
58
  aggregationFunctions: props.aggregationFunctions,
59
59
  colDef,
60
- isDataSource: !!props.unstable_dataSource
60
+ isDataSource: !!props.dataSource
61
61
  });
62
62
  if (availableAggregationFunctions.length === 0) {
63
63
  return columnMenuItems;
64
64
  }
65
65
  return [...columnMenuItems, 'columnMenuAggregationItem'];
66
- }, [props.aggregationFunctions, props.disableAggregation, props.unstable_dataSource]);
66
+ }, [props.aggregationFunctions, props.disableAggregation, props.dataSource]);
67
67
  const stateExportPreProcessing = React.useCallback(prevState => {
68
68
  if (props.disableAggregation) {
69
69
  return prevState;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector } from '@mui/x-data-grid';
3
+ import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridApiOptionHandler, useGridApiEventHandler, gridPaginatedVisibleSortedGridRowIdsSelector, gridExpandedSortedRowIdsSelector, gridRowSelectionIdsSelector, gridRowSelectionCountSelector } from '@mui/x-data-grid';
4
4
  import { getRowIdFromRowModel, getActiveElement, useGridRegisterPipeProcessor, getPublicApiRef, isPasteShortcut, useGridLogger } from '@mui/x-data-grid/internals';
5
5
  import { warnOnce } from '@mui/x-internals/warning';
6
6
  import { GRID_DETAIL_PANEL_TOGGLE_FIELD, GRID_REORDER_COL_DEF } from '@mui/x-data-grid-pro';
@@ -193,10 +193,10 @@ function defaultPasteResolver({
193
193
  }
194
194
  return true;
195
195
  });
196
- const selectedRows = apiRef.current.getSelectedRows();
197
- if (selectedRows.size > 0 && !isSingleValuePasted) {
196
+ if (gridRowSelectionCountSelector(apiRef) > 0 && !isSingleValuePasted) {
198
197
  // Multiple values are pasted starting from the first and top-most cell
199
198
  const pastedRowsDataCount = pastedData.length;
199
+ const selectedRows = gridRowSelectionIdsSelector(apiRef);
200
200
 
201
201
  // There's no guarantee that the selected rows are in the same order as the pasted rows
202
202
  selectedRows.forEach((row, rowId) => {
@@ -47,7 +47,7 @@ export interface GridDataSourceApiPremium {
47
47
  /**
48
48
  * The data source API.
49
49
  */
50
- unstable_dataSource: GridDataSourceApiBasePremium;
50
+ dataSource: GridDataSourceApiBasePremium;
51
51
  }
52
52
  export interface GridDataSourcePremiumPrivateApi extends GridDataSourcePrivateApi {
53
53
  resolveGroupAggregation: (groupId: GridRowId, field: string) => any;
@@ -38,11 +38,11 @@ export const useGridDataSourcePremium = (apiRef, props) => {
38
38
  }, [apiRef]);
39
39
  const resolveGroupAggregation = React.useCallback((groupId, field) => {
40
40
  if (groupId === GRID_ROOT_GROUP_ID) {
41
- return props.unstable_dataSource?.getAggregatedValue?.(aggregateRowRef.current, field);
41
+ return props.dataSource?.getAggregatedValue?.(aggregateRowRef.current, field);
42
42
  }
43
43
  const row = apiRef.current.getRow(groupId);
44
- return props.unstable_dataSource?.getAggregatedValue?.(row, field);
45
- }, [apiRef, props.unstable_dataSource]);
44
+ return props.dataSource?.getAggregatedValue?.(row, field);
45
+ }, [apiRef, props.dataSource]);
46
46
  const privateApi = _extends({}, api.private, {
47
47
  resolveGroupAggregation
48
48
  });
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { passFilterLogic, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn, GridStrategyGroup } from '@mui/x-data-grid-pro/internals';
2
+ import { passFilterLogic, GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn, GridStrategyGroup, getRowValue } from '@mui/x-data-grid-pro/internals';
3
3
  import { gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
4
4
  export { GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, getRowGroupingCriteriaFromGroupingField, isGroupingColumn };
5
5
  export let RowGroupingStrategy = /*#__PURE__*/function (RowGroupingStrategy) {
@@ -138,7 +138,7 @@ export const getCellGroupingCriteria = ({
138
138
  if (groupingRule.groupingValueGetter) {
139
139
  key = groupingRule.groupingValueGetter(row[groupingRule.field], row, colDef, apiRef);
140
140
  } else {
141
- key = row[groupingRule.field];
141
+ key = getRowValue(row, colDef, apiRef);
142
142
  }
143
143
  return {
144
144
  key,
@@ -1,4 +1,4 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
2
  import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
3
3
  import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
4
- export declare const useGridDataSourceRowGroupingPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
4
+ export declare const useGridDataSourceRowGroupingPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "dataSource">) => void;
@@ -5,11 +5,11 @@ import { getGroupingRules, RowGroupingStrategy } from "./gridRowGroupingUtils.js
5
5
  import { gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
6
6
  export const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
7
7
  const createRowTreeForRowGrouping = React.useCallback(params => {
8
- const getGroupKey = props.unstable_dataSource?.getGroupKey;
8
+ const getGroupKey = props.dataSource?.getGroupKey;
9
9
  if (!getGroupKey) {
10
10
  throw new Error('MUI X: No `getGroupKey` method provided with the dataSource.');
11
11
  }
12
- const getChildrenCount = props.unstable_dataSource?.getChildrenCount;
12
+ const getChildrenCount = props.dataSource?.getChildrenCount;
13
13
  if (!getChildrenCount) {
14
14
  throw new Error('MUI X: No `getChildrenCount` method provided with the dataSource.');
15
15
  }
@@ -57,7 +57,7 @@ export const useGridDataSourceRowGroupingPreProcessors = (apiRef, props) => {
57
57
  isGroupExpandedByDefault: props.isGroupExpandedByDefault,
58
58
  groupingName: RowGroupingStrategy.DataSource
59
59
  });
60
- }, [apiRef, props.unstable_dataSource, props.defaultGroupingExpansionDepth, props.isGroupExpandedByDefault]);
60
+ }, [apiRef, props.dataSource, props.defaultGroupingExpansionDepth, props.isGroupExpandedByDefault]);
61
61
  const filterRows = React.useCallback(() => {
62
62
  const rowTree = gridRowTreeSelector(apiRef);
63
63
  return skipFiltering(rowTree);
@@ -8,4 +8,4 @@ export declare const rowGroupingStateInitializer: GridStateInitializer<Pick<Data
8
8
  * @requires useGridRows (state, method) - can be after, async only
9
9
  * @requires useGridParamsApi (method) - can be after, async only
10
10
  */
11
- export declare const useGridRowGrouping: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "initialState" | "rowGroupingModel" | "onRowGroupingModelChange" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "groupingColDef" | "rowGroupingColumnMode" | "disableRowGrouping" | "slotProps" | "slots" | "unstable_dataSource">) => void;
11
+ export declare const useGridRowGrouping: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "initialState" | "rowGroupingModel" | "onRowGroupingModelChange" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "groupingColDef" | "rowGroupingColumnMode" | "disableRowGrouping" | "slotProps" | "slots" | "dataSource">) => void;
@@ -140,13 +140,13 @@ export const useGridRowGrouping = (apiRef, props) => {
140
140
  if (!isOnGroupingCell) {
141
141
  return;
142
142
  }
143
- if (props.unstable_dataSource && !params.rowNode.childrenExpanded) {
144
- apiRef.current.unstable_dataSource.fetchRows(params.id);
143
+ if (props.dataSource && !params.rowNode.childrenExpanded) {
144
+ apiRef.current.dataSource.fetchRows(params.id);
145
145
  return;
146
146
  }
147
147
  apiRef.current.setRowChildrenExpansion(params.id, !params.rowNode.childrenExpanded);
148
148
  }
149
- }, [apiRef, props.rowGroupingColumnMode, props.unstable_dataSource]);
149
+ }, [apiRef, props.rowGroupingColumnMode, props.dataSource]);
150
150
  const checkGroupingColumnsModelDiff = React.useCallback(() => {
151
151
  const sanitizedRowGroupingModel = gridRowGroupingSanitizedModelSelector(apiRef);
152
152
  const rulesOnLastRowTreeCreation = apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation || [];
@@ -169,7 +169,7 @@ export const useGridRowGrouping = (apiRef, props) => {
169
169
  useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
170
170
  useGridApiEventHandler(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
171
171
  useGridApiEventHandler(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
172
- useGridApiEventHandler(apiRef, 'rowGroupingModelChange', () => apiRef.current.unstable_dataSource.fetchRows());
172
+ useGridApiEventHandler(apiRef, 'rowGroupingModelChange', () => apiRef.current.dataSource.fetchRows());
173
173
 
174
174
  /*
175
175
  * EFFECTS
@@ -1,4 +1,4 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
2
  import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
3
3
  import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
4
- export declare const useGridRowGroupingPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "unstable_dataSource">) => void;
4
+ export declare const useGridRowGroupingPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "dataSource">) => void;
@@ -9,7 +9,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
9
9
  if (props.disableRowGrouping) {
10
10
  return [];
11
11
  }
12
- const strategy = props.unstable_dataSource ? RowGroupingStrategy.DataSource : RowGroupingStrategy.Default;
12
+ const strategy = props.dataSource ? RowGroupingStrategy.DataSource : RowGroupingStrategy.Default;
13
13
  const groupingColDefProp = props.groupingColDef;
14
14
 
15
15
  // We can't use `gridGroupingRowsSanitizedModelSelector` here because the new columns are not in the state yet
@@ -43,7 +43,7 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
43
43
  return [];
44
44
  }
45
45
  }
46
- }, [apiRef, props.groupingColDef, props.rowGroupingColumnMode, props.disableRowGrouping, props.unstable_dataSource]);
46
+ }, [apiRef, props.groupingColDef, props.rowGroupingColumnMode, props.disableRowGrouping, props.dataSource]);
47
47
  const updateGroupingColumn = React.useCallback(columnsState => {
48
48
  const groupingColDefs = getGroupingColDefs(columnsState);
49
49
  let newColumnFields = [];
@@ -148,14 +148,14 @@ export const useGridRowGroupingPreProcessors = (apiRef, props) => {
148
148
  useGridRegisterStrategyProcessor(apiRef, RowGroupingStrategy.Default, 'sorting', sortRows);
149
149
  useGridRegisterStrategyProcessor(apiRef, RowGroupingStrategy.Default, 'visibleRowsLookupCreation', getVisibleRowsLookup);
150
150
  useFirstRender(() => {
151
- setStrategyAvailability(apiRef, props.disableRowGrouping, props.unstable_dataSource);
151
+ setStrategyAvailability(apiRef, props.disableRowGrouping, props.dataSource);
152
152
  });
153
153
  const isFirstRender = React.useRef(true);
154
154
  React.useEffect(() => {
155
155
  if (!isFirstRender.current) {
156
- setStrategyAvailability(apiRef, props.disableRowGrouping, props.unstable_dataSource);
156
+ setStrategyAvailability(apiRef, props.disableRowGrouping, props.dataSource);
157
157
  } else {
158
158
  isFirstRender.current = false;
159
159
  }
160
- }, [apiRef, props.disableRowGrouping, props.unstable_dataSource]);
160
+ }, [apiRef, props.disableRowGrouping, props.dataSource]);
161
161
  };
package/modern/index.d.ts CHANGED
@@ -1,10 +1,4 @@
1
1
  import "./typeOverloads/index.js";
2
- import { LicenseInfo as LicenseInfoExport } from '@mui/x-license';
3
- /**
4
- * @deprecated Use `@mui/x-license` package instead:
5
- * @example import { LicenseInfo } from '@mui/x-license';
6
- */
7
- export declare class LicenseInfo extends LicenseInfoExport {}
8
2
  export * from '@mui/x-data-grid/components';
9
3
  export * from '@mui/x-data-grid-pro/components';
10
4
  export * from '@mui/x-data-grid/constants';
package/modern/index.js CHANGED
@@ -1,17 +1,11 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v8.0.0-alpha.12
2
+ * @mui/x-data-grid-premium v8.0.0-alpha.13
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  import "./typeOverloads/index.js";
9
- import { LicenseInfo as LicenseInfoExport } from '@mui/x-license';
10
- /**
11
- * @deprecated Use `@mui/x-license` package instead:
12
- * @example import { LicenseInfo } from '@mui/x-license';
13
- */
14
- export class LicenseInfo extends LicenseInfoExport {}
15
9
  export * from '@mui/x-data-grid/components';
16
10
  export * from '@mui/x-data-grid-pro/components';
17
11
  export * from '@mui/x-data-grid/constants';
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from '@mui/x-internals/types';
2
- import { GridCallbackDetails, GridValidRowModel, GridGroupNode, GridEventListener } from '@mui/x-data-grid-pro';
2
+ import { GridCallbackDetails, GridValidRowModel, GridGroupNode, GridEventListener, GridGetRowsError, GridUpdateRowError } from '@mui/x-data-grid-pro';
3
3
  import { GridExperimentalProFeatures, DataGridProPropsWithDefaultValue, DataGridProPropsWithoutDefaultValue, DataGridPropsWithComplexDefaultValueAfterProcessing, DataGridPropsWithComplexDefaultValueBeforeProcessing, DataGridPremiumSharedPropsWithDefaultValue } from '@mui/x-data-grid-pro/internals';
4
4
  import type { GridRowGroupingModel } from '../hooks/features/rowGrouping';
5
5
  import type { GridAggregationModel, GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationPosition } from '../hooks/features/aggregation';
@@ -51,7 +51,7 @@ export interface DataGridPremiumPropsWithDefaultValue<R extends GridValidRowMode
51
51
  rowGroupingColumnMode: 'single' | 'multiple';
52
52
  /**
53
53
  * Aggregation functions available on the grid.
54
- * @default GRID_AGGREGATION_FUNCTIONS when `unstable_dataSource` is not provided, `{}` when `unstable_dataSource` is provided
54
+ * @default GRID_AGGREGATION_FUNCTIONS when `dataSource` is not provided, `{}` when `dataSource` is provided
55
55
  */
56
56
  aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>;
57
57
  /**
@@ -81,7 +81,7 @@ export interface DataGridPremiumPropsWithDefaultValue<R extends GridValidRowMode
81
81
  */
82
82
  splitClipboardPastedText: (text: string) => string[][] | null;
83
83
  }
84
- export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends Omit<DataGridProPropsWithoutDefaultValue<R>, 'initialState' | 'apiRef' | 'unstable_dataSource' | 'unstable_onDataSourceError'> {
84
+ export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowModel = any> extends Omit<DataGridProPropsWithoutDefaultValue<R>, 'initialState' | 'apiRef' | 'dataSource' | 'onDataSourceError'> {
85
85
  /**
86
86
  * The ref object that allows grid manipulation. Can be instantiated with `useGridApiRef()`.
87
87
  */
@@ -153,11 +153,10 @@ export interface DataGridPremiumPropsWithoutDefaultValue<R extends GridValidRowM
153
153
  /**
154
154
  * Data source object.
155
155
  */
156
- unstable_dataSource?: GridDataSource;
156
+ dataSource?: GridDataSource;
157
157
  /**
158
- * Callback fired when the data source request fails.
159
- * @param {Error} error The error object.
160
- * @param {GridGetRowsParams} params With all properties from [[GridGetRowsParams]].
158
+ * Callback fired when a data source request fails.
159
+ * @param {GridGetRowsError | GridUpdateRowError} error The data source error object.
161
160
  */
162
- unstable_onDataSourceError?: (error: Error, params: GridGetRowsParams) => void;
161
+ onDataSourceError?: (error: GridGetRowsError<GridGetRowsParams> | GridUpdateRowError) => void;
163
162
  }
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTczOTc0NjgwMDAwMA==";
3
+ const releaseInfo = "MTc0MDY5NzIwMDAwMA==";
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": "8.0.0-alpha.12",
3
+ "version": "8.0.0-alpha.13",
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": "8.0.0-alpha.12",
44
- "@mui/x-data-grid-pro": "8.0.0-alpha.12",
45
- "@mui/x-internals": "8.0.0-alpha.12",
46
- "@mui/x-license": "8.0.0-alpha.12"
43
+ "@mui/x-data-grid": "8.0.0-alpha.13",
44
+ "@mui/x-data-grid-pro": "8.0.0-alpha.13",
45
+ "@mui/x-internals": "8.0.0-alpha.13",
46
+ "@mui/x-license": "8.0.0-alpha.13"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@emotion/react": "^11.9.0",