@mui/x-data-grid-premium 8.0.0-alpha.12 → 8.0.0-alpha.14
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 +430 -0
- package/DataGridPremium/DataGridPremium.js +51 -39
- package/DataGridPremium/useDataGridPremiumProps.js +2 -2
- package/components/GridAggregationHeader.d.ts +1 -1
- package/components/GridAggregationHeader.js +7 -11
- package/components/GridColumnMenuAggregationItem.js +4 -4
- package/components/GridDataSourceGroupingCriteriaCell.js +5 -6
- package/components/GridFooterCell.js +5 -6
- package/components/GridGroupingColumnFooterCell.js +2 -1
- package/components/GridGroupingColumnLeafCell.js +3 -9
- package/components/GridGroupingCriteriaCell.js +3 -8
- package/components/GridPremiumToolbar.d.ts +3 -0
- package/components/GridPremiumToolbar.js +31 -0
- package/components/export/ExportExcel.d.ts +29 -0
- package/components/export/ExportExcel.js +198 -0
- package/components/export/index.d.ts +1 -0
- package/components/export/index.js +16 -0
- package/components/index.d.ts +2 -1
- package/components/index.js +13 -1
- package/components/promptControl/GridToolbarPromptControl.js +34 -32
- package/constants/dataGridPremiumDefaultSlotsComponents.js +3 -1
- package/esm/DataGridPremium/DataGridPremium.js +51 -39
- package/esm/DataGridPremium/useDataGridPremiumProps.js +2 -2
- package/esm/components/GridAggregationHeader.d.ts +1 -1
- package/esm/components/GridAggregationHeader.js +7 -11
- package/esm/components/GridColumnMenuAggregationItem.js +4 -4
- package/esm/components/GridDataSourceGroupingCriteriaCell.js +6 -7
- package/esm/components/GridFooterCell.js +5 -6
- package/esm/components/GridGroupingColumnFooterCell.js +2 -1
- package/esm/components/GridGroupingColumnLeafCell.js +3 -8
- package/esm/components/GridGroupingCriteriaCell.js +3 -8
- package/esm/components/GridPremiumToolbar.d.ts +3 -0
- package/esm/components/GridPremiumToolbar.js +23 -0
- package/esm/components/export/ExportExcel.d.ts +29 -0
- package/esm/components/export/ExportExcel.js +191 -0
- package/esm/components/export/index.d.ts +1 -0
- package/esm/components/export/index.js +1 -0
- package/esm/components/index.d.ts +2 -1
- package/esm/components/index.js +2 -1
- package/esm/components/promptControl/GridToolbarPromptControl.js +34 -32
- package/esm/constants/dataGridPremiumDefaultSlotsComponents.js +3 -1
- package/esm/hooks/features/aggregation/useGridAggregation.d.ts +1 -1
- package/esm/hooks/features/aggregation/useGridAggregation.js +6 -6
- package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +1 -1
- package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +6 -6
- package/esm/hooks/features/clipboard/useGridClipboardImport.js +3 -3
- package/esm/hooks/features/dataSource/models.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +3 -3
- package/esm/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
- package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +1 -1
- package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +3 -3
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
- package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
- package/esm/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +5 -5
- package/esm/index.d.ts +0 -6
- package/esm/index.js +1 -7
- package/esm/models/dataGridPremiumProps.d.ts +7 -8
- package/esm/utils/releaseInfo.js +1 -1
- package/hooks/features/aggregation/useGridAggregation.d.ts +1 -1
- package/hooks/features/aggregation/useGridAggregation.js +6 -6
- package/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +1 -1
- package/hooks/features/aggregation/useGridAggregationPreProcessors.js +6 -6
- package/hooks/features/clipboard/useGridClipboardImport.js +2 -2
- package/hooks/features/dataSource/models.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourcePremium.js +3 -3
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +1 -1
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +3 -3
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +5 -5
- package/index.d.ts +0 -6
- package/index.js +2 -11
- package/models/dataGridPremiumProps.d.ts +7 -8
- package/modern/DataGridPremium/DataGridPremium.js +51 -39
- package/modern/DataGridPremium/useDataGridPremiumProps.js +2 -2
- package/modern/components/GridAggregationHeader.d.ts +1 -1
- package/modern/components/GridAggregationHeader.js +7 -11
- package/modern/components/GridColumnMenuAggregationItem.js +4 -4
- package/modern/components/GridDataSourceGroupingCriteriaCell.js +6 -7
- package/modern/components/GridFooterCell.js +5 -6
- package/modern/components/GridGroupingColumnFooterCell.js +2 -1
- package/modern/components/GridGroupingColumnLeafCell.js +3 -8
- package/modern/components/GridGroupingCriteriaCell.js +3 -8
- package/modern/components/GridPremiumToolbar.d.ts +3 -0
- package/modern/components/GridPremiumToolbar.js +23 -0
- package/modern/components/export/ExportExcel.d.ts +29 -0
- package/modern/components/export/ExportExcel.js +191 -0
- package/modern/components/export/index.d.ts +1 -0
- package/modern/components/export/index.js +1 -0
- package/modern/components/index.d.ts +2 -1
- package/modern/components/index.js +2 -1
- package/modern/components/promptControl/GridToolbarPromptControl.js +34 -32
- package/modern/constants/dataGridPremiumDefaultSlotsComponents.js +3 -1
- package/modern/hooks/features/aggregation/useGridAggregation.d.ts +1 -1
- package/modern/hooks/features/aggregation/useGridAggregation.js +6 -6
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +1 -1
- package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +6 -6
- package/modern/hooks/features/clipboard/useGridClipboardImport.js +3 -3
- package/modern/hooks/features/dataSource/models.d.ts +1 -1
- package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +3 -3
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +2 -2
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +1 -1
- package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +3 -3
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.d.ts +1 -1
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +4 -4
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +1 -1
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +5 -5
- package/modern/index.d.ts +0 -6
- package/modern/index.js +1 -7
- package/modern/models/dataGridPremiumProps.d.ts +7 -8
- package/modern/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/releaseInfo.js +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["excelOptions"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { GridToolbar } from '@mui/x-data-grid/internals';
|
|
6
|
+
import { ExportExcel } from "./export/index.js";
|
|
7
|
+
import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
|
|
8
|
+
import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export function GridPremiumToolbar(props) {
|
|
11
|
+
const rootProps = useGridRootProps();
|
|
12
|
+
const apiRef = useGridApiContext();
|
|
13
|
+
const other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
14
|
+
const additionalExportMenuItems = !props.excelOptions?.disableToolbarButton ? onMenuItemClick => /*#__PURE__*/_jsx(ExportExcel, {
|
|
15
|
+
render: /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({}, rootProps.slotProps?.baseMenuItem)),
|
|
16
|
+
options: props.excelOptions,
|
|
17
|
+
onClick: onMenuItemClick,
|
|
18
|
+
children: apiRef.current.getLocaleText('toolbarExportExcel')
|
|
19
|
+
}) : undefined;
|
|
20
|
+
return /*#__PURE__*/_jsx(GridToolbar, _extends({}, other, {
|
|
21
|
+
additionalExportMenuItems: additionalExportMenuItems
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridSlotProps, RenderProp } from '@mui/x-data-grid';
|
|
3
|
+
import { GridExcelExportOptions } from "../../hooks/features/export/index.js";
|
|
4
|
+
export type ExportExcelProps = GridSlotProps['baseButton'] & {
|
|
5
|
+
/**
|
|
6
|
+
* A function to customize rendering of the component.
|
|
7
|
+
*/
|
|
8
|
+
render?: RenderProp<GridSlotProps['baseButton']>;
|
|
9
|
+
/**
|
|
10
|
+
* The options to apply on the Excel export.
|
|
11
|
+
* @demos
|
|
12
|
+
* - [Excel export](/x/react-data-grid/export/#excel-export)
|
|
13
|
+
*/
|
|
14
|
+
options?: GridExcelExportOptions;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A button that triggers an Excel export.
|
|
18
|
+
* It renders the `baseButton` slot.
|
|
19
|
+
*
|
|
20
|
+
* Demos:
|
|
21
|
+
*
|
|
22
|
+
* - [Export](https://mui.com/x/react-data-grid/components/export/)
|
|
23
|
+
*
|
|
24
|
+
* API:
|
|
25
|
+
*
|
|
26
|
+
* - [ExportExcel API](https://mui.com/x/api/data-grid/export-excel/)
|
|
27
|
+
*/
|
|
28
|
+
declare const ExportExcel: React.ForwardRefExoticComponent<ExportExcelProps> | React.ForwardRefExoticComponent<Omit<ExportExcelProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
29
|
+
export { ExportExcel };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["render", "options", "onClick"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useGridComponentRenderer } from '@mui/x-data-grid/internals';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
|
+
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
/**
|
|
12
|
+
* A button that triggers an Excel export.
|
|
13
|
+
* It renders the `baseButton` slot.
|
|
14
|
+
*
|
|
15
|
+
* Demos:
|
|
16
|
+
*
|
|
17
|
+
* - [Export](https://mui.com/x/react-data-grid/components/export/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [ExportExcel API](https://mui.com/x/api/data-grid/export-excel/)
|
|
22
|
+
*/
|
|
23
|
+
const ExportExcel = forwardRef(function ExportExcel(props, ref) {
|
|
24
|
+
const {
|
|
25
|
+
render,
|
|
26
|
+
options,
|
|
27
|
+
onClick
|
|
28
|
+
} = props,
|
|
29
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
|
+
const rootProps = useGridRootProps();
|
|
31
|
+
const apiRef = useGridApiContext();
|
|
32
|
+
const handleClick = event => {
|
|
33
|
+
apiRef.current.exportDataAsExcel(options);
|
|
34
|
+
onClick?.(event);
|
|
35
|
+
};
|
|
36
|
+
const element = useGridComponentRenderer(rootProps.slots.baseButton, render, _extends({
|
|
37
|
+
onClick: handleClick
|
|
38
|
+
}, rootProps.slotProps?.baseButton, other, {
|
|
39
|
+
ref
|
|
40
|
+
}));
|
|
41
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
42
|
+
children: element
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
process.env.NODE_ENV !== "production" ? ExportExcel.propTypes = {
|
|
46
|
+
// ----------------------------- Warning --------------------------------
|
|
47
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
48
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
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
|
+
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
|
+
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
|
+
* Callback fired when the component is focused with a keyboard.
|
|
136
|
+
* We trigger a `onFocus` callback too.
|
|
137
|
+
*/
|
|
138
|
+
onFocusVisible: PropTypes.func,
|
|
139
|
+
/**
|
|
140
|
+
* The options to apply on the Excel export.
|
|
141
|
+
* @demos
|
|
142
|
+
* - [Excel export](/x/react-data-grid/export/#excel-export)
|
|
143
|
+
*/
|
|
144
|
+
options: PropTypes.shape({
|
|
145
|
+
allColumns: PropTypes.bool,
|
|
146
|
+
columnsStyles: PropTypes.object,
|
|
147
|
+
escapeFormulas: PropTypes.bool,
|
|
148
|
+
exceljsPostProcess: PropTypes.func,
|
|
149
|
+
exceljsPreProcess: PropTypes.func,
|
|
150
|
+
fields: PropTypes.arrayOf(PropTypes.string),
|
|
151
|
+
fileName: PropTypes.string,
|
|
152
|
+
getRowsToExport: PropTypes.func,
|
|
153
|
+
includeColumnGroupsHeaders: PropTypes.bool,
|
|
154
|
+
includeHeaders: PropTypes.bool,
|
|
155
|
+
valueOptionsSheetName: PropTypes.string,
|
|
156
|
+
worker: PropTypes.func
|
|
157
|
+
}),
|
|
158
|
+
/**
|
|
159
|
+
* A function to customize rendering of the component.
|
|
160
|
+
*/
|
|
161
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
162
|
+
/**
|
|
163
|
+
* The size of the component.
|
|
164
|
+
* `small` is equivalent to the dense button styling.
|
|
165
|
+
*/
|
|
166
|
+
size: PropTypes.oneOf(['large', 'medium', 'small']),
|
|
167
|
+
/**
|
|
168
|
+
* Element placed before the children.
|
|
169
|
+
*/
|
|
170
|
+
startIcon: PropTypes.node,
|
|
171
|
+
style: PropTypes.object,
|
|
172
|
+
/**
|
|
173
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
174
|
+
*/
|
|
175
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
176
|
+
tabIndex: PropTypes.number,
|
|
177
|
+
/**
|
|
178
|
+
* Props applied to the `TouchRipple` element.
|
|
179
|
+
*/
|
|
180
|
+
TouchRippleProps: PropTypes.object,
|
|
181
|
+
/**
|
|
182
|
+
* A ref that points to the `TouchRipple` element.
|
|
183
|
+
*/
|
|
184
|
+
touchRippleRef: PropTypes.any,
|
|
185
|
+
/**
|
|
186
|
+
* The variant to use.
|
|
187
|
+
* @default 'text'
|
|
188
|
+
*/
|
|
189
|
+
variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
|
|
190
|
+
} : void 0;
|
|
191
|
+
export { ExportExcel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ExportExcel.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ExportExcel.js";
|
|
@@ -2,4 +2,5 @@ export * from "./GridExcelExportMenuItem.js";
|
|
|
2
2
|
export * from "../material/icons.js";
|
|
3
3
|
export * from "./GridColumnMenuAggregationItem.js";
|
|
4
4
|
export * from "./promptControl/index.js";
|
|
5
|
-
export { GridColumnMenuGroupingItem } from "./GridPremiumColumnMenu.js";
|
|
5
|
+
export { GridColumnMenuGroupingItem } from "./GridPremiumColumnMenu.js";
|
|
6
|
+
export * from "./export/index.js";
|
|
@@ -2,4 +2,5 @@ export * from "./GridExcelExportMenuItem.js";
|
|
|
2
2
|
export * from "../material/icons.js";
|
|
3
3
|
export * from "./GridColumnMenuAggregationItem.js";
|
|
4
4
|
export * from "./promptControl/index.js";
|
|
5
|
-
export { GridColumnMenuGroupingItem } from "./GridPremiumColumnMenu.js";
|
|
5
|
+
export { GridColumnMenuGroupingItem } from "./GridPremiumColumnMenu.js";
|
|
6
|
+
export * from "./export/index.js";
|
|
@@ -119,10 +119,18 @@ function GridToolbarPromptControl(props) {
|
|
|
119
119
|
sort: s.direction
|
|
120
120
|
})));
|
|
121
121
|
const rows = getVisibleRows(apiRef, rootProps);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
const rowSelectionModel = {
|
|
123
|
+
type: 'include',
|
|
124
|
+
ids: new Set()
|
|
125
|
+
};
|
|
126
|
+
if (result.select !== -1) {
|
|
127
|
+
for (let i = 0; i < result.select; i += 1) {
|
|
128
|
+
const row = rows.rows[i];
|
|
129
|
+
const id = apiRef.current.getRowId(row);
|
|
130
|
+
rowSelectionModel.ids.add(id);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
apiRef.current.setRowSelectionModel(rowSelectionModel);
|
|
126
134
|
const columns = apiRef.current.getAllColumns();
|
|
127
135
|
const targetIndex = Number(columns.find(c => c.field === GRID_CHECKBOX_SELECTION_FIELD) !== undefined) + Number(result.grouping.length);
|
|
128
136
|
interestColumns.push(...Object.keys(result.aggregation));
|
|
@@ -172,35 +180,29 @@ function GridToolbarPromptControl(props) {
|
|
|
172
180
|
helperText: error,
|
|
173
181
|
slotProps: {
|
|
174
182
|
input: {
|
|
175
|
-
startAdornment: supportsSpeechRecognition && /*#__PURE__*/_jsx(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
onDone: handleDone,
|
|
185
|
-
onError: setError
|
|
186
|
-
})
|
|
183
|
+
startAdornment: supportsSpeechRecognition && /*#__PURE__*/_jsx(RecordButton, {
|
|
184
|
+
className: classes.recordButton,
|
|
185
|
+
lang: lang,
|
|
186
|
+
recording: isRecording,
|
|
187
|
+
setRecording: setRecording,
|
|
188
|
+
disabled: isLoading,
|
|
189
|
+
onUpdate: setQuery,
|
|
190
|
+
onDone: handleDone,
|
|
191
|
+
onError: setError
|
|
187
192
|
}),
|
|
188
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.
|
|
189
|
-
|
|
190
|
-
children: /*#__PURE__*/_jsx(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.toolbarPromptSendIcon, {
|
|
202
|
-
fontSize: "small"
|
|
203
|
-
})
|
|
193
|
+
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
194
|
+
title: apiRef.current.getLocaleText('toolbarPromptControlSendActionLabel'),
|
|
195
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
196
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, {
|
|
197
|
+
className: classes.sendButton,
|
|
198
|
+
disabled: isLoading || isRecording || query === '',
|
|
199
|
+
color: "primary",
|
|
200
|
+
onClick: processPrompt,
|
|
201
|
+
size: "small",
|
|
202
|
+
"aria-label": apiRef.current.getLocaleText('toolbarPromptControlSendActionAriaLabel'),
|
|
203
|
+
edge: "end",
|
|
204
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.toolbarPromptSendIcon, {
|
|
205
|
+
fontSize: "small"
|
|
204
206
|
})
|
|
205
207
|
})
|
|
206
208
|
})
|
|
@@ -3,7 +3,9 @@ import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '@mui/x-data-grid-pro/int
|
|
|
3
3
|
import { GridPremiumColumnMenu } from "../components/GridPremiumColumnMenu.js";
|
|
4
4
|
import materialSlots from "../material/index.js";
|
|
5
5
|
import { GridBottomContainer } from "../components/GridBottomContainer.js";
|
|
6
|
+
import { GridPremiumToolbar } from "../components/GridPremiumToolbar.js";
|
|
6
7
|
export const DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS = _extends({}, DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS, materialSlots, {
|
|
7
8
|
columnMenu: GridPremiumColumnMenu,
|
|
8
|
-
bottomContainer: GridBottomContainer
|
|
9
|
+
bottomContainer: GridBottomContainer,
|
|
10
|
+
toolbar: GridPremiumToolbar
|
|
9
11
|
});
|
|
@@ -3,4 +3,4 @@ import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
|
|
|
3
3
|
import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
|
|
4
4
|
import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
|
|
5
5
|
export declare const aggregationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'aggregationModel' | 'initialState'>, GridPrivateApiPremium>;
|
|
6
|
-
export declare const useGridAggregation: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "onAggregationModelChange" | "initialState" | "aggregationModel" | "getAggregationPosition" | "aggregationFunctions" | "aggregationRowsScope" | "disableAggregation" | "rowGroupingColumnMode" | "
|
|
6
|
+
export declare const useGridAggregation: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "onAggregationModelChange" | "initialState" | "aggregationModel" | "getAggregationPosition" | "aggregationFunctions" | "aggregationRowsScope" | "disableAggregation" | "rowGroupingColumnMode" | "dataSource">) => void;
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
79
|
-
apiRef.current.
|
|
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.
|
|
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" | "
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
41
|
+
return props.dataSource?.getAggregatedValue?.(aggregateRowRef.current, field);
|
|
42
42
|
}
|
|
43
43
|
const row = apiRef.current.getRow(groupId);
|
|
44
|
-
return props.
|
|
45
|
-
}, [apiRef, props.
|
|
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
|
|
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" | "
|
|
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.
|
|
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.
|
|
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.
|
|
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" | "
|
|
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.
|
|
144
|
-
apiRef.current.
|
|
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.
|
|
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.
|
|
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" | "
|
|
4
|
+
export declare const useGridRowGroupingPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "disableRowGrouping" | "groupingColDef" | "rowGroupingColumnMode" | "defaultGroupingExpansionDepth" | "isGroupExpandedByDefault" | "dataSource">) => void;
|