@mui/x-data-grid 5.17.23 → 5.17.25
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 +44 -0
- package/components/GridRowCount.js +3 -5
- package/components/GridScrollArea.js +3 -2
- package/components/GridSelectedRowCount.js +3 -5
- package/components/cell/GridEditInputCell.js +2 -4
- package/components/columnHeaders/GridColumnHeaderTitle.js +3 -5
- package/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/components/columnHeaders/GridColumnHeadersInner.js +7 -5
- package/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/components/containers/GridFooterContainer.js +3 -5
- package/components/containers/GridMainContainer.js +2 -4
- package/components/containers/GridOverlay.js +3 -5
- package/components/containers/GridRoot.js +6 -5
- package/components/containers/GridRootStyles.d.ts +5 -1
- package/components/containers/GridToolbarContainer.js +3 -5
- package/components/menu/GridMenu.js +2 -4
- package/components/panel/GridColumnsPanel.js +16 -6
- package/components/panel/GridPanel.js +4 -0
- package/components/panel/GridPanelContent.js +3 -5
- package/components/panel/GridPanelFooter.js +3 -5
- package/components/panel/GridPanelHeader.js +3 -5
- package/components/panel/GridPanelWrapper.d.ts +4 -0
- package/components/panel/GridPanelWrapper.js +28 -10
- package/components/panel/filterPanel/GridFilterForm.js +8 -5
- package/components/toolbar/GridToolbarFilterButton.js +3 -5
- package/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/components/virtualization/GridVirtualScroller.js +3 -5
- package/components/virtualization/GridVirtualScrollerContent.js +5 -3
- package/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +14 -0
- package/index.js +1 -1
- package/legacy/components/GridRowCount.js +3 -5
- package/legacy/components/GridScrollArea.js +3 -2
- package/legacy/components/GridSelectedRowCount.js +3 -5
- package/legacy/components/cell/GridEditInputCell.js +2 -4
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +3 -5
- package/legacy/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +7 -5
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/legacy/components/containers/GridFooterContainer.js +3 -5
- package/legacy/components/containers/GridMainContainer.js +2 -4
- package/legacy/components/containers/GridOverlay.js +3 -5
- package/legacy/components/containers/GridRoot.js +7 -6
- package/legacy/components/containers/GridToolbarContainer.js +3 -5
- package/legacy/components/menu/GridMenu.js +2 -4
- package/legacy/components/panel/GridColumnsPanel.js +16 -8
- package/legacy/components/panel/GridPanel.js +4 -0
- package/legacy/components/panel/GridPanelContent.js +3 -5
- package/legacy/components/panel/GridPanelFooter.js +3 -5
- package/legacy/components/panel/GridPanelHeader.js +3 -5
- package/legacy/components/panel/GridPanelWrapper.js +28 -9
- package/legacy/components/panel/filterPanel/GridFilterForm.js +8 -5
- package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -5
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/legacy/components/virtualization/GridVirtualScroller.js +3 -5
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +5 -3
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +14 -0
- package/legacy/index.js +1 -1
- package/modern/components/GridRowCount.js +3 -5
- package/modern/components/GridScrollArea.js +3 -2
- package/modern/components/GridSelectedRowCount.js +3 -5
- package/modern/components/cell/GridEditInputCell.js +2 -4
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +3 -5
- package/modern/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +7 -5
- package/modern/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/modern/components/containers/GridFooterContainer.js +3 -5
- package/modern/components/containers/GridMainContainer.js +2 -4
- package/modern/components/containers/GridOverlay.js +3 -5
- package/modern/components/containers/GridRoot.js +6 -5
- package/modern/components/containers/GridToolbarContainer.js +3 -5
- package/modern/components/menu/GridMenu.js +2 -4
- package/modern/components/panel/GridColumnsPanel.js +16 -6
- package/modern/components/panel/GridPanel.js +4 -0
- package/modern/components/panel/GridPanelContent.js +3 -5
- package/modern/components/panel/GridPanelFooter.js +3 -5
- package/modern/components/panel/GridPanelHeader.js +3 -5
- package/modern/components/panel/GridPanelWrapper.js +28 -10
- package/modern/components/panel/filterPanel/GridFilterForm.js +8 -5
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -5
- package/modern/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/modern/components/virtualization/GridVirtualScroller.js +3 -5
- package/modern/components/virtualization/GridVirtualScrollerContent.js +5 -3
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +14 -0
- package/modern/index.js +1 -1
- package/node/components/GridRowCount.js +3 -5
- package/node/components/GridScrollArea.js +3 -2
- package/node/components/GridSelectedRowCount.js +3 -5
- package/node/components/cell/GridEditInputCell.js +2 -4
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +3 -5
- package/node/components/columnHeaders/GridColumnHeaders.js +3 -5
- package/node/components/columnHeaders/GridColumnHeadersInner.js +5 -5
- package/node/components/columnHeaders/GridIconButtonContainer.js +3 -5
- package/node/components/containers/GridFooterContainer.js +3 -5
- package/node/components/containers/GridMainContainer.js +2 -4
- package/node/components/containers/GridOverlay.js +3 -5
- package/node/components/containers/GridRoot.js +4 -5
- package/node/components/containers/GridToolbarContainer.js +3 -5
- package/node/components/menu/GridMenu.js +2 -4
- package/node/components/panel/GridColumnsPanel.js +16 -6
- package/node/components/panel/GridPanel.js +5 -0
- package/node/components/panel/GridPanelContent.js +3 -5
- package/node/components/panel/GridPanelFooter.js +3 -5
- package/node/components/panel/GridPanelHeader.js +3 -5
- package/node/components/panel/GridPanelWrapper.js +30 -11
- package/node/components/panel/filterPanel/GridFilterForm.js +8 -5
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -5
- package/node/components/toolbar/GridToolbarQuickFilter.js +1 -0
- package/node/components/virtualization/GridVirtualScroller.js +3 -5
- package/node/components/virtualization/GridVirtualScrollerContent.js +3 -3
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +3 -5
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +13 -0
- package/node/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 5.17.25
|
|
7
|
+
|
|
8
|
+
_Feb 23, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🐞 Bugfixes
|
|
13
|
+
|
|
14
|
+
### `@mui/x-data-grid@v5.17.25` / `@mui/x-data-grid-pro@v5.17.25` / `@mui/x-data-grid-premium@v5.17.25`
|
|
15
|
+
|
|
16
|
+
#### Changes
|
|
17
|
+
|
|
18
|
+
- [DataGrid] Fix `ownerState` being `undefined` in theme style overrides (#7757) @lolaignatova
|
|
19
|
+
|
|
20
|
+
### `@mui/x-date-pickers@v5.0.20` / `@mui/x-date-pickers-pro@v5.0.20`
|
|
21
|
+
|
|
22
|
+
#### Changes
|
|
23
|
+
|
|
24
|
+
- [DateTimePicker] Ensure toolbar `viewType` is correctly updated (#7942) @LukasTy
|
|
25
|
+
|
|
26
|
+
## 5.17.24
|
|
27
|
+
|
|
28
|
+
_Feb 16, 2023_
|
|
29
|
+
|
|
30
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
31
|
+
|
|
32
|
+
- 🌍 Add Hungarian (hu-HU) locale
|
|
33
|
+
- 🐞 Bugfixes
|
|
34
|
+
|
|
35
|
+
### `@mui/x-data-grid@v5.17.24` / `@mui/x-data-grid-pro@v5.17.24` / `@mui/x-data-grid-premium@v5.17.24`
|
|
36
|
+
|
|
37
|
+
#### Changes
|
|
38
|
+
|
|
39
|
+
- [DataGrid] Allow to pass props to the `TrapFocus` inside the panel wrapper (#7897) @Vivek-Prajapatii
|
|
40
|
+
- [DataGrid] Avoid unnecessary rerenders after `updateRows` (#7945) @cherniavskii
|
|
41
|
+
- [DataGridPro] Change cursor when dragging a column (#7878) @sai6855
|
|
42
|
+
- [DataGridPremium] Fix `leafField` to have correct focus value (#7959) @MBilalShafi
|
|
43
|
+
|
|
44
|
+
### `@mui/x-date-pickers@v5.0.19` / `@mui/x-date-pickers-pro@v5.0.19`
|
|
45
|
+
|
|
46
|
+
#### Changes
|
|
47
|
+
|
|
48
|
+
- [l10n] Add Hungarian (hu-HU) locale (#7796) @noherczeg
|
|
49
|
+
|
|
6
50
|
## 5.17.23
|
|
7
51
|
|
|
8
52
|
_Feb 9, 2023_
|
|
@@ -41,10 +41,7 @@ const GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props,
|
|
|
41
41
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
42
42
|
|
|
43
43
|
const apiRef = useGridApiContext();
|
|
44
|
-
const
|
|
45
|
-
const ownerState = {
|
|
46
|
-
classes: rootProps.classes
|
|
47
|
-
};
|
|
44
|
+
const ownerState = useGridRootProps();
|
|
48
45
|
const classes = useUtilityClasses(ownerState);
|
|
49
46
|
|
|
50
47
|
if (rowCount === 0) {
|
|
@@ -54,7 +51,8 @@ const GridRowCount = /*#__PURE__*/React.forwardRef(function GridRowCount(props,
|
|
|
54
51
|
const text = visibleRowCount < rowCount ? apiRef.current.getLocaleText('footerTotalVisibleRows')(visibleRowCount, rowCount) : rowCount.toLocaleString();
|
|
55
52
|
return /*#__PURE__*/_jsxs(GridRowCountRoot, _extends({
|
|
56
53
|
ref: ref,
|
|
57
|
-
className: clsx(classes.root, className)
|
|
54
|
+
className: clsx(classes.root, className),
|
|
55
|
+
ownerState: ownerState
|
|
58
56
|
}, other, {
|
|
59
57
|
children: [apiRef.current.getLocaleText('footerTotalRows'), " ", text]
|
|
60
58
|
}));
|
|
@@ -62,8 +62,8 @@ function GridScrollAreaRaw(props) {
|
|
|
62
62
|
});
|
|
63
63
|
const rootProps = useGridRootProps();
|
|
64
64
|
|
|
65
|
-
const ownerState = _extends({},
|
|
66
|
-
|
|
65
|
+
const ownerState = _extends({}, rootProps, {
|
|
66
|
+
scrollDirection
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -105,6 +105,7 @@ function GridScrollAreaRaw(props) {
|
|
|
105
105
|
return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
106
106
|
ref: rootRef,
|
|
107
107
|
className: clsx(classes.root),
|
|
108
|
+
ownerState: ownerState,
|
|
108
109
|
onDragOver: handleDragOver,
|
|
109
110
|
style: {
|
|
110
111
|
height
|
|
@@ -48,15 +48,13 @@ const GridSelectedRowCount = /*#__PURE__*/React.forwardRef(function GridSelected
|
|
|
48
48
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
49
49
|
|
|
50
50
|
const apiRef = useGridApiContext();
|
|
51
|
-
const
|
|
52
|
-
const ownerState = {
|
|
53
|
-
classes: rootProps.classes
|
|
54
|
-
};
|
|
51
|
+
const ownerState = useGridRootProps();
|
|
55
52
|
const classes = useUtilityClasses(ownerState);
|
|
56
53
|
const rowSelectedText = apiRef.current.getLocaleText('footerRowSelected')(selectedRowCount);
|
|
57
54
|
return /*#__PURE__*/_jsx(GridSelectedRowCountRoot, _extends({
|
|
58
55
|
ref: ref,
|
|
59
|
-
className: clsx(classes.root, className)
|
|
56
|
+
className: clsx(classes.root, className),
|
|
57
|
+
ownerState: ownerState
|
|
60
58
|
}, other, {
|
|
61
59
|
children: rowSelectedText
|
|
62
60
|
}));
|
|
@@ -57,10 +57,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
57
57
|
const apiRef = useGridApiContext();
|
|
58
58
|
const inputRef = React.useRef();
|
|
59
59
|
const [valueState, setValueState] = React.useState(value);
|
|
60
|
-
const
|
|
61
|
-
classes: rootProps.classes
|
|
62
|
-
};
|
|
63
|
-
const classes = useUtilityClasses(ownerState);
|
|
60
|
+
const classes = useUtilityClasses(rootProps);
|
|
64
61
|
const handleChange = React.useCallback(async event => {
|
|
65
62
|
var _rootProps$experiment2;
|
|
66
63
|
|
|
@@ -101,6 +98,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
101
98
|
ref: ref,
|
|
102
99
|
inputRef: inputRef,
|
|
103
100
|
className: classes.root,
|
|
101
|
+
ownerState: rootProps,
|
|
104
102
|
fullWidth: true,
|
|
105
103
|
type: colDef.type === 'number' ? colDef.type : 'text',
|
|
106
104
|
value: valueState != null ? valueState : '',
|
|
@@ -40,13 +40,11 @@ const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHead
|
|
|
40
40
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
41
41
|
|
|
42
42
|
const rootProps = useGridRootProps();
|
|
43
|
-
const
|
|
44
|
-
classes: rootProps.classes
|
|
45
|
-
};
|
|
46
|
-
const classes = useUtilityClasses(ownerState);
|
|
43
|
+
const classes = useUtilityClasses(rootProps);
|
|
47
44
|
return /*#__PURE__*/_jsx(GridColumnHeaderTitleRoot, _extends({
|
|
48
45
|
ref: ref,
|
|
49
|
-
className: clsx(classes.root, className)
|
|
46
|
+
className: clsx(classes.root, className),
|
|
47
|
+
ownerState: rootProps
|
|
50
48
|
}, other));
|
|
51
49
|
});
|
|
52
50
|
|
|
@@ -48,12 +48,10 @@ export const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColu
|
|
|
48
48
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
49
49
|
|
|
50
50
|
const rootProps = useGridRootProps();
|
|
51
|
-
const
|
|
52
|
-
classes: rootProps.classes
|
|
53
|
-
};
|
|
54
|
-
const classes = useUtilityClasses(ownerState);
|
|
51
|
+
const classes = useUtilityClasses(rootProps);
|
|
55
52
|
return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
|
|
56
53
|
ref: ref,
|
|
57
|
-
className: clsx(className, classes.root)
|
|
54
|
+
className: clsx(className, classes.root),
|
|
55
|
+
ownerState: rootProps
|
|
58
56
|
}, other));
|
|
59
57
|
});
|
|
@@ -50,14 +50,16 @@ export const GridColumnHeadersInner = /*#__PURE__*/React.forwardRef(function Gri
|
|
|
50
50
|
|
|
51
51
|
const apiRef = useGridApiContext();
|
|
52
52
|
const rootProps = useGridRootProps();
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
const ownerState = _extends({}, rootProps, {
|
|
54
55
|
isDragging,
|
|
55
|
-
hasScrollX: (_apiRef$current$getRo = (_apiRef$current$getRo2 = apiRef.current.getRootDimensions()) == null ? void 0 : _apiRef$current$getRo2.hasScrollX) != null ? _apiRef$current$getRo : false
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
hasScrollX: (_apiRef$current$getRo = (_apiRef$current$getRo2 = apiRef.current.getRootDimensions()) == null ? void 0 : _apiRef$current$getRo2.hasScrollX) != null ? _apiRef$current$getRo : false
|
|
57
|
+
});
|
|
58
|
+
|
|
58
59
|
const classes = useUtilityClasses(ownerState);
|
|
59
60
|
return /*#__PURE__*/_jsx(GridColumnHeadersInnerRoot, _extends({
|
|
60
61
|
ref: ref,
|
|
61
|
-
className: clsx(className, classes.root)
|
|
62
|
+
className: clsx(className, classes.root),
|
|
63
|
+
ownerState: ownerState
|
|
62
64
|
}, other));
|
|
63
65
|
});
|
|
@@ -35,12 +35,10 @@ export const GridIconButtonContainer = /*#__PURE__*/React.forwardRef(function Gr
|
|
|
35
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
36
36
|
|
|
37
37
|
const rootProps = useGridRootProps();
|
|
38
|
-
const
|
|
39
|
-
classes: rootProps.classes
|
|
40
|
-
};
|
|
41
|
-
const classes = useUtilityClasses(ownerState);
|
|
38
|
+
const classes = useUtilityClasses(rootProps);
|
|
42
39
|
return /*#__PURE__*/_jsx(GridIconButtonContainerRoot, _extends({
|
|
43
40
|
ref: ref,
|
|
44
|
-
className: clsx(classes.root, className)
|
|
41
|
+
className: clsx(classes.root, className),
|
|
42
|
+
ownerState: rootProps
|
|
45
43
|
}, other));
|
|
46
44
|
});
|
|
@@ -44,13 +44,11 @@ const GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterCon
|
|
|
44
44
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
45
45
|
|
|
46
46
|
const rootProps = useGridRootProps();
|
|
47
|
-
const
|
|
48
|
-
classes: rootProps.classes
|
|
49
|
-
};
|
|
50
|
-
const classes = useUtilityClasses(ownerState);
|
|
47
|
+
const classes = useUtilityClasses(rootProps);
|
|
51
48
|
return /*#__PURE__*/_jsx(GridFooterContainerRoot, _extends({
|
|
52
49
|
ref: ref,
|
|
53
|
-
className: clsx(classes.root, className)
|
|
50
|
+
className: clsx(classes.root, className),
|
|
51
|
+
ownerState: rootProps
|
|
54
52
|
}, other));
|
|
55
53
|
});
|
|
56
54
|
process.env.NODE_ENV !== "production" ? GridFooterContainer.propTypes = {
|
|
@@ -28,12 +28,10 @@ const GridMainContainerRoot = styled('div', {
|
|
|
28
28
|
}));
|
|
29
29
|
export function GridMainContainer(props) {
|
|
30
30
|
const rootProps = useGridRootProps();
|
|
31
|
-
const
|
|
32
|
-
classes: rootProps.classes
|
|
33
|
-
};
|
|
34
|
-
const classes = useUtilityClasses(ownerState);
|
|
31
|
+
const classes = useUtilityClasses(rootProps);
|
|
35
32
|
return /*#__PURE__*/_jsx(GridMainContainerRoot, {
|
|
36
33
|
className: classes.root,
|
|
34
|
+
ownerState: rootProps,
|
|
37
35
|
children: props.children
|
|
38
36
|
});
|
|
39
37
|
}
|
|
@@ -47,13 +47,11 @@ const GridOverlay = /*#__PURE__*/React.forwardRef(function GridOverlay(props, re
|
|
|
47
47
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
48
48
|
|
|
49
49
|
const rootProps = useGridRootProps();
|
|
50
|
-
const
|
|
51
|
-
classes: rootProps.classes
|
|
52
|
-
};
|
|
53
|
-
const classes = useUtilityClasses(ownerState);
|
|
50
|
+
const classes = useUtilityClasses(rootProps);
|
|
54
51
|
return /*#__PURE__*/_jsx(GridOverlayRoot, _extends({
|
|
55
52
|
ref: ref,
|
|
56
|
-
className: clsx(classes.root, className)
|
|
53
|
+
className: clsx(classes.root, className),
|
|
54
|
+
ownerState: rootProps
|
|
57
55
|
}, other));
|
|
58
56
|
});
|
|
59
57
|
process.env.NODE_ENV !== "production" ? GridOverlay.propTypes = {
|
|
@@ -45,11 +45,11 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
45
45
|
const rootContainerRef = React.useRef(null);
|
|
46
46
|
const handleRef = useForkRef(rootContainerRef, ref);
|
|
47
47
|
const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
|
|
49
|
+
const ownerState = _extends({}, rootProps, {
|
|
50
|
+
density: densityValue
|
|
51
|
+
});
|
|
52
|
+
|
|
53
53
|
const classes = useUtilityClasses(ownerState);
|
|
54
54
|
apiRef.current.rootElementRef = rootContainerRef; // Our implementation of <NoSsr />
|
|
55
55
|
|
|
@@ -70,6 +70,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
70
70
|
return /*#__PURE__*/_jsx(GridRootStyles, _extends({
|
|
71
71
|
ref: handleRef,
|
|
72
72
|
className: clsx(className, classes.root),
|
|
73
|
+
ownerState: ownerState,
|
|
73
74
|
role: "grid",
|
|
74
75
|
"aria-colcount": visibleColumns.length,
|
|
75
76
|
"aria-rowcount": headerGroupingMaxDepth + 1 + pinnedRowsCount + totalRowCount,
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
3
|
+
export declare type OwnerState = DataGridProcessedProps;
|
|
4
|
+
export declare const GridRootStyles: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
|
+
ownerState: OwnerState;
|
|
6
|
+
}, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -40,10 +40,7 @@ const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarC
|
|
|
40
40
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
41
41
|
|
|
42
42
|
const rootProps = useGridRootProps();
|
|
43
|
-
const
|
|
44
|
-
classes: rootProps.classes
|
|
45
|
-
};
|
|
46
|
-
const classes = useUtilityClasses(ownerState);
|
|
43
|
+
const classes = useUtilityClasses(rootProps);
|
|
47
44
|
|
|
48
45
|
if (!children) {
|
|
49
46
|
return null;
|
|
@@ -51,7 +48,8 @@ const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarC
|
|
|
51
48
|
|
|
52
49
|
return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({
|
|
53
50
|
ref: ref,
|
|
54
|
-
className: clsx(className, classes.root)
|
|
51
|
+
className: clsx(className, classes.root),
|
|
52
|
+
ownerState: rootProps
|
|
55
53
|
}, other, {
|
|
56
54
|
children: children
|
|
57
55
|
}));
|
|
@@ -61,10 +61,7 @@ const GridMenu = props => {
|
|
|
61
61
|
const prevTarget = React.useRef(target);
|
|
62
62
|
const prevOpen = React.useRef(open);
|
|
63
63
|
const rootProps = useGridRootProps();
|
|
64
|
-
const
|
|
65
|
-
classes: rootProps.classes
|
|
66
|
-
};
|
|
67
|
-
const classes = useUtilityClasses(ownerState);
|
|
64
|
+
const classes = useUtilityClasses(rootProps);
|
|
68
65
|
React.useEffect(() => {
|
|
69
66
|
if (prevOpen.current && prevTarget.current) {
|
|
70
67
|
prevTarget.current.focus();
|
|
@@ -92,6 +89,7 @@ const GridMenu = props => {
|
|
|
92
89
|
return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
|
|
93
90
|
as: rootProps.components.BasePopper,
|
|
94
91
|
className: clsx(className, classes.root),
|
|
92
|
+
ownerState: rootProps,
|
|
95
93
|
open: open,
|
|
96
94
|
anchorEl: target,
|
|
97
95
|
transition: true,
|
|
@@ -37,9 +37,9 @@ const GridColumnsPanelRoot = styled('div', {
|
|
|
37
37
|
name: 'MuiDataGrid',
|
|
38
38
|
slot: 'ColumnsPanel',
|
|
39
39
|
overridesResolver: (props, styles) => styles.columnsPanel
|
|
40
|
-
})(
|
|
40
|
+
})({
|
|
41
41
|
padding: '8px 0px 8px 8px'
|
|
42
|
-
})
|
|
42
|
+
});
|
|
43
43
|
const GridColumnsPanelRowRoot = styled('div', {
|
|
44
44
|
name: 'MuiDataGrid',
|
|
45
45
|
slot: 'ColumnsPanelRow',
|
|
@@ -72,10 +72,7 @@ function GridColumnsPanel(props) {
|
|
|
72
72
|
const columnVisibilityModel = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
73
73
|
const rootProps = useGridRootProps();
|
|
74
74
|
const [searchValue, setSearchValue] = React.useState('');
|
|
75
|
-
const
|
|
76
|
-
classes: rootProps.classes
|
|
77
|
-
};
|
|
78
|
-
const classes = useUtilityClasses(ownerState);
|
|
75
|
+
const classes = useUtilityClasses(rootProps);
|
|
79
76
|
|
|
80
77
|
const {
|
|
81
78
|
sort,
|
|
@@ -179,11 +176,13 @@ function GridColumnsPanel(props) {
|
|
|
179
176
|
}), /*#__PURE__*/_jsx(GridPanelContent, {
|
|
180
177
|
children: /*#__PURE__*/_jsx(GridColumnsPanelRoot, {
|
|
181
178
|
className: classes.root,
|
|
179
|
+
ownerState: rootProps,
|
|
182
180
|
children: currentColumns.map(column => {
|
|
183
181
|
var _rootProps$components2;
|
|
184
182
|
|
|
185
183
|
return /*#__PURE__*/_jsxs(GridColumnsPanelRowRoot, {
|
|
186
184
|
className: classes.columnsPanelRow,
|
|
185
|
+
ownerState: rootProps,
|
|
187
186
|
children: [/*#__PURE__*/_jsx(FormControlLabel, {
|
|
188
187
|
control: /*#__PURE__*/_jsx(rootProps.components.BaseSwitch, _extends({
|
|
189
188
|
disabled: column.hideable === false,
|
|
@@ -226,6 +225,17 @@ process.env.NODE_ENV !== "production" ? GridColumnsPanel.propTypes = {
|
|
|
226
225
|
// ----------------------------------------------------------------------
|
|
227
226
|
autoFocusSearchField: PropTypes.bool,
|
|
228
227
|
searchPredicate: PropTypes.func,
|
|
228
|
+
slotProps: PropTypes.shape({
|
|
229
|
+
TrapFocus: PropTypes.shape({
|
|
230
|
+
children: PropTypes.element.isRequired,
|
|
231
|
+
disableAutoFocus: PropTypes.bool,
|
|
232
|
+
disableEnforceFocus: PropTypes.bool,
|
|
233
|
+
disableRestoreFocus: PropTypes.bool,
|
|
234
|
+
getTabbable: PropTypes.func,
|
|
235
|
+
isEnabled: PropTypes.func,
|
|
236
|
+
open: PropTypes.bool.isRequired
|
|
237
|
+
})
|
|
238
|
+
}),
|
|
229
239
|
sort: PropTypes.oneOf(['asc', 'desc'])
|
|
230
240
|
} : void 0;
|
|
231
241
|
export { GridColumnsPanel };
|
|
@@ -11,6 +11,7 @@ import Paper from '@mui/material/Paper';
|
|
|
11
11
|
import Popper from '@mui/material/Popper';
|
|
12
12
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
13
13
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
14
|
+
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
16
|
export const gridPanelClasses = generateUtilityClasses('MuiDataGrid', ['panel', 'paper']);
|
|
16
17
|
const GridPanelRoot = styled(Popper, {
|
|
@@ -44,6 +45,7 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
44
45
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
45
46
|
|
|
46
47
|
const apiRef = useGridApiContext();
|
|
48
|
+
const rootProps = useGridRootProps();
|
|
47
49
|
const classes = gridPanelClasses;
|
|
48
50
|
const [isPlaced, setIsPlaced] = React.useState(false);
|
|
49
51
|
const handleClickAway = React.useCallback(() => {
|
|
@@ -78,6 +80,7 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
78
80
|
ref: ref,
|
|
79
81
|
placement: "bottom-start",
|
|
80
82
|
className: clsx(className, classes.panel),
|
|
83
|
+
ownerState: rootProps,
|
|
81
84
|
anchorEl: anchorEl,
|
|
82
85
|
modifiers: modifiers
|
|
83
86
|
}, other, {
|
|
@@ -86,6 +89,7 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
86
89
|
onClickAway: handleClickAway,
|
|
87
90
|
children: /*#__PURE__*/_jsx(GridPaperRoot, {
|
|
88
91
|
className: classes.paper,
|
|
92
|
+
ownerState: rootProps,
|
|
89
93
|
elevation: 8,
|
|
90
94
|
onKeyDown: handleKeyDown,
|
|
91
95
|
children: isPlaced && children
|
|
@@ -39,12 +39,10 @@ function GridPanelContent(props) {
|
|
|
39
39
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
40
|
|
|
41
41
|
const rootProps = useGridRootProps();
|
|
42
|
-
const
|
|
43
|
-
classes: rootProps.classes
|
|
44
|
-
};
|
|
45
|
-
const classes = useUtilityClasses(ownerState);
|
|
42
|
+
const classes = useUtilityClasses(rootProps);
|
|
46
43
|
return /*#__PURE__*/_jsx(GridPanelContentRoot, _extends({
|
|
47
|
-
className: clsx(className, classes.root)
|
|
44
|
+
className: clsx(className, classes.root),
|
|
45
|
+
ownerState: rootProps
|
|
48
46
|
}, other));
|
|
49
47
|
}
|
|
50
48
|
|
|
@@ -39,12 +39,10 @@ function GridPanelFooter(props) {
|
|
|
39
39
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
40
|
|
|
41
41
|
const rootProps = useGridRootProps();
|
|
42
|
-
const
|
|
43
|
-
classes: rootProps.classes
|
|
44
|
-
};
|
|
45
|
-
const classes = useUtilityClasses(ownerState);
|
|
42
|
+
const classes = useUtilityClasses(rootProps);
|
|
46
43
|
return /*#__PURE__*/_jsx(GridPanelFooterRoot, _extends({
|
|
47
|
-
className: clsx(className, classes.root)
|
|
44
|
+
className: clsx(className, classes.root),
|
|
45
|
+
ownerState: rootProps
|
|
48
46
|
}, other));
|
|
49
47
|
}
|
|
50
48
|
|
|
@@ -37,12 +37,10 @@ function GridPanelHeader(props) {
|
|
|
37
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
38
38
|
|
|
39
39
|
const rootProps = useGridRootProps();
|
|
40
|
-
const
|
|
41
|
-
classes: rootProps.classes
|
|
42
|
-
};
|
|
43
|
-
const classes = useUtilityClasses(ownerState);
|
|
40
|
+
const classes = useUtilityClasses(rootProps);
|
|
44
41
|
return /*#__PURE__*/_jsx(GridPanelHeaderRoot, _extends({
|
|
45
|
-
className: clsx(className, classes.root)
|
|
42
|
+
className: clsx(className, classes.root),
|
|
43
|
+
ownerState: rootProps
|
|
46
44
|
}, other));
|
|
47
45
|
}
|
|
48
46
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { TrapFocusProps } from '@mui/material/Unstable_TrapFocus';
|
|
2
3
|
import { Theme } from '@mui/material/styles';
|
|
3
4
|
import { MUIStyledCommonProps } from '@mui/system';
|
|
4
5
|
export interface GridPanelWrapperProps extends React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>, MUIStyledCommonProps<Theme> {
|
|
6
|
+
slotProps?: {
|
|
7
|
+
TrapFocus?: TrapFocusProps;
|
|
8
|
+
};
|
|
5
9
|
}
|
|
6
10
|
declare const GridPanelWrapper: React.ForwardRefExoticComponent<GridPanelWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
11
|
export { GridPanelWrapper };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["className"];
|
|
3
|
+
const _excluded = ["className", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import TrapFocus from '@mui/material/Unstable_TrapFocus';
|
|
7
8
|
import { styled } from '@mui/material/styles';
|
|
@@ -37,24 +38,41 @@ const isEnabled = () => true;
|
|
|
37
38
|
|
|
38
39
|
const GridPanelWrapper = /*#__PURE__*/React.forwardRef(function GridPanelWrapper(props, ref) {
|
|
39
40
|
const {
|
|
40
|
-
className
|
|
41
|
+
className,
|
|
42
|
+
slotProps = {}
|
|
41
43
|
} = props,
|
|
42
44
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
43
45
|
|
|
44
46
|
const rootProps = useGridRootProps();
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
const classes = useUtilityClasses(ownerState);
|
|
49
|
-
return /*#__PURE__*/_jsx(TrapFocus, {
|
|
47
|
+
const classes = useUtilityClasses(rootProps);
|
|
48
|
+
return /*#__PURE__*/_jsx(TrapFocus, _extends({
|
|
50
49
|
open: true,
|
|
51
50
|
disableEnforceFocus: true,
|
|
52
|
-
isEnabled: isEnabled
|
|
51
|
+
isEnabled: isEnabled
|
|
52
|
+
}, slotProps.TrapFocus, {
|
|
53
53
|
children: /*#__PURE__*/_jsx(GridPanelWrapperRoot, _extends({
|
|
54
54
|
ref: ref,
|
|
55
55
|
tabIndex: -1,
|
|
56
|
-
className: clsx(className, classes.root)
|
|
56
|
+
className: clsx(className, classes.root),
|
|
57
|
+
ownerState: rootProps
|
|
57
58
|
}, other))
|
|
58
|
-
});
|
|
59
|
+
}));
|
|
59
60
|
});
|
|
61
|
+
process.env.NODE_ENV !== "production" ? GridPanelWrapper.propTypes = {
|
|
62
|
+
// ----------------------------- Warning --------------------------------
|
|
63
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
64
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
65
|
+
// ----------------------------------------------------------------------
|
|
66
|
+
slotProps: PropTypes.shape({
|
|
67
|
+
TrapFocus: PropTypes.shape({
|
|
68
|
+
children: PropTypes.element.isRequired,
|
|
69
|
+
disableAutoFocus: PropTypes.bool,
|
|
70
|
+
disableEnforceFocus: PropTypes.bool,
|
|
71
|
+
disableRestoreFocus: PropTypes.bool,
|
|
72
|
+
getTabbable: PropTypes.func,
|
|
73
|
+
isEnabled: PropTypes.func,
|
|
74
|
+
open: PropTypes.bool.isRequired
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
} : void 0;
|
|
60
78
|
export { GridPanelWrapper };
|
|
@@ -135,10 +135,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
135
135
|
const operatorSelectId = useId();
|
|
136
136
|
const operatorSelectLabelId = useId();
|
|
137
137
|
const rootProps = useGridRootProps();
|
|
138
|
-
const
|
|
139
|
-
classes: rootProps.classes
|
|
140
|
-
};
|
|
141
|
-
const classes = useUtilityClasses(ownerState);
|
|
138
|
+
const classes = useUtilityClasses(rootProps);
|
|
142
139
|
const valueRef = React.useRef(null);
|
|
143
140
|
const filterSelectorRef = React.useRef(null);
|
|
144
141
|
const hasLinkOperatorColumn = hasMultipleFilters && linkOperators.length > 0;
|
|
@@ -235,13 +232,15 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
235
232
|
}), [currentOperator]);
|
|
236
233
|
return /*#__PURE__*/_jsxs(GridFilterFormRoot, _extends({
|
|
237
234
|
ref: ref,
|
|
238
|
-
className: classes.root
|
|
235
|
+
className: classes.root,
|
|
236
|
+
ownerState: rootProps
|
|
239
237
|
}, other, {
|
|
240
238
|
children: [/*#__PURE__*/_jsx(FilterFormDeleteIcon, _extends({
|
|
241
239
|
variant: "standard",
|
|
242
240
|
as: rootProps.components.BaseFormControl
|
|
243
241
|
}, baseFormControlProps, deleteIconProps, {
|
|
244
242
|
className: clsx(classes.deleteIcon, baseFormControlProps.className, deleteIconProps.className),
|
|
243
|
+
ownerState: rootProps,
|
|
245
244
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
246
245
|
"aria-label": apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),
|
|
247
246
|
title: apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),
|
|
@@ -260,6 +259,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
260
259
|
visibility: showMultiFilterOperators ? 'visible' : 'hidden'
|
|
261
260
|
}, baseFormControlProps.sx || {}, linkOperatorInputProps.sx || {}),
|
|
262
261
|
className: clsx(classes.linkOperatorInput, baseFormControlProps.className, linkOperatorInputProps.className),
|
|
262
|
+
ownerState: rootProps,
|
|
263
263
|
children: /*#__PURE__*/_jsx(rootProps.components.BaseSelect, _extends({
|
|
264
264
|
inputProps: {
|
|
265
265
|
'aria-label': apiRef.current.getLocaleText('filterPanelLinkOperator')
|
|
@@ -279,6 +279,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
279
279
|
as: rootProps.components.BaseFormControl
|
|
280
280
|
}, baseFormControlProps, columnInputProps, {
|
|
281
281
|
className: clsx(classes.columnInput, baseFormControlProps.className, columnInputProps.className),
|
|
282
|
+
ownerState: rootProps,
|
|
282
283
|
children: [/*#__PURE__*/_jsx(InputLabel, {
|
|
283
284
|
htmlFor: columnSelectId,
|
|
284
285
|
id: columnSelectLabelId,
|
|
@@ -301,6 +302,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
301
302
|
as: rootProps.components.BaseFormControl
|
|
302
303
|
}, baseFormControlProps, operatorInputProps, {
|
|
303
304
|
className: clsx(classes.operatorInput, baseFormControlProps.className, operatorInputProps.className),
|
|
305
|
+
ownerState: rootProps,
|
|
304
306
|
children: [/*#__PURE__*/_jsx(InputLabel, {
|
|
305
307
|
htmlFor: operatorSelectId,
|
|
306
308
|
id: operatorSelectLabelId,
|
|
@@ -324,6 +326,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
324
326
|
as: rootProps.components.BaseFormControl
|
|
325
327
|
}, baseFormControlProps, valueInputPropsOther, {
|
|
326
328
|
className: clsx(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
|
|
329
|
+
ownerState: rootProps,
|
|
327
330
|
children: currentOperator != null && currentOperator.InputComponent ? /*#__PURE__*/_jsx(currentOperator.InputComponent, _extends({
|
|
328
331
|
apiRef: apiRef,
|
|
329
332
|
item: item,
|
|
@@ -52,10 +52,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
52
52
|
const activeFilters = useGridSelector(apiRef, gridFilterActiveItemsSelector);
|
|
53
53
|
const lookup = useGridSelector(apiRef, gridColumnLookupSelector);
|
|
54
54
|
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
55
|
-
const
|
|
56
|
-
classes: rootProps.classes
|
|
57
|
-
};
|
|
58
|
-
const classes = useUtilityClasses(ownerState);
|
|
55
|
+
const classes = useUtilityClasses(rootProps);
|
|
59
56
|
const tooltipContentNode = React.useMemo(() => {
|
|
60
57
|
if (preferencePanel.open) {
|
|
61
58
|
return apiRef.current.getLocaleText('toolbarFiltersTooltipHide');
|
|
@@ -77,6 +74,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
77
74
|
return /*#__PURE__*/_jsxs("div", {
|
|
78
75
|
children: [apiRef.current.getLocaleText('toolbarFiltersTooltipActive')(activeFilters.length), /*#__PURE__*/_jsx(GridToolbarFilterListRoot, {
|
|
79
76
|
className: classes.root,
|
|
77
|
+
ownerState: rootProps,
|
|
80
78
|
children: activeFilters.map((item, index) => _extends({}, lookup[item.columnField] && /*#__PURE__*/_jsx("li", {
|
|
81
79
|
children: `${lookup[item.columnField].headerName || item.columnField}
|
|
82
80
|
${getOperatorLabel(item)}
|
|
@@ -84,7 +82,7 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
|
|
|
84
82
|
}, index)))
|
|
85
83
|
})]
|
|
86
84
|
});
|
|
87
|
-
}, [apiRef, preferencePanel.open, activeFilters, lookup, classes]);
|
|
85
|
+
}, [apiRef, rootProps, preferencePanel.open, activeFilters, lookup, classes]);
|
|
88
86
|
|
|
89
87
|
const toggleFilter = event => {
|
|
90
88
|
var _buttonProps$onClick;
|
|
@@ -86,6 +86,7 @@ function GridToolbarQuickFilter(props) {
|
|
|
86
86
|
}, [updateSearchValue]);
|
|
87
87
|
return /*#__PURE__*/_jsx(GridToolbarQuickFilterRoot, _extends({
|
|
88
88
|
as: rootProps.components.BaseTextField,
|
|
89
|
+
ownerState: rootProps,
|
|
89
90
|
variant: "standard",
|
|
90
91
|
value: searchValue,
|
|
91
92
|
onChange: handleSearchValueChange,
|