@mui/x-data-grid 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -1
- package/components/GridHeader.d.ts +2 -2
- package/components/GridHeader.js +4 -6
- package/components/base/GridBody.d.ts +0 -1
- package/components/base/GridBody.js +32 -15
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +1 -1
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/containers/GridMainContainer.d.ts +3 -1
- package/components/containers/GridMainContainer.js +3 -2
- package/components/containers/GridRoot.js +0 -5
- package/components/index.d.ts +0 -1
- package/components/index.js +0 -1
- package/components/panel/GridColumnsPanel.js +3 -2
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +2 -1
- package/components/panel/filterPanel/GridFilterPanel.js +5 -2
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +4 -0
- package/hooks/features/dimensions/useGridDimensions.js +49 -10
- package/hooks/features/export/useGridPrintExport.js +3 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +11 -5
- package/index.js +1 -1
- package/joy/index.d.ts +2 -0
- package/joy/index.js +2 -0
- package/joy/joySlots.d.ts +4 -0
- package/joy/joySlots.js +71 -0
- package/joy/package.json +6 -0
- package/legacy/components/GridHeader.js +4 -6
- package/legacy/components/base/GridBody.js +33 -16
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/legacy/components/containers/GridMainContainer.js +3 -2
- package/legacy/components/containers/GridRoot.js +0 -5
- package/legacy/components/index.js +0 -1
- package/legacy/components/panel/GridColumnsPanel.js +3 -2
- package/legacy/components/panel/GridPanel.js +2 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +5 -2
- package/legacy/hooks/features/dimensions/useGridDimensions.js +55 -12
- package/legacy/hooks/features/export/useGridPrintExport.js +3 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +12 -6
- package/legacy/index.js +1 -1
- package/legacy/joy/index.js +2 -0
- package/legacy/joy/joySlots.js +73 -0
- package/material/index.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +2 -2
- package/modern/components/GridHeader.js +4 -6
- package/modern/components/base/GridBody.js +32 -15
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/modern/components/containers/GridMainContainer.js +3 -2
- package/modern/components/containers/GridRoot.js +0 -5
- package/modern/components/index.js +0 -1
- package/modern/components/panel/GridColumnsPanel.js +3 -2
- package/modern/components/panel/GridPanel.js +2 -1
- package/modern/components/panel/filterPanel/GridFilterPanel.js +5 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +48 -10
- package/modern/hooks/features/export/useGridPrintExport.js +3 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +11 -5
- package/modern/index.js +1 -1
- package/modern/joy/index.js +2 -0
- package/modern/joy/joySlots.js +71 -0
- package/node/components/GridHeader.js +5 -8
- package/node/components/base/GridBody.js +32 -15
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/node/components/containers/GridMainContainer.js +5 -3
- package/node/components/containers/GridRoot.js +0 -5
- package/node/components/index.js +0 -11
- package/node/components/panel/GridColumnsPanel.js +3 -2
- package/node/components/panel/GridPanel.js +2 -1
- package/node/components/panel/filterPanel/GridFilterPanel.js +5 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +47 -9
- package/node/hooks/features/export/useGridPrintExport.js +3 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +11 -5
- package/node/index.js +1 -1
- package/node/joy/index.js +13 -0
- package/node/joy/joySlots.js +79 -0
- package/package.json +1 -1
- package/components/GridAutoSizer.d.ts +0 -44
- package/components/GridAutoSizer.js +0 -126
- package/legacy/components/GridAutoSizer.js +0 -132
- package/modern/components/GridAutoSizer.js +0 -125
- package/node/components/GridAutoSizer.js +0 -132
|
@@ -94,8 +94,9 @@ function GridColumnsPanel(props) {
|
|
|
94
94
|
const toggleAllColumns = React.useCallback(isVisible => {
|
|
95
95
|
const currentModel = gridColumnVisibilityModelSelector(apiRef);
|
|
96
96
|
const newModel = _extends({}, currentModel);
|
|
97
|
+
const togglableColumns = getTogglableColumns ? getTogglableColumns(columns) : null;
|
|
97
98
|
columns.forEach(col => {
|
|
98
|
-
if (col.hideable) {
|
|
99
|
+
if (col.hideable && (togglableColumns == null || togglableColumns.includes(col.field))) {
|
|
99
100
|
if (isVisible) {
|
|
100
101
|
// delete the key from the model instead of setting it to `true`
|
|
101
102
|
delete newModel[col.field];
|
|
@@ -105,7 +106,7 @@ function GridColumnsPanel(props) {
|
|
|
105
106
|
}
|
|
106
107
|
});
|
|
107
108
|
return apiRef.current.setColumnVisibilityModel(newModel);
|
|
108
|
-
}, [apiRef, columns]);
|
|
109
|
+
}, [apiRef, columns, getTogglableColumns]);
|
|
109
110
|
const handleSearchValueChange = React.useCallback(event => {
|
|
110
111
|
setSearchValue(event.target.value);
|
|
111
112
|
}, []);
|
|
@@ -115,6 +115,7 @@ process.env.NODE_ENV !== "production" ? GridPanel.propTypes = {
|
|
|
115
115
|
/**
|
|
116
116
|
* If `true`, the component is shown.
|
|
117
117
|
*/
|
|
118
|
-
open: PropTypes.bool.isRequired
|
|
118
|
+
open: PropTypes.bool.isRequired,
|
|
119
|
+
ownerState: PropTypes.object
|
|
119
120
|
} : void 0;
|
|
120
121
|
export { GridPanel };
|
|
@@ -26,6 +26,7 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
26
26
|
const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
|
|
27
27
|
const filterableColumns = useGridSelector(apiRef, gridFilterableColumnDefinitionsSelector);
|
|
28
28
|
const lastFilterRef = React.useRef(null);
|
|
29
|
+
const placeholderFilter = React.useRef(null);
|
|
29
30
|
const {
|
|
30
31
|
logicOperators = [GridLogicOperator.And, GridLogicOperator.Or],
|
|
31
32
|
columnsSort,
|
|
@@ -89,8 +90,10 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
89
90
|
if (filterModel.items.length) {
|
|
90
91
|
return filterModel.items;
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
if (!placeholderFilter.current) {
|
|
94
|
+
placeholderFilter.current = getDefaultFilter();
|
|
95
|
+
}
|
|
96
|
+
return placeholderFilter.current ? [placeholderFilter.current] : [];
|
|
94
97
|
}, [filterModel.items, getDefaultFilter]);
|
|
95
98
|
const hasMultipleFilters = items.length > 1;
|
|
96
99
|
const addNewFilter = () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { unstable_debounce as debounce, unstable_ownerDocument as ownerDocument, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
2
|
+
import { unstable_debounce as debounce, unstable_ownerDocument as ownerDocument, unstable_useEnhancedEffect as useEnhancedEffect, unstable_ownerWindow as ownerWindow } from '@mui/utils';
|
|
3
3
|
import { useGridApiEventHandler, useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';
|
|
4
4
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
5
5
|
import { useGridLogger } from '../../utils/useGridLogger';
|
|
@@ -10,6 +10,7 @@ import { getVisibleRows } from '../../utils/useGridVisibleRows';
|
|
|
10
10
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
11
11
|
import { calculatePinnedRowsHeight } from '../rows/gridRowsUtils';
|
|
12
12
|
import { getTotalHeaderHeight } from '../columns/gridColumnsUtils';
|
|
13
|
+
import { gridClasses } from '../../../constants/gridClasses';
|
|
13
14
|
const isTestEnvironment = process.env.NODE_ENV === 'test';
|
|
14
15
|
const hasScroll = ({
|
|
15
16
|
content,
|
|
@@ -113,10 +114,20 @@ export function useGridDimensions(apiRef, props) {
|
|
|
113
114
|
apiRef.current.publishEvent('viewportInnerSizeChange', newFullDimensions.viewportInnerSize);
|
|
114
115
|
}
|
|
115
116
|
}, [apiRef, props.scrollbarSize, props.autoHeight, rowsMeta.currentPageTotalHeight, totalHeaderHeight]);
|
|
117
|
+
const [savedSize, setSavedSize] = React.useState();
|
|
118
|
+
const debouncedSetSavedSize = React.useMemo(() => debounce(setSavedSize, 60), []);
|
|
119
|
+
const previousSize = React.useRef();
|
|
120
|
+
useEnhancedEffect(() => {
|
|
121
|
+
if (savedSize) {
|
|
122
|
+
updateGridDimensionsRef();
|
|
123
|
+
apiRef.current.publishEvent('debouncedResize', rootDimensionsRef.current);
|
|
124
|
+
}
|
|
125
|
+
}, [apiRef, savedSize, updateGridDimensionsRef]);
|
|
126
|
+
|
|
127
|
+
// This is the function called by apiRef.current.resize()
|
|
116
128
|
const resize = React.useCallback(() => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, [apiRef, updateGridDimensionsRef]);
|
|
129
|
+
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
130
|
+
}, [apiRef]);
|
|
120
131
|
const getRootDimensions = React.useCallback(() => fullDimensionsRef.current, []);
|
|
121
132
|
const getViewportPageSize = React.useCallback(() => {
|
|
122
133
|
const dimensions = apiRef.current.getRootDimensions();
|
|
@@ -138,17 +149,44 @@ export function useGridDimensions(apiRef, props) {
|
|
|
138
149
|
const maximumPageSizeWithoutScrollBar = Math.floor(dimensions.viewportInnerSize.height / rowHeight);
|
|
139
150
|
return Math.min(maximumPageSizeWithoutScrollBar, currentPage.rows.length);
|
|
140
151
|
}, [apiRef, props.pagination, props.paginationMode, props.getRowHeight, rowHeight]);
|
|
152
|
+
const computeSizeAndPublishResizeEvent = React.useCallback(() => {
|
|
153
|
+
const rootEl = apiRef.current.rootElementRef?.current;
|
|
154
|
+
const mainEl = rootEl?.querySelector(`.${gridClasses.main}`);
|
|
155
|
+
if (!mainEl) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const height = mainEl.offsetHeight || 0;
|
|
159
|
+
const width = mainEl.offsetWidth || 0;
|
|
160
|
+
const win = ownerWindow(mainEl);
|
|
161
|
+
const computedStyle = win.getComputedStyle(mainEl);
|
|
162
|
+
const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;
|
|
163
|
+
const paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;
|
|
164
|
+
const paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;
|
|
165
|
+
const paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;
|
|
166
|
+
const newHeight = height - paddingTop - paddingBottom;
|
|
167
|
+
const newWidth = width - paddingLeft - paddingRight;
|
|
168
|
+
const hasHeightChanged = newHeight !== previousSize.current?.height;
|
|
169
|
+
const hasWidthChanged = newWidth !== previousSize.current?.width;
|
|
170
|
+
if (!previousSize.current || hasHeightChanged || hasWidthChanged) {
|
|
171
|
+
const size = {
|
|
172
|
+
width: newWidth,
|
|
173
|
+
height: newHeight
|
|
174
|
+
};
|
|
175
|
+
apiRef.current.publishEvent('resize', size);
|
|
176
|
+
previousSize.current = size;
|
|
177
|
+
}
|
|
178
|
+
}, [apiRef]);
|
|
141
179
|
const dimensionsApi = {
|
|
142
180
|
resize,
|
|
143
181
|
getRootDimensions
|
|
144
182
|
};
|
|
145
183
|
const dimensionsPrivateApi = {
|
|
146
184
|
getViewportPageSize,
|
|
147
|
-
updateGridDimensionsRef
|
|
185
|
+
updateGridDimensionsRef,
|
|
186
|
+
computeSizeAndPublishResizeEvent
|
|
148
187
|
};
|
|
149
188
|
useGridApiMethod(apiRef, dimensionsApi, 'public');
|
|
150
189
|
useGridApiMethod(apiRef, dimensionsPrivateApi, 'private');
|
|
151
|
-
const debounceResize = React.useMemo(() => debounce(resize, 60), [resize]);
|
|
152
190
|
const isFirstSizing = React.useRef(true);
|
|
153
191
|
const handleResize = React.useCallback(size => {
|
|
154
192
|
rootDimensionsRef.current = size;
|
|
@@ -165,18 +203,18 @@ export function useGridDimensions(apiRef, props) {
|
|
|
165
203
|
}
|
|
166
204
|
if (isTestEnvironment) {
|
|
167
205
|
// We don't need to debounce the resize for tests.
|
|
168
|
-
|
|
206
|
+
setSavedSize(size);
|
|
169
207
|
isFirstSizing.current = false;
|
|
170
208
|
return;
|
|
171
209
|
}
|
|
172
210
|
if (isFirstSizing.current) {
|
|
173
211
|
// We want to initialize the grid dimensions as soon as possible to avoid flickering
|
|
174
|
-
|
|
212
|
+
setSavedSize(size);
|
|
175
213
|
isFirstSizing.current = false;
|
|
176
214
|
return;
|
|
177
215
|
}
|
|
178
|
-
|
|
179
|
-
}, [props.autoHeight,
|
|
216
|
+
debouncedSetSavedSize(size);
|
|
217
|
+
}, [props.autoHeight, debouncedSetSavedSize, logger]);
|
|
180
218
|
useEnhancedEffect(() => updateGridDimensionsRef(), [updateGridDimensionsRef]);
|
|
181
219
|
useGridApiOptionHandler(apiRef, 'sortedRowsSet', updateGridDimensionsRef);
|
|
182
220
|
useGridApiOptionHandler(apiRef, 'paginationModelChange', updateGridDimensionsRef);
|
|
@@ -121,7 +121,9 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
121
121
|
printDoc.body.classList.add(...normalizeOptions.bodyClassName.split(' '));
|
|
122
122
|
}
|
|
123
123
|
if (normalizeOptions.copyStyles) {
|
|
124
|
-
const
|
|
124
|
+
const rootCandidate = gridRootElement.getRootNode();
|
|
125
|
+
const root = rootCandidate.constructor.name === 'ShadowRoot' ? rootCandidate : doc.current;
|
|
126
|
+
const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']");
|
|
125
127
|
for (let i = 0; i < headStyleElements.length; i += 1) {
|
|
126
128
|
const node = headStyleElements[i];
|
|
127
129
|
if (node.tagName === 'STYLE') {
|
|
@@ -174,11 +174,13 @@ export const useGridVirtualScroller = props => {
|
|
|
174
174
|
height: rootRef.current.clientHeight
|
|
175
175
|
});
|
|
176
176
|
}, [rowsMeta.currentPageTotalHeight]);
|
|
177
|
-
const handleResize = React.useCallback(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
const handleResize = React.useCallback(() => {
|
|
178
|
+
if (rootRef.current) {
|
|
179
|
+
setContainerDimensions({
|
|
180
|
+
width: rootRef.current.clientWidth,
|
|
181
|
+
height: rootRef.current.clientHeight
|
|
182
|
+
});
|
|
183
|
+
}
|
|
182
184
|
}, []);
|
|
183
185
|
useGridApiEventHandler(apiRef, 'debouncedResize', handleResize);
|
|
184
186
|
const updateRenderZonePosition = React.useCallback(nextRenderContext => {
|
|
@@ -304,6 +306,7 @@ export const useGridVirtualScroller = props => {
|
|
|
304
306
|
renderContext
|
|
305
307
|
}) => {
|
|
306
308
|
const {
|
|
309
|
+
onRowRender,
|
|
307
310
|
renderContext: nextRenderContext,
|
|
308
311
|
minFirstColumn = renderZoneMinColumnIndex,
|
|
309
312
|
maxLastColumn = renderZoneMaxColumnIndex,
|
|
@@ -387,6 +390,9 @@ export const useGridVirtualScroller = props => {
|
|
|
387
390
|
} else {
|
|
388
391
|
isSelected = apiRef.current.isRowSelectable(id);
|
|
389
392
|
}
|
|
393
|
+
if (onRowRender) {
|
|
394
|
+
onRowRender(id);
|
|
395
|
+
}
|
|
390
396
|
const focusedCell = cellFocus !== null && cellFocus.id === id ? cellFocus.field : null;
|
|
391
397
|
let tabbableCell = null;
|
|
392
398
|
if (cellTabIndex !== null && cellTabIndex.id === id) {
|
package/modern/index.js
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size", "checked", "sx", "value", "inputRef"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import JoyCheckbox from '@mui/joy/Checkbox';
|
|
6
|
+
import JoyInput from '@mui/joy/Input';
|
|
7
|
+
import JoyFormControl from '@mui/joy/FormControl';
|
|
8
|
+
import JoyFormLabel from '@mui/joy/FormLabel';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
12
|
+
let {
|
|
13
|
+
inputProps,
|
|
14
|
+
onChange,
|
|
15
|
+
checked,
|
|
16
|
+
inputRef
|
|
17
|
+
} = _ref,
|
|
18
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
+
return /*#__PURE__*/_jsx(JoyCheckbox, _extends({}, props, {
|
|
20
|
+
slotProps: {
|
|
21
|
+
input: _extends({}, inputProps, {
|
|
22
|
+
ref: inputRef
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
ref: ref,
|
|
26
|
+
checked: checked,
|
|
27
|
+
onChange: onChange
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
30
|
+
const TextField = /*#__PURE__*/React.forwardRef(({
|
|
31
|
+
onChange,
|
|
32
|
+
label,
|
|
33
|
+
placeholder,
|
|
34
|
+
value,
|
|
35
|
+
inputRef,
|
|
36
|
+
type
|
|
37
|
+
}, ref) => {
|
|
38
|
+
return /*#__PURE__*/_jsxs(JoyFormControl, {
|
|
39
|
+
ref: ref,
|
|
40
|
+
children: [/*#__PURE__*/_jsx(JoyFormLabel, {
|
|
41
|
+
sx: {
|
|
42
|
+
fontSize: 12
|
|
43
|
+
},
|
|
44
|
+
children: label
|
|
45
|
+
}), /*#__PURE__*/_jsx(JoyInput, {
|
|
46
|
+
type: type,
|
|
47
|
+
value: value,
|
|
48
|
+
onChange: onChange,
|
|
49
|
+
placeholder: placeholder,
|
|
50
|
+
size: "sm",
|
|
51
|
+
slotProps: {
|
|
52
|
+
input: {
|
|
53
|
+
ref: inputRef
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
const joySlots = {
|
|
60
|
+
baseCheckbox: Checkbox,
|
|
61
|
+
baseTextField: TextField
|
|
62
|
+
// BaseFormControl: MUIFormControl,
|
|
63
|
+
// BaseSelect: MUISelect,
|
|
64
|
+
// BaseSwitch: MUISwitch,
|
|
65
|
+
// BaseButton: MUIButton,
|
|
66
|
+
// BaseIconButton: MUIIconButton,
|
|
67
|
+
// BaseTooltip: MUITooltip,
|
|
68
|
+
// BasePopper: MUIPopper,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default joySlots;
|
|
@@ -4,19 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.GridHeader =
|
|
7
|
+
exports.GridHeader = GridHeader;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
|
|
14
|
+
function GridHeader() {
|
|
15
15
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
17
|
-
ref: ref
|
|
18
|
-
}, props, {
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
19
17
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.preferencesPanel, (0, _extends2.default)({}, rootProps.slotProps?.preferencesPanel)), rootProps.slots.toolbar && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.toolbar, (0, _extends2.default)({}, rootProps.slotProps?.toolbar))]
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
exports.GridHeader = GridHeader;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -8,10 +8,10 @@ exports.GridBody = GridBody;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _utils = require("@mui/utils");
|
|
11
12
|
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
|
|
12
13
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
13
14
|
var _GridMainContainer = require("../containers/GridMainContainer");
|
|
14
|
-
var _GridAutoSizer = require("../GridAutoSizer");
|
|
15
15
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
16
16
|
var _gridColumnsSelector = require("../../hooks/features/columns/gridColumnsSelector");
|
|
17
17
|
var _gridFilterSelector = require("../../hooks/features/filter/gridFilterSelector");
|
|
@@ -25,12 +25,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
26
|
function GridBody(props) {
|
|
27
27
|
const {
|
|
28
|
-
children,
|
|
29
28
|
VirtualScrollerComponent,
|
|
30
29
|
ColumnHeadersProps
|
|
31
30
|
} = props;
|
|
32
31
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
33
32
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
33
|
+
const rootRef = React.useRef(null);
|
|
34
34
|
const visibleColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector);
|
|
35
35
|
const filterColumnLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridFilterActiveItemsLookupSelector);
|
|
36
36
|
const sortColumnLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridSortingSelector.gridSortColumnLookupSelector);
|
|
@@ -47,6 +47,24 @@ function GridBody(props) {
|
|
|
47
47
|
const columnGroupsHeaderStructure = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsHeaderStructureSelector);
|
|
48
48
|
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);
|
|
49
49
|
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
50
|
+
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
51
|
+
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
52
|
+
const elementToObserve = rootRef.current;
|
|
53
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
54
|
+
return () => {};
|
|
55
|
+
}
|
|
56
|
+
const observer = new ResizeObserver(() => {
|
|
57
|
+
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
58
|
+
});
|
|
59
|
+
if (elementToObserve) {
|
|
60
|
+
observer.observe(elementToObserve);
|
|
61
|
+
}
|
|
62
|
+
return () => {
|
|
63
|
+
if (elementToObserve) {
|
|
64
|
+
observer.unobserve(elementToObserve);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}, [apiRef]);
|
|
50
68
|
const disableVirtualization = React.useCallback(() => {
|
|
51
69
|
setIsVirtualizationDisabled(true);
|
|
52
70
|
}, []);
|
|
@@ -73,10 +91,9 @@ function GridBody(props) {
|
|
|
73
91
|
columnHeadersElementRef: columnHeadersRef,
|
|
74
92
|
virtualScrollerRef
|
|
75
93
|
});
|
|
76
|
-
const
|
|
77
|
-
apiRef.current.publishEvent('resize', size);
|
|
78
|
-
}, [apiRef]);
|
|
94
|
+
const hasDimensions = !!apiRef.current.getRootDimensions();
|
|
79
95
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridMainContainer.GridMainContainer, {
|
|
96
|
+
ref: rootRef,
|
|
80
97
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnHeaders, (0, _extends2.default)({
|
|
81
98
|
ref: columnsContainerRef,
|
|
82
99
|
innerRef: columnHeadersRef,
|
|
@@ -94,15 +111,16 @@ function GridBody(props) {
|
|
|
94
111
|
columnVisibility: columnVisibility,
|
|
95
112
|
columnGroupsHeaderStructure: columnGroupsHeaderStructure,
|
|
96
113
|
hasOtherElementInTabSequence: hasOtherElementInTabSequence
|
|
97
|
-
}, ColumnHeadersProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
}, ColumnHeadersProps)), hasDimensions && /*#__PURE__*/(0, _jsxRuntime.jsx)(VirtualScrollerComponent
|
|
115
|
+
// The content is only rendered after dimensions are computed because
|
|
116
|
+
// the lazy-loading hook is listening to `renderedRowsIntervalChange`,
|
|
117
|
+
// but only does something if the dimensions are also available.
|
|
118
|
+
// If this event is published while dimensions haven't been computed,
|
|
119
|
+
// the `onFetchRows` prop won't be called during mount.
|
|
120
|
+
, {
|
|
121
|
+
ref: virtualScrollerRef,
|
|
122
|
+
disableVirtualization: isVirtualizationDisabled
|
|
123
|
+
})]
|
|
106
124
|
});
|
|
107
125
|
}
|
|
108
126
|
process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
|
|
@@ -110,7 +128,6 @@ process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
|
|
|
110
128
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
111
129
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
112
130
|
// ----------------------------------------------------------------------
|
|
113
|
-
children: _propTypes.default.node,
|
|
114
131
|
ColumnHeadersProps: _propTypes.default.object,
|
|
115
132
|
VirtualScrollerComponent: _propTypes.default.elementType.isRequired
|
|
116
133
|
} : void 0;
|
|
@@ -44,7 +44,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
44
44
|
};
|
|
45
45
|
const classes = useUtilityClasses(ownerState);
|
|
46
46
|
const checkboxElement = React.useRef(null);
|
|
47
|
-
const rippleRef = React.useRef();
|
|
47
|
+
const rippleRef = React.useRef(null);
|
|
48
48
|
const handleRef = (0, _utils.unstable_useForkRef)(checkboxElement, ref);
|
|
49
49
|
const element = apiRef.current.getCellElement(id, field);
|
|
50
50
|
const handleChange = event => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.GridMainContainer =
|
|
6
|
+
exports.GridMainContainer = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _utils = require("@mui/utils");
|
|
9
9
|
var _system = require("@mui/system");
|
|
@@ -32,12 +32,14 @@ const GridMainContainerRoot = (0, _system.styled)('div', {
|
|
|
32
32
|
flexDirection: 'column',
|
|
33
33
|
overflow: 'hidden'
|
|
34
34
|
}));
|
|
35
|
-
|
|
35
|
+
const GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
36
36
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
37
37
|
const classes = useUtilityClasses(rootProps);
|
|
38
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridMainContainerRoot, {
|
|
39
|
+
ref: ref,
|
|
39
40
|
className: classes.root,
|
|
40
41
|
ownerState: rootProps,
|
|
41
42
|
children: props.children
|
|
42
43
|
});
|
|
43
|
-
}
|
|
44
|
+
});
|
|
45
|
+
exports.GridMainContainer = GridMainContainer;
|
|
@@ -63,11 +63,6 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
63
63
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
64
64
|
setMountedState(true);
|
|
65
65
|
}, []);
|
|
66
|
-
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
67
|
-
if (mountedState) {
|
|
68
|
-
apiRef.current.updateGridDimensionsRef();
|
|
69
|
-
}
|
|
70
|
-
}, [apiRef, mountedState]);
|
|
71
66
|
if (!mountedState) {
|
|
72
67
|
return null;
|
|
73
68
|
}
|
package/node/components/index.js
CHANGED
|
@@ -113,17 +113,6 @@ Object.keys(_GridApiContext).forEach(function (key) {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
|
-
var _GridAutoSizer = require("./GridAutoSizer");
|
|
117
|
-
Object.keys(_GridAutoSizer).forEach(function (key) {
|
|
118
|
-
if (key === "default" || key === "__esModule") return;
|
|
119
|
-
if (key in exports && exports[key] === _GridAutoSizer[key]) return;
|
|
120
|
-
Object.defineProperty(exports, key, {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _GridAutoSizer[key];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
116
|
var _GridFooter = require("./GridFooter");
|
|
128
117
|
Object.keys(_GridFooter).forEach(function (key) {
|
|
129
118
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -102,8 +102,9 @@ function GridColumnsPanel(props) {
|
|
|
102
102
|
const toggleAllColumns = React.useCallback(isVisible => {
|
|
103
103
|
const currentModel = (0, _gridColumnsSelector.gridColumnVisibilityModelSelector)(apiRef);
|
|
104
104
|
const newModel = (0, _extends2.default)({}, currentModel);
|
|
105
|
+
const togglableColumns = getTogglableColumns ? getTogglableColumns(columns) : null;
|
|
105
106
|
columns.forEach(col => {
|
|
106
|
-
if (col.hideable) {
|
|
107
|
+
if (col.hideable && (togglableColumns == null || togglableColumns.includes(col.field))) {
|
|
107
108
|
if (isVisible) {
|
|
108
109
|
// delete the key from the model instead of setting it to `true`
|
|
109
110
|
delete newModel[col.field];
|
|
@@ -113,7 +114,7 @@ function GridColumnsPanel(props) {
|
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
return apiRef.current.setColumnVisibilityModel(newModel);
|
|
116
|
-
}, [apiRef, columns]);
|
|
117
|
+
}, [apiRef, columns, getTogglableColumns]);
|
|
117
118
|
const handleSearchValueChange = React.useCallback(event => {
|
|
118
119
|
setSearchValue(event.target.value);
|
|
119
120
|
}, []);
|
|
@@ -126,5 +126,6 @@ process.env.NODE_ENV !== "production" ? GridPanel.propTypes = {
|
|
|
126
126
|
/**
|
|
127
127
|
* If `true`, the component is shown.
|
|
128
128
|
*/
|
|
129
|
-
open: _propTypes.default.bool.isRequired
|
|
129
|
+
open: _propTypes.default.bool.isRequired,
|
|
130
|
+
ownerState: _propTypes.default.object
|
|
130
131
|
} : void 0;
|
|
@@ -34,6 +34,7 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
34
34
|
const filterModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridFilterModelSelector);
|
|
35
35
|
const filterableColumns = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridFilterableColumnDefinitionsSelector);
|
|
36
36
|
const lastFilterRef = React.useRef(null);
|
|
37
|
+
const placeholderFilter = React.useRef(null);
|
|
37
38
|
const {
|
|
38
39
|
logicOperators = [_gridFilterItem.GridLogicOperator.And, _gridFilterItem.GridLogicOperator.Or],
|
|
39
40
|
columnsSort,
|
|
@@ -97,8 +98,10 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
97
98
|
if (filterModel.items.length) {
|
|
98
99
|
return filterModel.items;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
if (!placeholderFilter.current) {
|
|
102
|
+
placeholderFilter.current = getDefaultFilter();
|
|
103
|
+
}
|
|
104
|
+
return placeholderFilter.current ? [placeholderFilter.current] : [];
|
|
102
105
|
}, [filterModel.items, getDefaultFilter]);
|
|
103
106
|
const hasMultipleFilters = items.length > 1;
|
|
104
107
|
const addNewFilter = () => {
|
|
@@ -16,6 +16,7 @@ var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
|
|
|
16
16
|
var _gridRowsMetaSelector = require("../rows/gridRowsMetaSelector");
|
|
17
17
|
var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
18
18
|
var _gridColumnsUtils = require("../columns/gridColumnsUtils");
|
|
19
|
+
var _gridClasses = require("../../../constants/gridClasses");
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
22
|
const isTestEnvironment = process.env.NODE_ENV === 'test';
|
|
@@ -121,10 +122,20 @@ function useGridDimensions(apiRef, props) {
|
|
|
121
122
|
apiRef.current.publishEvent('viewportInnerSizeChange', newFullDimensions.viewportInnerSize);
|
|
122
123
|
}
|
|
123
124
|
}, [apiRef, props.scrollbarSize, props.autoHeight, rowsMeta.currentPageTotalHeight, totalHeaderHeight]);
|
|
125
|
+
const [savedSize, setSavedSize] = React.useState();
|
|
126
|
+
const debouncedSetSavedSize = React.useMemo(() => (0, _utils.unstable_debounce)(setSavedSize, 60), []);
|
|
127
|
+
const previousSize = React.useRef();
|
|
128
|
+
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
129
|
+
if (savedSize) {
|
|
130
|
+
updateGridDimensionsRef();
|
|
131
|
+
apiRef.current.publishEvent('debouncedResize', rootDimensionsRef.current);
|
|
132
|
+
}
|
|
133
|
+
}, [apiRef, savedSize, updateGridDimensionsRef]);
|
|
134
|
+
|
|
135
|
+
// This is the function called by apiRef.current.resize()
|
|
124
136
|
const resize = React.useCallback(() => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}, [apiRef, updateGridDimensionsRef]);
|
|
137
|
+
apiRef.current.computeSizeAndPublishResizeEvent();
|
|
138
|
+
}, [apiRef]);
|
|
128
139
|
const getRootDimensions = React.useCallback(() => fullDimensionsRef.current, []);
|
|
129
140
|
const getViewportPageSize = React.useCallback(() => {
|
|
130
141
|
const dimensions = apiRef.current.getRootDimensions();
|
|
@@ -146,17 +157,44 @@ function useGridDimensions(apiRef, props) {
|
|
|
146
157
|
const maximumPageSizeWithoutScrollBar = Math.floor(dimensions.viewportInnerSize.height / rowHeight);
|
|
147
158
|
return Math.min(maximumPageSizeWithoutScrollBar, currentPage.rows.length);
|
|
148
159
|
}, [apiRef, props.pagination, props.paginationMode, props.getRowHeight, rowHeight]);
|
|
160
|
+
const computeSizeAndPublishResizeEvent = React.useCallback(() => {
|
|
161
|
+
const rootEl = apiRef.current.rootElementRef?.current;
|
|
162
|
+
const mainEl = rootEl?.querySelector(`.${_gridClasses.gridClasses.main}`);
|
|
163
|
+
if (!mainEl) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const height = mainEl.offsetHeight || 0;
|
|
167
|
+
const width = mainEl.offsetWidth || 0;
|
|
168
|
+
const win = (0, _utils.unstable_ownerWindow)(mainEl);
|
|
169
|
+
const computedStyle = win.getComputedStyle(mainEl);
|
|
170
|
+
const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;
|
|
171
|
+
const paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;
|
|
172
|
+
const paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;
|
|
173
|
+
const paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;
|
|
174
|
+
const newHeight = height - paddingTop - paddingBottom;
|
|
175
|
+
const newWidth = width - paddingLeft - paddingRight;
|
|
176
|
+
const hasHeightChanged = newHeight !== previousSize.current?.height;
|
|
177
|
+
const hasWidthChanged = newWidth !== previousSize.current?.width;
|
|
178
|
+
if (!previousSize.current || hasHeightChanged || hasWidthChanged) {
|
|
179
|
+
const size = {
|
|
180
|
+
width: newWidth,
|
|
181
|
+
height: newHeight
|
|
182
|
+
};
|
|
183
|
+
apiRef.current.publishEvent('resize', size);
|
|
184
|
+
previousSize.current = size;
|
|
185
|
+
}
|
|
186
|
+
}, [apiRef]);
|
|
149
187
|
const dimensionsApi = {
|
|
150
188
|
resize,
|
|
151
189
|
getRootDimensions
|
|
152
190
|
};
|
|
153
191
|
const dimensionsPrivateApi = {
|
|
154
192
|
getViewportPageSize,
|
|
155
|
-
updateGridDimensionsRef
|
|
193
|
+
updateGridDimensionsRef,
|
|
194
|
+
computeSizeAndPublishResizeEvent
|
|
156
195
|
};
|
|
157
196
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, dimensionsApi, 'public');
|
|
158
197
|
(0, _useGridApiMethod.useGridApiMethod)(apiRef, dimensionsPrivateApi, 'private');
|
|
159
|
-
const debounceResize = React.useMemo(() => (0, _utils.unstable_debounce)(resize, 60), [resize]);
|
|
160
198
|
const isFirstSizing = React.useRef(true);
|
|
161
199
|
const handleResize = React.useCallback(size => {
|
|
162
200
|
rootDimensionsRef.current = size;
|
|
@@ -173,18 +211,18 @@ function useGridDimensions(apiRef, props) {
|
|
|
173
211
|
}
|
|
174
212
|
if (isTestEnvironment) {
|
|
175
213
|
// We don't need to debounce the resize for tests.
|
|
176
|
-
|
|
214
|
+
setSavedSize(size);
|
|
177
215
|
isFirstSizing.current = false;
|
|
178
216
|
return;
|
|
179
217
|
}
|
|
180
218
|
if (isFirstSizing.current) {
|
|
181
219
|
// We want to initialize the grid dimensions as soon as possible to avoid flickering
|
|
182
|
-
|
|
220
|
+
setSavedSize(size);
|
|
183
221
|
isFirstSizing.current = false;
|
|
184
222
|
return;
|
|
185
223
|
}
|
|
186
|
-
|
|
187
|
-
}, [props.autoHeight,
|
|
224
|
+
debouncedSetSavedSize(size);
|
|
225
|
+
}, [props.autoHeight, debouncedSetSavedSize, logger]);
|
|
188
226
|
(0, _utils.unstable_useEnhancedEffect)(() => updateGridDimensionsRef(), [updateGridDimensionsRef]);
|
|
189
227
|
(0, _useGridApiEventHandler.useGridApiOptionHandler)(apiRef, 'sortedRowsSet', updateGridDimensionsRef);
|
|
190
228
|
(0, _useGridApiEventHandler.useGridApiOptionHandler)(apiRef, 'paginationModelChange', updateGridDimensionsRef);
|