@mui/x-data-grid 7.22.1 → 7.22.3
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 +139 -0
- package/colDef/gridBooleanOperators.js +4 -6
- package/components/GridDetailPanels.js +0 -1
- package/components/GridPinnedRows.js +0 -1
- package/components/GridRow.d.ts +2 -2
- package/components/GridRow.js +1 -1
- package/components/base/GridOverlays.js +5 -6
- package/components/cell/GridCell.d.ts +41 -3
- package/components/cell/GridCell.js +1 -9
- package/components/cell/GridEditInputCell.js +0 -67
- package/components/columnsManagement/GridColumnsManagement.d.ts +2 -0
- package/components/columnsManagement/GridColumnsManagement.js +53 -6
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +14 -5
- package/components/toolbar/GridToolbar.d.ts +2 -2
- package/components/toolbar/GridToolbar.js +12 -4
- package/components/toolbar/GridToolbarExport.d.ts +2 -2
- package/components/toolbar/GridToolbarExport.js +4 -3
- package/components/toolbar/index.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +6 -0
- package/constants/gridClasses.d.ts +4 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +23 -4
- package/hooks/features/editing/useGridRowEditing.js +23 -2
- package/hooks/features/export/useGridCsvExport.js +1 -1
- package/hooks/features/export/useGridPrintExport.js +1 -1
- package/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +30 -16
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.js +1 -5
- package/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/hooks/utils/useGridSelector.d.ts +3 -2
- package/hooks/utils/useGridSelector.js +27 -2
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/locales/arSD.js +1 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +2 -0
- package/locales/csCZ.js +2 -0
- package/locales/daDK.js +2 -0
- package/locales/deDE.js +2 -0
- package/locales/elGR.js +1 -0
- package/locales/esES.js +6 -4
- package/locales/faIR.js +2 -0
- package/locales/fiFI.js +2 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +2 -0
- package/locales/hrHR.js +2 -0
- package/locales/huHU.js +2 -0
- package/locales/isIS.js +1 -0
- package/locales/itIT.js +2 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +1 -0
- package/locales/nbNO.js +2 -0
- package/locales/nlNL.js +2 -0
- package/locales/nnNO.js +2 -0
- package/locales/plPL.js +1 -0
- package/locales/ptBR.js +2 -0
- package/locales/ptPT.js +2 -0
- package/locales/roRO.js +1 -0
- package/locales/ruRU.js +2 -0
- package/locales/skSK.js +1 -0
- package/locales/svSE.js +6 -5
- package/locales/trTR.js +4 -2
- package/locales/ukUA.js +1 -0
- package/locales/urPK.js +1 -0
- package/locales/viVN.js +2 -0
- package/locales/zhCN.js +6 -4
- package/locales/zhHK.js +1 -0
- package/locales/zhTW.js +1 -0
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/colDef/gridBooleanOperators.js +4 -6
- package/modern/components/GridDetailPanels.js +0 -1
- package/modern/components/GridPinnedRows.js +0 -1
- package/modern/components/GridRow.js +1 -1
- package/modern/components/base/GridOverlays.js +5 -6
- package/modern/components/cell/GridCell.js +1 -9
- package/modern/components/cell/GridEditInputCell.js +0 -67
- package/modern/components/columnsManagement/GridColumnsManagement.js +53 -6
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +14 -5
- package/modern/components/toolbar/GridToolbar.js +12 -4
- package/modern/components/toolbar/GridToolbarExport.js +4 -3
- package/modern/components/virtualization/GridVirtualScrollbar.js +6 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +23 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +23 -2
- package/modern/hooks/features/export/useGridCsvExport.js +1 -1
- package/modern/hooks/features/export/useGridPrintExport.js +1 -1
- package/modern/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +30 -16
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -5
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/modern/hooks/utils/useGridSelector.js +27 -2
- package/modern/index.js +1 -1
- package/modern/locales/arSD.js +1 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +2 -0
- package/modern/locales/csCZ.js +2 -0
- package/modern/locales/daDK.js +2 -0
- package/modern/locales/deDE.js +2 -0
- package/modern/locales/elGR.js +1 -0
- package/modern/locales/esES.js +6 -4
- package/modern/locales/faIR.js +2 -0
- package/modern/locales/fiFI.js +2 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +2 -0
- package/modern/locales/hrHR.js +2 -0
- package/modern/locales/huHU.js +2 -0
- package/modern/locales/isIS.js +1 -0
- package/modern/locales/itIT.js +2 -0
- package/modern/locales/jaJP.js +2 -0
- package/modern/locales/koKR.js +1 -0
- package/modern/locales/nbNO.js +2 -0
- package/modern/locales/nlNL.js +2 -0
- package/modern/locales/nnNO.js +2 -0
- package/modern/locales/plPL.js +1 -0
- package/modern/locales/ptBR.js +2 -0
- package/modern/locales/ptPT.js +2 -0
- package/modern/locales/roRO.js +1 -0
- package/modern/locales/ruRU.js +2 -0
- package/modern/locales/skSK.js +1 -0
- package/modern/locales/svSE.js +6 -5
- package/modern/locales/trTR.js +4 -2
- package/modern/locales/ukUA.js +1 -0
- package/modern/locales/urPK.js +1 -0
- package/modern/locales/viVN.js +2 -0
- package/modern/locales/zhCN.js +6 -4
- package/modern/locales/zhHK.js +1 -0
- package/modern/locales/zhTW.js +1 -0
- package/modern/utils/createSelector.js +11 -1
- package/modern/utils/utils.js +1 -3
- package/node/colDef/gridBooleanOperators.js +3 -5
- package/node/components/GridDetailPanels.js +0 -1
- package/node/components/GridPinnedRows.js +0 -1
- package/node/components/GridRow.js +1 -1
- package/node/components/base/GridOverlays.js +5 -6
- package/node/components/cell/GridCell.js +1 -9
- package/node/components/cell/GridEditInputCell.js +0 -67
- package/node/components/columnsManagement/GridColumnsManagement.js +53 -6
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +16 -5
- package/node/components/toolbar/GridToolbar.js +12 -4
- package/node/components/toolbar/GridToolbarExport.js +4 -3
- package/node/components/virtualization/GridVirtualScrollbar.js +6 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -1
- package/node/hooks/features/editing/useGridCellEditing.js +23 -4
- package/node/hooks/features/editing/useGridRowEditing.js +23 -2
- package/node/hooks/features/export/useGridCsvExport.js +2 -2
- package/node/hooks/features/export/useGridPrintExport.js +2 -2
- package/node/hooks/features/pagination/useGridPaginationModel.js +2 -2
- package/node/hooks/features/rowSelection/useGridRowSelection.js +29 -15
- package/node/hooks/features/rows/gridRowsUtils.js +2 -8
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
- package/node/hooks/utils/useGridSelector.js +29 -3
- package/node/index.js +1 -1
- package/node/locales/arSD.js +1 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +2 -0
- package/node/locales/csCZ.js +2 -0
- package/node/locales/daDK.js +2 -0
- package/node/locales/deDE.js +2 -0
- package/node/locales/elGR.js +1 -0
- package/node/locales/esES.js +6 -4
- package/node/locales/faIR.js +2 -0
- package/node/locales/fiFI.js +2 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +2 -0
- package/node/locales/hrHR.js +2 -0
- package/node/locales/huHU.js +2 -0
- package/node/locales/isIS.js +1 -0
- package/node/locales/itIT.js +2 -0
- package/node/locales/jaJP.js +2 -0
- package/node/locales/koKR.js +1 -0
- package/node/locales/nbNO.js +2 -0
- package/node/locales/nlNL.js +2 -0
- package/node/locales/nnNO.js +2 -0
- package/node/locales/plPL.js +1 -0
- package/node/locales/ptBR.js +2 -0
- package/node/locales/ptPT.js +2 -0
- package/node/locales/roRO.js +1 -0
- package/node/locales/ruRU.js +2 -0
- package/node/locales/skSK.js +1 -0
- package/node/locales/svSE.js +6 -5
- package/node/locales/trTR.js +4 -2
- package/node/locales/ukUA.js +1 -0
- package/node/locales/urPK.js +1 -0
- package/node/locales/viVN.js +2 -0
- package/node/locales/zhCN.js +6 -4
- package/node/locales/zhHK.js +1 -0
- package/node/locales/zhTW.js +1 -0
- package/node/utils/createSelector.js +11 -1
- package/node/utils/utils.js +1 -3
- package/package.json +1 -1
- package/utils/createSelector.d.ts +1 -1
- package/utils/createSelector.js +11 -1
- package/utils/utils.js +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,145 @@
|
|
|
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.22.3
|
|
7
|
+
|
|
8
|
+
_Nov 21, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 📊 Charts Pro get stable. The [zoom](https://mui.com/x/react-charts/zoom-and-pan/) and [Heatmap](https://mui.com/x/react-charts/heatmap/) are now stable.
|
|
13
|
+
- 🌍 Improve Chinese, Spanish, Swedish, and Turkish locales on the Data Grid
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
17
|
+
@CarlosLopezLg, @headironc, @viktormelin, @qerkules, @DungTiger, @hendrikpeilke, @k-rajat19.
|
|
18
|
+
Following are all team members who have contributed to this release:
|
|
19
|
+
@alexfauquette, @LukasTy, @MBilalShafi, @flaviendelangle.
|
|
20
|
+
|
|
21
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@7.22.3`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Add prop to override search input props in `GridColumnsManagement` (#15476) @k-rajat19
|
|
28
|
+
- [DataGrid] Add test coverage for issues fixed in #15184 @MBilalShafi
|
|
29
|
+
- [DataGrid] Fix memoized selectors with arguments (#15336) @MBilalShafi
|
|
30
|
+
- [DataGrid] Fix right column group header border with virtualization (#15503) @hendrikpeilke
|
|
31
|
+
- [DataGrid] Pass reason to `onPaginationModelChange` (#15402) @DungTiger
|
|
32
|
+
- [DataGrid] Set default overlay height in flex parent layout (#15535) @cherniavskii
|
|
33
|
+
- [l10n] Improve Chinese (zh-CN) locale (#15365) @headironc
|
|
34
|
+
- [l10n] Improve Spanish (es-ES) locale (#15369) @CarlosLopezLg
|
|
35
|
+
- [l10n] Improve Swedish (sv-SE) locale (#15371) @viktormelin
|
|
36
|
+
- [l10n] Improve Turkish (tr-TR) locale (#15414) @qerkules
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-pro@7.22.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid@7.22.3`.
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-premium@7.22.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid-pro@7.22.3`.
|
|
45
|
+
|
|
46
|
+
### Date and Time Pickers
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers@7.22.3`
|
|
49
|
+
|
|
50
|
+
- [pickers] Always use `props.value` when it changes (#15500) @flaviendelangle
|
|
51
|
+
- [pickers] Ensure internal value timezone is updated (#15491) @LukasTy
|
|
52
|
+
- [pickers] Fix `DateTimeRangePicker` error when using format without time (#15341) @fxnoob
|
|
53
|
+
- [pickers] Fix unused code in `PickersToolbar` component (#15525) @LukasTy
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-date-pickers-pro@7.22.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
56
|
+
|
|
57
|
+
Same changes as in `@mui/x-date-pickers@7.22.3`, plus:
|
|
58
|
+
|
|
59
|
+
- [DateTimeRangePicker] Use time in `referenceDate` when selecting date (#15431) @LukasTy
|
|
60
|
+
|
|
61
|
+
### Charts
|
|
62
|
+
|
|
63
|
+
#### `@mui/x-charts@7.22.3`
|
|
64
|
+
|
|
65
|
+
No changes since `@mui/x-charts@7.22.2`.
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts-pro@7.22.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
68
|
+
|
|
69
|
+
- [charts-pro] Fix missing typeOverload (#15400) @alexfauquette
|
|
70
|
+
|
|
71
|
+
### Docs
|
|
72
|
+
|
|
73
|
+
- [docs] Add `PickersPopper` component to customization playground (#15397) @LukasTy
|
|
74
|
+
- [docs] Add `next` version links (#15423) @LukasTy
|
|
75
|
+
- [docs] Use the `loading` state in the demos (#15538) @cherniavskii
|
|
76
|
+
|
|
77
|
+
- [code-infra] Tentative fix for Argos flaky screenshot tests (#15399) @JCQuintas
|
|
78
|
+
- [docs-infra] Transpile `.ts` demo files (#15421) @KenanYusuf
|
|
79
|
+
- [core] Clarify release version bump strategy (#15536) @cherniavskii
|
|
80
|
+
|
|
81
|
+
## 7.22.2
|
|
82
|
+
|
|
83
|
+
_Nov 8, 2024_
|
|
84
|
+
|
|
85
|
+
We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
|
|
86
|
+
|
|
87
|
+
- 👨🏽💻 API enhancements
|
|
88
|
+
- 🐞 Bugfixes
|
|
89
|
+
|
|
90
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
91
|
+
@clins1994, @GuillaumeMeheut, @k-rajat19.
|
|
92
|
+
Following are all team members who have contributed to this release:
|
|
93
|
+
@LukasTy, @MBilalShafi, @KenanYusuf, @arminmeh.
|
|
94
|
+
|
|
95
|
+
### Upcoming alpha
|
|
96
|
+
|
|
97
|
+
Keep an eye out for the MUI⠀X `v8.0.0-aplha.0` release soon. It will follow a weekly release schedule as always until it is stable.
|
|
98
|
+
|
|
99
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
100
|
+
|
|
101
|
+
### Data Grid
|
|
102
|
+
|
|
103
|
+
#### `@mui/x-data-grid@7.22.2`
|
|
104
|
+
|
|
105
|
+
- [DataGrid] Fix `null` reference error in `GridVirtualScrollbar` (#15289) @MBilalShafi
|
|
106
|
+
- [DataGrid] Fix filtering with `boolean` column type (#15257) @k-rajat19
|
|
107
|
+
- [DataGrid] Improve row selection propagation trigger (#15274) @MBilalShafi
|
|
108
|
+
- [DataGrid] Preprocess edit cell props on backspace/delete (#15223) @KenanYusuf
|
|
109
|
+
- [DataGrid] Add a recipe to persist column width and order (#15309) @MBilalShafi
|
|
110
|
+
|
|
111
|
+
#### `@mui/x-data-grid-pro@7.22.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
112
|
+
|
|
113
|
+
Same changes as in `@mui/x-data-grid@7.22.2`, plus:
|
|
114
|
+
|
|
115
|
+
- [DataGridPro] Apply default properties if they are not passed in a reorder column (#15320) @k-rajat19
|
|
116
|
+
- [DataGridPro] Toggle row expansion with `Enter` key in Tree data (#15313) @k-rajat19
|
|
117
|
+
|
|
118
|
+
#### `@mui/x-data-grid-premium@7.22.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
119
|
+
|
|
120
|
+
Same changes as in `@mui/x-data-grid-pro@7.22.2`, plus:
|
|
121
|
+
|
|
122
|
+
- [DataGridPremium] Fix incorrect rows selection count when selection propagation is enabled with row grouping (#15222) @arminmeh
|
|
123
|
+
|
|
124
|
+
### Date and Time Pickers
|
|
125
|
+
|
|
126
|
+
#### `@mui/x-date-pickers@7.22.2`
|
|
127
|
+
|
|
128
|
+
- [pickers] Add support for `moment-hijri@3.0.0` (#15248) @LukasTy
|
|
129
|
+
|
|
130
|
+
#### `@mui/x-date-pickers-pro@7.22.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
131
|
+
|
|
132
|
+
Same changes as in `@mui/x-date-pickers@7.22.2`.
|
|
133
|
+
|
|
134
|
+
### Charts
|
|
135
|
+
|
|
136
|
+
#### `@mui/x-charts@7.22.2`
|
|
137
|
+
|
|
138
|
+
- [charts] Allow `SeriesValueFormatter` to return `null` value (#15295) @clins1994
|
|
139
|
+
- [charts] Allow configuring the `domainLimit` for each axis. (#15325) @GuillaumeMeheut
|
|
140
|
+
|
|
141
|
+
#### `@mui/x-charts-pro@7.0.0-beta.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
142
|
+
|
|
143
|
+
Same changes as in `@mui/x-charts@7.22.2`.
|
|
144
|
+
|
|
6
145
|
## 7.22.1
|
|
7
146
|
|
|
8
147
|
_Nov 1, 2024_
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { GridFilterInputBoolean } from "../components/panel/filterPanel/GridFilterInputBoolean.js";
|
|
1
|
+
import { GridFilterInputBoolean, sanitizeFilterItemValue } from "../components/panel/filterPanel/GridFilterInputBoolean.js";
|
|
2
2
|
export const getGridBooleanOperators = () => [{
|
|
3
3
|
value: 'is',
|
|
4
4
|
getApplyFilterFn: filterItem => {
|
|
5
|
-
|
|
5
|
+
const sanitizedValue = sanitizeFilterItemValue(filterItem.value);
|
|
6
|
+
if (sanitizedValue === undefined) {
|
|
6
7
|
return null;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
return value => {
|
|
10
|
-
return Boolean(value) === valueAsBoolean;
|
|
11
|
-
};
|
|
9
|
+
return value => Boolean(value) === sanitizedValue;
|
|
12
10
|
},
|
|
13
11
|
InputComponent: GridFilterInputBoolean
|
|
14
12
|
}];
|
package/components/GridRow.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface GridRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
38
38
|
onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
39
39
|
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
40
40
|
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
41
|
-
[x: string]:
|
|
41
|
+
[x: `data-${string}`]: string;
|
|
42
42
|
}
|
|
43
|
-
declare const MemoizedGridRow: React.ForwardRefExoticComponent<
|
|
43
|
+
declare const MemoizedGridRow: React.ForwardRefExoticComponent<GridRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
44
|
export { MemoizedGridRow as GridRow };
|
package/components/GridRow.js
CHANGED
|
@@ -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 = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "dimensions", "renderContext", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "dimensions", "renderContext", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "showBottomBorder", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -4,12 +4,11 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { styled } from '@mui/system';
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
+
import { minimalContentHeight } from "../../hooks/features/rows/gridRowsUtils.js";
|
|
7
8
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
8
9
|
import { gridDimensionsSelector } from "../../hooks/features/dimensions/index.js";
|
|
9
10
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
10
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
11
|
-
import { useGridVisibleRows } from "../../hooks/utils/useGridVisibleRows.js";
|
|
12
|
-
import { getMinimalContentHeight } from "../../hooks/features/rows/gridRowsUtils.js";
|
|
13
12
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
14
|
const GridOverlayWrapperRoot = styled('div', {
|
|
@@ -26,6 +25,7 @@ loadingOverlayVariant !== 'skeleton' ? {
|
|
|
26
25
|
position: 'sticky',
|
|
27
26
|
// To stay in place while scrolling
|
|
28
27
|
top: 'var(--DataGrid-headersTotalHeight)',
|
|
28
|
+
// TODO: take pinned rows into account
|
|
29
29
|
left: 0,
|
|
30
30
|
width: 0,
|
|
31
31
|
// To stay above the content instead of shifting it down
|
|
@@ -53,11 +53,10 @@ const useUtilityClasses = ownerState => {
|
|
|
53
53
|
function GridOverlayWrapper(props) {
|
|
54
54
|
const apiRef = useGridApiContext();
|
|
55
55
|
const rootProps = useGridRootProps();
|
|
56
|
-
const currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
57
56
|
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
58
|
-
let height = dimensions.viewportOuterSize.height - dimensions.topContainerHeight - dimensions.bottomContainerHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
|
|
59
|
-
if (
|
|
60
|
-
height =
|
|
57
|
+
let height = Math.max(dimensions.viewportOuterSize.height - dimensions.topContainerHeight - dimensions.bottomContainerHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0), 0);
|
|
58
|
+
if (height === 0) {
|
|
59
|
+
height = minimalContentHeight;
|
|
61
60
|
}
|
|
62
61
|
const classes = useUtilityClasses(_extends({}, props, {
|
|
63
62
|
classes: rootProps.classes
|
|
@@ -14,7 +14,7 @@ export declare const gridPinnedColumnPositionLookup: {
|
|
|
14
14
|
0: undefined;
|
|
15
15
|
3: undefined;
|
|
16
16
|
};
|
|
17
|
-
export type GridCellProps = {
|
|
17
|
+
export type GridCellProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
18
18
|
align: GridAlignment;
|
|
19
19
|
className?: string;
|
|
20
20
|
colIndex: number;
|
|
@@ -32,12 +32,50 @@ export type GridCellProps = {
|
|
|
32
32
|
gridHasFiller: boolean;
|
|
33
33
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
34
34
|
onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
35
|
+
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
35
36
|
onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
|
|
37
|
+
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
36
38
|
onMouseUp?: React.MouseEventHandler<HTMLDivElement>;
|
|
39
|
+
onMouseOver?: React.MouseEventHandler<HTMLDivElement>;
|
|
40
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
37
41
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
38
42
|
onDragEnter?: React.DragEventHandler<HTMLDivElement>;
|
|
39
43
|
onDragOver?: React.DragEventHandler<HTMLDivElement>;
|
|
40
|
-
|
|
44
|
+
onFocus?: React.FocusEventHandler<Element>;
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
style?: React.CSSProperties;
|
|
47
|
+
[x: `data-${string}`]: string;
|
|
41
48
|
};
|
|
42
|
-
declare const MemoizedGridCell: React.ForwardRefExoticComponent<
|
|
49
|
+
declare const MemoizedGridCell: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
50
|
+
[x: `data-${string}`]: string;
|
|
51
|
+
align: GridAlignment;
|
|
52
|
+
className?: string;
|
|
53
|
+
colIndex: number;
|
|
54
|
+
column: GridColDef;
|
|
55
|
+
rowId: GridRowId;
|
|
56
|
+
width: number;
|
|
57
|
+
colSpan?: number;
|
|
58
|
+
disableDragEvents?: boolean;
|
|
59
|
+
isNotVisible: boolean;
|
|
60
|
+
editCellState: GridEditCellProps<any> | null;
|
|
61
|
+
pinnedOffset: number;
|
|
62
|
+
pinnedPosition: PinnedPosition;
|
|
63
|
+
sectionIndex: number;
|
|
64
|
+
sectionLength: number;
|
|
65
|
+
gridHasFiller: boolean;
|
|
66
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
67
|
+
onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
68
|
+
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
69
|
+
onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
|
|
70
|
+
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
71
|
+
onMouseUp?: React.MouseEventHandler<HTMLDivElement>;
|
|
72
|
+
onMouseOver?: React.MouseEventHandler<HTMLDivElement>;
|
|
73
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
74
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
75
|
+
onDragEnter?: React.DragEventHandler<HTMLDivElement>;
|
|
76
|
+
onDragOver?: React.DragEventHandler<HTMLDivElement>;
|
|
77
|
+
onFocus?: React.FocusEventHandler<Element>;
|
|
78
|
+
children?: React.ReactNode;
|
|
79
|
+
style?: React.CSSProperties;
|
|
80
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
43
81
|
export { MemoizedGridCell as GridCell };
|
|
@@ -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 = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "
|
|
3
|
+
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "gridHasFiller", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
4
4
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -342,7 +342,6 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
342
342
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
343
343
|
// ----------------------------------------------------------------------
|
|
344
344
|
align: PropTypes.oneOf(['center', 'left', 'right']).isRequired,
|
|
345
|
-
className: PropTypes.string,
|
|
346
345
|
colIndex: PropTypes.number.isRequired,
|
|
347
346
|
colSpan: PropTypes.number,
|
|
348
347
|
column: PropTypes.object.isRequired,
|
|
@@ -355,13 +354,6 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
355
354
|
}),
|
|
356
355
|
gridHasFiller: PropTypes.bool.isRequired,
|
|
357
356
|
isNotVisible: PropTypes.bool.isRequired,
|
|
358
|
-
onClick: PropTypes.func,
|
|
359
|
-
onDoubleClick: PropTypes.func,
|
|
360
|
-
onDragEnter: PropTypes.func,
|
|
361
|
-
onDragOver: PropTypes.func,
|
|
362
|
-
onKeyDown: PropTypes.func,
|
|
363
|
-
onMouseDown: PropTypes.func,
|
|
364
|
-
onMouseUp: PropTypes.func,
|
|
365
357
|
pinnedOffset: PropTypes.number.isRequired,
|
|
366
358
|
pinnedPosition: PropTypes.oneOf([0, 1, 2, 3]).isRequired,
|
|
367
359
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
@@ -2,7 +2,6 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
5
|
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
7
6
|
import { styled } from '@mui/material/styles';
|
|
8
7
|
import InputBase from '@mui/material/InputBase';
|
|
@@ -94,71 +93,5 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
94
93
|
}) : undefined
|
|
95
94
|
}, other));
|
|
96
95
|
});
|
|
97
|
-
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
98
|
-
// ----------------------------- Warning --------------------------------
|
|
99
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
100
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
101
|
-
// ----------------------------------------------------------------------
|
|
102
|
-
/**
|
|
103
|
-
* GridApi that let you manipulate the grid.
|
|
104
|
-
*/
|
|
105
|
-
api: PropTypes.object.isRequired,
|
|
106
|
-
/**
|
|
107
|
-
* The mode of the cell.
|
|
108
|
-
*/
|
|
109
|
-
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
110
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
111
|
-
/**
|
|
112
|
-
* The column of the row that the current cell belongs to.
|
|
113
|
-
*/
|
|
114
|
-
colDef: PropTypes.object.isRequired,
|
|
115
|
-
debounceMs: PropTypes.number,
|
|
116
|
-
/**
|
|
117
|
-
* The column field of the cell that triggered the event.
|
|
118
|
-
*/
|
|
119
|
-
field: PropTypes.string.isRequired,
|
|
120
|
-
/**
|
|
121
|
-
* The cell value formatted with the column valueFormatter.
|
|
122
|
-
*/
|
|
123
|
-
formattedValue: PropTypes.any,
|
|
124
|
-
/**
|
|
125
|
-
* If true, the cell is the active element.
|
|
126
|
-
*/
|
|
127
|
-
hasFocus: PropTypes.bool.isRequired,
|
|
128
|
-
/**
|
|
129
|
-
* The grid row id.
|
|
130
|
-
*/
|
|
131
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
132
|
-
/**
|
|
133
|
-
* If true, the cell is editable.
|
|
134
|
-
*/
|
|
135
|
-
isEditable: PropTypes.bool,
|
|
136
|
-
isProcessingProps: PropTypes.bool,
|
|
137
|
-
isValidating: PropTypes.bool,
|
|
138
|
-
/**
|
|
139
|
-
* Callback called when the value is changed by the user.
|
|
140
|
-
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
141
|
-
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
142
|
-
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
143
|
-
*/
|
|
144
|
-
onValueChange: PropTypes.func,
|
|
145
|
-
/**
|
|
146
|
-
* The row model of the row that the current cell belongs to.
|
|
147
|
-
*/
|
|
148
|
-
row: PropTypes.any.isRequired,
|
|
149
|
-
/**
|
|
150
|
-
* The node of the row that the current cell belongs to.
|
|
151
|
-
*/
|
|
152
|
-
rowNode: PropTypes.object.isRequired,
|
|
153
|
-
/**
|
|
154
|
-
* the tabIndex value.
|
|
155
|
-
*/
|
|
156
|
-
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
157
|
-
/**
|
|
158
|
-
* The cell value.
|
|
159
|
-
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
160
|
-
*/
|
|
161
|
-
value: PropTypes.any
|
|
162
|
-
} : void 0;
|
|
163
96
|
export { GridEditInputCell };
|
|
164
97
|
export const renderEditInputCell = params => /*#__PURE__*/_jsx(GridEditInputCell, _extends({}, params));
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
2
3
|
import type { GridColDef } from '../../models/colDef/gridColDef';
|
|
3
4
|
export interface GridColumnsManagementProps {
|
|
4
5
|
sort?: 'asc' | 'desc';
|
|
5
6
|
searchPredicate?: (column: GridColDef, searchValue: string) => boolean;
|
|
7
|
+
searchInputProps?: Partial<TextFieldProps>;
|
|
6
8
|
/**
|
|
7
9
|
* If `true`, the column search field will be focused automatically.
|
|
8
10
|
* If `false`, the first column switch input will be focused automatically.
|
|
@@ -5,6 +5,8 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
6
6
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
7
7
|
import { styled } from '@mui/material/styles';
|
|
8
|
+
import TextField from '@mui/material/TextField';
|
|
9
|
+
import { inputBaseClasses } from '@mui/material/InputBase';
|
|
8
10
|
import { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from "../../hooks/features/columns/gridColumnsSelector.js";
|
|
9
11
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
10
12
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
@@ -20,6 +22,7 @@ const useUtilityClasses = ownerState => {
|
|
|
20
22
|
const slots = {
|
|
21
23
|
root: ['columnsManagement'],
|
|
22
24
|
header: ['columnsManagementHeader'],
|
|
25
|
+
searchInput: ['columnsManagementSearchInput'],
|
|
23
26
|
footer: ['columnsManagementFooter'],
|
|
24
27
|
row: ['columnsManagementRow']
|
|
25
28
|
};
|
|
@@ -42,7 +45,8 @@ function GridColumnsManagement(props) {
|
|
|
42
45
|
disableShowHideToggle = false,
|
|
43
46
|
disableResetButton = false,
|
|
44
47
|
toggleAllMode = 'all',
|
|
45
|
-
getTogglableColumns
|
|
48
|
+
getTogglableColumns,
|
|
49
|
+
searchInputProps
|
|
46
50
|
} = props;
|
|
47
51
|
const isResetDisabled = React.useMemo(() => checkColumnVisibilityModelsSame(columnVisibilityModel, initialColumnVisibilityModel), [columnVisibilityModel, initialColumnVisibilityModel]);
|
|
48
52
|
const sortedColumns = React.useMemo(() => {
|
|
@@ -109,28 +113,52 @@ function GridColumnsManagement(props) {
|
|
|
109
113
|
}
|
|
110
114
|
return false;
|
|
111
115
|
};
|
|
116
|
+
const handleSearchReset = React.useCallback(() => {
|
|
117
|
+
setSearchValue('');
|
|
118
|
+
searchInputRef.current.focus();
|
|
119
|
+
}, []);
|
|
112
120
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
113
121
|
children: [/*#__PURE__*/_jsx(GridColumnsManagementHeader, {
|
|
114
122
|
className: classes.header,
|
|
115
123
|
ownerState: rootProps,
|
|
116
|
-
children: /*#__PURE__*/_jsx(
|
|
124
|
+
children: /*#__PURE__*/_jsx(SearchInput, _extends({
|
|
125
|
+
as: rootProps.slots.baseTextField,
|
|
126
|
+
ownerState: rootProps,
|
|
117
127
|
placeholder: apiRef.current.getLocaleText('columnsManagementSearchTitle'),
|
|
118
128
|
inputRef: searchInputRef,
|
|
129
|
+
className: classes.searchInput,
|
|
119
130
|
value: searchValue,
|
|
120
131
|
onChange: handleSearchValueChange,
|
|
121
132
|
variant: "outlined",
|
|
122
133
|
size: "small",
|
|
134
|
+
type: "search",
|
|
123
135
|
InputProps: {
|
|
124
136
|
startAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseInputAdornment, {
|
|
125
137
|
position: "start",
|
|
126
138
|
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {})
|
|
127
139
|
}),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
140
|
+
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
141
|
+
"aria-label": apiRef.current.getLocaleText('columnsManagementDeleteIconLabel'),
|
|
142
|
+
size: "small",
|
|
143
|
+
sx: [searchValue ? {
|
|
144
|
+
visibility: 'visible'
|
|
145
|
+
} : {
|
|
146
|
+
visibility: 'hidden'
|
|
147
|
+
}],
|
|
148
|
+
tabIndex: -1,
|
|
149
|
+
onClick: handleSearchReset
|
|
150
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
151
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterClearIcon, {
|
|
152
|
+
fontSize: "small"
|
|
153
|
+
})
|
|
154
|
+
}))
|
|
155
|
+
},
|
|
156
|
+
inputProps: {
|
|
157
|
+
'aria-label': apiRef.current.getLocaleText('columnsManagementSearchTitle')
|
|
131
158
|
},
|
|
159
|
+
autoComplete: "off",
|
|
132
160
|
fullWidth: true
|
|
133
|
-
}, rootProps.slotProps?.baseTextField))
|
|
161
|
+
}, rootProps.slotProps?.baseTextField, searchInputProps))
|
|
134
162
|
}), /*#__PURE__*/_jsxs(GridColumnsManagementBody, {
|
|
135
163
|
className: classes.root,
|
|
136
164
|
ownerState: rootProps,
|
|
@@ -205,6 +233,7 @@ process.env.NODE_ENV !== "production" ? GridColumnsManagement.propTypes = {
|
|
|
205
233
|
* @returns {GridColDef['field'][]} The list of togglable columns' field names.
|
|
206
234
|
*/
|
|
207
235
|
getTogglableColumns: PropTypes.func,
|
|
236
|
+
searchInputProps: PropTypes.object,
|
|
208
237
|
searchPredicate: PropTypes.func,
|
|
209
238
|
sort: PropTypes.oneOf(['asc', 'desc']),
|
|
210
239
|
/**
|
|
@@ -239,6 +268,24 @@ const GridColumnsManagementHeader = styled('div', {
|
|
|
239
268
|
}) => ({
|
|
240
269
|
padding: theme.spacing(1.5, 3)
|
|
241
270
|
}));
|
|
271
|
+
const SearchInput = styled(TextField, {
|
|
272
|
+
name: 'MuiDataGrid',
|
|
273
|
+
slot: 'ColumnsManagementSearchInput',
|
|
274
|
+
overridesResolver: (props, styles) => styles.columnsManagementSearchInput
|
|
275
|
+
})(({
|
|
276
|
+
theme
|
|
277
|
+
}) => ({
|
|
278
|
+
[`& .${inputBaseClasses.root}`]: {
|
|
279
|
+
padding: theme.spacing(0, 1.5, 0, 1.5)
|
|
280
|
+
},
|
|
281
|
+
[`& .${inputBaseClasses.input}::-webkit-search-decoration,
|
|
282
|
+
& .${inputBaseClasses.input}::-webkit-search-cancel-button,
|
|
283
|
+
& .${inputBaseClasses.input}::-webkit-search-results-button,
|
|
284
|
+
& .${inputBaseClasses.input}::-webkit-search-results-decoration`]: {
|
|
285
|
+
/* clears the 'X' icon from Chrome */
|
|
286
|
+
display: 'none'
|
|
287
|
+
}
|
|
288
|
+
}));
|
|
242
289
|
const GridColumnsManagementFooter = styled('div', {
|
|
243
290
|
name: 'MuiDataGrid',
|
|
244
291
|
slot: 'ColumnsManagementFooter',
|
|
@@ -16,7 +16,7 @@ export interface GridPanelProps extends Partial<React.ComponentProps<typeof Grid
|
|
|
16
16
|
open: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare const gridPanelClasses: Record<keyof GridPanelClasses, string>;
|
|
19
|
-
declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "
|
|
19
|
+
declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
20
20
|
ownerState: OwnerState;
|
|
21
21
|
}, {}, {}>;
|
|
22
22
|
declare const GridPanel: React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -9,6 +9,7 @@ export type GridFilterInputBooleanProps = GridFilterInputValueProps & TextFieldP
|
|
|
9
9
|
*/
|
|
10
10
|
isFilterActive?: boolean;
|
|
11
11
|
};
|
|
12
|
+
export declare const sanitizeFilterItemValue: (value: any) => boolean | undefined;
|
|
12
13
|
declare function GridFilterInputBoolean(props: GridFilterInputBooleanProps): React.JSX.Element;
|
|
13
14
|
declare namespace GridFilterInputBoolean {
|
|
14
15
|
var propTypes: any;
|
|
@@ -7,6 +7,15 @@ import { refType, unstable_useId as useId } from '@mui/utils';
|
|
|
7
7
|
import { styled } from '@mui/material/styles';
|
|
8
8
|
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const sanitizeFilterItemValue = value => {
|
|
11
|
+
if (String(value).toLowerCase() === 'true') {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (String(value).toLowerCase() === 'false') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
};
|
|
10
19
|
const BooleanOperatorContainer = styled('div')({
|
|
11
20
|
display: 'flex',
|
|
12
21
|
alignItems: 'center',
|
|
@@ -27,7 +36,7 @@ function GridFilterInputBoolean(props) {
|
|
|
27
36
|
variant = 'standard'
|
|
28
37
|
} = props,
|
|
29
38
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
|
-
const [filterValueState, setFilterValueState] = React.useState(item.value
|
|
39
|
+
const [filterValueState, setFilterValueState] = React.useState(sanitizeFilterItemValue(item.value));
|
|
31
40
|
const rootProps = useGridRootProps();
|
|
32
41
|
const labelId = useId();
|
|
33
42
|
const selectId = useId();
|
|
@@ -35,14 +44,14 @@ function GridFilterInputBoolean(props) {
|
|
|
35
44
|
const isSelectNative = baseSelectProps.native ?? false;
|
|
36
45
|
const baseSelectOptionProps = rootProps.slotProps?.baseSelectOption || {};
|
|
37
46
|
const onFilterChange = React.useCallback(event => {
|
|
38
|
-
const value = event.target.value;
|
|
47
|
+
const value = sanitizeFilterItemValue(event.target.value);
|
|
39
48
|
setFilterValueState(value);
|
|
40
49
|
applyValue(_extends({}, item, {
|
|
41
|
-
value
|
|
50
|
+
value
|
|
42
51
|
}));
|
|
43
52
|
}, [applyValue, item]);
|
|
44
53
|
React.useEffect(() => {
|
|
45
|
-
setFilterValueState(item.value
|
|
54
|
+
setFilterValueState(sanitizeFilterItemValue(item.value));
|
|
46
55
|
}, [item.value]);
|
|
47
56
|
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
48
57
|
return /*#__PURE__*/_jsxs(BooleanOperatorContainer, {
|
|
@@ -57,7 +66,7 @@ function GridFilterInputBoolean(props) {
|
|
|
57
66
|
labelId: labelId,
|
|
58
67
|
id: selectId,
|
|
59
68
|
label: label,
|
|
60
|
-
value: filterValueState,
|
|
69
|
+
value: filterValueState === undefined ? '' : String(filterValueState),
|
|
61
70
|
onChange: onFilterChange,
|
|
62
71
|
variant: variant,
|
|
63
72
|
notched: variant === 'outlined' ? true : undefined,
|