@mui/x-data-grid 6.4.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/DataGrid/useDataGridProps.js +5 -12
  3. package/colDef/gridNumericOperators.js +0 -6
  4. package/components/cell/GridEditInputCell.js +4 -1
  5. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +15 -2
  6. package/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
  7. package/components/panel/filterPanel/GridFilterInputDate.d.ts +8 -1
  8. package/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  9. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +8 -1
  10. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
  11. package/components/panel/filterPanel/GridFilterInputValue.d.ts +11 -4
  12. package/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  13. package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -1
  14. package/components/panel/filterPanel/GridFilterPanel.js +1 -1
  15. package/components/panel/filterPanel/index.d.ts +3 -1
  16. package/components/panel/filterPanel/index.js +2 -1
  17. package/constants/localeTextConstants.js +26 -0
  18. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +9 -2
  19. package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  20. package/hooks/features/dimensions/useGridDimensions.js +2 -2
  21. package/hooks/features/editing/useGridEditing.js +0 -3
  22. package/hooks/features/focus/gridFocusState.d.ts +2 -0
  23. package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
  24. package/hooks/features/focus/gridFocusStateSelector.js +6 -0
  25. package/hooks/features/focus/useGridFocus.js +55 -9
  26. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -0
  27. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
  28. package/hooks/features/headerFiltering/index.d.ts +1 -0
  29. package/hooks/features/headerFiltering/index.js +1 -0
  30. package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +6 -0
  31. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +91 -0
  32. package/hooks/features/index.d.ts +1 -0
  33. package/hooks/features/index.js +2 -1
  34. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  35. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  36. package/hooks/features/rows/useGridRows.js +16 -1
  37. package/index.js +1 -1
  38. package/internals/index.d.ts +6 -1
  39. package/internals/index.js +4 -0
  40. package/internals/utils/index.d.ts +1 -0
  41. package/internals/utils/index.js +2 -1
  42. package/internals/utils/useProps.d.ts +8 -0
  43. package/internals/utils/useProps.js +13 -0
  44. package/legacy/DataGrid/useDataGridProps.js +8 -8
  45. package/legacy/colDef/gridNumericOperators.js +0 -6
  46. package/legacy/components/cell/GridEditInputCell.js +4 -1
  47. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +79 -35
  48. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +26 -5
  49. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +54 -31
  50. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +28 -5
  51. package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
  52. package/legacy/components/panel/filterPanel/index.js +2 -1
  53. package/legacy/constants/localeTextConstants.js +26 -0
  54. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
  55. package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
  56. package/legacy/hooks/features/editing/useGridEditing.js +0 -3
  57. package/legacy/hooks/features/focus/gridFocusStateSelector.js +10 -0
  58. package/legacy/hooks/features/focus/useGridFocus.js +58 -9
  59. package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +11 -0
  60. package/legacy/hooks/features/headerFiltering/index.js +1 -0
  61. package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +93 -0
  62. package/legacy/hooks/features/index.js +2 -1
  63. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  64. package/legacy/hooks/features/rows/useGridRows.js +16 -1
  65. package/legacy/index.js +1 -1
  66. package/legacy/internals/index.js +4 -0
  67. package/legacy/internals/utils/index.js +2 -1
  68. package/legacy/internals/utils/useProps.js +11 -0
  69. package/legacy/locales/arSD.js +28 -0
  70. package/legacy/locales/beBY.js +28 -0
  71. package/legacy/locales/bgBG.js +28 -0
  72. package/legacy/locales/csCZ.js +36 -8
  73. package/legacy/locales/daDK.js +28 -0
  74. package/legacy/locales/deDE.js +28 -0
  75. package/legacy/locales/elGR.js +27 -0
  76. package/legacy/locales/esES.js +28 -0
  77. package/legacy/locales/faIR.js +28 -0
  78. package/legacy/locales/fiFI.js +28 -0
  79. package/legacy/locales/frFR.js +28 -0
  80. package/legacy/locales/heIL.js +30 -2
  81. package/legacy/locales/huHU.js +28 -0
  82. package/legacy/locales/itIT.js +28 -0
  83. package/legacy/locales/jaJP.js +28 -0
  84. package/legacy/locales/koKR.js +28 -0
  85. package/legacy/locales/nbNO.js +28 -0
  86. package/legacy/locales/nlNL.js +28 -0
  87. package/legacy/locales/plPL.js +28 -0
  88. package/legacy/locales/ptBR.js +28 -0
  89. package/legacy/locales/roRO.js +28 -0
  90. package/legacy/locales/ruRU.js +28 -0
  91. package/legacy/locales/skSK.js +28 -0
  92. package/legacy/locales/svSE.js +28 -0
  93. package/legacy/locales/trTR.js +28 -0
  94. package/legacy/locales/ukUA.js +28 -0
  95. package/legacy/locales/urPK.js +28 -0
  96. package/legacy/locales/viVN.js +27 -0
  97. package/legacy/locales/zhCN.js +28 -0
  98. package/legacy/locales/zhTW.js +28 -0
  99. package/legacy/material/index.js +2 -0
  100. package/legacy/models/api/gridHeaderFilteringApi.js +1 -0
  101. package/legacy/models/gridHeaderFilteringModel.js +1 -0
  102. package/legacy/models/index.js +0 -1
  103. package/locales/arSD.js +28 -0
  104. package/locales/beBY.js +28 -0
  105. package/locales/bgBG.js +28 -0
  106. package/locales/csCZ.js +36 -8
  107. package/locales/daDK.js +28 -0
  108. package/locales/deDE.js +28 -0
  109. package/locales/elGR.js +27 -0
  110. package/locales/esES.js +28 -0
  111. package/locales/faIR.js +28 -0
  112. package/locales/fiFI.js +28 -0
  113. package/locales/frFR.js +28 -0
  114. package/locales/heIL.js +30 -2
  115. package/locales/huHU.js +28 -0
  116. package/locales/itIT.js +28 -0
  117. package/locales/jaJP.js +28 -0
  118. package/locales/koKR.js +28 -0
  119. package/locales/nbNO.js +28 -0
  120. package/locales/nlNL.js +28 -0
  121. package/locales/plPL.js +28 -0
  122. package/locales/ptBR.js +28 -0
  123. package/locales/roRO.js +28 -0
  124. package/locales/ruRU.js +28 -0
  125. package/locales/skSK.js +28 -0
  126. package/locales/svSE.js +28 -0
  127. package/locales/trTR.js +28 -0
  128. package/locales/ukUA.js +28 -0
  129. package/locales/urPK.js +28 -0
  130. package/locales/viVN.js +27 -0
  131. package/locales/zhCN.js +28 -0
  132. package/locales/zhTW.js +28 -0
  133. package/material/index.d.ts +3 -66
  134. package/material/index.js +2 -0
  135. package/models/api/gridApiCommon.d.ts +3 -2
  136. package/models/api/gridCoreApi.d.ts +4 -0
  137. package/models/api/gridFocusApi.d.ts +6 -0
  138. package/models/api/gridHeaderFilteringApi.d.ts +30 -0
  139. package/models/api/gridHeaderFilteringApi.js +1 -0
  140. package/models/api/gridLocaleTextApi.d.ts +25 -0
  141. package/models/events/gridEventLookup.d.ts +27 -1
  142. package/models/gridFilterOperator.d.ts +4 -0
  143. package/models/gridHeaderFilteringModel.d.ts +5 -0
  144. package/models/gridHeaderFilteringModel.js +1 -0
  145. package/models/gridSlotsComponent.d.ts +16 -4
  146. package/models/gridStateCommunity.d.ts +2 -0
  147. package/models/index.d.ts +1 -1
  148. package/models/index.js +0 -1
  149. package/modern/DataGrid/useDataGridProps.js +5 -12
  150. package/modern/colDef/gridNumericOperators.js +0 -6
  151. package/modern/components/cell/GridEditInputCell.js +4 -1
  152. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
  153. package/modern/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  154. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
  155. package/modern/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  156. package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
  157. package/modern/components/panel/filterPanel/index.js +2 -1
  158. package/modern/constants/localeTextConstants.js +26 -0
  159. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  160. package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
  161. package/modern/hooks/features/editing/useGridEditing.js +0 -3
  162. package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -0
  163. package/modern/hooks/features/focus/useGridFocus.js +55 -9
  164. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
  165. package/modern/hooks/features/headerFiltering/index.js +1 -0
  166. package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +90 -0
  167. package/modern/hooks/features/index.js +2 -1
  168. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  169. package/modern/hooks/features/rows/useGridRows.js +16 -1
  170. package/modern/index.js +1 -1
  171. package/modern/internals/index.js +4 -0
  172. package/modern/internals/utils/index.js +2 -1
  173. package/modern/internals/utils/useProps.js +13 -0
  174. package/modern/locales/arSD.js +28 -0
  175. package/modern/locales/beBY.js +28 -0
  176. package/modern/locales/bgBG.js +28 -0
  177. package/modern/locales/csCZ.js +36 -8
  178. package/modern/locales/daDK.js +28 -0
  179. package/modern/locales/deDE.js +28 -0
  180. package/modern/locales/elGR.js +27 -0
  181. package/modern/locales/esES.js +28 -0
  182. package/modern/locales/faIR.js +28 -0
  183. package/modern/locales/fiFI.js +28 -0
  184. package/modern/locales/frFR.js +28 -0
  185. package/modern/locales/heIL.js +30 -2
  186. package/modern/locales/huHU.js +28 -0
  187. package/modern/locales/itIT.js +28 -0
  188. package/modern/locales/jaJP.js +28 -0
  189. package/modern/locales/koKR.js +28 -0
  190. package/modern/locales/nbNO.js +28 -0
  191. package/modern/locales/nlNL.js +28 -0
  192. package/modern/locales/plPL.js +28 -0
  193. package/modern/locales/ptBR.js +28 -0
  194. package/modern/locales/roRO.js +28 -0
  195. package/modern/locales/ruRU.js +28 -0
  196. package/modern/locales/skSK.js +28 -0
  197. package/modern/locales/svSE.js +28 -0
  198. package/modern/locales/trTR.js +28 -0
  199. package/modern/locales/ukUA.js +28 -0
  200. package/modern/locales/urPK.js +28 -0
  201. package/modern/locales/viVN.js +27 -0
  202. package/modern/locales/zhCN.js +28 -0
  203. package/modern/locales/zhTW.js +28 -0
  204. package/modern/material/index.js +2 -0
  205. package/modern/models/api/gridHeaderFilteringApi.js +1 -0
  206. package/modern/models/gridHeaderFilteringModel.js +1 -0
  207. package/modern/models/index.js +0 -1
  208. package/node/DataGrid/useDataGridProps.js +4 -11
  209. package/node/colDef/gridNumericOperators.js +0 -6
  210. package/node/components/cell/GridEditInputCell.js +4 -1
  211. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +78 -35
  212. package/node/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  213. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
  214. package/node/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  215. package/node/components/panel/filterPanel/GridFilterPanel.js +2 -1
  216. package/node/components/panel/filterPanel/index.js +26 -8
  217. package/node/constants/localeTextConstants.js +26 -0
  218. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  219. package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
  220. package/node/hooks/features/editing/useGridEditing.js +0 -3
  221. package/node/hooks/features/focus/gridFocusStateSelector.js +9 -1
  222. package/node/hooks/features/focus/useGridFocus.js +55 -9
  223. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +15 -0
  224. package/node/hooks/features/headerFiltering/index.js +16 -0
  225. package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +101 -0
  226. package/node/hooks/features/index.js +11 -0
  227. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
  228. package/node/hooks/features/rows/useGridRows.js +16 -1
  229. package/node/index.js +1 -1
  230. package/node/internals/index.js +46 -0
  231. package/node/internals/utils/index.js +11 -0
  232. package/node/internals/utils/useProps.js +22 -0
  233. package/node/locales/arSD.js +28 -0
  234. package/node/locales/beBY.js +28 -0
  235. package/node/locales/bgBG.js +28 -0
  236. package/node/locales/csCZ.js +36 -8
  237. package/node/locales/daDK.js +28 -0
  238. package/node/locales/deDE.js +28 -0
  239. package/node/locales/elGR.js +27 -0
  240. package/node/locales/esES.js +28 -0
  241. package/node/locales/faIR.js +28 -0
  242. package/node/locales/fiFI.js +28 -0
  243. package/node/locales/frFR.js +28 -0
  244. package/node/locales/heIL.js +30 -2
  245. package/node/locales/huHU.js +28 -0
  246. package/node/locales/itIT.js +28 -0
  247. package/node/locales/jaJP.js +28 -0
  248. package/node/locales/koKR.js +28 -0
  249. package/node/locales/nbNO.js +28 -0
  250. package/node/locales/nlNL.js +28 -0
  251. package/node/locales/plPL.js +28 -0
  252. package/node/locales/ptBR.js +28 -0
  253. package/node/locales/roRO.js +28 -0
  254. package/node/locales/ruRU.js +28 -0
  255. package/node/locales/skSK.js +28 -0
  256. package/node/locales/svSE.js +28 -0
  257. package/node/locales/trTR.js +28 -0
  258. package/node/locales/ukUA.js +28 -0
  259. package/node/locales/urPK.js +28 -0
  260. package/node/locales/viVN.js +27 -0
  261. package/node/locales/zhCN.js +28 -0
  262. package/node/locales/zhTW.js +28 -0
  263. package/node/material/index.js +2 -0
  264. package/node/models/api/gridHeaderFilteringApi.js +5 -0
  265. package/node/models/gridHeaderFilteringModel.js +5 -0
  266. package/node/models/index.js +0 -11
  267. package/package.json +1 -1
@@ -1,67 +1,4 @@
1
- /// <reference types="react" />
2
- import MUICheckbox from '@mui/material/Checkbox';
3
- import MUITextField from '@mui/material/TextField';
4
- import MUISwitch from '@mui/material/Switch';
5
- import MUITooltip from '@mui/material/Tooltip';
6
- import MUISelectOption from './components/MUISelectOption';
7
- declare const materialSlots: {
8
- BaseCheckbox: typeof MUICheckbox;
9
- BaseTextField: typeof MUITextField;
10
- BaseFormControl: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/FormControl").FormControlTypeMap<{}, "div">>;
11
- BaseSelect: (<T>(props: import("@mui/material/Select").SelectProps<T>) => JSX.Element) & {
12
- muiName: string;
13
- };
14
- BaseSwitch: typeof MUISwitch;
15
- BaseButton: import("@mui/material").ExtendButtonBase<import("@mui/material/Button").ButtonTypeMap<{}, "button">>;
16
- BaseIconButton: import("@mui/material").ExtendButtonBase<import("@mui/material/IconButton").IconButtonTypeMap<{}, "button">>;
17
- BaseTooltip: typeof MUITooltip;
18
- BasePopper: import("react").ForwardRefExoticComponent<Omit<import("@mui/base").PopperProps<"div">, "direction"> & {
19
- component?: import("react").ElementType<any> | undefined;
20
- components?: {
21
- Root?: import("react").ElementType<any> | undefined;
22
- } | undefined;
23
- componentsProps?: {
24
- root?: import("@mui/base").SlotComponentProps<"div", import("@mui/base").PopperRootSlotPropsOverrides, import("@mui/base").PopperOwnProps> | undefined;
25
- } | undefined;
26
- sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
27
- } & import("react").RefAttributes<HTMLDivElement>>;
28
- BaseInputLabel: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/InputLabel").InputLabelTypeMap<{}, "label">>;
29
- BaseSelectOption: typeof MUISelectOption;
30
- BaseChip: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/Chip").ChipTypeMap<{}, "div">>;
31
- BooleanCellTrueIcon: import("react").JSXElementConstructor<any>;
32
- BooleanCellFalseIcon: import("react").JSXElementConstructor<any>;
33
- ColumnMenuIcon: import("react").JSXElementConstructor<any>;
34
- OpenFilterButtonIcon: import("react").JSXElementConstructor<any>;
35
- ColumnFilteredIcon: import("react").JSXElementConstructor<any>;
36
- ColumnSelectorIcon: import("react").JSXElementConstructor<any>;
37
- ColumnUnsortedIcon: import("react").JSXElementConstructor<any> | null;
38
- ColumnSortedAscendingIcon: import("react").JSXElementConstructor<any> | null;
39
- ColumnSortedDescendingIcon: import("react").JSXElementConstructor<any> | null;
40
- ColumnResizeIcon: import("react").JSXElementConstructor<any>;
41
- DensityCompactIcon: import("react").JSXElementConstructor<any>;
42
- DensityStandardIcon: import("react").JSXElementConstructor<any>;
43
- DensityComfortableIcon: import("react").JSXElementConstructor<any>;
44
- ExportIcon: import("react").JSXElementConstructor<any>;
45
- MoreActionsIcon: import("react").JSXElementConstructor<any>;
46
- TreeDataExpandIcon: import("react").JSXElementConstructor<any>;
47
- TreeDataCollapseIcon: import("react").JSXElementConstructor<any>;
48
- GroupingCriteriaExpandIcon: import("react").JSXElementConstructor<any>;
49
- GroupingCriteriaCollapseIcon: import("react").JSXElementConstructor<any>;
50
- DetailPanelExpandIcon: import("react").JSXElementConstructor<any>;
51
- DetailPanelCollapseIcon: import("react").JSXElementConstructor<any>;
52
- FilterPanelAddIcon: import("react").JSXElementConstructor<any>;
53
- FilterPanelDeleteIcon: import("react").JSXElementConstructor<any>;
54
- FilterPanelRemoveAllIcon: import("react").JSXElementConstructor<any>;
55
- RowReorderIcon: import("react").JSXElementConstructor<any>;
56
- QuickFilterIcon: import("react").JSXElementConstructor<any>;
57
- QuickFilterClearIcon: import("react").JSXElementConstructor<any>;
58
- ColumnMenuHideIcon: import("react").JSXElementConstructor<any>;
59
- ColumnMenuSortAscendingIcon: import("react").JSXElementConstructor<any>;
60
- ColumnMenuSortDescendingIcon: import("react").JSXElementConstructor<any>;
61
- ColumnMenuFilterIcon: import("react").JSXElementConstructor<any>;
62
- ColumnMenuManageColumnsIcon: import("react").JSXElementConstructor<any>;
63
- ColumnMenuClearIcon: import("react").JSXElementConstructor<any>;
64
- LoadIcon: import("react").JSXElementConstructor<any>;
65
- ColumnReorderIcon: import("react").JSXElementConstructor<any>;
66
- };
1
+ import type { GridIconSlotsComponent } from '../models';
2
+ import type { GridBaseSlots } from '../models/gridSlotsComponent';
3
+ declare const materialSlots: GridBaseSlots & GridIconSlotsComponent;
67
4
  export default materialSlots;
package/material/index.js CHANGED
@@ -6,6 +6,7 @@ import MUISelect from '@mui/material/Select';
6
6
  import MUISwitch from '@mui/material/Switch';
7
7
  import MUIButton from '@mui/material/Button';
8
8
  import MUIIconButton from '@mui/material/IconButton';
9
+ import MUIInputAdornment from '@mui/material/InputAdornment';
9
10
  import MUITooltip from '@mui/material/Tooltip';
10
11
  import MUIPopper from '@mui/material/Popper';
11
12
  import MUIInputLabel from '@mui/material/InputLabel';
@@ -58,6 +59,7 @@ const materialSlots = _extends({}, iconSlots, {
58
59
  BaseSwitch: MUISwitch,
59
60
  BaseButton: MUIButton,
60
61
  BaseIconButton: MUIIconButton,
62
+ BaseInputAdornment: MUIInputAdornment,
61
63
  BaseTooltip: MUITooltip,
62
64
  BasePopper: MUIPopper,
63
65
  BaseInputLabel: MUIInputLabel,
@@ -27,9 +27,10 @@ import type { GridPaginationApi } from '../../hooks/features/pagination';
27
27
  import type { GridStatePersistenceApi } from '../../hooks/features/statePersistence';
28
28
  import { GridColumnGroupingApi } from './gridColumnGroupingApi';
29
29
  import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
30
- export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi {
30
+ import { GridHeaderFilteringApi, GridHeaderFilteringPrivateApi } from './gridHeaderFilteringApi';
31
+ export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridDisableVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi, GridHeaderFilteringApi {
31
32
  }
32
- export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon> extends GridCorePrivateApi<Api, PrivateApi>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridVirtualScrollerApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi {
33
+ export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon> extends GridCorePrivateApi<Api, PrivateApi>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridVirtualScrollerApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi {
33
34
  }
34
35
  export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon> {
35
36
  }
@@ -69,6 +69,10 @@ export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPri
69
69
  * The React ref of the grid column container virtualized div element.
70
70
  */
71
71
  columnHeadersContainerElementRef?: React.RefObject<HTMLDivElement>;
72
+ /**
73
+ * The React ref of the grid header filter row element.
74
+ */
75
+ headerFiltersElementRef?: React.RefObject<HTMLDivElement>;
72
76
  /**
73
77
  * The React ref of the grid column headers container element.
74
78
  */
@@ -14,6 +14,12 @@ export interface GridFocusApi {
14
14
  * @param {string} event The event that triggers the action.
15
15
  */
16
16
  setColumnHeaderFocus: (field: string, event?: MuiBaseEvent) => void;
17
+ /**
18
+ * Sets the focus to the column header filter at the given `field`.
19
+ * @param {string} field The column field.
20
+ * @param {string} event The event that triggers the action.
21
+ */
22
+ setColumnHeaderFilterFocus: (field: string, event?: MuiBaseEvent) => void;
17
23
  }
18
24
  export interface GridFocusPrivateApi {
19
25
  /**
@@ -0,0 +1,30 @@
1
+ import { GridColDef } from '../colDef';
2
+ import { GridHeaderFilteringState } from '../gridHeaderFilteringModel';
3
+ export interface GridHeaderFilteringPrivateApi {
4
+ /**
5
+ * Internal function to set the header filter state.
6
+ * @param {Partial<GridHeaderFilteringState>} headerFilterState The field to be edited.
7
+ * @ignore - do not document.
8
+ */
9
+ setHeaderFilterState: (headerFilterState: Partial<GridHeaderFilteringState>) => void;
10
+ }
11
+ export interface GridHeaderFilteringApi {
12
+ /**
13
+ * Puts the cell corresponding to the given row id and field into edit mode.
14
+ * @param {GridColDef['field']} field The field of the header filter to put in edit mode.
15
+ */
16
+ startHeaderFilterEditMode: (field: GridColDef['field']) => void;
17
+ /**
18
+ * Stops the edit mode for the current field.
19
+ */
20
+ stopHeaderFilterEditMode: () => void;
21
+ /**
22
+ * Opens the header filter menu for the given field.
23
+ * @param {GridColDef['field']} field The field of the header filter to open menu for.
24
+ */
25
+ showHeaderFilterMenu: (field: GridColDef['field']) => void;
26
+ /**
27
+ * Hides the header filter menu.
28
+ */
29
+ hideHeaderFilterMenu: () => void;
30
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -54,6 +54,31 @@ export interface GridLocaleText {
54
54
  filterOperatorIsEmpty: string;
55
55
  filterOperatorIsNotEmpty: string;
56
56
  filterOperatorIsAnyOf: string;
57
+ 'filterOperator=': string;
58
+ 'filterOperator!=': string;
59
+ 'filterOperator>': string;
60
+ 'filterOperator>=': string;
61
+ 'filterOperator<': string;
62
+ 'filterOperator<=': string;
63
+ headerFilterOperatorContains: string;
64
+ headerFilterOperatorEquals: string;
65
+ headerFilterOperatorStartsWith: string;
66
+ headerFilterOperatorEndsWith: string;
67
+ headerFilterOperatorIs: string;
68
+ headerFilterOperatorNot: string;
69
+ headerFilterOperatorAfter: string;
70
+ headerFilterOperatorOnOrAfter: string;
71
+ headerFilterOperatorBefore: string;
72
+ headerFilterOperatorOnOrBefore: string;
73
+ headerFilterOperatorIsEmpty: string;
74
+ headerFilterOperatorIsNotEmpty: string;
75
+ headerFilterOperatorIsAnyOf: string;
76
+ 'headerFilterOperator=': string;
77
+ 'headerFilterOperator!=': string;
78
+ 'headerFilterOperator>': string;
79
+ 'headerFilterOperator>=': string;
80
+ 'headerFilterOperator<': string;
81
+ 'headerFilterOperator<=': string;
57
82
  filterValueAny: string;
58
83
  filterValueTrue: string;
59
84
  filterValueFalse: string;
@@ -189,6 +189,32 @@ export interface GridColumnHeaderEventLookup {
189
189
  params: GridColumnOrderChangeParams;
190
190
  };
191
191
  }
192
+ export interface GridHeaderFilterEventLookup {
193
+ /**
194
+ * Fired when a column header filter is clicked
195
+ * @ignore - do not document.
196
+ */
197
+ headerFilterClick: {
198
+ params: GridColumnHeaderParams;
199
+ event: React.MouseEvent<HTMLElement>;
200
+ };
201
+ /**
202
+ * Fired when a key is pressed in a column header filter. It's mapped to the `keydown` DOM event.
203
+ * @ignore - do not document.
204
+ */
205
+ headerFilterKeyDown: {
206
+ params: GridColumnHeaderParams;
207
+ event: React.KeyboardEvent<HTMLElement>;
208
+ };
209
+ /**
210
+ * Fired when a mouse is pressed in a column header filter. It's mapped to the `mousedown` DOM event.
211
+ * @ignore - do not document.
212
+ */
213
+ headerFilterMouseDown: {
214
+ params: GridColumnHeaderParams;
215
+ event: React.KeyboardEvent<HTMLElement>;
216
+ };
217
+ }
192
218
  export interface GridColumnGroupHeaderEventLookup {
193
219
  /**
194
220
  * Fired when a key is pressed in a column group header. It's mapped do the `keydown` DOM event.
@@ -318,7 +344,7 @@ export interface GridControlledStateReasonLookup {
318
344
  filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState';
319
345
  pagination: 'setPaginationModel' | 'stateRestorePreProcessing';
320
346
  }
321
- export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
347
+ export interface GridEventLookup extends GridRowEventLookup, GridColumnHeaderEventLookup, GridHeaderFilterEventLookup, GridColumnGroupHeaderEventLookup, GridCellEventLookup, GridControlledStateEventLookup {
322
348
  /**
323
349
  * Fired when the grid is unmounted.
324
350
  */
@@ -13,6 +13,10 @@ export interface GridFilterOperator<R extends GridValidRowModel = any, V = any,
13
13
  * The label of the filter operator.
14
14
  */
15
15
  label?: string;
16
+ /**
17
+ * The label of the filter shown in header filter row.
18
+ */
19
+ headerLabel?: string;
16
20
  /**
17
21
  * The name of the filter operator.
18
22
  * It will be matched with the `operator` property of the filter items.
@@ -0,0 +1,5 @@
1
+ import { GridColDef } from './colDef';
2
+ export type GridHeaderFilteringState = {
3
+ editing: GridColDef['field'] | null;
4
+ menuOpen: GridColDef['field'] | null;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,15 +1,22 @@
1
1
  import * as React from 'react';
2
2
  import type { UncapitalizeObjectKeys } from '../internals/utils';
3
3
  import type { GridIconSlotsComponent } from './gridIconSlotsComponent';
4
- /**
5
- * Grid components React prop interface containing all the overridable components.
6
- */
7
- export interface GridSlotsComponent extends GridIconSlotsComponent {
4
+ export interface GridBaseSlots {
8
5
  /**
9
6
  * The custom Checkbox component used in the grid for both header and cells.
10
7
  * @default Checkbox
11
8
  */
12
9
  BaseCheckbox: React.JSXElementConstructor<any>;
10
+ /**
11
+ * The custom Chip component used in the grid.
12
+ * @default Chip
13
+ */
14
+ BaseChip: React.JSXElementConstructor<any>;
15
+ /**
16
+ * The custom InputAdornment component used in the grid.
17
+ * @default InputAdornment
18
+ */
19
+ BaseInputAdornment: React.JSXElementConstructor<any>;
13
20
  /**
14
21
  * The custom TextField component used in the grid.
15
22
  * @default TextField
@@ -60,6 +67,11 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
60
67
  * @default MenuItem
61
68
  */
62
69
  BaseSelectOption: React.JSXElementConstructor<any>;
70
+ }
71
+ /**
72
+ * Grid components React prop interface containing all the overridable components.
73
+ */
74
+ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponent {
63
75
  /**
64
76
  * The custom Chip component used in the grid.
65
77
  * @default Chip
@@ -1,6 +1,7 @@
1
1
  import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridDensityState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState } from '../hooks';
2
2
  import type { GridRowsMetaState } from '../hooks/features/rows/gridRowsMetaState';
3
3
  import type { GridEditingState } from './gridEditRowModel';
4
+ import { GridHeaderFilteringState } from './gridHeaderFilteringModel';
4
5
  import type { GridRowSelectionModel } from './gridRowSelectionModel';
5
6
  /**
6
7
  * The state of `DataGrid`.
@@ -9,6 +10,7 @@ export interface GridStateCommunity {
9
10
  rows: GridRowsState;
10
11
  rowsMeta: GridRowsMetaState;
11
12
  editRows: GridEditingState;
13
+ headerFiltering: GridHeaderFilteringState;
12
14
  pagination: GridPaginationState;
13
15
  columns: GridColumnsState;
14
16
  columnGrouping: GridColumnsGroupingState;
package/models/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export * from './gridCell';
16
16
  export * from './gridColumnHeaderClass';
17
17
  export * from './api';
18
18
  export * from './gridIconSlotsComponent';
19
- export * from './gridSlotsComponent';
19
+ export type { GridSlotsComponent, UncapitalizedGridSlotsComponent } from './gridSlotsComponent';
20
20
  export * from './gridSlotsComponentsProps';
21
21
  export * from './gridDensity';
22
22
  export * from './logger';
package/models/index.js CHANGED
@@ -16,7 +16,6 @@ export * from './gridCell';
16
16
  export * from './gridColumnHeaderClass';
17
17
  export * from './api';
18
18
  export * from './gridIconSlotsComponent';
19
- export * from './gridSlotsComponent';
20
19
  export * from './gridSlotsComponentsProps';
21
20
  export * from './gridDensity';
22
21
  export * from './logger';
@@ -1,12 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["components", "componentsProps"];
4
2
  import * as React from 'react';
5
3
  import { useThemeProps } from '@mui/material/styles';
6
4
  import { GRID_DEFAULT_LOCALE_TEXT } from '../constants';
7
5
  import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
8
6
  import { GridEditModes } from '../models';
9
- import { computeSlots, uncapitalizeObjectKeys } from '../internals/utils';
7
+ import { computeSlots, useProps, uncapitalizeObjectKeys } from '../internals/utils';
10
8
  const DATA_GRID_FORCED_PROPS = {
11
9
  disableMultipleColumnsFiltering: true,
12
10
  disableMultipleColumnsSorting: true,
@@ -72,15 +70,10 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
72
70
  };
73
71
  const defaultSlots = uncapitalizeObjectKeys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
74
72
  export const useDataGridProps = inProps => {
75
- const _useThemeProps = useThemeProps({
76
- props: inProps,
77
- name: 'MuiDataGrid'
78
- }),
79
- {
80
- components,
81
- componentsProps
82
- } = _useThemeProps,
83
- themedProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
73
+ const [components, componentsProps, themedProps] = useProps(useThemeProps({
74
+ props: inProps,
75
+ name: 'MuiDataGrid'
76
+ }));
84
77
  const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
85
78
  const slots = React.useMemo(() => computeSlots({
86
79
  defaultSlots,
@@ -17,7 +17,6 @@ export const getGridNumericQuickFilterFn = value => {
17
17
  };
18
18
  };
19
19
  export const getGridNumericOperators = () => [{
20
- label: '=',
21
20
  value: '=',
22
21
  getApplyFilterFn: filterItem => {
23
22
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -34,7 +33,6 @@ export const getGridNumericOperators = () => [{
34
33
  type: 'number'
35
34
  }
36
35
  }, {
37
- label: '!=',
38
36
  value: '!=',
39
37
  getApplyFilterFn: filterItem => {
40
38
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -51,7 +49,6 @@ export const getGridNumericOperators = () => [{
51
49
  type: 'number'
52
50
  }
53
51
  }, {
54
- label: '>',
55
52
  value: '>',
56
53
  getApplyFilterFn: filterItem => {
57
54
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -71,7 +68,6 @@ export const getGridNumericOperators = () => [{
71
68
  type: 'number'
72
69
  }
73
70
  }, {
74
- label: '>=',
75
71
  value: '>=',
76
72
  getApplyFilterFn: filterItem => {
77
73
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -91,7 +87,6 @@ export const getGridNumericOperators = () => [{
91
87
  type: 'number'
92
88
  }
93
89
  }, {
94
- label: '<',
95
90
  value: '<',
96
91
  getApplyFilterFn: filterItem => {
97
92
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -111,7 +106,6 @@ export const getGridNumericOperators = () => [{
111
106
  type: 'number'
112
107
  }
113
108
  }, {
114
- label: '<=',
115
109
  value: '<=',
116
110
  getApplyFilterFn: filterItem => {
117
111
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -88,7 +88,10 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
88
88
  type: colDef.type === 'number' ? colDef.type : 'text',
89
89
  value: valueState ?? '',
90
90
  onChange: handleChange,
91
- endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {}) : undefined
91
+ endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
92
+ fontSize: "small",
93
+ color: "action"
94
+ }) : undefined
92
95
  }, other));
93
96
  });
94
97
  process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
@@ -1,17 +1,29 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
3
+ const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "label"];
4
4
  import * as React from 'react';
5
+ import PropTypes from 'prop-types';
5
6
  import { unstable_useId as useId } from '@mui/utils';
7
+ import { styled } from '@mui/material/styles';
6
8
  import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
7
9
  import { jsx as _jsx } from "react/jsx-runtime";
8
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
- export function GridFilterInputBoolean(props) {
11
+ const BooleanOperatorContainer = styled('div')({
12
+ display: 'flex',
13
+ alignItems: 'flex-end',
14
+ width: '100%'
15
+ });
16
+ function GridFilterInputBoolean(props) {
10
17
  const {
11
18
  item,
12
19
  applyValue,
13
20
  apiRef,
14
- focusElementRef
21
+ focusElementRef,
22
+ headerFilterMenu,
23
+ isFilterActive,
24
+ clearButton,
25
+ tabIndex,
26
+ label: labelProp
15
27
  } = props,
16
28
  others = _objectWithoutPropertiesLoose(props, _excluded);
17
29
  const [filterValueState, setFilterValueState] = React.useState(item.value || '');
@@ -31,39 +43,71 @@ export function GridFilterInputBoolean(props) {
31
43
  React.useEffect(() => {
32
44
  setFilterValueState(item.value || '');
33
45
  }, [item.value]);
34
- const label = apiRef.current.getLocaleText('filterPanelInputLabel');
35
- return /*#__PURE__*/_jsxs(React.Fragment, {
36
- children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
37
- id: labelId,
38
- shrink: true,
39
- variant: "standard",
40
- children: label
41
- })), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
42
- labelId: labelId,
43
- id: selectId,
44
- label: label,
45
- value: filterValueState,
46
- onChange: onFilterChange,
47
- variant: "standard",
48
- native: isSelectNative,
49
- displayEmpty: true,
50
- inputProps: {
51
- ref: focusElementRef
52
- }
53
- }, others, baseSelectProps, {
54
- children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
46
+ const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
47
+ return /*#__PURE__*/_jsxs(BooleanOperatorContainer, {
48
+ children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
49
+ fullWidth: true,
50
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, rootProps.slotProps?.baseInputLabel, {
51
+ id: labelId,
52
+ shrink: true,
53
+ variant: "standard",
54
+ children: label
55
+ })), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
56
+ labelId: labelId,
57
+ id: selectId,
58
+ label: label,
59
+ value: filterValueState,
60
+ onChange: onFilterChange,
61
+ variant: "standard",
55
62
  native: isSelectNative,
56
- value: "",
57
- children: apiRef.current.getLocaleText('filterValueAny')
58
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
59
- native: isSelectNative,
60
- value: "true",
61
- children: apiRef.current.getLocaleText('filterValueTrue')
62
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
63
- native: isSelectNative,
64
- value: "false",
65
- children: apiRef.current.getLocaleText('filterValueFalse')
63
+ displayEmpty: true,
64
+ startAdornment: isFilterActive ? headerFilterMenu : null,
65
+ inputProps: {
66
+ ref: focusElementRef,
67
+ tabIndex
68
+ }
69
+ }, others, baseSelectProps, {
70
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
71
+ native: isSelectNative,
72
+ value: "",
73
+ children: apiRef.current.getLocaleText('filterValueAny')
74
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
75
+ native: isSelectNative,
76
+ value: "true",
77
+ children: apiRef.current.getLocaleText('filterValueTrue')
78
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
79
+ native: isSelectNative,
80
+ value: "false",
81
+ children: apiRef.current.getLocaleText('filterValueFalse')
82
+ }))]
66
83
  }))]
67
- }))]
84
+ }), clearButton]
68
85
  });
69
- }
86
+ }
87
+ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
88
+ // ----------------------------- Warning --------------------------------
89
+ // | These PropTypes are generated from the TypeScript type definitions |
90
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
91
+ // ----------------------------------------------------------------------
92
+ apiRef: PropTypes.shape({
93
+ current: PropTypes.object.isRequired
94
+ }).isRequired,
95
+ applyValue: PropTypes.func.isRequired,
96
+ clearButton: PropTypes.node,
97
+ focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
98
+ current: PropTypes.any.isRequired
99
+ })]),
100
+ headerFilterMenu: PropTypes.node,
101
+ /**
102
+ * It is `true` if the filter either has a value or an operator with no value
103
+ * required is selected (e.g. `isEmpty`)
104
+ */
105
+ isFilterActive: PropTypes.bool,
106
+ item: PropTypes.shape({
107
+ field: PropTypes.string.isRequired,
108
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
109
+ operator: PropTypes.string.isRequired,
110
+ value: PropTypes.any
111
+ }).isRequired
112
+ } : void 0;
113
+ export { GridFilterInputBoolean };
@@ -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", "applyValue", "type", "apiRef", "focusElementRef", "InputProps"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "disabled"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -14,7 +14,12 @@ function GridFilterInputDate(props) {
14
14
  type,
15
15
  apiRef,
16
16
  focusElementRef,
17
- InputProps
17
+ InputProps,
18
+ headerFilterMenu,
19
+ isFilterActive,
20
+ clearButton,
21
+ tabIndex,
22
+ disabled
18
23
  } = props,
19
24
  other = _objectWithoutPropertiesLoose(props, _excluded);
20
25
  const filterTimeout = React.useRef();
@@ -44,6 +49,7 @@ function GridFilterInputDate(props) {
44
49
  setFilterValueState(String(itemValue));
45
50
  }, [item.value]);
46
51
  return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
52
+ fullWidth: true,
47
53
  id: id,
48
54
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
49
55
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
@@ -55,11 +61,19 @@ function GridFilterInputDate(props) {
55
61
  shrink: true
56
62
  },
57
63
  inputRef: focusElementRef,
58
- InputProps: _extends({}, applying ? {
59
- endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
60
- } : {}, InputProps, {
64
+ InputProps: _extends({}, applying || clearButton ? {
65
+ endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
66
+ fontSize: "small",
67
+ color: "action"
68
+ }) : clearButton
69
+ } : {}, headerFilterMenu && isFilterActive ? {
70
+ startAdornment: headerFilterMenu
71
+ } : {}, {
72
+ disabled
73
+ }, InputProps, {
61
74
  inputProps: _extends({
62
- max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'
75
+ max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
76
+ tabIndex
63
77
  }, InputProps?.inputProps)
64
78
  })
65
79
  }, other, rootProps.slotProps?.baseTextField));
@@ -73,7 +87,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
73
87
  current: PropTypes.object.isRequired
74
88
  }).isRequired,
75
89
  applyValue: PropTypes.func.isRequired,
90
+ clearButton: PropTypes.node,
76
91
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
92
+ headerFilterMenu: PropTypes.node,
93
+ /**
94
+ * It is `true` if the filter either has a value or an operator with no value
95
+ * required is selected (e.g. `isEmpty`)
96
+ */
97
+ isFilterActive: PropTypes.bool,
77
98
  item: PropTypes.shape({
78
99
  field: PropTypes.string.isRequired,
79
100
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),