@mui/x-data-grid-premium 8.0.0-beta.1 → 8.0.0-beta.3

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 (39) hide show
  1. package/CHANGELOG.md +235 -0
  2. package/DataGridPremium/DataGridPremium.js +25 -17
  3. package/components/GridDataSourceGroupingCriteriaCell.js +2 -2
  4. package/components/export/ExportExcel.js +4 -129
  5. package/esm/DataGridPremium/DataGridPremium.js +25 -17
  6. package/esm/components/GridDataSourceGroupingCriteriaCell.js +2 -2
  7. package/esm/components/export/ExportExcel.js +4 -129
  8. package/esm/hooks/features/aggregation/gridAggregationUtils.js +2 -1
  9. package/esm/hooks/features/aggregation/useGridAggregation.js +4 -4
  10. package/esm/hooks/features/cellSelection/useGridCellSelection.js +6 -6
  11. package/esm/hooks/features/clipboard/useGridClipboardImport.js +4 -4
  12. package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +1 -1
  13. package/esm/hooks/features/export/useGridExcelExport.js +2 -2
  14. package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
  15. package/esm/index.js +1 -1
  16. package/esm/utils/releaseInfo.js +1 -1
  17. package/hooks/features/aggregation/gridAggregationUtils.js +2 -1
  18. package/hooks/features/aggregation/useGridAggregation.js +3 -3
  19. package/hooks/features/cellSelection/useGridCellSelection.js +5 -5
  20. package/hooks/features/clipboard/useGridClipboardImport.js +3 -3
  21. package/hooks/features/dataSource/useGridDataSourcePremium.js +1 -1
  22. package/hooks/features/export/useGridExcelExport.js +1 -1
  23. package/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
  24. package/index.js +1 -1
  25. package/modern/DataGridPremium/DataGridPremium.js +25 -17
  26. package/modern/components/GridDataSourceGroupingCriteriaCell.js +2 -2
  27. package/modern/components/export/ExportExcel.js +4 -129
  28. package/modern/hooks/features/aggregation/gridAggregationUtils.js +2 -1
  29. package/modern/hooks/features/aggregation/useGridAggregation.js +4 -4
  30. package/modern/hooks/features/cellSelection/useGridCellSelection.js +6 -6
  31. package/modern/hooks/features/clipboard/useGridClipboardImport.js +4 -4
  32. package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +1 -1
  33. package/modern/hooks/features/export/useGridExcelExport.js +2 -2
  34. package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
  35. package/modern/index.js +1 -1
  36. package/modern/utils/releaseInfo.js +1 -1
  37. package/package.json +9 -9
  38. package/tsconfig.build.tsbuildinfo +1 -1
  39. package/utils/releaseInfo.js +1 -1
@@ -47,113 +47,9 @@ process.env.NODE_ENV !== "production" ? ExportExcel.propTypes = {
47
47
  // | These PropTypes are generated from the TypeScript type definitions |
48
48
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
49
49
  // ----------------------------------------------------------------------
50
- /**
51
- * A ref for imperative actions.
52
- * It currently only supports `focusVisible()` action.
53
- */
54
- action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
55
- current: PropTypes.shape({
56
- focusVisible: PropTypes.func.isRequired
57
- })
58
- })]),
59
- /**
60
- * If `true`, the ripples are centered.
61
- * They won't start at the cursor interaction position.
62
- * @default false
63
- */
64
- centerRipple: PropTypes.bool,
65
50
  className: PropTypes.string,
66
- /**
67
- * The color of the component.
68
- * It supports both default and custom theme colors, which can be added as shown in the
69
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
70
- * @default 'primary'
71
- */
72
- color: PropTypes.oneOf(['error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
73
- component: PropTypes.elementType,
74
- /**
75
- * If `true`, the component is disabled.
76
- */
77
51
  disabled: PropTypes.bool,
78
- /**
79
- * If `true`, no elevation is used.
80
- * @default false
81
- */
82
- disableElevation: PropTypes.bool,
83
- /**
84
- * If `true`, the keyboard focus ripple is disabled.
85
- * @default false
86
- */
87
- disableFocusRipple: PropTypes.bool,
88
- /**
89
- * If `true`, the ripple effect is disabled.
90
- *
91
- * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
92
- * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
93
- * @default false
94
- */
95
- disableRipple: PropTypes.bool,
96
- /**
97
- * If `true`, the touch ripple effect is disabled.
98
- * @default false
99
- */
100
- disableTouchRipple: PropTypes.bool,
101
- /**
102
- * Element placed after the children.
103
- */
104
- endIcon: PropTypes.node,
105
- /**
106
- * If `true`, the base button will have a keyboard focus ripple.
107
- * @default false
108
- */
109
- focusRipple: PropTypes.bool,
110
- /**
111
- * This prop can help identify which element has keyboard focus.
112
- * The class name will be applied when the element gains the focus through keyboard interaction.
113
- * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
114
- * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
115
- * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
116
- * if needed.
117
- */
118
- focusVisibleClassName: PropTypes.string,
119
- /**
120
- * If `true`, the button will take up the full width of its container.
121
- * @default false
122
- */
123
- fullWidth: PropTypes.bool,
124
- /**
125
- * The URL to link to when the button is clicked.
126
- * If defined, an `a` element will be used as the root node.
127
- */
128
- href: PropTypes.string,
129
- /**
130
- * The component used to render a link when the `href` prop is provided.
131
- * @default 'a'
132
- */
133
- LinkComponent: PropTypes.elementType,
134
- /**
135
- * If `true`, the loading indicator is visible and the button is disabled.
136
- * If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
137
- * @default null
138
- */
139
- loading: PropTypes.bool,
140
- /**
141
- * Element placed before the children if the button is in loading state.
142
- * The node should contain an element with `role="progressbar"` with an accessible name.
143
- * By default, it renders a `CircularProgress` that is labeled by the button itself.
144
- * @default <CircularProgress color="inherit" size={16} />
145
- */
146
- loadingIndicator: PropTypes.node,
147
- /**
148
- * The loading indicator can be positioned on the start, end, or the center of the button.
149
- * @default 'center'
150
- */
151
- loadingPosition: PropTypes.oneOf(['center', 'end', 'start']),
152
- /**
153
- * Callback fired when the component is focused with a keyboard.
154
- * We trigger a `onFocus` callback too.
155
- */
156
- onFocusVisible: PropTypes.func,
52
+ id: PropTypes.string,
157
53
  /**
158
54
  * The options to apply on the Excel export.
159
55
  * @demos
@@ -177,33 +73,12 @@ process.env.NODE_ENV !== "production" ? ExportExcel.propTypes = {
177
73
  * A function to customize rendering of the component.
178
74
  */
179
75
  render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
180
- /**
181
- * The size of the component.
182
- * `small` is equivalent to the dense button styling.
183
- */
76
+ role: PropTypes.string,
184
77
  size: PropTypes.oneOf(['large', 'medium', 'small']),
185
- /**
186
- * Element placed before the children.
187
- */
188
78
  startIcon: PropTypes.node,
189
79
  style: PropTypes.object,
190
- /**
191
- * The system prop that allows defining system overrides as well as additional CSS styles.
192
- */
193
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
194
80
  tabIndex: PropTypes.number,
195
- /**
196
- * Props applied to the `TouchRipple` element.
197
- */
198
- TouchRippleProps: PropTypes.object,
199
- /**
200
- * A ref that points to the `TouchRipple` element.
201
- */
202
- touchRippleRef: PropTypes.any,
203
- /**
204
- * The variant to use.
205
- * @default 'text'
206
- */
207
- variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
81
+ title: PropTypes.string,
82
+ touchRippleRef: PropTypes.any
208
83
  } : void 0;
209
84
  export { ExportExcel };
@@ -2,7 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { unstable_capitalize as capitalize } from '@mui/utils';
3
3
  import { GRID_ID_AUTOGENERATED } from '@mui/x-data-grid/internals';
4
4
  import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid-pro';
5
- import { addPinnedRow, isDeepEqual, insertNodeInTree, removeNodeFromTree } from '@mui/x-data-grid-pro/internals';
5
+ import { addPinnedRow, insertNodeInTree, removeNodeFromTree } from '@mui/x-data-grid-pro/internals';
6
+ import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
6
7
  export const GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = 'auto-generated-group-footer-root';
7
8
  export const getAggregationFooterRowIdFromGroupId = groupId => {
8
9
  if (groupId == null) {
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { gridColumnLookupSelector, useGridApiEventHandler, useGridApiMethod } from '@mui/x-data-grid-pro';
3
+ import { gridColumnLookupSelector, useGridEvent, useGridApiMethod } from '@mui/x-data-grid-pro';
4
4
  import { useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
5
5
  import { gridAggregationModelSelector } from "./gridAggregationSelectors.js";
6
6
  import { getAggregationRules, mergeStateWithAggregationModel, areAggregationRulesEqual } from "./gridAggregationUtils.js";
@@ -88,9 +88,9 @@ export const useGridAggregation = (apiRef, props) => {
88
88
  apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
89
89
  }
90
90
  }, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.dataSource]);
91
- useGridApiEventHandler(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
92
- useGridApiEventHandler(apiRef, 'columnsChange', checkAggregationRulesDiff);
93
- useGridApiEventHandler(apiRef, 'filteredRowsSet', applyAggregation);
91
+ useGridEvent(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
92
+ useGridEvent(apiRef, 'columnsChange', checkAggregationRulesDiff);
93
+ useGridEvent(apiRef, 'filteredRowsSet', applyAggregation);
94
94
 
95
95
  /**
96
96
  * EFFECTS
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import ownerDocument from '@mui/utils/ownerDocument';
4
4
  import useEventCallback from '@mui/utils/useEventCallback';
5
5
  import { getTotalHeaderHeight, getVisibleRows, isNavigationKey, serializeCellValue, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
6
- import { useGridApiEventHandler, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
6
+ import { useGridEvent, useGridApiMethod, GRID_ACTIONS_COLUMN_TYPE, GRID_CHECKBOX_SELECTION_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, gridClasses, gridFocusCellSelector, GRID_REORDER_COL_DEF, gridSortedRowIdsSelector, gridDimensionsSelector } from '@mui/x-data-grid-pro';
7
7
  import { gridCellSelectionStateSelector } from "./gridCellSelectionSelector.js";
8
8
  export const cellSelectionStateInitializer = (state, props) => _extends({}, state, {
9
9
  cellSelection: _extends({}, props.cellSelectionModel ?? props.initialState?.cellSelection)
@@ -354,11 +354,11 @@ export const useGridCellSelection = (apiRef, props) => {
354
354
  field
355
355
  }, cellWithVirtualFocus.current);
356
356
  });
357
- useGridApiEventHandler(apiRef, 'cellClick', runIfCellSelectionIsEnabled(handleCellClick));
358
- useGridApiEventHandler(apiRef, 'cellFocusIn', runIfCellSelectionIsEnabled(handleCellFocusIn));
359
- useGridApiEventHandler(apiRef, 'cellKeyDown', runIfCellSelectionIsEnabled(handleCellKeyDown));
360
- useGridApiEventHandler(apiRef, 'cellMouseDown', runIfCellSelectionIsEnabled(handleCellMouseDown));
361
- useGridApiEventHandler(apiRef, 'cellMouseOver', runIfCellSelectionIsEnabled(handleCellMouseOver));
357
+ useGridEvent(apiRef, 'cellClick', runIfCellSelectionIsEnabled(handleCellClick));
358
+ useGridEvent(apiRef, 'cellFocusIn', runIfCellSelectionIsEnabled(handleCellFocusIn));
359
+ useGridEvent(apiRef, 'cellKeyDown', runIfCellSelectionIsEnabled(handleCellKeyDown));
360
+ useGridEvent(apiRef, 'cellMouseDown', runIfCellSelectionIsEnabled(handleCellMouseDown));
361
+ useGridEvent(apiRef, 'cellMouseOver', runIfCellSelectionIsEnabled(handleCellMouseOver));
362
362
  React.useEffect(() => {
363
363
  if (props.cellSelectionModel) {
364
364
  apiRef.current.setCellSelectionModel(props.cellSelectionModel);
@@ -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, gridRowSelectionIdsSelector, gridRowSelectionCountSelector } from '@mui/x-data-grid';
3
+ import { GRID_CHECKBOX_SELECTION_FIELD, gridFocusCellSelector, gridVisibleColumnFieldsSelector, useGridEventPriority, useGridEvent, 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';
@@ -328,8 +328,8 @@ export const useGridClipboardImport = (apiRef, props) => {
328
328
  }
329
329
  return initialValue;
330
330
  }, [enableClipboardPaste]);
331
- useGridApiEventHandler(apiRef, 'cellKeyDown', handlePaste);
332
- useGridApiOptionHandler(apiRef, 'clipboardPasteStart', props.onClipboardPasteStart);
333
- useGridApiOptionHandler(apiRef, 'clipboardPasteEnd', props.onClipboardPasteEnd);
331
+ useGridEvent(apiRef, 'cellKeyDown', handlePaste);
332
+ useGridEventPriority(apiRef, 'clipboardPasteStart', props.onClipboardPasteStart);
333
+ useGridEventPriority(apiRef, 'clipboardPasteEnd', props.onClipboardPasteEnd);
334
334
  useGridRegisterPipeProcessor(apiRef, 'canStartEditing', checkIfCanStartEditing);
335
335
  };
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { useGridApiEventHandler as addEventHandler, useGridApiMethod, GRID_ROOT_GROUP_ID } from '@mui/x-data-grid-pro';
3
+ import { useGridEvent as addEventHandler, useGridApiMethod, GRID_ROOT_GROUP_ID } from '@mui/x-data-grid-pro';
4
4
  import { useGridDataSourceBasePro, useGridRegisterStrategyProcessor, useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
5
5
  function getKeyPremium(params) {
6
6
  return JSON.stringify([params.filterModel, params.sortModel, params.groupKeys, params.groupFields, params.start, params.end, params.aggregationModel]);
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  const _excluded = ["worker", "exceljsPostProcess", "exceljsPreProcess", "columnsStyles", "includeHeaders", "getRowsToExport", "valueOptionsSheetName"];
3
3
  import * as React from 'react';
4
- import { useGridApiMethod, useGridLogger, useGridApiOptionHandler } from '@mui/x-data-grid';
4
+ import { useGridApiMethod, useGridLogger, useGridEventPriority } from '@mui/x-data-grid';
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";
@@ -135,5 +135,5 @@ export const useGridExcelExport = (apiRef, props) => {
135
135
  }];
136
136
  }, []);
137
137
  useGridRegisterPipeProcessor(apiRef, 'exportMenu', addExportMenuButtons);
138
- useGridApiOptionHandler(apiRef, 'excelExportStateChange', props.onExcelExportStateChange);
138
+ useGridEventPriority(apiRef, 'excelExportStateChange', props.onExcelExportStateChange);
139
139
  };
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { useGridApiEventHandler, useGridApiMethod, gridColumnLookupSelector } from '@mui/x-data-grid-pro';
3
+ import { useGridEvent, useGridApiMethod, gridColumnLookupSelector } from '@mui/x-data-grid-pro';
4
4
  import { useGridRegisterPipeProcessor, GridStrategyGroup } from '@mui/x-data-grid-pro/internals';
5
5
  import { gridRowGroupingModelSelector, gridRowGroupingSanitizedModelSelector } from "./gridRowGroupingSelector.js";
6
6
  import { getRowGroupingFieldFromGroupingCriteria, RowGroupingStrategy, isGroupingColumn, mergeStateWithRowGroupingModel, setStrategyAvailability, getGroupingRules, areGroupingRulesEqual } from "./gridRowGroupingUtils.js";
@@ -166,10 +166,10 @@ export const useGridRowGrouping = (apiRef, props) => {
166
166
  }
167
167
  }
168
168
  }, [apiRef, props.disableRowGrouping]);
169
- useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
170
- useGridApiEventHandler(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
171
- useGridApiEventHandler(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
172
- useGridApiEventHandler(apiRef, 'rowGroupingModelChange', () => apiRef.current.dataSource.fetchRows());
169
+ useGridEvent(apiRef, 'cellKeyDown', handleCellKeyDown);
170
+ useGridEvent(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
171
+ useGridEvent(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
172
+ useGridEvent(apiRef, 'rowGroupingModelChange', () => apiRef.current.dataSource.fetchRows());
173
173
 
174
174
  /*
175
175
  * EFFECTS
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v8.0.0-beta.1
2
+ * @mui/x-data-grid-premium v8.0.0-beta.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTc0MjUxNTIwMDAwMA==";
3
+ const releaseInfo = "MTc0MzYzMTIwMDAwMA==";
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
@@ -10,6 +10,7 @@ var _utils = require("@mui/utils");
10
10
  var _internals = require("@mui/x-data-grid/internals");
11
11
  var _xDataGridPro = require("@mui/x-data-grid-pro");
12
12
  var _internals2 = require("@mui/x-data-grid-pro/internals");
13
+ var _isDeepEqual = require("@mui/x-internals/isDeepEqual");
13
14
  const GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = exports.GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = 'auto-generated-group-footer-root';
14
15
  const getAggregationFooterRowIdFromGroupId = groupId => {
15
16
  if (groupId == null) {
@@ -162,7 +163,7 @@ exports.addFooterRows = addFooterRows;
162
163
  const areAggregationRulesEqual = (previousValue, newValue) => {
163
164
  const previousFields = Object.keys(previousValue ?? {});
164
165
  const newFields = Object.keys(newValue);
165
- if (!(0, _internals2.isDeepEqual)(previousFields, newFields)) {
166
+ if (!(0, _isDeepEqual.isDeepEqual)(previousFields, newFields)) {
166
167
  return false;
167
168
  }
168
169
  return newFields.every(field => {
@@ -97,9 +97,9 @@ const useGridAggregation = (apiRef, props) => {
97
97
  apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
98
98
  }
99
99
  }, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.dataSource]);
100
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
101
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'columnsChange', checkAggregationRulesDiff);
102
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'filteredRowsSet', applyAggregation);
100
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
101
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'columnsChange', checkAggregationRulesDiff);
102
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'filteredRowsSet', applyAggregation);
103
103
 
104
104
  /**
105
105
  * EFFECTS
@@ -363,11 +363,11 @@ const useGridCellSelection = (apiRef, props) => {
363
363
  field
364
364
  }, cellWithVirtualFocus.current);
365
365
  });
366
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'cellClick', runIfCellSelectionIsEnabled(handleCellClick));
367
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'cellFocusIn', runIfCellSelectionIsEnabled(handleCellFocusIn));
368
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'cellKeyDown', runIfCellSelectionIsEnabled(handleCellKeyDown));
369
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'cellMouseDown', runIfCellSelectionIsEnabled(handleCellMouseDown));
370
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'cellMouseOver', runIfCellSelectionIsEnabled(handleCellMouseOver));
366
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'cellClick', runIfCellSelectionIsEnabled(handleCellClick));
367
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'cellFocusIn', runIfCellSelectionIsEnabled(handleCellFocusIn));
368
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'cellKeyDown', runIfCellSelectionIsEnabled(handleCellKeyDown));
369
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'cellMouseDown', runIfCellSelectionIsEnabled(handleCellMouseDown));
370
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'cellMouseOver', runIfCellSelectionIsEnabled(handleCellMouseOver));
371
371
  React.useEffect(() => {
372
372
  if (props.cellSelectionModel) {
373
373
  apiRef.current.setCellSelectionModel(props.cellSelectionModel);
@@ -336,9 +336,9 @@ const useGridClipboardImport = (apiRef, props) => {
336
336
  }
337
337
  return initialValue;
338
338
  }, [enableClipboardPaste]);
339
- (0, _xDataGrid.useGridApiEventHandler)(apiRef, 'cellKeyDown', handlePaste);
340
- (0, _xDataGrid.useGridApiOptionHandler)(apiRef, 'clipboardPasteStart', props.onClipboardPasteStart);
341
- (0, _xDataGrid.useGridApiOptionHandler)(apiRef, 'clipboardPasteEnd', props.onClipboardPasteEnd);
339
+ (0, _xDataGrid.useGridEvent)(apiRef, 'cellKeyDown', handlePaste);
340
+ (0, _xDataGrid.useGridEventPriority)(apiRef, 'clipboardPasteStart', props.onClipboardPasteStart);
341
+ (0, _xDataGrid.useGridEventPriority)(apiRef, 'clipboardPasteEnd', props.onClipboardPasteEnd);
342
342
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'canStartEditing', checkIfCanStartEditing);
343
343
  };
344
344
  exports.useGridClipboardImport = useGridClipboardImport;
@@ -59,7 +59,7 @@ const useGridDataSourcePremium = (apiRef, props) => {
59
59
  (0, _internals.useGridRegisterStrategyProcessor)(apiRef, strategyProcessor.strategyName, strategyProcessor.group, strategyProcessor.processor);
60
60
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'processDataSourceRows', processDataSourceRows);
61
61
  Object.entries(events).forEach(([event, handler]) => {
62
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, event, handler);
62
+ (0, _xDataGridPro.useGridEvent)(apiRef, event, handler);
63
63
  });
64
64
  React.useEffect(() => {
65
65
  setStrategyAvailability();
@@ -143,6 +143,6 @@ const useGridExcelExport = (apiRef, props) => {
143
143
  }];
144
144
  }, []);
145
145
  (0, _internals.useGridRegisterPipeProcessor)(apiRef, 'exportMenu', addExportMenuButtons);
146
- (0, _xDataGrid.useGridApiOptionHandler)(apiRef, 'excelExportStateChange', props.onExcelExportStateChange);
146
+ (0, _xDataGrid.useGridEventPriority)(apiRef, 'excelExportStateChange', props.onExcelExportStateChange);
147
147
  };
148
148
  exports.useGridExcelExport = useGridExcelExport;
@@ -175,10 +175,10 @@ const useGridRowGrouping = (apiRef, props) => {
175
175
  }
176
176
  }
177
177
  }, [apiRef, props.disableRowGrouping]);
178
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'cellKeyDown', handleCellKeyDown);
179
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
180
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
181
- (0, _xDataGridPro.useGridApiEventHandler)(apiRef, 'rowGroupingModelChange', () => apiRef.current.dataSource.fetchRows());
178
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'cellKeyDown', handleCellKeyDown);
179
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
180
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
181
+ (0, _xDataGridPro.useGridEvent)(apiRef, 'rowGroupingModelChange', () => apiRef.current.dataSource.fetchRows());
182
182
 
183
183
  /*
184
184
  * EFFECTS
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-premium v8.0.0-beta.1
2
+ * @mui/x-data-grid-premium v8.0.0-beta.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -79,11 +79,11 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
79
79
  current: PropTypes.object
80
80
  }),
81
81
  /**
82
- * The label of the Data Grid.
82
+ * The `aria-label` of the Data Grid.
83
83
  */
84
84
  'aria-label': PropTypes.string,
85
85
  /**
86
- * The id of the element containing a label for the Data Grid.
86
+ * The `id` of the element containing a label for the Data Grid.
87
87
  */
88
88
  'aria-labelledby': PropTypes.string,
89
89
  /**
@@ -145,6 +145,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
145
145
  * Override or extend the styles applied to the component.
146
146
  */
147
147
  classes: PropTypes.object,
148
+ className: PropTypes.string,
148
149
  /**
149
150
  * The character used to separate cell values when copying to the clipboard.
150
151
  * @default '\t'
@@ -507,6 +508,12 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
507
508
  * @default false
508
509
  */
509
510
  keepNonExistentRowsSelected: PropTypes.bool,
511
+ /**
512
+ * The label of the Data Grid.
513
+ * If the `showToolbar` prop is `true`, the label will be displayed in the toolbar and applied to the `aria-label` attribute of the grid.
514
+ * If the `showToolbar` prop is `false`, the label will not be visible but will be applied to the `aria-label` attribute of the grid.
515
+ */
516
+ label: PropTypes.string,
510
517
  /**
511
518
  * Used together with `dataSource` to enable lazy loading.
512
519
  * If enabled, the grid stops adding `paginationModel` to the data requests (`getRows`)
@@ -519,6 +526,21 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
519
526
  * @default 500
520
527
  */
521
528
  lazyLoadingRequestThrottleMs: PropTypes.number,
529
+ /**
530
+ * If `true`, displays the data in a list view.
531
+ * Use in combination with `listViewColumn`.
532
+ */
533
+ listView: PropTypes.bool,
534
+ /**
535
+ * Definition of the column rendered when the `listView` prop is enabled.
536
+ */
537
+ listViewColumn: PropTypes.shape({
538
+ align: PropTypes.oneOf(['center', 'left', 'right']),
539
+ cellClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
540
+ display: PropTypes.oneOf(['flex', 'text']),
541
+ field: PropTypes.string.isRequired,
542
+ renderCell: PropTypes.func
543
+ }),
522
544
  /**
523
545
  * If `true`, a loading overlay is displayed.
524
546
  * @default false
@@ -1070,6 +1092,7 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1070
1092
  * @default (pastedText) => { const text = pastedText.replace(/\r?\n$/, ''); return text.split(/\r\n|\n|\r/).map((row) => row.split('\t')); }
1071
1093
  */
1072
1094
  splitClipboardPastedText: PropTypes.func,
1095
+ style: PropTypes.object,
1073
1096
  /**
1074
1097
  * The system prop that allows defining system overrides as well as additional CSS styles.
1075
1098
  */
@@ -1085,21 +1108,6 @@ process.env.NODE_ENV !== "production" ? DataGridPremiumRaw.propTypes = {
1085
1108
  * @default false
1086
1109
  */
1087
1110
  treeData: PropTypes.bool,
1088
- /**
1089
- * Definition of the column rendered when the `unstable_listView` prop is enabled.
1090
- */
1091
- unstable_listColumn: PropTypes.shape({
1092
- align: PropTypes.oneOf(['center', 'left', 'right']),
1093
- cellClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
1094
- display: PropTypes.oneOf(['flex', 'text']),
1095
- field: PropTypes.string.isRequired,
1096
- renderCell: PropTypes.func
1097
- }),
1098
- /**
1099
- * If `true`, displays the data in a list view.
1100
- * Use in combination with `unstable_listColumn`.
1101
- */
1102
- unstable_listView: PropTypes.bool,
1103
1111
  /**
1104
1112
  * If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
1105
1113
  * By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
@@ -49,7 +49,7 @@ function GridGroupingCriteriaCellIcon(props) {
49
49
  })
50
50
  });
51
51
  }
52
- return descendantCount > 0 ? /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
52
+ return descendantCount === -1 || descendantCount > 0 ? /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
53
53
  size: "small",
54
54
  onClick: handleClick,
55
55
  tabIndex: -1,
@@ -82,7 +82,7 @@ export function GridDataSourceGroupingCriteriaCell(props) {
82
82
  const classes = useUtilityClasses(rootProps);
83
83
  let descendantCount = 0;
84
84
  if (row) {
85
- descendantCount = Math.max(rootProps.dataSource?.getChildrenCount?.(row) ?? 0, 0);
85
+ descendantCount = rootProps.dataSource?.getChildrenCount?.(row) ?? 0;
86
86
  }
87
87
  let cellContent;
88
88
  const colDef = apiRef.current.getColumn(rowNode.groupingField);