@mui/x-data-grid-pro 6.18.0 → 7.0.0-alpha.0
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 +212 -5
- package/DataGridPro/DataGridPro.js +0 -10
- package/DataGridPro/useDataGridProProps.js +10 -15
- package/components/headerFiltering/GridHeaderFilterCell.js +0 -1
- package/components/headerFiltering/GridHeaderFilterMenu.js +0 -1
- package/components/headerFiltering/GridHeaderFilterMenuContainer.js +0 -1
- package/constants/dataGridProDefaultSlotsComponents.js +4 -4
- package/hooks/features/columnResize/useGridColumnResize.js +4 -1
- package/index.js +1 -1
- package/legacy/DataGridPro/DataGridPro.js +0 -10
- package/legacy/DataGridPro/useDataGridProProps.js +9 -17
- package/legacy/components/headerFiltering/GridHeaderFilterCell.js +0 -1
- package/legacy/components/headerFiltering/GridHeaderFilterMenu.js +0 -1
- package/legacy/components/headerFiltering/GridHeaderFilterMenuContainer.js +0 -1
- package/legacy/constants/dataGridProDefaultSlotsComponents.js +4 -4
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +4 -1
- package/legacy/index.js +1 -1
- package/legacy/material/index.js +2 -2
- package/legacy/models/dataSource.js +1 -0
- package/legacy/utils/releaseInfo.js +1 -1
- package/material/index.d.ts +2 -2
- package/material/index.js +2 -2
- package/models/dataGridProProps.d.ts +3 -13
- package/models/dataSource.d.ts +64 -0
- package/models/dataSource.js +1 -0
- package/models/gridProIconSlotsComponent.d.ts +2 -2
- package/models/gridProSlotsComponent.d.ts +2 -5
- package/modern/DataGridPro/DataGridPro.js +0 -10
- package/modern/DataGridPro/useDataGridProProps.js +6 -8
- package/modern/components/headerFiltering/GridHeaderFilterCell.js +0 -1
- package/modern/components/headerFiltering/GridHeaderFilterMenu.js +0 -1
- package/modern/components/headerFiltering/GridHeaderFilterMenuContainer.js +0 -1
- package/modern/constants/dataGridProDefaultSlotsComponents.js +4 -4
- package/modern/hooks/features/columnResize/useGridColumnResize.js +3 -1
- package/modern/index.js +1 -1
- package/modern/material/index.js +2 -2
- package/modern/models/dataSource.js +1 -0
- package/modern/utils/releaseInfo.js +1 -1
- package/node/DataGridPro/DataGridPro.js +0 -10
- package/node/DataGridPro/useDataGridProProps.js +5 -7
- package/node/components/headerFiltering/GridHeaderFilterCell.js +0 -1
- package/node/components/headerFiltering/GridHeaderFilterMenu.js +0 -1
- package/node/components/headerFiltering/GridHeaderFilterMenuContainer.js +0 -1
- package/node/constants/dataGridProDefaultSlotsComponents.js +4 -4
- package/node/hooks/features/columnResize/useGridColumnResize.js +3 -1
- package/node/index.js +1 -1
- package/node/material/index.js +2 -2
- package/node/models/dataSource.js +5 -0
- 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,213 @@
|
|
|
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
|
+
## 7.0.0-alpha.0
|
|
7
|
+
|
|
8
|
+
_Nov 10, 2023_
|
|
9
|
+
|
|
10
|
+
We're thrilled to announce the first alpha release of our next major version, v7.
|
|
11
|
+
This release introduces a few breaking changes, paving the way for the upcoming features like Pivoting and DateTimeRangePicker.
|
|
12
|
+
|
|
13
|
+
A special shoutout to thank the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
14
|
+
|
|
15
|
+
- 🚀 First v7 alpha release
|
|
16
|
+
- ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
|
|
17
|
+
- 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/)
|
|
18
|
+
- 💫 New recipes added for the data grid
|
|
19
|
+
- 📈 `<ChartsReferenceLine />` component is now available
|
|
20
|
+
- 🌍 Add Basque (eu) locale, improve Czech (cs-CZ) and Spanish (es-ES) locales
|
|
21
|
+
- 🐞 Bugfixes
|
|
22
|
+
- 📚 Documentation improvements
|
|
23
|
+
|
|
24
|
+
### Data Grid
|
|
25
|
+
|
|
26
|
+
#### Breaking changes
|
|
27
|
+
|
|
28
|
+
- The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead. See [components section](/x/react-data-grid/components/) for more details.
|
|
29
|
+
- The print export will now only print the selected rows if there are any.
|
|
30
|
+
If there are no selected rows, it will print all rows. This makes the print export consistent with the other exports.
|
|
31
|
+
You can [customize the rows to export by using the `getRowsToExport` function](/x/react-data-grid/export/#customizing-the-rows-to-export).
|
|
32
|
+
- The `getApplyFilterFnV7` in `GridFilterOperator` was renamed to `getApplyFilterFn`.
|
|
33
|
+
If you use `getApplyFilterFnV7` directly - rename it to `getApplyFilterFn`.
|
|
34
|
+
- The signature of the function returned by `getApplyFilterFn` has changed for performance reasons:
|
|
35
|
+
|
|
36
|
+
```diff
|
|
37
|
+
const getApplyFilterFn: GetApplyFilterFn<any, unknown> = (filterItem) => {
|
|
38
|
+
if (!filterItem.value) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i');
|
|
42
|
+
- return (cellParams) => {
|
|
43
|
+
- const { value } = cellParams;
|
|
44
|
+
+ return (value, row, colDef, apiRef) => {
|
|
45
|
+
return value != null ? filterRegex.test(String(value)) : false;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- The `getApplyQuickFilterFnV7` in `GridColDef` was renamed to `getApplyQuickFilterFn`.
|
|
51
|
+
If you use `getApplyQuickFilterFnV7` directly - rename it to `getApplyQuickFilterFn`.
|
|
52
|
+
- The signature of the function returned by `getApplyQuickFilterFn` has changed for performance reasons:
|
|
53
|
+
|
|
54
|
+
```diff
|
|
55
|
+
const getGridStringQuickFilterFn: GetApplyQuickFilterFn<any, unknown> = (value) => {
|
|
56
|
+
if (!value) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const filterRegex = new RegExp(escapeRegExp(value), 'i');
|
|
60
|
+
- return (cellParams) => {
|
|
61
|
+
- const { formattedValue } = cellParams;
|
|
62
|
+
+ return (value, row, column, apiRef) => {
|
|
63
|
+
+ let formattedValue = apiRef.current.getRowFormattedValue(row, column);
|
|
64
|
+
return formattedValue != null ? filterRegex.test(formattedValue.toString()) : false;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### `@mui/x-data-grid@7.0.0-alpha.0`
|
|
70
|
+
|
|
71
|
+
- [DataGrid] Fix for error thrown when removing skeleton rows, after sorting is applied (#10807) @benjaminbialy
|
|
72
|
+
- [DataGrid] Fix: `undefined` slot value (#10937) @romgrk
|
|
73
|
+
- [DataGrid] Print selected rows by default (#10846) @cherniavskii
|
|
74
|
+
- [DataGrid] Remove deprecated `components` and `componentsProps` (#10911) @MBilalShafi
|
|
75
|
+
- [DataGrid] Remove legacy filtering API (#10897) @cherniavskii
|
|
76
|
+
- [DataGrid] Fix keyboard navigation for actions cell with disabled buttons (#10882) @michelengelen
|
|
77
|
+
- [DataGrid] Added a recipe for using non-native select in filter panel (#10916) @michelengelen
|
|
78
|
+
- [DataGrid] Added a recipe to style cells without impacting the aggregation cells (#10913) @michelengelen
|
|
79
|
+
- [l10n] Improve Czech (cs-CZ) locale (#10949) @luborepka
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-data-grid-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
82
|
+
|
|
83
|
+
Same changes as in `@mui/x-data-grid@7.0.0-alpha.0`, plus:
|
|
84
|
+
|
|
85
|
+
- [DataGridPro] Autosize Columns - Fix headers being cut off (#10666) @gitstart
|
|
86
|
+
- [DataGridPro] Add data source interface and basic documentation (#10543) @MBilalShafi
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-data-grid-premium@7.0.0-alpha.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
89
|
+
|
|
90
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.0`, plus:
|
|
91
|
+
|
|
92
|
+
- [DataGridPremium] Render aggregation label when `renderHeader` is used (#10936) @cherniavskii
|
|
93
|
+
|
|
94
|
+
### Date Pickers
|
|
95
|
+
|
|
96
|
+
#### Breaking changes
|
|
97
|
+
|
|
98
|
+
- The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead.
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-date-pickers@7.0.0-alpha.0`
|
|
101
|
+
|
|
102
|
+
- [pickers] Escape non tokens words (#10400) @alexfauquette
|
|
103
|
+
- [fields] Fix `MultiInputTimeRangeField` section selection (#10922) @noraleonte
|
|
104
|
+
- [pickers] Refine `referenceDate` behavior in views (#10863) @LukasTy
|
|
105
|
+
- [pickers] Remove `components` and `componentsProps` props (#10700) @alexfauquette
|
|
106
|
+
- [l10n] Add Basque (eu) locale and improve Spanish (es-ES) locale (#10819) @lajtomekadimon
|
|
107
|
+
- [pickers] Add short weekdays token (#10988) @alexfauquette
|
|
108
|
+
|
|
109
|
+
#### `@mui/x-date-pickers-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
110
|
+
|
|
111
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-alpha.0`.
|
|
112
|
+
|
|
113
|
+
### Charts / `@mui/x-charts@7.0.0-alpha.0`
|
|
114
|
+
|
|
115
|
+
#### Breaking changes
|
|
116
|
+
|
|
117
|
+
Types for `slots` and `slotProps` got renamed by removing the "Component" which is meaningless for charts.
|
|
118
|
+
Unless you imported those types, to create a wrapper, you should not be impacted by this breaking change.
|
|
119
|
+
|
|
120
|
+
Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
121
|
+
|
|
122
|
+
```diff
|
|
123
|
+
-ChartsTooltipSlotsComponent
|
|
124
|
+
+ChartsTooltipSlots
|
|
125
|
+
|
|
126
|
+
-ChartsTooltipSlotComponentProps
|
|
127
|
+
+ChartsTooltipSlotProps
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- [charts] Add `<ChartsReferenceLine />` component (#10597) (#10946) @alexfauquette
|
|
131
|
+
- [charts] Improve properties JSDoc (#10931) (#10955) @alexfauquette
|
|
132
|
+
- [charts] Rename `slots` and `slotProps` types (#10875) @alexfauquette
|
|
133
|
+
|
|
134
|
+
### `@mui/x-codemod@7.0.0-alpha.0`
|
|
135
|
+
|
|
136
|
+
- [codemod] Add `v7.0.0/preset-safe` (#10973) @LukasTy
|
|
137
|
+
|
|
138
|
+
### Docs
|
|
139
|
+
|
|
140
|
+
- [docs] Add `@next` tag to the installation instructions (#10963) @MBilalShafi
|
|
141
|
+
- [docs] Document how to hide the legend (#10951) @alexfauquette
|
|
142
|
+
- [docs] Fix typo in the migration guide (#10972) @flaviendelangle
|
|
143
|
+
|
|
144
|
+
### Core
|
|
145
|
+
|
|
146
|
+
- [core] Adds migration docs for charts, pickers and tree view (#10926) @michelengelen
|
|
147
|
+
- [core] Bump monorepo (#10959) @LukasTy
|
|
148
|
+
- [core] Changed prettier branch value to next (#10917) @michelengelen
|
|
149
|
+
- [core] Fix GitHub title tag consistency @oliviertassinari
|
|
150
|
+
- [core] Fixed wrong package names in migration docs (#10953) @michelengelen
|
|
151
|
+
- [core] Merge `master` into `next` (#10929) @cherniavskii
|
|
152
|
+
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
153
|
+
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
154
|
+
|
|
155
|
+
## 6.18.1
|
|
156
|
+
|
|
157
|
+
_Nov 9, 2023_
|
|
158
|
+
|
|
159
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
160
|
+
|
|
161
|
+
- ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
|
|
162
|
+
- 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/) published
|
|
163
|
+
- 📈 `<ChartsReferenceLine />` component is now available
|
|
164
|
+
- 🐞 Bugfixes
|
|
165
|
+
- 📚 Documentation improvements
|
|
166
|
+
|
|
167
|
+
### Data Grid
|
|
168
|
+
|
|
169
|
+
#### `@mui/x-data-grid@6.18.1`
|
|
170
|
+
|
|
171
|
+
- [DataGrid] Fix cell value type in quick filtering v7 (#10884) @cherniavskii
|
|
172
|
+
- [DataGrid] Fix keyboard navigation for actions cell with disabled buttons (#10947) @michelengelen
|
|
173
|
+
- [DataGrid] Fix `undefined` slot values (#10934) @romgrk
|
|
174
|
+
|
|
175
|
+
#### `@mui/x-data-grid-pro@6.18.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
176
|
+
|
|
177
|
+
Same changes as in `@mui/x-data-grid@6.18.1`, plus:
|
|
178
|
+
|
|
179
|
+
- [DataGridPro] Add data source interface and basic documentation (#10543) @MBilalShafi
|
|
180
|
+
|
|
181
|
+
#### `@mui/x-data-grid-premium@6.18.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
182
|
+
|
|
183
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.1`, plus:
|
|
184
|
+
|
|
185
|
+
- [DataGridPremium] Render aggregation label when `renderHeader` is used (#10961) @cherniavskii
|
|
186
|
+
|
|
187
|
+
### Date Pickers
|
|
188
|
+
|
|
189
|
+
#### `@mui/x-date-pickers@6.18.1`
|
|
190
|
+
|
|
191
|
+
- [fields] Fix multi input date time field section selection (#10915) @noraleonte
|
|
192
|
+
- [pickers] Always use up-to-date `defaultView` (#10889) @LukasTy
|
|
193
|
+
|
|
194
|
+
#### `@mui/x-date-pickers-pro@6.18.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
195
|
+
|
|
196
|
+
Same changes as in `@mui/x-date-pickers@6.18.1`.
|
|
197
|
+
|
|
198
|
+
### Charts / `@mui/x-charts@6.18.1`
|
|
199
|
+
|
|
200
|
+
- [charts] Add `<ChartsReferenceLine />` component (#10597) @wascou
|
|
201
|
+
- [charts] Improve properties JSDoc (#10931) @alexfauquette
|
|
202
|
+
|
|
203
|
+
### Docs
|
|
204
|
+
|
|
205
|
+
- [docs] Fix charts docs as stable (#10888) @alexfauquette
|
|
206
|
+
- [docs] Document how to hide the legend (#10954) @alexfauquette
|
|
207
|
+
|
|
208
|
+
### Core
|
|
209
|
+
|
|
210
|
+
- [core] Adds new alpha version to version select on the docs (#10944) @michelengelen
|
|
211
|
+
- [core] Fix GitHub title tag consistency @oliviertassinari
|
|
212
|
+
|
|
6
213
|
## 6.18.0
|
|
7
214
|
|
|
8
215
|
_Nov 3, 2023_
|
|
@@ -357,7 +564,7 @@ Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
|
|
|
357
564
|
|
|
358
565
|
- [core] Fix casing consistency with legal and marketing content @oliviertassinari
|
|
359
566
|
- [core] Revert the link in the priority support ticket description (#10517) @michelengelen
|
|
360
|
-
- [
|
|
567
|
+
- [changelog] Polish image @oliviertassinari
|
|
361
568
|
|
|
362
569
|
## 6.16.0
|
|
363
570
|
|
|
@@ -1149,7 +1356,7 @@ Same changes as in `@mui/x-date-pickers@6.10.1`.
|
|
|
1149
1356
|
### Core
|
|
1150
1357
|
|
|
1151
1358
|
- [core] Add `validate` command (#9714) @romgrk
|
|
1152
|
-
- [
|
|
1359
|
+
- [changelog] Update generator to new format @oliviertassinari
|
|
1153
1360
|
|
|
1154
1361
|
## 6.10.0
|
|
1155
1362
|
|
|
@@ -1207,7 +1414,7 @@ Same changes as in `@mui/x-date-pickers@6.10.0`.
|
|
|
1207
1414
|
|
|
1208
1415
|
- [core] Disambiguate eslint plugin name @oliviertassinari
|
|
1209
1416
|
- [core] Update priority support issue template and prompt (#9574) @DanailH
|
|
1210
|
-
- [
|
|
1417
|
+
- [changelog] Clarify each plan (#9446) @oliviertassinari
|
|
1211
1418
|
- [license] Fix error terminology (#9614) @oliviertassinari
|
|
1212
1419
|
|
|
1213
1420
|
## 6.9.2
|
|
@@ -1356,8 +1563,8 @@ Same changes as in `@mui/x-date-pickers@6.9.1`.
|
|
|
1356
1563
|
- [core] Fix priority support prompt action (#9472) @DanailH
|
|
1357
1564
|
- [core] Update `uses` for priority support action (#9480) @DanailH
|
|
1358
1565
|
- [core] Bumb update monorepo (#9476) @alexfauquette
|
|
1359
|
-
- [
|
|
1360
|
-
- [
|
|
1566
|
+
- [changelog] Fix media quality (#9439) @oliviertassinari
|
|
1567
|
+
- [changelog] Remove height img attribute @oliviertassinari
|
|
1361
1568
|
- [test] Skip flaky row pinning tests in JSDOM (#9511) @cherniavskii
|
|
1362
1569
|
|
|
1363
1570
|
## 6.9.0
|
|
@@ -145,16 +145,6 @@ DataGridProRaw.propTypes = {
|
|
|
145
145
|
* If defined, the grid will ignore the `hide` property in [[GridColDef]].
|
|
146
146
|
*/
|
|
147
147
|
columnVisibilityModel: PropTypes.object,
|
|
148
|
-
/**
|
|
149
|
-
* Overridable components.
|
|
150
|
-
* @deprecated Use the `slots` prop instead.
|
|
151
|
-
*/
|
|
152
|
-
components: PropTypes.object,
|
|
153
|
-
/**
|
|
154
|
-
* Overridable components props dynamically passed to the component at rendering.
|
|
155
|
-
* @deprecated Use the `slotProps` prop instead.
|
|
156
|
-
*/
|
|
157
|
-
componentsProps: PropTypes.object,
|
|
158
148
|
/**
|
|
159
149
|
* If above 0, the row children will be expanded up to this depth.
|
|
160
150
|
* If equal to -1, all the row children will be expanded.
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
5
|
-
import { computeSlots,
|
|
5
|
+
import { computeSlots, useProps } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridProDefaultSlotsComponents';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -23,25 +23,20 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
23
23
|
getDetailPanelHeight: () => 500,
|
|
24
24
|
unstable_headerFilters: false
|
|
25
25
|
});
|
|
26
|
-
const defaultSlots =
|
|
26
|
+
const defaultSlots = DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
|
|
27
27
|
export const useDataGridProProps = inProps => {
|
|
28
|
-
const
|
|
28
|
+
const themedProps = useProps(useThemeProps({
|
|
29
29
|
props: inProps,
|
|
30
30
|
name: 'MuiDataGrid'
|
|
31
31
|
}));
|
|
32
32
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
33
33
|
const slots = React.useMemo(() => computeSlots({
|
|
34
34
|
defaultSlots,
|
|
35
|
-
slots: themedProps.slots
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
slots,
|
|
43
|
-
slotProps: (_themedProps$slotProp = themedProps.slotProps) != null ? _themedProps$slotProp : componentsProps,
|
|
44
|
-
signature: 'DataGridPro'
|
|
45
|
-
});
|
|
46
|
-
}, [themedProps, localeText, slots, componentsProps]);
|
|
35
|
+
slots: themedProps.slots
|
|
36
|
+
}), [themedProps.slots]);
|
|
37
|
+
return React.useMemo(() => _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
38
|
+
localeText,
|
|
39
|
+
slots,
|
|
40
|
+
signature: 'DataGridPro'
|
|
41
|
+
}), [themedProps, localeText, slots]);
|
|
47
42
|
};
|
|
@@ -219,7 +219,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
|
|
|
219
219
|
colIndex: PropTypes.number.isRequired,
|
|
220
220
|
filterOperators: PropTypes.arrayOf(PropTypes.shape({
|
|
221
221
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
222
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
223
222
|
getValueAsString: PropTypes.func,
|
|
224
223
|
headerLabel: PropTypes.string,
|
|
225
224
|
InputComponent: PropTypes.elementType,
|
|
@@ -76,7 +76,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenu.propTypes = {
|
|
|
76
76
|
open: PropTypes.bool.isRequired,
|
|
77
77
|
operators: PropTypes.arrayOf(PropTypes.shape({
|
|
78
78
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
79
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
80
79
|
getValueAsString: PropTypes.func,
|
|
81
80
|
headerLabel: PropTypes.string,
|
|
82
81
|
InputComponent: PropTypes.elementType,
|
|
@@ -83,7 +83,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenuContainer.propTypes
|
|
|
83
83
|
}).isRequired,
|
|
84
84
|
operators: PropTypes.arrayOf(PropTypes.shape({
|
|
85
85
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
86
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
87
86
|
getValueAsString: PropTypes.func,
|
|
88
87
|
headerLabel: PropTypes.string,
|
|
89
88
|
InputComponent: PropTypes.elementType,
|
|
@@ -6,8 +6,8 @@ import { GridHeaderFilterMenu } from '../components/headerFiltering/GridHeaderFi
|
|
|
6
6
|
import { GridHeaderFilterCell } from '../components/headerFiltering/GridHeaderFilterCell';
|
|
7
7
|
import materialSlots from '../material';
|
|
8
8
|
export const DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS = _extends({}, DATA_GRID_DEFAULT_SLOTS_COMPONENTS, materialSlots, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
columnMenu: GridProColumnMenu,
|
|
10
|
+
columnHeaders: GridColumnHeaders,
|
|
11
|
+
headerFilterCell: GridHeaderFilterCell,
|
|
12
|
+
headerFilterMenu: GridHeaderFilterMenu
|
|
13
13
|
});
|
|
@@ -144,13 +144,16 @@ function extractColumnWidths(apiRef, options, columns) {
|
|
|
144
144
|
if (options.includeHeaders) {
|
|
145
145
|
const header = findGridHeader(apiRef.current, column.field);
|
|
146
146
|
if (header) {
|
|
147
|
+
var _iconContainer$client, _menuContainer$client;
|
|
147
148
|
const title = header.querySelector(`.${gridClasses.columnHeaderTitle}`);
|
|
148
149
|
const content = header.querySelector(`.${gridClasses.columnHeaderTitleContainerContent}`);
|
|
150
|
+
const iconContainer = header.querySelector(`.${gridClasses.iconButtonContainer}`);
|
|
151
|
+
const menuContainer = header.querySelector(`.${gridClasses.menuIcon}`);
|
|
149
152
|
const element = title != null ? title : content;
|
|
150
153
|
const style = window.getComputedStyle(header, null);
|
|
151
154
|
const paddingWidth = parseInt(style.paddingLeft, 10) + parseInt(style.paddingRight, 10);
|
|
152
155
|
const contentWidth = element.scrollWidth + 1;
|
|
153
|
-
const width = paddingWidth +
|
|
156
|
+
const width = contentWidth + paddingWidth + ((_iconContainer$client = iconContainer == null ? void 0 : iconContainer.clientWidth) != null ? _iconContainer$client : 0) + ((_menuContainer$client = menuContainer == null ? void 0 : menuContainer.clientWidth) != null ? _menuContainer$client : 0);
|
|
154
157
|
filteredWidths.push(width);
|
|
155
158
|
}
|
|
156
159
|
}
|
package/index.js
CHANGED
|
@@ -145,16 +145,6 @@ DataGridProRaw.propTypes = {
|
|
|
145
145
|
* If defined, the grid will ignore the `hide` property in [[GridColDef]].
|
|
146
146
|
*/
|
|
147
147
|
columnVisibilityModel: PropTypes.object,
|
|
148
|
-
/**
|
|
149
|
-
* Overridable components.
|
|
150
|
-
* @deprecated Use the `slots` prop instead.
|
|
151
|
-
*/
|
|
152
|
-
components: PropTypes.object,
|
|
153
|
-
/**
|
|
154
|
-
* Overridable components props dynamically passed to the component at rendering.
|
|
155
|
-
* @deprecated Use the `slotProps` prop instead.
|
|
156
|
-
*/
|
|
157
|
-
componentsProps: PropTypes.object,
|
|
158
148
|
/**
|
|
159
149
|
* If above 0, the row children will be expanded up to this depth.
|
|
160
150
|
* If equal to -1, all the row children will be expanded.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
5
4
|
import { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
6
|
-
import { computeSlots,
|
|
5
|
+
import { computeSlots, useProps } from '@mui/x-data-grid/internals';
|
|
7
6
|
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridProDefaultSlotsComponents';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -26,33 +25,26 @@ export var DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_DEF
|
|
|
26
25
|
},
|
|
27
26
|
unstable_headerFilters: false
|
|
28
27
|
});
|
|
29
|
-
var defaultSlots =
|
|
28
|
+
var defaultSlots = DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
|
|
30
29
|
export var useDataGridProProps = function useDataGridProProps(inProps) {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
_useProps2 = _slicedToArray(_useProps, 3),
|
|
36
|
-
components = _useProps2[0],
|
|
37
|
-
componentsProps = _useProps2[1],
|
|
38
|
-
themedProps = _useProps2[2];
|
|
30
|
+
var themedProps = useProps(useThemeProps({
|
|
31
|
+
props: inProps,
|
|
32
|
+
name: 'MuiDataGrid'
|
|
33
|
+
}));
|
|
39
34
|
var localeText = React.useMemo(function () {
|
|
40
35
|
return _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText);
|
|
41
36
|
}, [themedProps.localeText]);
|
|
42
37
|
var slots = React.useMemo(function () {
|
|
43
38
|
return computeSlots({
|
|
44
39
|
defaultSlots: defaultSlots,
|
|
45
|
-
slots: themedProps.slots
|
|
46
|
-
components: components
|
|
40
|
+
slots: themedProps.slots
|
|
47
41
|
});
|
|
48
|
-
}, [
|
|
42
|
+
}, [themedProps.slots]);
|
|
49
43
|
return React.useMemo(function () {
|
|
50
|
-
var _themedProps$slotProp;
|
|
51
44
|
return _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
52
45
|
localeText: localeText,
|
|
53
46
|
slots: slots,
|
|
54
|
-
slotProps: (_themedProps$slotProp = themedProps.slotProps) != null ? _themedProps$slotProp : componentsProps,
|
|
55
47
|
signature: 'DataGridPro'
|
|
56
48
|
});
|
|
57
|
-
}, [themedProps, localeText, slots
|
|
49
|
+
}, [themedProps, localeText, slots]);
|
|
58
50
|
};
|
|
@@ -224,7 +224,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
|
|
|
224
224
|
colIndex: PropTypes.number.isRequired,
|
|
225
225
|
filterOperators: PropTypes.arrayOf(PropTypes.shape({
|
|
226
226
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
227
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
228
227
|
getValueAsString: PropTypes.func,
|
|
229
228
|
headerLabel: PropTypes.string,
|
|
230
229
|
InputComponent: PropTypes.elementType,
|
|
@@ -75,7 +75,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenu.propTypes = {
|
|
|
75
75
|
open: PropTypes.bool.isRequired,
|
|
76
76
|
operators: PropTypes.arrayOf(PropTypes.shape({
|
|
77
77
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
78
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
79
78
|
getValueAsString: PropTypes.func,
|
|
80
79
|
headerLabel: PropTypes.string,
|
|
81
80
|
InputComponent: PropTypes.elementType,
|
|
@@ -81,7 +81,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenuContainer.propTypes
|
|
|
81
81
|
}).isRequired,
|
|
82
82
|
operators: PropTypes.arrayOf(PropTypes.shape({
|
|
83
83
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
84
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
85
84
|
getValueAsString: PropTypes.func,
|
|
86
85
|
headerLabel: PropTypes.string,
|
|
87
86
|
InputComponent: PropTypes.elementType,
|
|
@@ -6,8 +6,8 @@ import { GridHeaderFilterMenu } from '../components/headerFiltering/GridHeaderFi
|
|
|
6
6
|
import { GridHeaderFilterCell } from '../components/headerFiltering/GridHeaderFilterCell';
|
|
7
7
|
import materialSlots from '../material';
|
|
8
8
|
export var DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS = _extends({}, DATA_GRID_DEFAULT_SLOTS_COMPONENTS, materialSlots, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
columnMenu: GridProColumnMenu,
|
|
10
|
+
columnHeaders: GridColumnHeaders,
|
|
11
|
+
headerFilterCell: GridHeaderFilterCell,
|
|
12
|
+
headerFilterMenu: GridHeaderFilterMenu
|
|
13
13
|
});
|
|
@@ -153,13 +153,16 @@ function extractColumnWidths(apiRef, options, columns) {
|
|
|
153
153
|
if (options.includeHeaders) {
|
|
154
154
|
var header = findGridHeader(apiRef.current, column.field);
|
|
155
155
|
if (header) {
|
|
156
|
+
var _iconContainer$client, _menuContainer$client;
|
|
156
157
|
var title = header.querySelector(".".concat(gridClasses.columnHeaderTitle));
|
|
157
158
|
var content = header.querySelector(".".concat(gridClasses.columnHeaderTitleContainerContent));
|
|
159
|
+
var iconContainer = header.querySelector(".".concat(gridClasses.iconButtonContainer));
|
|
160
|
+
var menuContainer = header.querySelector(".".concat(gridClasses.menuIcon));
|
|
158
161
|
var element = title != null ? title : content;
|
|
159
162
|
var style = window.getComputedStyle(header, null);
|
|
160
163
|
var paddingWidth = parseInt(style.paddingLeft, 10) + parseInt(style.paddingRight, 10);
|
|
161
164
|
var contentWidth = element.scrollWidth + 1;
|
|
162
|
-
var width = paddingWidth +
|
|
165
|
+
var width = contentWidth + paddingWidth + ((_iconContainer$client = iconContainer == null ? void 0 : iconContainer.clientWidth) != null ? _iconContainer$client : 0) + ((_menuContainer$client = menuContainer == null ? void 0 : menuContainer.clientWidth) != null ? _menuContainer$client : 0);
|
|
163
166
|
filteredWidths.push(width);
|
|
164
167
|
}
|
|
165
168
|
}
|
package/legacy/index.js
CHANGED
package/legacy/material/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridPushPinRightIcon, GridPushPinLeftIcon } from './icons';
|
|
3
3
|
var iconSlots = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
columnMenuPinRightIcon: GridPushPinRightIcon,
|
|
5
|
+
columnMenuPinLeftIcon: GridPushPinLeftIcon
|
|
6
6
|
};
|
|
7
7
|
var materialSlots = _extends({}, iconSlots);
|
|
8
8
|
export default materialSlots;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export var getReleaseInfo = function getReleaseInfo() {
|
|
3
|
-
var releaseInfo = "
|
|
3
|
+
var releaseInfo = "MTY5OTU3MDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
package/material/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const materialSlots: {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
columnMenuPinLeftIcon: import("react").JSXElementConstructor<any>;
|
|
4
|
+
columnMenuPinRightIcon: import("react").JSXElementConstructor<any>;
|
|
5
5
|
};
|
|
6
6
|
export default materialSlots;
|
package/material/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridPushPinRightIcon, GridPushPinLeftIcon } from './icons';
|
|
3
3
|
const iconSlots = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
columnMenuPinRightIcon: GridPushPinRightIcon,
|
|
5
|
+
columnMenuPinLeftIcon: GridPushPinLeftIcon
|
|
6
6
|
};
|
|
7
7
|
const materialSlots = _extends({}, iconSlots);
|
|
8
8
|
export default materialSlots;
|
|
@@ -6,7 +6,7 @@ import type { GridPinnedRowsProp } from '../hooks/features/rowPinning';
|
|
|
6
6
|
import { GridApiPro } from './gridApiPro';
|
|
7
7
|
import { GridGroupingColDefOverride, GridGroupingColDefOverrideParams } from './gridGroupingColDefOverride';
|
|
8
8
|
import { GridInitialStatePro } from './gridStatePro';
|
|
9
|
-
import { GridProSlotsComponent
|
|
9
|
+
import { GridProSlotsComponent } from './gridProSlotsComponent';
|
|
10
10
|
import type { GridProSlotProps } from './gridProSlotProps';
|
|
11
11
|
import { GridAutosizeOptions } from '../hooks';
|
|
12
12
|
export interface GridExperimentalProFeatures extends GridExperimentalFeatures {
|
|
@@ -18,13 +18,8 @@ export interface GridExperimentalProFeatures extends GridExperimentalFeatures {
|
|
|
18
18
|
interface DataGridProPropsWithComplexDefaultValueBeforeProcessing extends Omit<DataGridPropsWithComplexDefaultValueBeforeProcessing, 'components'> {
|
|
19
19
|
/**
|
|
20
20
|
* Overridable components.
|
|
21
|
-
* @deprecated Use the `slots` prop instead.
|
|
22
21
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Overridable components.
|
|
26
|
-
*/
|
|
27
|
-
slots?: Partial<UncapitalizedGridProSlotsComponent>;
|
|
22
|
+
slots?: Partial<GridProSlotsComponent>;
|
|
28
23
|
}
|
|
29
24
|
/**
|
|
30
25
|
* The props users can give to the `DataGridProProps` component.
|
|
@@ -32,7 +27,7 @@ interface DataGridProPropsWithComplexDefaultValueBeforeProcessing extends Omit<D
|
|
|
32
27
|
export interface DataGridProProps<R extends GridValidRowModel = any> extends Omit<Partial<DataGridProPropsWithDefaultValue> & DataGridProPropsWithComplexDefaultValueBeforeProcessing & DataGridProPropsWithoutDefaultValue<R>, DataGridProForcedPropsKey> {
|
|
33
28
|
}
|
|
34
29
|
interface DataGridProPropsWithComplexDefaultValueAfterProcessing extends Omit<DataGridPropsWithComplexDefaultValueAfterProcessing, 'slots'> {
|
|
35
|
-
slots:
|
|
30
|
+
slots: GridProSlotsComponent;
|
|
36
31
|
}
|
|
37
32
|
/**
|
|
38
33
|
* The props of the `DataGridPro` component after the pre-processing phase.
|
|
@@ -227,10 +222,5 @@ export interface DataGridProPropsWithoutDefaultValue<R extends GridValidRowModel
|
|
|
227
222
|
* Overridable components props dynamically passed to the component at rendering.
|
|
228
223
|
*/
|
|
229
224
|
slotProps?: GridProSlotProps;
|
|
230
|
-
/**
|
|
231
|
-
* Overridable components props dynamically passed to the component at rendering.
|
|
232
|
-
* @deprecated Use the `slotProps` prop instead.
|
|
233
|
-
*/
|
|
234
|
-
componentsProps?: GridProSlotProps;
|
|
235
225
|
}
|
|
236
226
|
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { GridSortModel, GridFilterModel, GridColDef, GridRowModel, GridPaginationModel } from '@mui/x-data-grid';
|
|
2
|
+
interface GetRowsParams {
|
|
3
|
+
sortModel: GridSortModel;
|
|
4
|
+
filterModel: GridFilterModel;
|
|
5
|
+
/**
|
|
6
|
+
* Alternate to `start` and `end`, maps to `GridPaginationModel` interface
|
|
7
|
+
*/
|
|
8
|
+
paginationModel: GridPaginationModel;
|
|
9
|
+
/**
|
|
10
|
+
* First row index to fetch (number) or cursor information (number | string)
|
|
11
|
+
*/
|
|
12
|
+
start: number | string;
|
|
13
|
+
/**
|
|
14
|
+
* Last row index to fetch
|
|
15
|
+
*/
|
|
16
|
+
end: number;
|
|
17
|
+
/**
|
|
18
|
+
* Array of keys returned by `getGroupKey` of all the parent rows until the row for which the data is requested
|
|
19
|
+
* `getGroupKey` prop must be implemented to use this
|
|
20
|
+
* Useful for `treeData` and `rowGrouping` only
|
|
21
|
+
*/
|
|
22
|
+
groupKeys: string[];
|
|
23
|
+
/**
|
|
24
|
+
* List of grouped columns (only applicable with `rowGrouping`)
|
|
25
|
+
*/
|
|
26
|
+
groupFields: GridColDef['field'][];
|
|
27
|
+
}
|
|
28
|
+
interface GetRowsResponse {
|
|
29
|
+
rows: GridRowModel[];
|
|
30
|
+
/**
|
|
31
|
+
* To reflect updates in total `rowCount` (optional)
|
|
32
|
+
* Useful when the `rowCount` is inaccurate (e.g. when filtering) or not available upfront
|
|
33
|
+
*/
|
|
34
|
+
rowCount?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Additional `pageInfo` to help the grid determine if there are more rows to fetch (corner-cases)
|
|
37
|
+
* `hasNextPage`: When row count is unknown/inaccurate, if `truncated` is set or rowCount is not known, data will keep loading until `hasNextPage` is `false`
|
|
38
|
+
* `truncated`: To reflect `rowCount` is inaccurate (will trigger `x-y of many` in pagination after the count of rows fetched is greater than provided `rowCount`)
|
|
39
|
+
* It could be useful with:
|
|
40
|
+
* 1. Cursor based pagination:
|
|
41
|
+
* When rowCount is not known, grid will check for `hasNextPage` to determine
|
|
42
|
+
* if there are more rows to fetch.
|
|
43
|
+
* 2. Inaccurate `rowCount`:
|
|
44
|
+
* `truncated: true` will let the grid know that `rowCount` is estimated/truncated.
|
|
45
|
+
* Thus `hasNextPage` will come into play to check more rows are available to fetch after the number becomes >= provided `rowCount`
|
|
46
|
+
*/
|
|
47
|
+
pageInfo?: {
|
|
48
|
+
hasNextPage?: boolean;
|
|
49
|
+
truncated?: number;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export interface DataSource {
|
|
53
|
+
/**
|
|
54
|
+
Fetcher Functions:
|
|
55
|
+
- `getRows` is required
|
|
56
|
+
- `updateRow` is optional
|
|
57
|
+
|
|
58
|
+
`getRows` will be used by the grid to fetch data for the current page or children for the current parent group
|
|
59
|
+
It may return a `rowCount` to update the total count of rows in the grid along with the optional `pageInfo`
|
|
60
|
+
*/
|
|
61
|
+
getRows(params: GetRowsParams): Promise<GetRowsResponse>;
|
|
62
|
+
updateRow?(rows: GridRowModel): Promise<any>;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,10 +4,10 @@ export interface GridProIconSlotsComponent {
|
|
|
4
4
|
* Icon displayed in column menu for left pinning
|
|
5
5
|
* @default GridPushPinLeftIcon
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
columnMenuPinLeftIcon: React.JSXElementConstructor<any>;
|
|
8
8
|
/**
|
|
9
9
|
* Icon displayed in column menu for right pinning
|
|
10
10
|
* @default GridPushPinRightIcon
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
columnMenuPinRightIcon: React.JSXElementConstructor<any>;
|
|
13
13
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GridSlotsComponent } from '@mui/x-data-grid';
|
|
3
|
-
import { UncapitalizeObjectKeys } from '@mui/x-data-grid/internals';
|
|
4
3
|
import { GridProIconSlotsComponent } from './gridProIconSlotsComponent';
|
|
5
4
|
/**
|
|
6
5
|
* Grid components React prop interface containing all the overridable components
|
|
@@ -11,12 +10,10 @@ export interface GridProSlotsComponent extends GridSlotsComponent, GridProIconSl
|
|
|
11
10
|
* Component responsible for showing menu adornment in Header filter row
|
|
12
11
|
* @default GridHeaderFilterCell
|
|
13
12
|
*/
|
|
14
|
-
|
|
13
|
+
headerFilterCell: React.JSXElementConstructor<any>;
|
|
15
14
|
/**
|
|
16
15
|
* Component responsible for showing menu in Header filter row
|
|
17
16
|
* @default GridHeaderFilterMenu
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
export interface UncapitalizedGridProSlotsComponent extends UncapitalizeObjectKeys<GridProSlotsComponent> {
|
|
18
|
+
headerFilterMenu: React.JSXElementConstructor<any> | null;
|
|
22
19
|
}
|
|
@@ -145,16 +145,6 @@ DataGridProRaw.propTypes = {
|
|
|
145
145
|
* If defined, the grid will ignore the `hide` property in [[GridColDef]].
|
|
146
146
|
*/
|
|
147
147
|
columnVisibilityModel: PropTypes.object,
|
|
148
|
-
/**
|
|
149
|
-
* Overridable components.
|
|
150
|
-
* @deprecated Use the `slots` prop instead.
|
|
151
|
-
*/
|
|
152
|
-
components: PropTypes.object,
|
|
153
|
-
/**
|
|
154
|
-
* Overridable components props dynamically passed to the component at rendering.
|
|
155
|
-
* @deprecated Use the `slotProps` prop instead.
|
|
156
|
-
*/
|
|
157
|
-
componentsProps: PropTypes.object,
|
|
158
148
|
/**
|
|
159
149
|
* If above 0, the row children will be expanded up to this depth.
|
|
160
150
|
* If equal to -1, all the row children will be expanded.
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
5
|
-
import { computeSlots,
|
|
5
|
+
import { computeSlots, useProps } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridProDefaultSlotsComponents';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -23,22 +23,20 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
23
23
|
getDetailPanelHeight: () => 500,
|
|
24
24
|
unstable_headerFilters: false
|
|
25
25
|
});
|
|
26
|
-
const defaultSlots =
|
|
26
|
+
const defaultSlots = DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
|
|
27
27
|
export const useDataGridProProps = inProps => {
|
|
28
|
-
const
|
|
28
|
+
const themedProps = useProps(useThemeProps({
|
|
29
29
|
props: inProps,
|
|
30
30
|
name: 'MuiDataGrid'
|
|
31
31
|
}));
|
|
32
32
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
33
33
|
const slots = React.useMemo(() => computeSlots({
|
|
34
34
|
defaultSlots,
|
|
35
|
-
slots: themedProps.slots
|
|
36
|
-
|
|
37
|
-
}), [components, themedProps.slots]);
|
|
35
|
+
slots: themedProps.slots
|
|
36
|
+
}), [themedProps.slots]);
|
|
38
37
|
return React.useMemo(() => _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
39
38
|
localeText,
|
|
40
39
|
slots,
|
|
41
|
-
slotProps: themedProps.slotProps ?? componentsProps,
|
|
42
40
|
signature: 'DataGridPro'
|
|
43
|
-
}), [themedProps, localeText, slots
|
|
41
|
+
}), [themedProps, localeText, slots]);
|
|
44
42
|
};
|
|
@@ -216,7 +216,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
|
|
|
216
216
|
colIndex: PropTypes.number.isRequired,
|
|
217
217
|
filterOperators: PropTypes.arrayOf(PropTypes.shape({
|
|
218
218
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
219
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
220
219
|
getValueAsString: PropTypes.func,
|
|
221
220
|
headerLabel: PropTypes.string,
|
|
222
221
|
InputComponent: PropTypes.elementType,
|
|
@@ -75,7 +75,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenu.propTypes = {
|
|
|
75
75
|
open: PropTypes.bool.isRequired,
|
|
76
76
|
operators: PropTypes.arrayOf(PropTypes.shape({
|
|
77
77
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
78
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
79
78
|
getValueAsString: PropTypes.func,
|
|
80
79
|
headerLabel: PropTypes.string,
|
|
81
80
|
InputComponent: PropTypes.elementType,
|
|
@@ -82,7 +82,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenuContainer.propTypes
|
|
|
82
82
|
}).isRequired,
|
|
83
83
|
operators: PropTypes.arrayOf(PropTypes.shape({
|
|
84
84
|
getApplyFilterFn: PropTypes.func.isRequired,
|
|
85
|
-
getApplyFilterFnV7: PropTypes.func,
|
|
86
85
|
getValueAsString: PropTypes.func,
|
|
87
86
|
headerLabel: PropTypes.string,
|
|
88
87
|
InputComponent: PropTypes.elementType,
|
|
@@ -6,8 +6,8 @@ import { GridHeaderFilterMenu } from '../components/headerFiltering/GridHeaderFi
|
|
|
6
6
|
import { GridHeaderFilterCell } from '../components/headerFiltering/GridHeaderFilterCell';
|
|
7
7
|
import materialSlots from '../material';
|
|
8
8
|
export const DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS = _extends({}, DATA_GRID_DEFAULT_SLOTS_COMPONENTS, materialSlots, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
columnMenu: GridProColumnMenu,
|
|
10
|
+
columnHeaders: GridColumnHeaders,
|
|
11
|
+
headerFilterCell: GridHeaderFilterCell,
|
|
12
|
+
headerFilterMenu: GridHeaderFilterMenu
|
|
13
13
|
});
|
|
@@ -145,11 +145,13 @@ function extractColumnWidths(apiRef, options, columns) {
|
|
|
145
145
|
if (header) {
|
|
146
146
|
const title = header.querySelector(`.${gridClasses.columnHeaderTitle}`);
|
|
147
147
|
const content = header.querySelector(`.${gridClasses.columnHeaderTitleContainerContent}`);
|
|
148
|
+
const iconContainer = header.querySelector(`.${gridClasses.iconButtonContainer}`);
|
|
149
|
+
const menuContainer = header.querySelector(`.${gridClasses.menuIcon}`);
|
|
148
150
|
const element = title ?? content;
|
|
149
151
|
const style = window.getComputedStyle(header, null);
|
|
150
152
|
const paddingWidth = parseInt(style.paddingLeft, 10) + parseInt(style.paddingRight, 10);
|
|
151
153
|
const contentWidth = element.scrollWidth + 1;
|
|
152
|
-
const width = paddingWidth +
|
|
154
|
+
const width = contentWidth + paddingWidth + (iconContainer?.clientWidth ?? 0) + (menuContainer?.clientWidth ?? 0);
|
|
153
155
|
filteredWidths.push(width);
|
|
154
156
|
}
|
|
155
157
|
}
|
package/modern/index.js
CHANGED
package/modern/material/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridPushPinRightIcon, GridPushPinLeftIcon } from './icons';
|
|
3
3
|
const iconSlots = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
columnMenuPinRightIcon: GridPushPinRightIcon,
|
|
5
|
+
columnMenuPinLeftIcon: GridPushPinLeftIcon
|
|
6
6
|
};
|
|
7
7
|
const materialSlots = _extends({}, iconSlots);
|
|
8
8
|
export default materialSlots;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY5OTU3MDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -153,16 +153,6 @@ DataGridProRaw.propTypes = {
|
|
|
153
153
|
* If defined, the grid will ignore the `hide` property in [[GridColDef]].
|
|
154
154
|
*/
|
|
155
155
|
columnVisibilityModel: _propTypes.default.object,
|
|
156
|
-
/**
|
|
157
|
-
* Overridable components.
|
|
158
|
-
* @deprecated Use the `slots` prop instead.
|
|
159
|
-
*/
|
|
160
|
-
components: _propTypes.default.object,
|
|
161
|
-
/**
|
|
162
|
-
* Overridable components props dynamically passed to the component at rendering.
|
|
163
|
-
* @deprecated Use the `slotProps` prop instead.
|
|
164
|
-
*/
|
|
165
|
-
componentsProps: _propTypes.default.object,
|
|
166
156
|
/**
|
|
167
157
|
* If above 0, the row children will be expanded up to this depth.
|
|
168
158
|
* If equal to -1, all the row children will be expanded.
|
|
@@ -31,23 +31,21 @@ const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PRO_PROPS_DEFAULT_V
|
|
|
31
31
|
getDetailPanelHeight: () => 500,
|
|
32
32
|
unstable_headerFilters: false
|
|
33
33
|
});
|
|
34
|
-
const defaultSlots =
|
|
34
|
+
const defaultSlots = _dataGridProDefaultSlotsComponents.DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS;
|
|
35
35
|
const useDataGridProProps = inProps => {
|
|
36
|
-
const
|
|
36
|
+
const themedProps = (0, _internals.useProps)((0, _styles.useThemeProps)({
|
|
37
37
|
props: inProps,
|
|
38
38
|
name: 'MuiDataGrid'
|
|
39
39
|
}));
|
|
40
40
|
const localeText = React.useMemo(() => (0, _extends2.default)({}, _xDataGrid.GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
41
41
|
const slots = React.useMemo(() => (0, _internals.computeSlots)({
|
|
42
42
|
defaultSlots,
|
|
43
|
-
slots: themedProps.slots
|
|
44
|
-
|
|
45
|
-
}), [components, themedProps.slots]);
|
|
43
|
+
slots: themedProps.slots
|
|
44
|
+
}), [themedProps.slots]);
|
|
46
45
|
return React.useMemo(() => (0, _extends2.default)({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
47
46
|
localeText,
|
|
48
47
|
slots,
|
|
49
|
-
slotProps: themedProps.slotProps ?? componentsProps,
|
|
50
48
|
signature: 'DataGridPro'
|
|
51
|
-
}), [themedProps, localeText, slots
|
|
49
|
+
}), [themedProps, localeText, slots]);
|
|
52
50
|
};
|
|
53
51
|
exports.useDataGridProProps = useDataGridProProps;
|
|
@@ -224,7 +224,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterCell.propTypes = {
|
|
|
224
224
|
colIndex: _propTypes.default.number.isRequired,
|
|
225
225
|
filterOperators: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
226
226
|
getApplyFilterFn: _propTypes.default.func.isRequired,
|
|
227
|
-
getApplyFilterFnV7: _propTypes.default.func,
|
|
228
227
|
getValueAsString: _propTypes.default.func,
|
|
229
228
|
headerLabel: _propTypes.default.string,
|
|
230
229
|
InputComponent: _propTypes.default.elementType,
|
|
@@ -84,7 +84,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenu.propTypes = {
|
|
|
84
84
|
open: _propTypes.default.bool.isRequired,
|
|
85
85
|
operators: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
86
86
|
getApplyFilterFn: _propTypes.default.func.isRequired,
|
|
87
|
-
getApplyFilterFnV7: _propTypes.default.func,
|
|
88
87
|
getValueAsString: _propTypes.default.func,
|
|
89
88
|
headerLabel: _propTypes.default.string,
|
|
90
89
|
InputComponent: _propTypes.default.elementType,
|
|
@@ -90,7 +90,6 @@ process.env.NODE_ENV !== "production" ? GridHeaderFilterMenuContainer.propTypes
|
|
|
90
90
|
}).isRequired,
|
|
91
91
|
operators: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
92
92
|
getApplyFilterFn: _propTypes.default.func.isRequired,
|
|
93
|
-
getApplyFilterFnV7: _propTypes.default.func,
|
|
94
93
|
getValueAsString: _propTypes.default.func,
|
|
95
94
|
headerLabel: _propTypes.default.string,
|
|
96
95
|
InputComponent: _propTypes.default.elementType,
|
|
@@ -13,8 +13,8 @@ var _GridHeaderFilterMenu = require("../components/headerFiltering/GridHeaderFil
|
|
|
13
13
|
var _GridHeaderFilterCell = require("../components/headerFiltering/GridHeaderFilterCell");
|
|
14
14
|
var _material = _interopRequireDefault(require("../material"));
|
|
15
15
|
const DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS = exports.DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS = (0, _extends2.default)({}, _internals.DATA_GRID_DEFAULT_SLOTS_COMPONENTS, _material.default, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
columnMenu: _GridProColumnMenu.GridProColumnMenu,
|
|
17
|
+
columnHeaders: _GridColumnHeaders.GridColumnHeaders,
|
|
18
|
+
headerFilterCell: _GridHeaderFilterCell.GridHeaderFilterCell,
|
|
19
|
+
headerFilterMenu: _GridHeaderFilterMenu.GridHeaderFilterMenu
|
|
20
20
|
});
|
|
@@ -154,11 +154,13 @@ function extractColumnWidths(apiRef, options, columns) {
|
|
|
154
154
|
if (header) {
|
|
155
155
|
const title = header.querySelector(`.${_xDataGrid.gridClasses.columnHeaderTitle}`);
|
|
156
156
|
const content = header.querySelector(`.${_xDataGrid.gridClasses.columnHeaderTitleContainerContent}`);
|
|
157
|
+
const iconContainer = header.querySelector(`.${_xDataGrid.gridClasses.iconButtonContainer}`);
|
|
158
|
+
const menuContainer = header.querySelector(`.${_xDataGrid.gridClasses.menuIcon}`);
|
|
157
159
|
const element = title ?? content;
|
|
158
160
|
const style = window.getComputedStyle(header, null);
|
|
159
161
|
const paddingWidth = parseInt(style.paddingLeft, 10) + parseInt(style.paddingRight, 10);
|
|
160
162
|
const contentWidth = element.scrollWidth + 1;
|
|
161
|
-
const width = paddingWidth +
|
|
163
|
+
const width = contentWidth + paddingWidth + (iconContainer?.clientWidth ?? 0) + (menuContainer?.clientWidth ?? 0);
|
|
162
164
|
filteredWidths.push(width);
|
|
163
165
|
}
|
|
164
166
|
}
|
package/node/index.js
CHANGED
package/node/material/index.js
CHANGED
|
@@ -8,8 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _icons = require("./icons");
|
|
10
10
|
const iconSlots = {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
columnMenuPinRightIcon: _icons.GridPushPinRightIcon,
|
|
12
|
+
columnMenuPinLeftIcon: _icons.GridPushPinLeftIcon
|
|
13
13
|
};
|
|
14
14
|
const materialSlots = (0, _extends2.default)({}, iconSlots);
|
|
15
15
|
var _default = exports.default = materialSlots;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getReleaseInfo = void 0;
|
|
7
7
|
var _utils = require("@mui/utils");
|
|
8
8
|
const getReleaseInfo = () => {
|
|
9
|
-
const releaseInfo = "
|
|
9
|
+
const releaseInfo = "MTY5OTU3MDgwMDAwMA==";
|
|
10
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
11
|
// A simple hack to set the value in the test environment (has no build step).
|
|
12
12
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-pro",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.0",
|
|
4
4
|
"description": "The Pro plan edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.23.2",
|
|
35
35
|
"@mui/utils": "^5.14.16",
|
|
36
|
-
"@mui/x-data-grid": "
|
|
37
|
-
"@mui/x-license-pro": "
|
|
36
|
+
"@mui/x-data-grid": "7.0.0-alpha.0",
|
|
37
|
+
"@mui/x-license-pro": "7.0.0-alpha.0",
|
|
38
38
|
"@types/format-util": "^1.0.3",
|
|
39
39
|
"clsx": "^2.0.0",
|
|
40
40
|
"prop-types": "^15.8.1",
|
package/utils/releaseInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTY5OTU3MDgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|