@mui/x-data-grid 6.0.0-alpha.14 → 6.0.0-alpha.15
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 +157 -0
- package/DataGrid/DataGrid.js +7 -18
- package/DataGrid/useDataGridProps.js +1 -1
- package/components/GridAutoSizer.d.ts +1 -1
- package/components/GridAutoSizer.js +6 -19
- package/components/GridScrollArea.js +1 -1
- package/components/base/GridBody.js +4 -16
- package/components/cell/GridCell.js +0 -5
- package/components/columnHeaders/GridColumnHeaders.js +2 -4
- package/components/panel/filterPanel/GridFilterForm.d.ts +7 -7
- package/components/panel/filterPanel/GridFilterForm.js +33 -33
- package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterPanel.js +14 -14
- package/components/virtualization/GridVirtualScroller.js +1 -0
- package/constants/gridClasses.d.ts +1 -1
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +11 -10
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +2 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -2
- package/hooks/features/columns/gridColumnsUtils.js +1 -13
- package/hooks/features/columns/useGridColumns.d.ts +2 -2
- package/hooks/features/columns/useGridColumns.js +15 -11
- package/hooks/features/density/useGridDensity.d.ts +2 -2
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/hooks/features/editing/useGridRowEditing.js +8 -3
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/events/useGridEvents.js +0 -2
- package/hooks/features/export/useGridPrintExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.js +8 -11
- package/hooks/features/filter/gridFilterState.js +3 -3
- package/hooks/features/filter/gridFilterUtils.js +5 -5
- package/hooks/features/filter/useGridFilter.js +4 -4
- package/hooks/features/index.d.ts +0 -1
- package/hooks/features/index.js +0 -1
- package/index.js +3 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +2 -1
- package/legacy/DataGrid/DataGrid.js +7 -18
- package/legacy/DataGrid/useDataGridProps.js +1 -1
- package/legacy/components/GridAutoSizer.js +6 -19
- package/legacy/components/GridScrollArea.js +1 -1
- package/legacy/components/base/GridBody.js +4 -16
- package/legacy/components/cell/GridCell.js +0 -5
- package/legacy/components/columnHeaders/GridColumnHeaders.js +2 -4
- package/legacy/components/panel/filterPanel/GridFilterForm.js +35 -35
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +15 -15
- package/legacy/components/virtualization/GridVirtualScroller.js +1 -0
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +1 -1
- package/legacy/hooks/features/clipboard/useGridClipboard.js +10 -10
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +2 -2
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/legacy/hooks/features/columns/gridColumnsUtils.js +35 -51
- package/legacy/hooks/features/columns/useGridColumns.js +16 -14
- package/legacy/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/legacy/hooks/features/editing/useGridRowEditing.js +10 -3
- package/legacy/hooks/features/events/useGridEvents.js +0 -2
- package/legacy/hooks/features/export/useGridPrintExport.js +8 -11
- package/legacy/hooks/features/filter/gridFilterState.js +3 -3
- package/legacy/hooks/features/filter/gridFilterUtils.js +5 -5
- package/legacy/hooks/features/filter/useGridFilter.js +4 -4
- package/legacy/hooks/features/index.js +0 -1
- package/legacy/index.js +3 -1
- package/legacy/internals/index.js +2 -1
- package/legacy/locales/arSD.js +1 -1
- package/legacy/locales/bgBG.js +1 -1
- package/legacy/locales/csCZ.js +1 -1
- package/legacy/locales/daDK.js +1 -1
- package/legacy/locales/deDE.js +1 -1
- package/legacy/locales/elGR.js +1 -1
- package/legacy/locales/esES.js +26 -35
- package/legacy/locales/faIR.js +1 -1
- package/legacy/locales/fiFI.js +1 -1
- package/legacy/locales/frFR.js +1 -1
- package/legacy/locales/heIL.js +1 -1
- package/legacy/locales/huHU.js +1 -1
- package/legacy/locales/itIT.js +1 -1
- package/legacy/locales/jaJP.js +1 -1
- package/legacy/locales/koKR.js +1 -1
- package/legacy/locales/nbNO.js +1 -1
- package/legacy/locales/nlNL.js +1 -1
- package/legacy/locales/plPL.js +1 -1
- package/legacy/locales/ptBR.js +1 -1
- package/legacy/locales/roRO.js +1 -1
- package/legacy/locales/ruRU.js +1 -1
- package/legacy/locales/skSK.js +1 -1
- package/legacy/locales/svSE.js +1 -1
- package/legacy/locales/trTR.js +1 -1
- package/legacy/locales/ukUA.js +1 -1
- package/legacy/locales/viVN.js +1 -1
- package/legacy/locales/zhCN.js +1 -1
- package/legacy/locales/zhTW.js +1 -1
- package/legacy/models/gridFilterItem.js +6 -6
- package/legacy/utils/utils.js +1 -1
- package/locales/arSD.js +1 -1
- package/locales/bgBG.js +1 -1
- package/locales/csCZ.js +1 -1
- package/locales/daDK.js +1 -1
- package/locales/deDE.js +1 -1
- package/locales/elGR.js +1 -1
- package/locales/esES.js +26 -35
- package/locales/faIR.js +1 -1
- package/locales/fiFI.js +1 -1
- package/locales/frFR.js +1 -1
- package/locales/heIL.js +1 -1
- package/locales/huHU.js +1 -1
- package/locales/itIT.js +1 -1
- package/locales/jaJP.js +1 -1
- package/locales/koKR.js +1 -1
- package/locales/nbNO.js +1 -1
- package/locales/nlNL.js +1 -1
- package/locales/plPL.js +1 -1
- package/locales/ptBR.js +1 -1
- package/locales/roRO.js +1 -1
- package/locales/ruRU.js +1 -1
- package/locales/skSK.js +1 -1
- package/locales/svSE.js +1 -1
- package/locales/trTR.js +1 -1
- package/locales/ukUA.js +1 -1
- package/locales/viVN.js +1 -1
- package/locales/zhCN.js +1 -1
- package/locales/zhTW.js +1 -1
- package/models/api/gridClipboardApi.d.ts +1 -2
- package/models/api/gridColumnApi.d.ts +6 -0
- package/models/api/gridFilterApi.d.ts +4 -4
- package/models/api/gridLocaleTextApi.d.ts +1 -1
- package/models/api/gridParamsApi.d.ts +1 -1
- package/models/events/gridEventLookup.d.ts +9 -0
- package/models/gridFilterItem.d.ts +2 -2
- package/models/gridFilterItem.js +6 -6
- package/models/gridFilterModel.d.ts +9 -9
- package/models/params/gridColumnOrderChangeParams.d.ts +2 -10
- package/models/props/DataGridProps.d.ts +3 -15
- package/modern/DataGrid/DataGrid.js +7 -18
- package/modern/DataGrid/useDataGridProps.js +1 -1
- package/modern/components/GridAutoSizer.js +6 -19
- package/modern/components/GridScrollArea.js +1 -1
- package/modern/components/base/GridBody.js +4 -16
- package/modern/components/cell/GridCell.js +0 -5
- package/modern/components/columnHeaders/GridColumnHeaders.js +2 -4
- package/modern/components/panel/filterPanel/GridFilterForm.js +33 -33
- package/modern/components/panel/filterPanel/GridFilterPanel.js +14 -14
- package/modern/components/virtualization/GridVirtualScroller.js +1 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +11 -10
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +2 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/modern/hooks/features/columns/gridColumnsUtils.js +1 -13
- package/modern/hooks/features/columns/useGridColumns.js +15 -11
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +8 -3
- package/modern/hooks/features/events/useGridEvents.js +0 -2
- package/modern/hooks/features/export/useGridPrintExport.js +8 -11
- package/modern/hooks/features/filter/gridFilterState.js +3 -3
- package/modern/hooks/features/filter/gridFilterUtils.js +4 -4
- package/modern/hooks/features/filter/useGridFilter.js +4 -4
- package/modern/hooks/features/index.js +0 -1
- package/modern/index.js +3 -1
- package/modern/internals/index.js +2 -1
- package/modern/locales/arSD.js +1 -1
- package/modern/locales/bgBG.js +1 -1
- package/modern/locales/csCZ.js +1 -1
- package/modern/locales/daDK.js +1 -1
- package/modern/locales/deDE.js +1 -1
- package/modern/locales/elGR.js +1 -1
- package/modern/locales/esES.js +26 -35
- package/modern/locales/faIR.js +1 -1
- package/modern/locales/fiFI.js +1 -1
- package/modern/locales/frFR.js +1 -1
- package/modern/locales/heIL.js +1 -1
- package/modern/locales/huHU.js +1 -1
- package/modern/locales/itIT.js +1 -1
- package/modern/locales/jaJP.js +1 -1
- package/modern/locales/koKR.js +1 -1
- package/modern/locales/nbNO.js +1 -1
- package/modern/locales/nlNL.js +1 -1
- package/modern/locales/plPL.js +1 -1
- package/modern/locales/ptBR.js +1 -1
- package/modern/locales/roRO.js +1 -1
- package/modern/locales/ruRU.js +1 -1
- package/modern/locales/skSK.js +1 -1
- package/modern/locales/svSE.js +1 -1
- package/modern/locales/trTR.js +1 -1
- package/modern/locales/ukUA.js +1 -1
- package/modern/locales/viVN.js +1 -1
- package/modern/locales/zhCN.js +1 -1
- package/modern/locales/zhTW.js +1 -1
- package/modern/models/gridFilterItem.js +6 -6
- package/modern/utils/utils.js +1 -1
- package/node/DataGrid/DataGrid.js +7 -18
- package/node/DataGrid/useDataGridProps.js +1 -1
- package/node/components/GridAutoSizer.js +6 -19
- package/node/components/GridScrollArea.js +1 -1
- package/node/components/base/GridBody.js +4 -16
- package/node/components/cell/GridCell.js +0 -5
- package/node/components/columnHeaders/GridColumnHeaders.js +2 -4
- package/node/components/panel/filterPanel/GridFilterForm.js +32 -32
- package/node/components/panel/filterPanel/GridFilterPanel.js +13 -13
- package/node/components/virtualization/GridVirtualScroller.js +1 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +11 -10
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +2 -2
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/node/hooks/features/columns/gridColumnsUtils.js +1 -14
- package/node/hooks/features/columns/useGridColumns.js +14 -10
- package/node/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +8 -3
- package/node/hooks/features/events/useGridEvents.js +0 -2
- package/node/hooks/features/export/useGridPrintExport.js +8 -11
- package/node/hooks/features/filter/gridFilterState.js +2 -2
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/filter/useGridFilter.js +4 -4
- package/node/hooks/features/index.js +0 -11
- package/node/index.js +3 -1
- package/node/internals/index.js +13 -0
- package/node/locales/arSD.js +1 -1
- package/node/locales/bgBG.js +1 -1
- package/node/locales/csCZ.js +1 -1
- package/node/locales/daDK.js +1 -1
- package/node/locales/deDE.js +1 -1
- package/node/locales/elGR.js +1 -1
- package/node/locales/esES.js +26 -35
- package/node/locales/faIR.js +1 -1
- package/node/locales/fiFI.js +1 -1
- package/node/locales/frFR.js +1 -1
- package/node/locales/heIL.js +1 -1
- package/node/locales/huHU.js +1 -1
- package/node/locales/itIT.js +1 -1
- package/node/locales/jaJP.js +1 -1
- package/node/locales/koKR.js +1 -1
- package/node/locales/nbNO.js +1 -1
- package/node/locales/nlNL.js +1 -1
- package/node/locales/plPL.js +1 -1
- package/node/locales/ptBR.js +1 -1
- package/node/locales/roRO.js +1 -1
- package/node/locales/ruRU.js +1 -1
- package/node/locales/skSK.js +1 -1
- package/node/locales/svSE.js +1 -1
- package/node/locales/trTR.js +1 -1
- package/node/locales/ukUA.js +1 -1
- package/node/locales/viVN.js +1 -1
- package/node/locales/zhCN.js +1 -1
- package/node/locales/zhTW.js +1 -1
- package/node/models/gridFilterItem.js +7 -7
- package/node/utils/utils.js +1 -1
- package/package.json +1 -1
- package/utils/utils.d.ts +1 -1
- package/utils/utils.js +1 -1
- package/hooks/features/editing/index.d.ts +0 -1
- package/hooks/features/editing/index.js +0 -1
- package/legacy/hooks/features/editing/index.js +0 -1
- package/modern/hooks/features/editing/index.js +0 -1
- package/node/hooks/features/editing/index.js +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,163 @@
|
|
|
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-alpha.15
|
|
7
|
+
|
|
8
|
+
_Jan 13, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Support components and slots for new pickers (#7390) @alexfauquette
|
|
13
|
+
- ✨ Update `onColumnOrderChange` behavior to match `onRowsOrderChange` (#7385) @DanailH
|
|
14
|
+
- 🌍 Improve Spanish (es-ES) and Belarusian (be-BY) locales
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
### `@mui/x-data-grid@v6.0.0-alpha.15` / `@mui/x-data-grid-pro@6.0.0-alpha.15` / `@mui/x-data-grid-premium@6.0.0-alpha.15`
|
|
19
|
+
|
|
20
|
+
#### Breaking changes
|
|
21
|
+
|
|
22
|
+
- Remove the `onCellFocusOut` prop (#6302) @cherniavskii
|
|
23
|
+
|
|
24
|
+
The `onCellFocusOut` prop was removed. Use `componentsProps.cell.onBlur` instead:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<DataGrid
|
|
28
|
+
componentsProps={{
|
|
29
|
+
cell: {
|
|
30
|
+
onBlur: (event) => {
|
|
31
|
+
const cellElement = event.currentTarget;
|
|
32
|
+
const field = cellElement.getAttribute('data-field');
|
|
33
|
+
const rowId = cell.parentElement.getAttribute('data-id');
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- [DataGrid] Stop exporting editing selector (#7456) @m4theushw
|
|
41
|
+
|
|
42
|
+
The `gridEditRowsStateSelector` selector was removed.
|
|
43
|
+
|
|
44
|
+
- [DataGrid] Rework column headers and virtual scroller positioning (#7001) @cherniavskii
|
|
45
|
+
|
|
46
|
+
The `headerHeight` prop was renamed to `columnHeaderHeight`.
|
|
47
|
+
|
|
48
|
+
- [DataGrid] Remove the `columnTypes` prop (#7309) @cherniavskii
|
|
49
|
+
|
|
50
|
+
The `columnTypes` prop was removed. For custom column types see [Custom column types](https://mui.com/x/react-data-grid/column-definition/#custom-column-types) docs.
|
|
51
|
+
|
|
52
|
+
- [DataGrid] Rename `linkOperators` to `logicOperators` (#7310) @cherniavskii
|
|
53
|
+
|
|
54
|
+
The `apiRef.current.setFilterLinkOperator` method was renamed to `apiRef.current.setFilterLogicOperator`.
|
|
55
|
+
The `GridLinkOperator` enum was renamed to `GridLogicOperator`.
|
|
56
|
+
The `GridFilterModel['linkOperator']` was renamed to `GridFilterModel['logicOperator']`.
|
|
57
|
+
The `linkOperators` prop of `GridFilterForm` and `GridFilterPanel` components was renamed to `logicOperators`.
|
|
58
|
+
The `linkOperatorInputProps` prop of `GridFilterForm` component was renamed to `logicOperatorInputProps`.
|
|
59
|
+
The `filterFormProps.linkOperatorInputProps` prop in `GridFilterForm` component was renamed to `filterFormProps.logicOperatorInputProps`.
|
|
60
|
+
The `GridLocaleText['filterPanelLinkOperator']` property was renamed to `GridLocaleText['filterPanelLogicOperator']`.
|
|
61
|
+
The `.MuiDataGrid-filterFormLinkOperatorInput`CSS class was renamed to `.MuiDataGrid-filterFormLogicOperatorInput`.
|
|
62
|
+
|
|
63
|
+
- [DataGrid] Remove `Alt+C` keyboard shortcut (#7466) @MBilalShafi
|
|
64
|
+
|
|
65
|
+
<kbd>Alt</kbd> (or <kbd>⌥ Option</kbd>) + <kbd>C</kbd> keyboard shortcut is no longer supported.
|
|
66
|
+
|
|
67
|
+
#### Changes
|
|
68
|
+
|
|
69
|
+
- [DataGrid] Fix <kbd>Tab</kbd> between portaled and non-portaled edit components (#7098) @m4theushw
|
|
70
|
+
- [DataGrid] Remove the `columnTypes` prop (#7309) @cherniavskii
|
|
71
|
+
- [DataGrid] Remove the `onCellFocusOut` prop (#6302) @cherniavskii
|
|
72
|
+
- [DataGrid] Rename `linkOperators` to `logicOperators` (#7310) @cherniavskii
|
|
73
|
+
- [DataGrid] Rework column headers and virtual scroller positioning (#7001) @cherniavskii
|
|
74
|
+
- [DataGrid] Stop exporting editing selector (#7456) @m4theushw
|
|
75
|
+
- [DataGrid] Update `onColumnOrderChange` behavior to match `onRowsOrderChange` (#7385) @DanailH
|
|
76
|
+
- [DataGrid] Improve Spanish (es-ES) locale (#7447) @Anderssxn
|
|
77
|
+
- [DataGrid] Remove Alt+C keyboard shortcut (#7466) @MBilalShafi
|
|
78
|
+
- [DataGridPremium] Fix Excel export not working with date strings (#7396) @cherniavskii
|
|
79
|
+
|
|
80
|
+
### `@mui/x-date-pickers@6.0.0-alpha.15` / `@mui/x-date-pickers-pro@6.0.0-alpha.15`
|
|
81
|
+
|
|
82
|
+
#### Breaking changes
|
|
83
|
+
|
|
84
|
+
- [pickers] Stop using the `WrapperVariantContext` in `MonthCalendar` and `YearCalendar` (#7382) @flaviendelangle
|
|
85
|
+
|
|
86
|
+
The `modeMobile` and `modeDesktop` classes have been removed from the `PickersMonth` and `PickersYear` internal components.
|
|
87
|
+
|
|
88
|
+
If you were using those classes on responsive components,
|
|
89
|
+
you can import `DEFAULT_DESKTOP_MODE_MEDIA_QUERY` from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro` (or use your custom media query if any):
|
|
90
|
+
|
|
91
|
+
```diff
|
|
92
|
+
<GlobalStyles
|
|
93
|
+
styles={{
|
|
94
|
+
- [`.${pickersYearClasses.modeDesktop}`]: {
|
|
95
|
+
- backgroundColor: 'red'
|
|
96
|
+
- }
|
|
97
|
+
+ [DEFAULT_DESKTOP_MODE_MEDIA_QUERY]: {
|
|
98
|
+
+ [`.${pickersYearClasses.root}`]: {
|
|
99
|
+
+ backgroundColor: 'red'
|
|
100
|
+
+ }
|
|
101
|
+
+ }
|
|
102
|
+
- [`.${pickersYearClasses.modeMobile}`]: {
|
|
103
|
+
- backgroundColor: 'red'
|
|
104
|
+
- }
|
|
105
|
+
+ [DEFAULT_DESKTOP_MODE_MEDIA_QUERY.replace('@media', '@media not')]: {
|
|
106
|
+
+ [`.${pickersYearClasses.root}`]: {
|
|
107
|
+
+ backgroundColor: 'red'
|
|
108
|
+
+ }
|
|
109
|
+
+ }
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Works exactly the same way for `PickersMonth`.
|
|
115
|
+
|
|
116
|
+
- [pickers] Refactor `shouldDisableTime` (#7299) @LukasTy
|
|
117
|
+
|
|
118
|
+
The `shouldDisableTime` prop signature has been changed. Either rename the prop usage to `shouldDisableClock` or refactor usage.
|
|
119
|
+
|
|
120
|
+
```diff
|
|
121
|
+
<DateTimePicker
|
|
122
|
+
- shouldDisableTime={(timeValue, view) => view === 'hours' && timeValue < 12}
|
|
123
|
+
+ shouldDisableClock={(timeValue, view) => view === 'hours' && timeValue < 12}
|
|
124
|
+
/>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```diff
|
|
128
|
+
<DateTimePicker
|
|
129
|
+
- shouldDisableTime={(timeValue, view) => view === 'hours' && timeValue < 12}
|
|
130
|
+
+ shouldDisableTime={(time, view) => view === 'hours' && value.hour() < 12}
|
|
131
|
+
/>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Changes
|
|
135
|
+
|
|
136
|
+
- [fields] Fix Android editing (#7444) @flaviendelangle
|
|
137
|
+
- [pickers] Add Belarusian (be-BY) locale (#7395) @volhalink
|
|
138
|
+
- [pickers] Hide am/pm controls when their is no hour view (#7380) @flaviendelangle
|
|
139
|
+
- [pickers] Hide the tabs by default on `DesktopNextDateTimePicker` (#7503) @flaviendelangle
|
|
140
|
+
- [pickers] Refactor `shouldDisableTime` (#7299) @LukasTy
|
|
141
|
+
- [pickers] Remove `WrapperVariantContext` from `DateTimePickerTabs` (#7374) @LukasTy
|
|
142
|
+
- [pickers] Stop using the `WrapperVariantContext` in `MonthCalendar` and `YearCalendar` (#7382) @flaviendelangle
|
|
143
|
+
- [pickers] Support `components` and `slots` for new pickers (#7390) @alexfauquette
|
|
144
|
+
- [pickers] Replace `slotsProps` by `slotProps` (#7528) @alexfauquette
|
|
145
|
+
|
|
146
|
+
### Docs
|
|
147
|
+
|
|
148
|
+
- [docs] Fix codesandboxes using `DemoContainer` (#7388) @LukasTy
|
|
149
|
+
- [docs] Fix wrong reference to currentView (#7441) @oliviertassinari
|
|
150
|
+
- [docs] New page for `DateRangeCalendar` (#7378) @flaviendelangle
|
|
151
|
+
- [docs] Update the migration guide with the breaking changes between the legacy and the new pickers (#7345) @flaviendelangle
|
|
152
|
+
- [docs] Use new pickers on "Custom components" demos (#7194) @flaviendelangle
|
|
153
|
+
|
|
154
|
+
### Core
|
|
155
|
+
|
|
156
|
+
- [core] Handle selection edge case (#7350) @oliviertassinari
|
|
157
|
+
- [core] Improve license message @oliviertassinari
|
|
158
|
+
- [pickers] Move default `closeOnSelect` to prop definition (#7459) @flaviendelangle
|
|
159
|
+
- [core] Move interfaces of UI views to dedicated files (#7458) @flaviendelangle
|
|
160
|
+
- [core] Update package used to import LicenseInfo (#7442) @oliviertassinari
|
|
161
|
+
- [test] Add a few inheritComponent (#7352) @oliviertassinari
|
|
162
|
+
|
|
6
163
|
## 6.0.0-alpha.14
|
|
7
164
|
|
|
8
165
|
_Jan 5, 2023_
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -78,6 +78,11 @@ DataGridRaw.propTypes = {
|
|
|
78
78
|
*/
|
|
79
79
|
columnBuffer: PropTypes.number,
|
|
80
80
|
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
|
|
81
|
+
/**
|
|
82
|
+
* Sets the height in pixel of the column headers in the grid.
|
|
83
|
+
* @default 56
|
|
84
|
+
*/
|
|
85
|
+
columnHeaderHeight: PropTypes.number,
|
|
81
86
|
/**
|
|
82
87
|
* Set of columns of type [[GridColDef[]]].
|
|
83
88
|
*/
|
|
@@ -93,10 +98,6 @@ DataGridRaw.propTypes = {
|
|
|
93
98
|
* @default 3
|
|
94
99
|
*/
|
|
95
100
|
columnThreshold: PropTypes.number,
|
|
96
|
-
/**
|
|
97
|
-
* Extend native column types with your new column types.
|
|
98
|
-
*/
|
|
99
|
-
columnTypes: PropTypes.object,
|
|
100
101
|
/**
|
|
101
102
|
* Set the column visibility model of the grid.
|
|
102
103
|
* If defined, the grid will ignore the `hide` property in [[GridColDef]].
|
|
@@ -183,7 +184,7 @@ DataGridRaw.propTypes = {
|
|
|
183
184
|
operator: PropTypes.string.isRequired,
|
|
184
185
|
value: PropTypes.any
|
|
185
186
|
})).isRequired,
|
|
186
|
-
|
|
187
|
+
logicOperator: PropTypes.oneOf(['and', 'or']),
|
|
187
188
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
188
189
|
quickFilterValues: PropTypes.array
|
|
189
190
|
}),
|
|
@@ -229,11 +230,6 @@ DataGridRaw.propTypes = {
|
|
|
229
230
|
* @returns {GridRowSpacing} The row spacing values.
|
|
230
231
|
*/
|
|
231
232
|
getRowSpacing: PropTypes.func,
|
|
232
|
-
/**
|
|
233
|
-
* Set the height in pixel of the column headers in the grid.
|
|
234
|
-
* @default 56
|
|
235
|
-
*/
|
|
236
|
-
headerHeight: PropTypes.number,
|
|
237
233
|
/**
|
|
238
234
|
* If `true`, the footer component is hidden.
|
|
239
235
|
* @default false
|
|
@@ -328,13 +324,6 @@ DataGridRaw.propTypes = {
|
|
|
328
324
|
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
329
325
|
*/
|
|
330
326
|
onCellEditStop: PropTypes.func,
|
|
331
|
-
/**
|
|
332
|
-
* Callback fired when a cell loses focus.
|
|
333
|
-
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
334
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event object.
|
|
335
|
-
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
336
|
-
*/
|
|
337
|
-
onCellFocusOut: PropTypes.func,
|
|
338
327
|
/**
|
|
339
328
|
* Callback fired when a keydown event comes from a cell element.
|
|
340
329
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -570,7 +559,7 @@ DataGridRaw.propTypes = {
|
|
|
570
559
|
*/
|
|
571
560
|
rowCount: PropTypes.number,
|
|
572
561
|
/**
|
|
573
|
-
*
|
|
562
|
+
* Sets the height in pixel of a row in the grid.
|
|
574
563
|
* @default 52
|
|
575
564
|
*/
|
|
576
565
|
rowHeight: PropTypes.number,
|
|
@@ -44,7 +44,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
44
44
|
disableVirtualization: false,
|
|
45
45
|
editMode: GridEditModes.Cell,
|
|
46
46
|
filterMode: 'client',
|
|
47
|
-
|
|
47
|
+
columnHeaderHeight: 56,
|
|
48
48
|
hideFooter: false,
|
|
49
49
|
hideFooterPagination: false,
|
|
50
50
|
hideFooterRowCount: false,
|
|
@@ -9,7 +9,7 @@ export interface AutoSizerProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
9
9
|
* @param {AutoSizerSize} size The grid's size.
|
|
10
10
|
* @returns {React.ReactNode} The children to render.
|
|
11
11
|
*/
|
|
12
|
-
children:
|
|
12
|
+
children: React.ReactNode;
|
|
13
13
|
/**
|
|
14
14
|
* Default height to use for initial render; useful for SSR.
|
|
15
15
|
* @default null
|
|
@@ -68,28 +68,15 @@ const GridAutoSizer = /*#__PURE__*/React.forwardRef(function AutoSizer(props, re
|
|
|
68
68
|
detectElementResize.removeResizeListener(parentElement.current, handleResize);
|
|
69
69
|
};
|
|
70
70
|
}, [nonce, handleResize]);
|
|
71
|
-
|
|
72
|
-
// Outer div should not force width/height since that may prevent containers from shrinking.
|
|
73
|
-
// Inner component should overflow and use calculated width/height.
|
|
74
|
-
// See issue #68 for more information.
|
|
75
|
-
const outerStyle = {
|
|
76
|
-
overflow: 'visible'
|
|
77
|
-
};
|
|
78
|
-
const childParams = {};
|
|
79
|
-
if (!disableHeight) {
|
|
80
|
-
outerStyle.height = 0;
|
|
81
|
-
childParams.height = state.height;
|
|
82
|
-
}
|
|
83
|
-
if (!disableWidth) {
|
|
84
|
-
outerStyle.width = 0;
|
|
85
|
-
childParams.width = state.width;
|
|
86
|
-
}
|
|
87
71
|
const handleRef = useForkRef(rootRef, ref);
|
|
88
72
|
return /*#__PURE__*/_jsx("div", _extends({
|
|
89
73
|
ref: handleRef,
|
|
90
|
-
style: _extends({
|
|
74
|
+
style: _extends({
|
|
75
|
+
flex: disableHeight ? 0 : '1 1 0px',
|
|
76
|
+
overflow: 'auto'
|
|
77
|
+
}, style)
|
|
91
78
|
}, other, {
|
|
92
|
-
children: state.height === null && state.width === null ? null : children
|
|
79
|
+
children: state.height === null && state.width === null ? null : children
|
|
93
80
|
}));
|
|
94
81
|
});
|
|
95
82
|
process.env.NODE_ENV !== "production" ? GridAutoSizer.propTypes = {
|
|
@@ -102,7 +89,7 @@ process.env.NODE_ENV !== "production" ? GridAutoSizer.propTypes = {
|
|
|
102
89
|
* @param {AutoSizerSize} size The grid's size.
|
|
103
90
|
* @returns {React.ReactNode} The children to render.
|
|
104
91
|
*/
|
|
105
|
-
children: PropTypes.
|
|
92
|
+
children: PropTypes.node,
|
|
106
93
|
/**
|
|
107
94
|
* Default height to use for initial render; useful for SSR.
|
|
108
95
|
* @default null
|
|
@@ -62,7 +62,7 @@ function GridScrollAreaRaw(props) {
|
|
|
62
62
|
classes: rootProps.classes
|
|
63
63
|
});
|
|
64
64
|
const classes = useUtilityClasses(ownerState);
|
|
65
|
-
const headerHeight = Math.floor(rootProps.
|
|
65
|
+
const headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
|
|
66
66
|
const handleScrolling = React.useCallback(newScrollPosition => {
|
|
67
67
|
scrollPosition.current = newScrollPosition;
|
|
68
68
|
}, []);
|
|
@@ -4,7 +4,6 @@ import { useGridPrivateApiContext } from '../../hooks/utils/useGridPrivateApiCon
|
|
|
4
4
|
import { GridMainContainer } from '../containers/GridMainContainer';
|
|
5
5
|
import { GridAutoSizer } from '../GridAutoSizer';
|
|
6
6
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
7
|
-
import { getTotalHeaderHeight } from '../../hooks/features/columns/gridColumnsUtils';
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
function GridBody(props) {
|
|
@@ -15,7 +14,6 @@ function GridBody(props) {
|
|
|
15
14
|
} = props;
|
|
16
15
|
const apiRef = useGridPrivateApiContext();
|
|
17
16
|
const rootProps = useGridRootProps();
|
|
18
|
-
const totalHeaderHeight = getTotalHeaderHeight(apiRef, rootProps.headerHeight);
|
|
19
17
|
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
20
18
|
const disableVirtualization = React.useCallback(() => {
|
|
21
19
|
setIsVirtualizationDisabled(true);
|
|
@@ -54,20 +52,10 @@ function GridBody(props) {
|
|
|
54
52
|
nonce: rootProps.nonce,
|
|
55
53
|
disableHeight: rootProps.autoHeight,
|
|
56
54
|
onResize: handleResize,
|
|
57
|
-
children:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// In this case, let the container to grow whatever it needs.
|
|
62
|
-
height: size.height ? size.height - totalHeaderHeight : 'auto',
|
|
63
|
-
marginTop: totalHeaderHeight
|
|
64
|
-
};
|
|
65
|
-
return /*#__PURE__*/_jsx(VirtualScrollerComponent, {
|
|
66
|
-
ref: virtualScrollerRef,
|
|
67
|
-
style: style,
|
|
68
|
-
disableVirtualization: isVirtualizationDisabled
|
|
69
|
-
});
|
|
70
|
-
}
|
|
55
|
+
children: /*#__PURE__*/_jsx(VirtualScrollerComponent, {
|
|
56
|
+
ref: virtualScrollerRef,
|
|
57
|
+
disableVirtualization: isVirtualizationDisabled
|
|
58
|
+
})
|
|
71
59
|
}), children]
|
|
72
60
|
});
|
|
73
61
|
}
|
|
@@ -100,11 +100,6 @@ function GridCell(props) {
|
|
|
100
100
|
}
|
|
101
101
|
}, [apiRef, field, onMouseDown, rowId]);
|
|
102
102
|
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
103
|
-
// Ignore portal
|
|
104
|
-
if (!event.currentTarget.contains(event.target)) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
103
|
// The row might have been deleted during the click
|
|
109
104
|
if (!apiRef.current.getRow(rowId)) {
|
|
110
105
|
return;
|
|
@@ -25,13 +25,11 @@ const GridColumnHeadersRoot = styled('div', {
|
|
|
25
25
|
theme
|
|
26
26
|
}) => {
|
|
27
27
|
return {
|
|
28
|
-
position: '
|
|
29
|
-
top: 0,
|
|
30
|
-
left: 0,
|
|
31
|
-
right: 0,
|
|
28
|
+
position: 'relative',
|
|
32
29
|
overflow: 'hidden',
|
|
33
30
|
display: 'flex',
|
|
34
31
|
alignItems: 'center',
|
|
32
|
+
boxSizing: 'border-box',
|
|
35
33
|
borderBottom: '1px solid',
|
|
36
34
|
borderTopLeftRadius: theme.shape.borderRadius,
|
|
37
35
|
borderTopRightRadius: theme.shape.borderRadius
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { GridFilterItem,
|
|
2
|
+
import { GridFilterItem, GridLogicOperator } from '../../../models/gridFilterItem';
|
|
3
3
|
import { GridColDef, GridStateColDef } from '../../../models/colDef/gridColDef';
|
|
4
4
|
export interface FilterColumnsArgs {
|
|
5
5
|
field: GridColDef['field'];
|
|
@@ -23,7 +23,7 @@ export interface GridFilterFormProps {
|
|
|
23
23
|
/**
|
|
24
24
|
* The current logic operator applied.
|
|
25
25
|
*/
|
|
26
|
-
multiFilterOperator?:
|
|
26
|
+
multiFilterOperator?: GridLogicOperator;
|
|
27
27
|
/**
|
|
28
28
|
* If `true`, disables the logic operator field but still renders it.
|
|
29
29
|
*/
|
|
@@ -40,9 +40,9 @@ export interface GridFilterFormProps {
|
|
|
40
40
|
applyFilterChanges: (item: GridFilterItem) => void;
|
|
41
41
|
/**
|
|
42
42
|
* Callback called when the logic operator is changed.
|
|
43
|
-
* @param {
|
|
43
|
+
* @param {GridLogicOperator} operator The new logic operator.
|
|
44
44
|
*/
|
|
45
|
-
applyMultiFilterOperatorChanges: (operator:
|
|
45
|
+
applyMultiFilterOperatorChanges: (operator: GridLogicOperator) => void;
|
|
46
46
|
/**
|
|
47
47
|
* Callback called when the delete button is clicked.
|
|
48
48
|
* @param {GridFilterItem} item The deleted [[GridFilterItem]].
|
|
@@ -56,9 +56,9 @@ export interface GridFilterFormProps {
|
|
|
56
56
|
filterColumns?: (args: FilterColumnsArgs) => GridColDef['field'][];
|
|
57
57
|
/**
|
|
58
58
|
* Sets the available logic operators.
|
|
59
|
-
* @default [
|
|
59
|
+
* @default [GridLogicOperator.And, GridLogicOperator.Or]
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
logicOperators?: GridLogicOperator[];
|
|
62
62
|
/**
|
|
63
63
|
* Changes how the options in the columns selector should be ordered.
|
|
64
64
|
* If not specified, the order is derived from the `columns` prop.
|
|
@@ -73,7 +73,7 @@ export interface GridFilterFormProps {
|
|
|
73
73
|
* Props passed to the logic operator input component.
|
|
74
74
|
* @default {}
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
logicOperatorInputProps?: any;
|
|
77
77
|
/**
|
|
78
78
|
* Props passed to the operator input component.
|
|
79
79
|
* @default {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "
|
|
3
|
+
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "logicOperators", "columnsSort", "filterColumns", "deleteIconProps", "logicOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"],
|
|
4
4
|
_excluded2 = ["InputComponentProps"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -14,7 +14,7 @@ import clsx from 'clsx';
|
|
|
14
14
|
import { gridFilterableColumnDefinitionsSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
15
15
|
import { gridFilterModelSelector } from '../../../hooks/features/filter/gridFilterSelector';
|
|
16
16
|
import { useGridSelector } from '../../../hooks/utils/useGridSelector';
|
|
17
|
-
import {
|
|
17
|
+
import { GridLogicOperator } from '../../../models/gridFilterItem';
|
|
18
18
|
import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
|
|
19
19
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
20
20
|
import { getDataGridUtilityClass } from '../../../constants/gridClasses';
|
|
@@ -27,7 +27,7 @@ const useUtilityClasses = ownerState => {
|
|
|
27
27
|
const slots = {
|
|
28
28
|
root: ['filterForm'],
|
|
29
29
|
deleteIcon: ['filterFormDeleteIcon'],
|
|
30
|
-
|
|
30
|
+
logicOperatorInput: ['filterFormLogicOperatorInput'],
|
|
31
31
|
columnInput: ['filterFormColumnInput'],
|
|
32
32
|
operatorInput: ['filterFormOperatorInput'],
|
|
33
33
|
valueInput: ['filterFormValueInput']
|
|
@@ -56,10 +56,10 @@ const FilterFormDeleteIcon = styled(FormControl, {
|
|
|
56
56
|
marginRight: theme.spacing(0.5),
|
|
57
57
|
marginBottom: theme.spacing(0.2)
|
|
58
58
|
}));
|
|
59
|
-
const
|
|
59
|
+
const FilterFormLogicOperatorInput = styled(FormControl, {
|
|
60
60
|
name: 'MuiDataGrid',
|
|
61
|
-
slot: '
|
|
62
|
-
overridesResolver: (_, styles) => styles.
|
|
61
|
+
slot: 'FilterFormLogicOperatorInput',
|
|
62
|
+
overridesResolver: (_, styles) => styles.filterFormLogicOperatorInput
|
|
63
63
|
})({
|
|
64
64
|
minWidth: 55,
|
|
65
65
|
marginRight: 5,
|
|
@@ -86,14 +86,14 @@ const FilterFormValueInput = styled(FormControl, {
|
|
|
86
86
|
})({
|
|
87
87
|
width: 190
|
|
88
88
|
});
|
|
89
|
-
const
|
|
90
|
-
switch (
|
|
91
|
-
case
|
|
89
|
+
const getLogicOperatorLocaleKey = logicOperator => {
|
|
90
|
+
switch (logicOperator) {
|
|
91
|
+
case GridLogicOperator.And:
|
|
92
92
|
return 'filterPanelOperatorAnd';
|
|
93
|
-
case
|
|
93
|
+
case GridLogicOperator.Or:
|
|
94
94
|
return 'filterPanelOperatorOr';
|
|
95
95
|
default:
|
|
96
|
-
throw new Error('MUI: Invalid `
|
|
96
|
+
throw new Error('MUI: Invalid `logicOperator` property in the `GridFilterPanel`.');
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
const getColumnLabel = col => col.headerName || col.field;
|
|
@@ -110,11 +110,11 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
110
110
|
disableMultiFilterOperator,
|
|
111
111
|
applyMultiFilterOperatorChanges,
|
|
112
112
|
focusElementRef,
|
|
113
|
-
|
|
113
|
+
logicOperators = [GridLogicOperator.And, GridLogicOperator.Or],
|
|
114
114
|
columnsSort,
|
|
115
115
|
filterColumns,
|
|
116
116
|
deleteIconProps = {},
|
|
117
|
-
|
|
117
|
+
logicOperatorInputProps = {},
|
|
118
118
|
operatorInputProps = {},
|
|
119
119
|
columnInputProps = {},
|
|
120
120
|
valueInputProps = {}
|
|
@@ -134,7 +134,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
134
134
|
const classes = useUtilityClasses(ownerState);
|
|
135
135
|
const valueRef = React.useRef(null);
|
|
136
136
|
const filterSelectorRef = React.useRef(null);
|
|
137
|
-
const
|
|
137
|
+
const hasLogicOperatorColumn = hasMultipleFilters && logicOperators.length > 0;
|
|
138
138
|
const baseFormControlProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseFormControl) || {};
|
|
139
139
|
const baseSelectProps = ((_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect) || {};
|
|
140
140
|
const isBaseSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;
|
|
@@ -200,9 +200,9 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
200
200
|
value: eraseItemValue ? undefined : item.value
|
|
201
201
|
}));
|
|
202
202
|
}, [applyFilterChanges, item, currentColumn, currentOperator]);
|
|
203
|
-
const
|
|
204
|
-
const
|
|
205
|
-
applyMultiFilterOperatorChanges(
|
|
203
|
+
const changeLogicOperator = React.useCallback(event => {
|
|
204
|
+
const logicOperator = event.target.value === GridLogicOperator.And.toString() ? GridLogicOperator.And : GridLogicOperator.Or;
|
|
205
|
+
applyMultiFilterOperatorChanges(logicOperator);
|
|
206
206
|
}, [applyMultiFilterOperatorChanges]);
|
|
207
207
|
const handleDeleteFilter = () => {
|
|
208
208
|
if (rootProps.disableMultipleColumnsFiltering) {
|
|
@@ -247,28 +247,28 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
247
247
|
fontSize: "small"
|
|
248
248
|
})
|
|
249
249
|
})
|
|
250
|
-
})), /*#__PURE__*/_jsx(
|
|
250
|
+
})), /*#__PURE__*/_jsx(FilterFormLogicOperatorInput, _extends({
|
|
251
251
|
variant: "standard",
|
|
252
252
|
as: rootProps.components.BaseFormControl
|
|
253
|
-
}, baseFormControlProps,
|
|
253
|
+
}, baseFormControlProps, logicOperatorInputProps, {
|
|
254
254
|
sx: _extends({
|
|
255
|
-
display:
|
|
255
|
+
display: hasLogicOperatorColumn ? 'flex' : 'none',
|
|
256
256
|
visibility: showMultiFilterOperators ? 'visible' : 'hidden'
|
|
257
|
-
}, baseFormControlProps.sx || {},
|
|
258
|
-
className: clsx(classes.
|
|
257
|
+
}, baseFormControlProps.sx || {}, logicOperatorInputProps.sx || {}),
|
|
258
|
+
className: clsx(classes.logicOperatorInput, baseFormControlProps.className, logicOperatorInputProps.className),
|
|
259
259
|
children: /*#__PURE__*/_jsx(rootProps.components.BaseSelect, _extends({
|
|
260
260
|
inputProps: {
|
|
261
|
-
'aria-label': apiRef.current.getLocaleText('
|
|
261
|
+
'aria-label': apiRef.current.getLocaleText('filterPanelLogicOperator')
|
|
262
262
|
},
|
|
263
263
|
value: multiFilterOperator,
|
|
264
|
-
onChange:
|
|
265
|
-
disabled: !!disableMultiFilterOperator ||
|
|
264
|
+
onChange: changeLogicOperator,
|
|
265
|
+
disabled: !!disableMultiFilterOperator || logicOperators.length === 1,
|
|
266
266
|
native: isBaseSelectNative
|
|
267
267
|
}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseSelect, {
|
|
268
|
-
children:
|
|
269
|
-
value:
|
|
270
|
-
children: apiRef.current.getLocaleText(
|
|
271
|
-
},
|
|
268
|
+
children: logicOperators.map(logicOperator => /*#__PURE__*/_jsx(OptionComponent, {
|
|
269
|
+
value: logicOperator.toString(),
|
|
270
|
+
children: apiRef.current.getLocaleText(getLogicOperatorLocaleKey(logicOperator))
|
|
271
|
+
}, logicOperator.toString()))
|
|
272
272
|
}))
|
|
273
273
|
})), /*#__PURE__*/_jsxs(FilterFormColumnInput, _extends({
|
|
274
274
|
variant: "standard",
|
|
@@ -341,7 +341,7 @@ process.env.NODE_ENV !== "production" ? GridFilterForm.propTypes = {
|
|
|
341
341
|
applyFilterChanges: PropTypes.func.isRequired,
|
|
342
342
|
/**
|
|
343
343
|
* Callback called when the logic operator is changed.
|
|
344
|
-
* @param {
|
|
344
|
+
* @param {GridLogicOperator} operator The new logic operator.
|
|
345
345
|
*/
|
|
346
346
|
applyMultiFilterOperatorChanges: PropTypes.func.isRequired,
|
|
347
347
|
/**
|
|
@@ -401,12 +401,12 @@ process.env.NODE_ENV !== "production" ? GridFilterForm.propTypes = {
|
|
|
401
401
|
* Props passed to the logic operator input component.
|
|
402
402
|
* @default {}
|
|
403
403
|
*/
|
|
404
|
-
|
|
404
|
+
logicOperatorInputProps: PropTypes.any,
|
|
405
405
|
/**
|
|
406
406
|
* Sets the available logic operators.
|
|
407
|
-
* @default [
|
|
407
|
+
* @default [GridLogicOperator.And, GridLogicOperator.Or]
|
|
408
408
|
*/
|
|
409
|
-
|
|
409
|
+
logicOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),
|
|
410
410
|
/**
|
|
411
411
|
* The current logic operator applied.
|
|
412
412
|
*/
|
|
@@ -7,7 +7,7 @@ export interface GetColumnForNewFilterArgs {
|
|
|
7
7
|
currentFilters: GridFilterItem[];
|
|
8
8
|
columns: GridStateColDef[];
|
|
9
9
|
}
|
|
10
|
-
export interface GridFilterPanelProps extends Pick<GridFilterFormProps, '
|
|
10
|
+
export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOperators' | 'columnsSort'> {
|
|
11
11
|
/**
|
|
12
12
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
13
13
|
*/
|
|
@@ -21,7 +21,7 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'linkOpe
|
|
|
21
21
|
/**
|
|
22
22
|
* Props passed to each filter form.
|
|
23
23
|
*/
|
|
24
|
-
filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | '
|
|
24
|
+
filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'logicOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps'>;
|
|
25
25
|
/**
|
|
26
26
|
* @ignore - do not document.
|
|
27
27
|
*/
|