@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.
- package/CHANGELOG.md +235 -0
- package/DataGridPremium/DataGridPremium.js +25 -17
- package/components/GridDataSourceGroupingCriteriaCell.js +2 -2
- package/components/export/ExportExcel.js +4 -129
- package/esm/DataGridPremium/DataGridPremium.js +25 -17
- package/esm/components/GridDataSourceGroupingCriteriaCell.js +2 -2
- package/esm/components/export/ExportExcel.js +4 -129
- package/esm/hooks/features/aggregation/gridAggregationUtils.js +2 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +4 -4
- package/esm/hooks/features/cellSelection/useGridCellSelection.js +6 -6
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +4 -4
- package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +1 -1
- package/esm/hooks/features/export/useGridExcelExport.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
- package/esm/index.js +1 -1
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/gridAggregationUtils.js +2 -1
- package/hooks/features/aggregation/useGridAggregation.js +3 -3
- package/hooks/features/cellSelection/useGridCellSelection.js +5 -5
- package/hooks/features/clipboard/useGridClipboardImport.js +3 -3
- package/hooks/features/dataSource/useGridDataSourcePremium.js +1 -1
- package/hooks/features/export/useGridExcelExport.js +1 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
- package/index.js +1 -1
- package/modern/DataGridPremium/DataGridPremium.js +25 -17
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +2 -2
- package/modern/components/export/ExportExcel.js +4 -129
- package/modern/hooks/features/aggregation/gridAggregationUtils.js +2 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +4 -4
- package/modern/hooks/features/cellSelection/useGridCellSelection.js +6 -6
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +4 -4
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +1 -1
- package/modern/hooks/features/export/useGridExcelExport.js +2 -2
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +5 -5
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +9 -9
- package/tsconfig.build.tsbuildinfo +1 -1
- 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
|
-
|
|
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,
|
|
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,
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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 {
|
|
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
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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,
|
|
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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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 {
|
|
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,
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
package/esm/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 = "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,
|
|
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.
|
|
101
|
-
(0, _xDataGridPro.
|
|
102
|
-
(0, _xDataGridPro.
|
|
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.
|
|
367
|
-
(0, _xDataGridPro.
|
|
368
|
-
(0, _xDataGridPro.
|
|
369
|
-
(0, _xDataGridPro.
|
|
370
|
-
(0, _xDataGridPro.
|
|
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.
|
|
340
|
-
(0, _xDataGrid.
|
|
341
|
-
(0, _xDataGrid.
|
|
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.
|
|
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.
|
|
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.
|
|
179
|
-
(0, _xDataGridPro.
|
|
180
|
-
(0, _xDataGridPro.
|
|
181
|
-
(0, _xDataGridPro.
|
|
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
|
@@ -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 =
|
|
85
|
+
descendantCount = rootProps.dataSource?.getChildrenCount?.(row) ?? 0;
|
|
86
86
|
}
|
|
87
87
|
let cellContent;
|
|
88
88
|
const colDef = apiRef.current.getColumn(rowNode.groupingField);
|