@mui/x-data-grid-pro 6.0.0-beta.3 → 6.0.0-beta.5
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 +145 -0
- package/DataGridPro/DataGridPro.js +10 -0
- package/DataGridPro/useDataGridProProps.js +26 -19
- package/components/DataGridProColumnHeaders.js +6 -6
- package/components/DataGridProVirtualScroller.js +27 -20
- package/components/GridColumnMenuPinningItem.js +3 -3
- package/components/GridDetailPanel.js +4 -0
- package/components/GridDetailPanelToggleCell.js +4 -4
- package/components/GridRowReorderCell.js +1 -1
- package/components/GridTreeDataGroupingCell.js +4 -4
- package/hooks/features/columnPinning/useGridColumnPinning.d.ts +1 -1
- package/hooks/features/columnReorder/useGridColumnReorder.js +3 -0
- package/index.js +1 -1
- package/legacy/DataGridPro/DataGridPro.js +10 -0
- package/legacy/DataGridPro/useDataGridProProps.js +21 -20
- package/legacy/components/DataGridProColumnHeaders.js +6 -6
- package/legacy/components/DataGridProVirtualScroller.js +27 -20
- package/legacy/components/GridColumnMenuPinningItem.js +3 -3
- package/legacy/components/GridDetailPanel.js +4 -0
- package/legacy/components/GridDetailPanelToggleCell.js +4 -4
- package/legacy/components/GridRowReorderCell.js +1 -1
- package/legacy/components/GridTreeDataGroupingCell.js +4 -4
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +3 -0
- package/legacy/index.js +1 -1
- package/legacy/utils/releaseInfo.js +1 -1
- package/models/dataGridProProps.d.ts +9 -4
- package/models/gridProSlotsComponent.d.ts +4 -1
- package/modern/DataGridPro/DataGridPro.js +10 -0
- package/modern/DataGridPro/useDataGridProProps.js +21 -17
- package/modern/components/DataGridProColumnHeaders.js +6 -6
- package/modern/components/DataGridProVirtualScroller.js +27 -20
- package/modern/components/GridColumnMenuPinningItem.js +3 -3
- package/modern/components/GridDetailPanel.js +4 -0
- package/modern/components/GridDetailPanelToggleCell.js +3 -3
- package/modern/components/GridRowReorderCell.js +1 -1
- package/modern/components/GridTreeDataGroupingCell.js +3 -3
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +3 -0
- package/modern/index.js +1 -1
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPro/DataGridPro.js +10 -0
- package/node/DataGridPro/useDataGridProProps.js +21 -17
- package/node/components/DataGridProColumnHeaders.js +6 -6
- package/node/components/DataGridProVirtualScroller.js +27 -20
- package/node/components/GridColumnMenuPinningItem.js +3 -3
- package/node/components/GridDetailPanel.js +4 -0
- package/node/components/GridDetailPanelToggleCell.js +3 -3
- package/node/components/GridRowReorderCell.js +1 -1
- package/node/components/GridTreeDataGroupingCell.js +3 -3
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +3 -0
- package/node/index.js +1 -1
- package/node/utils/releaseInfo.js +1 -1
- package/package.json +3 -3
- package/utils/releaseInfo.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,107 @@
|
|
|
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
|
+
## 6.0.0-beta.5
|
|
7
|
+
|
|
8
|
+
_Feb 23, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⚡️ Add web worker support for Excel export (#7770) @m4theushw
|
|
13
|
+
- 🎁 Add a button to remove all filters on the data grid filter panel (#7326) @MBilalShafi
|
|
14
|
+
- ⚙️ Allow to customize options label and value in the data grid `singleSelect` column (#7684) @m4theushw
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### `@mui/x-data-grid@v6.0.0-beta.5` / `@mui/x-data-grid-pro@v6.0.0-beta.5` / `@mui/x-data-grid-premium@v6.0.0-beta.5`
|
|
19
|
+
|
|
20
|
+
#### Changes
|
|
21
|
+
|
|
22
|
+
- [DataGrid] Allow to customize label and value for `singleSelect` (#7684) @m4theushw
|
|
23
|
+
- [DataGrid] Fix `ownerState` being `undefined` in theme style overrides (#7964) @lolaignatova
|
|
24
|
+
- [DataGrid] Introduce `slots` and deprecate `components` (#7882) @MBilalShafi
|
|
25
|
+
- [DataGridPro] Add `Remove All` option in filter panel (#7326) @MBilalShafi
|
|
26
|
+
- [DataGridPremium] Add web worker support for Excel export (#7770) @m4theushw
|
|
27
|
+
|
|
28
|
+
### `@mui/x-date-pickers@v6.0.0-beta.5` / `@mui/x-date-pickers-pro@v6.0.0-beta.5`
|
|
29
|
+
|
|
30
|
+
#### Breaking changes
|
|
31
|
+
|
|
32
|
+
- The `MuiDateSectionName` type was renamed to `FieldSectionType`
|
|
33
|
+
|
|
34
|
+
#### Changes
|
|
35
|
+
|
|
36
|
+
- [fields] Fix multi input range fields validation when uncontrolled (#8002) @LukasTy
|
|
37
|
+
- [fields] Fix single input time range fields slot props (#7988) @LukasTy
|
|
38
|
+
- [fields] Make the `ArrowUp` / `ArrowDown` edition only impact the active section (#7993) @flaviendelangle
|
|
39
|
+
- [fields] Fix single input range fields clearing (#7995) @flaviendelangle
|
|
40
|
+
- [fields] Clean the section object (#8009) @flaviendelangle
|
|
41
|
+
- [pickers] Fix `textField` slot `error` prop propagation (#7987) @LukasTy
|
|
42
|
+
|
|
43
|
+
### `@mui/x-codemod@v6.0.0-beta.5`
|
|
44
|
+
|
|
45
|
+
#### Changes
|
|
46
|
+
|
|
47
|
+
- [codemod] Add `apiRef.current.getRowIndex` to `DataGrid` renaming codemod (#8001) @MBilalShafi
|
|
48
|
+
|
|
49
|
+
### Docs
|
|
50
|
+
|
|
51
|
+
- [docs] Fine tune range fields demos (#7992) @LukasTy
|
|
52
|
+
- [docs] Fix a few scroll issues on mobile (#7900) @oliviertassinari
|
|
53
|
+
- [docs] Fix inconsistency in the data grid migration guide (#7963) @MBilalShafi
|
|
54
|
+
|
|
55
|
+
### Core
|
|
56
|
+
|
|
57
|
+
- [core] Fix `moment` locale on adapter tests (#8020) @flaviendelangle
|
|
58
|
+
- [test] Support all adapters on the field tests about the formats (#7996) @flaviendelangle
|
|
59
|
+
|
|
60
|
+
## 6.0.0-beta.4
|
|
61
|
+
|
|
62
|
+
_Feb 16, 2023_
|
|
63
|
+
|
|
64
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
65
|
+
|
|
66
|
+
- ⚡️ Improve grid performance by reducing rerenders (#7857) @cherniavskii
|
|
67
|
+
- 📚 Documentation improvements
|
|
68
|
+
- 🐞 Bugfixes
|
|
69
|
+
|
|
70
|
+
### `@mui/x-data-grid@v6.0.0-beta.4` / `@mui/x-data-grid-pro@v6.0.0-beta.4` / `@mui/x-data-grid-premium@v6.0.0-beta.4`
|
|
71
|
+
|
|
72
|
+
#### Changes
|
|
73
|
+
|
|
74
|
+
- [DataGrid] Add interface for `singleSelect` column (#7685) @m4theushw
|
|
75
|
+
- [DataGrid] Allow to pass props to the `TrapFocus` inside the panel wrapper (#7733) @Vivek-Prajapatii
|
|
76
|
+
- [DataGrid] Avoid unnecessary rerenders after `updateRows` (#7857) @cherniavskii
|
|
77
|
+
- [DataGridPro] Change cursor when dragging a column (#7725) @sai6855
|
|
78
|
+
- [DataGridPremium] Fix `leafField` to have correct focus value (#7950) @MBilalShafi
|
|
79
|
+
|
|
80
|
+
### `@mui/x-date-pickers@v6.0.0-beta.4` / `@mui/x-date-pickers-pro@v6.0.0-beta.4`
|
|
81
|
+
|
|
82
|
+
#### Changes
|
|
83
|
+
|
|
84
|
+
- [DateRangePicker] Fix slide transition by avoiding useless component re-rendering (#7874) @LukasTy
|
|
85
|
+
- [fields] Support Backspace key on `Android` (#7842) @flaviendelangle
|
|
86
|
+
- [fields] Support escaped characters on `Luxon` (#7888) @flaviendelangle
|
|
87
|
+
- [pickers] Prepare new pickers for custom fields (#7806) @flaviendelangle
|
|
88
|
+
|
|
89
|
+
### `@mui/x-codemod@v6.0.0-beta.4`
|
|
90
|
+
|
|
91
|
+
#### Changes
|
|
92
|
+
|
|
93
|
+
- [codemod] Fix import path (#7952) @LukasTy
|
|
94
|
+
|
|
95
|
+
### Docs
|
|
96
|
+
|
|
97
|
+
- [docs] Add an info callout specifying the current state of desktop time view (#7933) @LukasTy
|
|
98
|
+
- [docs] Add missing param in `useGridApiEventHandler` examples (#7939) @flaviendelangle
|
|
99
|
+
- [docs] Fix markdown table alignments (#7898) @oliviertassinari
|
|
100
|
+
- [docs] Improve `DataGrid` migration guide (#7861) @MBilalShafi
|
|
101
|
+
- [docs] Update `LocalizationProvider` `dateAdapter` with a link to the doc (#7872) @LukasTy
|
|
102
|
+
|
|
103
|
+
### Core
|
|
104
|
+
|
|
105
|
+
- [core] Run editing field tests on all major adapters (#7868) @flaviendelangle
|
|
106
|
+
|
|
6
107
|
## 6.0.0-beta.3
|
|
7
108
|
|
|
8
109
|
_Feb 9, 2023_
|
|
@@ -2132,6 +2233,50 @@ You can find more information about the new api, including how to set those tran
|
|
|
2132
2233
|
- [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
|
|
2133
2234
|
- [website] Improve security header @oliviertassinari
|
|
2134
2235
|
|
|
2236
|
+
## 5.17.25
|
|
2237
|
+
|
|
2238
|
+
_Feb 23, 2023_
|
|
2239
|
+
|
|
2240
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
2241
|
+
|
|
2242
|
+
- 🐞 Bugfixes
|
|
2243
|
+
|
|
2244
|
+
### `@mui/x-data-grid@v5.17.25` / `@mui/x-data-grid-pro@v5.17.25` / `@mui/x-data-grid-premium@v5.17.25`
|
|
2245
|
+
|
|
2246
|
+
#### Changes
|
|
2247
|
+
|
|
2248
|
+
- [DataGrid] Fix `ownerState` being `undefined` in theme style overrides (#7757) @lolaignatova
|
|
2249
|
+
|
|
2250
|
+
### `@mui/x-date-pickers@v5.0.20` / `@mui/x-date-pickers-pro@v5.0.20`
|
|
2251
|
+
|
|
2252
|
+
#### Changes
|
|
2253
|
+
|
|
2254
|
+
- [DateTimePicker] Ensure toolbar `viewType` is correctly updated (#7942) @LukasTy
|
|
2255
|
+
|
|
2256
|
+
## 5.17.24
|
|
2257
|
+
|
|
2258
|
+
_Feb 16, 2023_
|
|
2259
|
+
|
|
2260
|
+
We'd like to offer a big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:
|
|
2261
|
+
|
|
2262
|
+
- 🌍 Add Hungarian (hu-HU) locale
|
|
2263
|
+
- 🐞 Bugfixes
|
|
2264
|
+
|
|
2265
|
+
### `@mui/x-data-grid@v5.17.24` / `@mui/x-data-grid-pro@v5.17.24` / `@mui/x-data-grid-premium@v5.17.24`
|
|
2266
|
+
|
|
2267
|
+
#### Changes
|
|
2268
|
+
|
|
2269
|
+
- [DataGrid] Allow to pass props to the `TrapFocus` inside the panel wrapper (#7897) @Vivek-Prajapatii
|
|
2270
|
+
- [DataGrid] Avoid unnecessary rerenders after `updateRows` (#7945) @cherniavskii
|
|
2271
|
+
- [DataGridPro] Change cursor when dragging a column (#7878) @sai6855
|
|
2272
|
+
- [DataGridPremium] Fix `leafField` to have correct focus value (#7959) @MBilalShafi
|
|
2273
|
+
|
|
2274
|
+
### `@mui/x-date-pickers@v5.0.19` / `@mui/x-date-pickers-pro@v5.0.19`
|
|
2275
|
+
|
|
2276
|
+
#### Changes
|
|
2277
|
+
|
|
2278
|
+
- [l10n] Add Hungarian (hu-HU) locale (#7796) @noherczeg
|
|
2279
|
+
|
|
2135
2280
|
## 5.17.23
|
|
2136
2281
|
|
|
2137
2282
|
_Feb 9, 2023_
|
|
@@ -115,10 +115,12 @@ DataGridProRaw.propTypes = {
|
|
|
115
115
|
columnVisibilityModel: PropTypes.object,
|
|
116
116
|
/**
|
|
117
117
|
* Overrideable components.
|
|
118
|
+
* @deprecated Use the `slots` prop instead.
|
|
118
119
|
*/
|
|
119
120
|
components: PropTypes.object,
|
|
120
121
|
/**
|
|
121
122
|
* Overrideable components props dynamically passed to the component at rendering.
|
|
123
|
+
* @deprecated Use the `slotProps` prop instead.
|
|
122
124
|
*/
|
|
123
125
|
componentsProps: PropTypes.object,
|
|
124
126
|
/**
|
|
@@ -771,6 +773,14 @@ DataGridProRaw.propTypes = {
|
|
|
771
773
|
* @default false
|
|
772
774
|
*/
|
|
773
775
|
showColumnVerticalBorder: PropTypes.bool,
|
|
776
|
+
/**
|
|
777
|
+
* Overrideable components props dynamically passed to the component at rendering.
|
|
778
|
+
*/
|
|
779
|
+
slotProps: PropTypes.object,
|
|
780
|
+
/**
|
|
781
|
+
* Overrideable components.
|
|
782
|
+
*/
|
|
783
|
+
slots: PropTypes.object,
|
|
774
784
|
/**
|
|
775
785
|
* Sorting can be processed on the server or client-side.
|
|
776
786
|
* Set it to 'client' if you would like to handle sorting on the client-side.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["components", "componentsProps"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
6
|
import { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
7
|
+
import { computeSlots, uncapitalizeObjectKeys } from '@mui/x-data-grid/internals';
|
|
5
8
|
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridProDefaultSlotsComponents';
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -19,26 +22,30 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
19
22
|
rowsLoadingMode: 'client',
|
|
20
23
|
getDetailPanelHeight: () => 500
|
|
21
24
|
});
|
|
25
|
+
const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS);
|
|
22
26
|
export const useDataGridProProps = inProps => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
const _useThemeProps = useThemeProps({
|
|
28
|
+
props: inProps,
|
|
29
|
+
name: 'MuiDataGrid'
|
|
30
|
+
}),
|
|
31
|
+
{
|
|
32
|
+
components,
|
|
33
|
+
componentsProps
|
|
34
|
+
} = _useThemeProps,
|
|
35
|
+
themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
|
|
27
36
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
const slots = React.useMemo(() => computeSlots({
|
|
38
|
+
defaultSlots,
|
|
39
|
+
slots: themedProps.slots,
|
|
40
|
+
components
|
|
41
|
+
}), [components, themedProps.slots]);
|
|
42
|
+
return React.useMemo(() => {
|
|
43
|
+
var _themedProps$slotProp;
|
|
44
|
+
return _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
45
|
+
localeText,
|
|
46
|
+
slots,
|
|
47
|
+
slotProps: (_themedProps$slotProp = themedProps.slotProps) != null ? _themedProps$slotProp : componentsProps,
|
|
48
|
+
signature: 'DataGridPro'
|
|
36
49
|
});
|
|
37
|
-
|
|
38
|
-
}, [themedProps.components]);
|
|
39
|
-
return React.useMemo(() => _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
40
|
-
localeText,
|
|
41
|
-
components,
|
|
42
|
-
signature: 'DataGridPro'
|
|
43
|
-
}), [themedProps, localeText, components]);
|
|
50
|
+
}, [themedProps, localeText, slots, componentsProps]);
|
|
44
51
|
};
|
|
@@ -103,11 +103,11 @@ export const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function D
|
|
|
103
103
|
innerRef,
|
|
104
104
|
minColumnIndex: leftPinnedColumns.length
|
|
105
105
|
});
|
|
106
|
-
const ownerState = {
|
|
106
|
+
const ownerState = _extends({}, rootProps, {
|
|
107
107
|
leftPinnedColumns,
|
|
108
108
|
rightPinnedColumns,
|
|
109
109
|
classes: rootProps.classes
|
|
110
|
-
};
|
|
110
|
+
});
|
|
111
111
|
const classes = useUtilityClasses(ownerState);
|
|
112
112
|
const leftRenderContext = renderContext && leftPinnedColumns.length ? _extends({}, renderContext, {
|
|
113
113
|
firstColumnIndex: 0,
|
|
@@ -127,10 +127,10 @@ export const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function D
|
|
|
127
127
|
}, getRootProps(other), {
|
|
128
128
|
children: [leftRenderContext && /*#__PURE__*/_jsxs(GridColumnHeadersPinnedColumnHeaders, _extends({
|
|
129
129
|
className: classes.leftPinnedColumns,
|
|
130
|
-
ownerState: {
|
|
130
|
+
ownerState: _extends({}, ownerState, {
|
|
131
131
|
side: GridPinnedPosition.left,
|
|
132
132
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
133
|
-
}
|
|
133
|
+
})
|
|
134
134
|
}, pinnedColumnHeadersProps, {
|
|
135
135
|
children: [getColumnGroupHeaders({
|
|
136
136
|
renderContext: leftRenderContext,
|
|
@@ -156,10 +156,10 @@ export const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function D
|
|
|
156
156
|
maxLastColumn: visibleColumnFields.length - rightPinnedColumns.length
|
|
157
157
|
})]
|
|
158
158
|
})), rightRenderContext && /*#__PURE__*/_jsxs(GridColumnHeadersPinnedColumnHeaders, _extends({
|
|
159
|
-
ownerState: {
|
|
159
|
+
ownerState: _extends({}, ownerState, {
|
|
160
160
|
side: GridPinnedPosition.right,
|
|
161
161
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
162
|
-
},
|
|
162
|
+
}),
|
|
163
163
|
className: classes.rightPinnedColumns,
|
|
164
164
|
style: {
|
|
165
165
|
paddingRight: scrollbarSize
|
|
@@ -110,6 +110,11 @@ const VirtualScrollerPinnedColumns = styled('div', {
|
|
|
110
110
|
borderLeftStyle: 'solid'
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
|
+
var PinnedRowsPosition;
|
|
114
|
+
(function (PinnedRowsPosition) {
|
|
115
|
+
PinnedRowsPosition["top"] = "top";
|
|
116
|
+
PinnedRowsPosition["bottom"] = "bottom";
|
|
117
|
+
})(PinnedRowsPosition || (PinnedRowsPosition = {}));
|
|
113
118
|
const VirtualScrollerPinnedRows = styled('div', {
|
|
114
119
|
name: 'MuiDataGrid',
|
|
115
120
|
slot: 'PinnedRows',
|
|
@@ -136,7 +141,7 @@ const VirtualScrollerPinnedRows = styled('div', {
|
|
|
136
141
|
}), ownerState.position === 'top' && {
|
|
137
142
|
top: 0,
|
|
138
143
|
boxShadow: `0px 3px 4px -2px ${boxShadowColor}`
|
|
139
|
-
}, ownerState.position ===
|
|
144
|
+
}, ownerState.position === PinnedRowsPosition.bottom && {
|
|
140
145
|
boxShadow: `0px -3px 4px -2px ${boxShadowColor}`,
|
|
141
146
|
bottom: 0
|
|
142
147
|
});
|
|
@@ -190,9 +195,10 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
190
195
|
const pinnedRows = useGridSelector(apiRef, gridPinnedRowsSelector);
|
|
191
196
|
const topPinnedRowsData = React.useMemo(() => (pinnedRows == null ? void 0 : pinnedRows.top) || [], [pinnedRows == null ? void 0 : pinnedRows.top]);
|
|
192
197
|
const bottomPinnedRowsData = React.useMemo(() => (pinnedRows == null ? void 0 : pinnedRows.bottom) || [], [pinnedRows == null ? void 0 : pinnedRows.bottom]);
|
|
193
|
-
const
|
|
198
|
+
const ownerState = _extends({}, rootProps, {
|
|
194
199
|
classes: rootProps.classes
|
|
195
200
|
});
|
|
201
|
+
const classes = useUtilityClasses(ownerState);
|
|
196
202
|
const {
|
|
197
203
|
renderContext,
|
|
198
204
|
getRows,
|
|
@@ -284,9 +290,9 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
284
290
|
return /*#__PURE__*/_jsxs(GridVirtualScroller, _extends({}, getRootProps(other), {
|
|
285
291
|
children: [/*#__PURE__*/_jsx(GridOverlays, {}), topPinnedRowsData.length > 0 ? /*#__PURE__*/_jsxs(VirtualScrollerPinnedRows, {
|
|
286
292
|
className: classes.topPinnedRows,
|
|
287
|
-
ownerState: {
|
|
288
|
-
position:
|
|
289
|
-
},
|
|
293
|
+
ownerState: _extends({}, ownerState, {
|
|
294
|
+
position: PinnedRowsPosition.top
|
|
295
|
+
}),
|
|
290
296
|
style: {
|
|
291
297
|
width: contentProps.style.width,
|
|
292
298
|
height: pinnedRowsHeight.top
|
|
@@ -294,10 +300,10 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
294
300
|
role: "rowgroup",
|
|
295
301
|
children: [leftRenderContext && /*#__PURE__*/_jsx(VirtualScrollerPinnedColumns, {
|
|
296
302
|
className: classes.leftPinnedColumns,
|
|
297
|
-
ownerState: {
|
|
303
|
+
ownerState: _extends({}, ownerState, {
|
|
298
304
|
side: GridPinnedPosition.left,
|
|
299
305
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
300
|
-
},
|
|
306
|
+
}),
|
|
301
307
|
children: getRows({
|
|
302
308
|
renderContext: leftRenderContext,
|
|
303
309
|
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
@@ -313,10 +319,10 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
313
319
|
children: topPinnedRows
|
|
314
320
|
}), rightRenderContext && /*#__PURE__*/_jsx(VirtualScrollerPinnedColumns, {
|
|
315
321
|
className: classes.rightPinnedColumns,
|
|
316
|
-
ownerState: {
|
|
322
|
+
ownerState: _extends({}, ownerState, {
|
|
317
323
|
side: GridPinnedPosition.right,
|
|
318
324
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
319
|
-
},
|
|
325
|
+
}),
|
|
320
326
|
children: getRows({
|
|
321
327
|
renderContext: rightRenderContext,
|
|
322
328
|
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
@@ -330,10 +336,10 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
330
336
|
children: [leftRenderContext && /*#__PURE__*/_jsx(VirtualScrollerPinnedColumns, {
|
|
331
337
|
ref: leftColumns,
|
|
332
338
|
className: classes.leftPinnedColumns,
|
|
333
|
-
ownerState: {
|
|
339
|
+
ownerState: _extends({}, ownerState, {
|
|
334
340
|
side: GridPinnedPosition.left,
|
|
335
341
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
336
|
-
},
|
|
342
|
+
}),
|
|
337
343
|
style: pinnedColumnsStyle,
|
|
338
344
|
children: getRows({
|
|
339
345
|
renderContext: leftRenderContext,
|
|
@@ -347,10 +353,10 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
347
353
|
children: mainRows
|
|
348
354
|
})), rightRenderContext && /*#__PURE__*/_jsx(VirtualScrollerPinnedColumns, {
|
|
349
355
|
ref: rightColumns,
|
|
350
|
-
ownerState: {
|
|
356
|
+
ownerState: _extends({}, ownerState, {
|
|
351
357
|
side: GridPinnedPosition.right,
|
|
352
358
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
353
|
-
},
|
|
359
|
+
}),
|
|
354
360
|
className: classes.rightPinnedColumns,
|
|
355
361
|
style: pinnedColumnsStyle,
|
|
356
362
|
children: getRows({
|
|
@@ -363,13 +369,14 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
363
369
|
})
|
|
364
370
|
}), detailPanels.length > 0 && /*#__PURE__*/_jsx(VirtualScrollerDetailPanels, {
|
|
365
371
|
className: classes.detailPanels,
|
|
372
|
+
ownerState: ownerState,
|
|
366
373
|
children: detailPanels
|
|
367
374
|
})]
|
|
368
375
|
})), bottomPinnedRowsData.length > 0 ? /*#__PURE__*/_jsxs(VirtualScrollerPinnedRows, {
|
|
369
376
|
className: classes.bottomPinnedRows,
|
|
370
|
-
ownerState: {
|
|
371
|
-
position:
|
|
372
|
-
},
|
|
377
|
+
ownerState: _extends({}, ownerState, {
|
|
378
|
+
position: PinnedRowsPosition.bottom
|
|
379
|
+
}),
|
|
373
380
|
style: {
|
|
374
381
|
width: contentProps.style.width,
|
|
375
382
|
height: pinnedRowsHeight.bottom
|
|
@@ -377,10 +384,10 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
377
384
|
role: "rowgroup",
|
|
378
385
|
children: [leftRenderContext && /*#__PURE__*/_jsx(VirtualScrollerPinnedColumns, {
|
|
379
386
|
className: classes.leftPinnedColumns,
|
|
380
|
-
ownerState: {
|
|
387
|
+
ownerState: _extends({}, ownerState, {
|
|
381
388
|
side: GridPinnedPosition.left,
|
|
382
389
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
383
|
-
},
|
|
390
|
+
}),
|
|
384
391
|
children: getRows({
|
|
385
392
|
renderContext: leftRenderContext,
|
|
386
393
|
minFirstColumn: leftRenderContext.firstColumnIndex,
|
|
@@ -397,10 +404,10 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
397
404
|
children: bottomPinnedRows
|
|
398
405
|
}), rightRenderContext && /*#__PURE__*/_jsx(VirtualScrollerPinnedColumns, {
|
|
399
406
|
className: classes.rightPinnedColumns,
|
|
400
|
-
ownerState: {
|
|
407
|
+
ownerState: _extends({}, ownerState, {
|
|
401
408
|
side: GridPinnedPosition.right,
|
|
402
409
|
showCellVerticalBorder: rootProps.showCellVerticalBorder
|
|
403
|
-
},
|
|
410
|
+
}),
|
|
404
411
|
children: getRows({
|
|
405
412
|
renderContext: rightRenderContext,
|
|
406
413
|
minFirstColumn: rightRenderContext.firstColumnIndex,
|
|
@@ -28,7 +28,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
28
28
|
const pinToLeftMenuItem = /*#__PURE__*/_jsxs(MenuItem, {
|
|
29
29
|
onClick: pinColumn(GridPinnedPosition.left),
|
|
30
30
|
children: [/*#__PURE__*/_jsx(ListItemIcon, {
|
|
31
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
31
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuPinLeftIcon, {
|
|
32
32
|
fontSize: "small"
|
|
33
33
|
})
|
|
34
34
|
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
@@ -38,7 +38,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
38
38
|
const pinToRightMenuItem = /*#__PURE__*/_jsxs(MenuItem, {
|
|
39
39
|
onClick: pinColumn(GridPinnedPosition.right),
|
|
40
40
|
children: [/*#__PURE__*/_jsx(ListItemIcon, {
|
|
41
|
-
children: /*#__PURE__*/_jsx(rootProps.
|
|
41
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnMenuPinRightIcon, {
|
|
42
42
|
fontSize: "small"
|
|
43
43
|
})
|
|
44
44
|
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
@@ -52,7 +52,7 @@ function GridColumnMenuPinningItem(props) {
|
|
|
52
52
|
if (side) {
|
|
53
53
|
const otherSide = side === GridPinnedPosition.right ? GridPinnedPosition.left : GridPinnedPosition.right;
|
|
54
54
|
const label = otherSide === GridPinnedPosition.right ? 'pinToRight' : 'pinToLeft';
|
|
55
|
-
const Icon = side === GridPinnedPosition.right ? rootProps.
|
|
55
|
+
const Icon = side === GridPinnedPosition.right ? rootProps.slots.columnMenuPinLeftIcon : rootProps.slots.columnMenuPinRightIcon;
|
|
56
56
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
57
57
|
children: [/*#__PURE__*/_jsxs(MenuItem, {
|
|
58
58
|
onClick: pinColumn(otherSide),
|
|
@@ -4,6 +4,7 @@ const _excluded = ["rowId", "height", "style"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import Box from '@mui/material/Box';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
|
+
import { useGridRootProps } from '@mui/x-data-grid';
|
|
7
8
|
import { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
const DetailPanel = styled(Box, {
|
|
@@ -28,6 +29,8 @@ function GridDetailPanel(props) {
|
|
|
28
29
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
29
30
|
const apiRef = useGridPrivateApiContext();
|
|
30
31
|
const ref = React.useRef();
|
|
32
|
+
const rootProps = useGridRootProps();
|
|
33
|
+
const ownerState = rootProps;
|
|
31
34
|
React.useLayoutEffect(() => {
|
|
32
35
|
if (height === 'auto' && ref.current && typeof ResizeObserver === 'undefined') {
|
|
33
36
|
// Fallback for IE
|
|
@@ -52,6 +55,7 @@ function GridDetailPanel(props) {
|
|
|
52
55
|
});
|
|
53
56
|
return /*#__PURE__*/_jsx(DetailPanel, _extends({
|
|
54
57
|
ref: ref,
|
|
58
|
+
ownerState: ownerState,
|
|
55
59
|
style: style
|
|
56
60
|
}, other));
|
|
57
61
|
}
|
|
@@ -18,7 +18,7 @@ const useUtilityClasses = ownerState => {
|
|
|
18
18
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
19
19
|
};
|
|
20
20
|
function GridDetailPanelToggleCell(props) {
|
|
21
|
-
var _rootProps$
|
|
21
|
+
var _rootProps$slotProps;
|
|
22
22
|
const {
|
|
23
23
|
id,
|
|
24
24
|
value: isExpanded
|
|
@@ -32,14 +32,14 @@ function GridDetailPanelToggleCell(props) {
|
|
|
32
32
|
const classes = useUtilityClasses(ownerState);
|
|
33
33
|
const contentCache = useGridSelector(apiRef, gridDetailPanelExpandedRowsContentCacheSelector);
|
|
34
34
|
const hasContent = /*#__PURE__*/React.isValidElement(contentCache[id]);
|
|
35
|
-
const Icon = isExpanded ? rootProps.
|
|
36
|
-
return /*#__PURE__*/_jsx(rootProps.
|
|
35
|
+
const Icon = isExpanded ? rootProps.slots.detailPanelCollapseIcon : rootProps.slots.detailPanelExpandIcon;
|
|
36
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
37
37
|
size: "small",
|
|
38
38
|
tabIndex: -1,
|
|
39
39
|
disabled: !hasContent,
|
|
40
40
|
className: classes.root,
|
|
41
41
|
"aria-label": isExpanded ? apiRef.current.getLocaleText('collapseDetailPanel') : apiRef.current.getLocaleText('expandDetailPanel')
|
|
42
|
-
}, (_rootProps$
|
|
42
|
+
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
43
43
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
44
44
|
fontSize: "inherit"
|
|
45
45
|
})
|
|
@@ -62,7 +62,7 @@ function GridRowReorderCell(params) {
|
|
|
62
62
|
className: classes.root,
|
|
63
63
|
draggable: isDraggable
|
|
64
64
|
}, draggableEventHandlers, {
|
|
65
|
-
children: [/*#__PURE__*/_jsx(rootProps.
|
|
65
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.rowReorderIcon, {}), /*#__PURE__*/_jsx("div", {
|
|
66
66
|
className: classes.placeholder,
|
|
67
67
|
children: cellValue
|
|
68
68
|
})]
|
|
@@ -19,7 +19,7 @@ const useUtilityClasses = ownerState => {
|
|
|
19
19
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
20
20
|
};
|
|
21
21
|
function GridTreeDataGroupingCell(props) {
|
|
22
|
-
var _filteredDescendantCo, _rootProps$
|
|
22
|
+
var _filteredDescendantCo, _rootProps$slotProps;
|
|
23
23
|
const {
|
|
24
24
|
id,
|
|
25
25
|
field,
|
|
@@ -36,7 +36,7 @@ function GridTreeDataGroupingCell(props) {
|
|
|
36
36
|
const classes = useUtilityClasses(ownerState);
|
|
37
37
|
const filteredDescendantCountLookup = useGridSelector(apiRef, gridFilteredDescendantCountLookupSelector);
|
|
38
38
|
const filteredDescendantCount = (_filteredDescendantCo = filteredDescendantCountLookup[rowNode.id]) != null ? _filteredDescendantCo : 0;
|
|
39
|
-
const Icon = rowNode.childrenExpanded ? rootProps.
|
|
39
|
+
const Icon = rowNode.childrenExpanded ? rootProps.slots.treeDataCollapseIcon : rootProps.slots.treeDataExpandIcon;
|
|
40
40
|
const handleClick = event => {
|
|
41
41
|
apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded);
|
|
42
42
|
apiRef.current.setCellFocus(id, field);
|
|
@@ -50,12 +50,12 @@ function GridTreeDataGroupingCell(props) {
|
|
|
50
50
|
},
|
|
51
51
|
children: [/*#__PURE__*/_jsx("div", {
|
|
52
52
|
className: classes.toggle,
|
|
53
|
-
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(rootProps.
|
|
53
|
+
children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
54
54
|
size: "small",
|
|
55
55
|
onClick: handleClick,
|
|
56
56
|
tabIndex: -1,
|
|
57
57
|
"aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
|
|
58
|
-
}, rootProps == null ? void 0 : (_rootProps$
|
|
58
|
+
}, rootProps == null ? void 0 : (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
59
59
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
60
60
|
fontSize: "inherit"
|
|
61
61
|
})
|
|
@@ -3,4 +3,4 @@ import { GridStateInitializer } from '@mui/x-data-grid/internals';
|
|
|
3
3
|
import { GridPrivateApiPro } from '../../../models/gridApiPro';
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
5
5
|
export declare const columnPinningStateInitializer: GridStateInitializer<Pick<DataGridProProcessedProps, 'pinnedColumns' | 'initialState' | 'disableColumnPinning'>>;
|
|
6
|
-
export declare const useGridColumnPinning: (apiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, 'disableColumnPinning' | 'initialState' | 'pinnedColumns' | 'onPinnedColumnsChange' | '
|
|
6
|
+
export declare const useGridColumnPinning: (apiRef: React.MutableRefObject<GridPrivateApiPro>, props: Pick<DataGridProProcessedProps, 'disableColumnPinning' | 'initialState' | 'pinnedColumns' | 'onPinnedColumnsChange' | 'slotProps' | 'slots'>) => void;
|
|
@@ -58,6 +58,9 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
58
58
|
event.stopPropagation();
|
|
59
59
|
dragColNode.current = event.currentTarget;
|
|
60
60
|
dragColNode.current.classList.add(classes.columnHeaderDragging);
|
|
61
|
+
if (event.dataTransfer) {
|
|
62
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
63
|
+
}
|
|
61
64
|
apiRef.current.setState(state => _extends({}, state, {
|
|
62
65
|
columnReorder: _extends({}, state.columnReorder, {
|
|
63
66
|
dragCol: params.field
|
package/index.js
CHANGED
|
@@ -115,10 +115,12 @@ DataGridProRaw.propTypes = {
|
|
|
115
115
|
columnVisibilityModel: PropTypes.object,
|
|
116
116
|
/**
|
|
117
117
|
* Overrideable components.
|
|
118
|
+
* @deprecated Use the `slots` prop instead.
|
|
118
119
|
*/
|
|
119
120
|
components: PropTypes.object,
|
|
120
121
|
/**
|
|
121
122
|
* Overrideable components props dynamically passed to the component at rendering.
|
|
123
|
+
* @deprecated Use the `slotProps` prop instead.
|
|
122
124
|
*/
|
|
123
125
|
componentsProps: PropTypes.object,
|
|
124
126
|
/**
|
|
@@ -771,6 +773,14 @@ DataGridProRaw.propTypes = {
|
|
|
771
773
|
* @default false
|
|
772
774
|
*/
|
|
773
775
|
showColumnVerticalBorder: PropTypes.bool,
|
|
776
|
+
/**
|
|
777
|
+
* Overrideable components props dynamically passed to the component at rendering.
|
|
778
|
+
*/
|
|
779
|
+
slotProps: PropTypes.object,
|
|
780
|
+
/**
|
|
781
|
+
* Overrideable components.
|
|
782
|
+
*/
|
|
783
|
+
slots: PropTypes.object,
|
|
774
784
|
/**
|
|
775
785
|
* Sorting can be processed on the server or client-side.
|
|
776
786
|
* Set it to 'client' if you would like to handle sorting on the client-side.
|