@mui/x-data-grid 6.6.0 → 6.8.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 (313) hide show
  1. package/CHANGELOG.md +147 -13
  2. package/components/GridColumnHeaders.d.ts +2 -2
  3. package/components/GridColumnHeaders.js +3 -1
  4. package/components/GridRow.d.ts +2 -2
  5. package/components/GridRow.js +23 -69
  6. package/components/cell/GridCell.d.ts +24 -15
  7. package/components/cell/GridCell.js +422 -45
  8. package/components/cell/index.d.ts +2 -1
  9. package/components/cell/index.js +1 -1
  10. package/components/containers/GridRootStyles.js +38 -17
  11. package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  12. package/components/panel/GridColumnsPanel.d.ts +14 -0
  13. package/components/panel/GridColumnsPanel.js +14 -0
  14. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +0 -1
  15. package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  16. package/components/panel/filterPanel/GridFilterInputDate.d.ts +0 -1
  17. package/components/panel/filterPanel/GridFilterInputDate.js +1 -6
  18. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +0 -1
  19. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +5 -6
  20. package/components/panel/filterPanel/GridFilterInputValue.d.ts +0 -1
  21. package/components/panel/filterPanel/GridFilterInputValue.js +1 -6
  22. package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -0
  23. package/components/panel/filterPanel/GridFilterPanel.js +8 -0
  24. package/components/toolbar/GridToolbar.js +2 -2
  25. package/components/virtualization/GridVirtualScroller.js +4 -9
  26. package/components/virtualization/GridVirtualScrollerContent.js +11 -20
  27. package/constants/defaultGridSlotsComponents.js +6 -2
  28. package/constants/gridClasses.d.ts +4 -0
  29. package/constants/gridClasses.js +1 -1
  30. package/constants/localeTextConstants.js +4 -4
  31. package/hooks/core/useGridApiInitialization.js +4 -1
  32. package/hooks/core/useGridStateInitialization.js +2 -9
  33. package/hooks/features/clipboard/useGridClipboard.js +1 -4
  34. package/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
  35. package/hooks/features/editing/useGridCellEditing.js +5 -3
  36. package/hooks/features/editing/useGridRowEditing.js +14 -6
  37. package/hooks/features/filter/gridFilterUtils.d.ts +4 -1
  38. package/hooks/features/filter/gridFilterUtils.js +19 -13
  39. package/hooks/features/filter/useGridFilter.js +4 -2
  40. package/hooks/features/focus/useGridFocus.js +10 -4
  41. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  42. package/hooks/features/rows/useGridParamsApi.d.ts +2 -0
  43. package/hooks/features/rows/useGridParamsApi.js +7 -15
  44. package/hooks/features/rows/useGridRowsMeta.js +1 -1
  45. package/hooks/features/sorting/useGridSorting.js +2 -1
  46. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +8 -816
  47. package/hooks/features/virtualization/useGridVirtualScroller.js +42 -40
  48. package/hooks/utils/index.d.ts +1 -1
  49. package/hooks/utils/index.js +1 -1
  50. package/hooks/utils/useGridSelector.d.ts +3 -1
  51. package/hooks/utils/useGridSelector.js +37 -6
  52. package/hooks/utils/useLazyRef.d.ts +2 -0
  53. package/hooks/utils/useLazyRef.js +9 -0
  54. package/hooks/utils/useOnMount.d.ts +2 -0
  55. package/hooks/utils/useOnMount.js +7 -0
  56. package/index.js +1 -1
  57. package/legacy/components/GridColumnHeaders.js +3 -1
  58. package/legacy/components/GridRow.js +25 -69
  59. package/legacy/components/cell/GridCell.js +425 -46
  60. package/legacy/components/cell/index.js +1 -1
  61. package/legacy/components/containers/GridRootStyles.js +25 -18
  62. package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  63. package/legacy/components/panel/GridColumnsPanel.js +14 -0
  64. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +7 -7
  65. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +1 -5
  66. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
  67. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -5
  68. package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -0
  69. package/legacy/components/toolbar/GridToolbar.js +2 -2
  70. package/legacy/components/virtualization/GridVirtualScroller.js +4 -7
  71. package/legacy/components/virtualization/GridVirtualScrollerContent.js +10 -17
  72. package/legacy/constants/defaultGridSlotsComponents.js +6 -2
  73. package/legacy/constants/gridClasses.js +1 -1
  74. package/legacy/constants/localeTextConstants.js +4 -4
  75. package/legacy/hooks/core/useGridApiInitialization.js +4 -1
  76. package/legacy/hooks/core/useGridStateInitialization.js +2 -7
  77. package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -4
  78. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
  79. package/legacy/hooks/features/editing/useGridCellEditing.js +5 -3
  80. package/legacy/hooks/features/editing/useGridRowEditing.js +15 -7
  81. package/legacy/hooks/features/filter/gridFilterUtils.js +23 -19
  82. package/legacy/hooks/features/filter/useGridFilter.js +4 -2
  83. package/legacy/hooks/features/focus/useGridFocus.js +10 -4
  84. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  85. package/legacy/hooks/features/rows/useGridParamsApi.js +23 -15
  86. package/legacy/hooks/features/rows/useGridRowsMeta.js +1 -1
  87. package/legacy/hooks/features/sorting/useGridSorting.js +2 -1
  88. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +40 -36
  89. package/legacy/hooks/utils/index.js +1 -1
  90. package/legacy/hooks/utils/useGridSelector.js +43 -5
  91. package/legacy/hooks/utils/useLazyRef.js +9 -0
  92. package/legacy/hooks/utils/useOnMount.js +7 -0
  93. package/legacy/index.js +1 -1
  94. package/legacy/locales/arSD.js +4 -4
  95. package/legacy/locales/beBY.js +4 -4
  96. package/legacy/locales/bgBG.js +4 -4
  97. package/legacy/locales/csCZ.js +25 -27
  98. package/legacy/locales/daDK.js +4 -4
  99. package/legacy/locales/deDE.js +25 -27
  100. package/legacy/locales/elGR.js +70 -79
  101. package/legacy/locales/esES.js +4 -4
  102. package/legacy/locales/faIR.js +4 -4
  103. package/legacy/locales/fiFI.js +4 -4
  104. package/legacy/locales/heIL.js +4 -4
  105. package/legacy/locales/huHU.js +4 -4
  106. package/legacy/locales/itIT.js +4 -4
  107. package/legacy/locales/jaJP.js +4 -4
  108. package/legacy/locales/koKR.js +4 -4
  109. package/legacy/locales/nbNO.js +4 -4
  110. package/legacy/locales/plPL.js +4 -4
  111. package/legacy/locales/ptBR.js +4 -4
  112. package/legacy/locales/roRO.js +4 -4
  113. package/legacy/locales/ruRU.js +4 -4
  114. package/legacy/locales/skSK.js +4 -4
  115. package/legacy/locales/svSE.js +4 -4
  116. package/legacy/locales/trTR.js +16 -17
  117. package/legacy/locales/ukUA.js +4 -4
  118. package/legacy/locales/urPK.js +4 -4
  119. package/legacy/locales/viVN.js +4 -4
  120. package/legacy/locales/zhCN.js +4 -4
  121. package/legacy/locales/zhTW.js +4 -4
  122. package/legacy/utils/EventManager.js +2 -2
  123. package/legacy/utils/Store.js +34 -0
  124. package/legacy/utils/doesSupportPreventScroll.js +13 -0
  125. package/legacy/utils/fastMemo.js +5 -0
  126. package/legacy/utils/fastObjectShallowCompare.js +32 -0
  127. package/legacy/utils/keyboardUtils.js +4 -2
  128. package/locales/arSD.js +4 -4
  129. package/locales/beBY.js +4 -4
  130. package/locales/bgBG.js +4 -4
  131. package/locales/csCZ.js +25 -27
  132. package/locales/daDK.js +4 -4
  133. package/locales/deDE.js +25 -27
  134. package/locales/elGR.js +66 -79
  135. package/locales/esES.js +4 -4
  136. package/locales/faIR.js +4 -4
  137. package/locales/fiFI.js +4 -4
  138. package/locales/heIL.js +4 -4
  139. package/locales/huHU.js +4 -4
  140. package/locales/itIT.js +4 -4
  141. package/locales/jaJP.js +4 -4
  142. package/locales/koKR.js +4 -4
  143. package/locales/nbNO.js +4 -4
  144. package/locales/plPL.js +4 -4
  145. package/locales/ptBR.js +4 -4
  146. package/locales/roRO.js +4 -4
  147. package/locales/ruRU.js +4 -4
  148. package/locales/skSK.js +4 -4
  149. package/locales/svSE.js +4 -4
  150. package/locales/trTR.js +16 -17
  151. package/locales/ukUA.js +4 -4
  152. package/locales/urPK.js +4 -4
  153. package/locales/viVN.js +4 -4
  154. package/locales/zhCN.js +4 -4
  155. package/locales/zhTW.js +4 -4
  156. package/models/api/gridCoreApi.d.ts +6 -0
  157. package/models/colDef/gridColDef.d.ts +4 -3
  158. package/models/colDef/gridColType.d.ts +3 -1
  159. package/models/events/gridEventLookup.d.ts +11 -3
  160. package/modern/components/GridColumnHeaders.js +3 -1
  161. package/modern/components/GridRow.js +22 -69
  162. package/modern/components/cell/GridCell.js +421 -45
  163. package/modern/components/cell/index.js +1 -1
  164. package/modern/components/containers/GridRootStyles.js +38 -17
  165. package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  166. package/modern/components/panel/GridColumnsPanel.js +14 -0
  167. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  168. package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -6
  169. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +5 -6
  170. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -6
  171. package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -0
  172. package/modern/components/toolbar/GridToolbar.js +2 -2
  173. package/modern/components/virtualization/GridVirtualScroller.js +4 -9
  174. package/modern/components/virtualization/GridVirtualScrollerContent.js +10 -20
  175. package/modern/constants/defaultGridSlotsComponents.js +6 -2
  176. package/modern/constants/gridClasses.js +1 -1
  177. package/modern/constants/localeTextConstants.js +4 -4
  178. package/modern/hooks/core/useGridApiInitialization.js +4 -1
  179. package/modern/hooks/core/useGridStateInitialization.js +2 -9
  180. package/modern/hooks/features/clipboard/useGridClipboard.js +1 -4
  181. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
  182. package/modern/hooks/features/editing/useGridCellEditing.js +5 -3
  183. package/modern/hooks/features/editing/useGridRowEditing.js +14 -6
  184. package/modern/hooks/features/filter/gridFilterUtils.js +17 -12
  185. package/modern/hooks/features/filter/useGridFilter.js +4 -2
  186. package/modern/hooks/features/focus/useGridFocus.js +9 -4
  187. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  188. package/modern/hooks/features/rows/useGridParamsApi.js +7 -15
  189. package/modern/hooks/features/rows/useGridRowsMeta.js +1 -1
  190. package/modern/hooks/features/sorting/useGridSorting.js +2 -1
  191. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +42 -40
  192. package/modern/hooks/utils/index.js +1 -1
  193. package/modern/hooks/utils/useGridSelector.js +37 -6
  194. package/modern/hooks/utils/useLazyRef.js +9 -0
  195. package/modern/hooks/utils/useOnMount.js +7 -0
  196. package/modern/index.js +1 -1
  197. package/modern/locales/arSD.js +4 -4
  198. package/modern/locales/beBY.js +4 -4
  199. package/modern/locales/bgBG.js +4 -4
  200. package/modern/locales/csCZ.js +25 -27
  201. package/modern/locales/daDK.js +4 -4
  202. package/modern/locales/deDE.js +25 -27
  203. package/modern/locales/elGR.js +66 -79
  204. package/modern/locales/esES.js +4 -4
  205. package/modern/locales/faIR.js +4 -4
  206. package/modern/locales/fiFI.js +4 -4
  207. package/modern/locales/heIL.js +4 -4
  208. package/modern/locales/huHU.js +4 -4
  209. package/modern/locales/itIT.js +4 -4
  210. package/modern/locales/jaJP.js +4 -4
  211. package/modern/locales/koKR.js +4 -4
  212. package/modern/locales/nbNO.js +4 -4
  213. package/modern/locales/plPL.js +4 -4
  214. package/modern/locales/ptBR.js +4 -4
  215. package/modern/locales/roRO.js +4 -4
  216. package/modern/locales/ruRU.js +4 -4
  217. package/modern/locales/skSK.js +4 -4
  218. package/modern/locales/svSE.js +4 -4
  219. package/modern/locales/trTR.js +16 -17
  220. package/modern/locales/ukUA.js +4 -4
  221. package/modern/locales/urPK.js +4 -4
  222. package/modern/locales/viVN.js +4 -4
  223. package/modern/locales/zhCN.js +4 -4
  224. package/modern/locales/zhTW.js +4 -4
  225. package/modern/utils/EventManager.js +2 -2
  226. package/modern/utils/Store.js +24 -0
  227. package/modern/utils/doesSupportPreventScroll.js +13 -0
  228. package/modern/utils/fastMemo.js +5 -0
  229. package/modern/utils/fastObjectShallowCompare.js +32 -0
  230. package/modern/utils/keyboardUtils.js +4 -2
  231. package/node/components/GridColumnHeaders.js +4 -2
  232. package/node/components/GridRow.js +22 -69
  233. package/node/components/cell/GridCell.js +424 -47
  234. package/node/components/cell/index.js +17 -10
  235. package/node/components/containers/GridRootStyles.js +38 -17
  236. package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
  237. package/node/components/panel/GridColumnsPanel.js +14 -0
  238. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  239. package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -6
  240. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +5 -6
  241. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -6
  242. package/node/components/panel/filterPanel/GridFilterPanel.js +8 -0
  243. package/node/components/toolbar/GridToolbar.js +2 -2
  244. package/node/components/virtualization/GridVirtualScroller.js +4 -9
  245. package/node/components/virtualization/GridVirtualScrollerContent.js +10 -20
  246. package/node/constants/defaultGridSlotsComponents.js +4 -1
  247. package/node/constants/gridClasses.js +1 -1
  248. package/node/constants/localeTextConstants.js +4 -4
  249. package/node/hooks/core/useGridApiInitialization.js +4 -1
  250. package/node/hooks/core/useGridStateInitialization.js +2 -9
  251. package/node/hooks/features/clipboard/useGridClipboard.js +1 -4
  252. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -2
  253. package/node/hooks/features/editing/useGridCellEditing.js +5 -3
  254. package/node/hooks/features/editing/useGridRowEditing.js +14 -6
  255. package/node/hooks/features/filter/gridFilterUtils.js +17 -12
  256. package/node/hooks/features/filter/useGridFilter.js +7 -5
  257. package/node/hooks/features/focus/useGridFocus.js +9 -4
  258. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
  259. package/node/hooks/features/rows/useGridParamsApi.js +9 -15
  260. package/node/hooks/features/rows/useGridRowsMeta.js +1 -1
  261. package/node/hooks/features/sorting/useGridSorting.js +2 -1
  262. package/node/hooks/features/virtualization/useGridVirtualScroller.js +42 -38
  263. package/node/hooks/utils/index.js +14 -10
  264. package/node/hooks/utils/useGridSelector.js +41 -7
  265. package/node/hooks/utils/useLazyRef.js +17 -0
  266. package/node/hooks/utils/useOnMount.js +15 -0
  267. package/node/index.js +1 -1
  268. package/node/locales/arSD.js +4 -4
  269. package/node/locales/beBY.js +4 -4
  270. package/node/locales/bgBG.js +4 -4
  271. package/node/locales/csCZ.js +25 -27
  272. package/node/locales/daDK.js +4 -4
  273. package/node/locales/deDE.js +25 -27
  274. package/node/locales/elGR.js +66 -79
  275. package/node/locales/esES.js +4 -4
  276. package/node/locales/faIR.js +4 -4
  277. package/node/locales/fiFI.js +4 -4
  278. package/node/locales/heIL.js +4 -4
  279. package/node/locales/huHU.js +4 -4
  280. package/node/locales/itIT.js +4 -4
  281. package/node/locales/jaJP.js +4 -4
  282. package/node/locales/koKR.js +4 -4
  283. package/node/locales/nbNO.js +4 -4
  284. package/node/locales/plPL.js +4 -4
  285. package/node/locales/ptBR.js +4 -4
  286. package/node/locales/roRO.js +4 -4
  287. package/node/locales/ruRU.js +4 -4
  288. package/node/locales/skSK.js +4 -4
  289. package/node/locales/svSE.js +4 -4
  290. package/node/locales/trTR.js +16 -17
  291. package/node/locales/ukUA.js +4 -4
  292. package/node/locales/urPK.js +4 -4
  293. package/node/locales/viVN.js +4 -4
  294. package/node/locales/zhCN.js +4 -4
  295. package/node/locales/zhTW.js +4 -4
  296. package/node/utils/EventManager.js +2 -2
  297. package/node/utils/Store.js +31 -0
  298. package/node/utils/doesSupportPreventScroll.js +19 -0
  299. package/node/utils/fastMemo.js +13 -0
  300. package/node/utils/fastObjectShallowCompare.js +38 -0
  301. package/node/utils/keyboardUtils.js +4 -2
  302. package/package.json +1 -1
  303. package/themeAugmentation/overrides.d.ts +1 -1
  304. package/utils/EventManager.js +2 -2
  305. package/utils/Store.d.ts +11 -0
  306. package/utils/Store.js +24 -0
  307. package/utils/doesSupportPreventScroll.d.ts +1 -0
  308. package/utils/doesSupportPreventScroll.js +13 -0
  309. package/utils/fastMemo.d.ts +1 -0
  310. package/utils/fastMemo.js +5 -0
  311. package/utils/fastObjectShallowCompare.d.ts +1 -0
  312. package/utils/fastObjectShallowCompare.js +32 -0
  313. package/utils/keyboardUtils.js +4 -2
@@ -4,8 +4,22 @@ import type { GridColDef } from '../../models/colDef/gridColDef';
4
4
  export interface GridColumnsPanelProps extends GridPanelWrapperProps {
5
5
  sort?: 'asc' | 'desc';
6
6
  searchPredicate?: (column: GridColDef, searchValue: string) => boolean;
7
+ /**
8
+ * If `true`, the column search field will be focused automatically.
9
+ * If `false`, the first column switch input will be focused automatically.
10
+ * This helps to avoid input keyboard panel to popup automatically on touch devices.
11
+ * @default true
12
+ */
7
13
  autoFocusSearchField?: boolean;
14
+ /**
15
+ * If `true`, the `Hide all` button will not be displayed.
16
+ * @default false
17
+ */
8
18
  disableHideAllButton?: boolean;
19
+ /**
20
+ * If `true`, the `Show all` button will be disabled
21
+ * @default false
22
+ */
9
23
  disableShowAllButton?: boolean;
10
24
  /**
11
25
  * Returns the list of togglable columns.
@@ -198,8 +198,22 @@ process.env.NODE_ENV !== "production" ? GridColumnsPanel.propTypes = {
198
198
  // | These PropTypes are generated from the TypeScript type definitions |
199
199
  // | To update them edit the TypeScript types and run "yarn proptypes" |
200
200
  // ----------------------------------------------------------------------
201
+ /**
202
+ * If `true`, the column search field will be focused automatically.
203
+ * If `false`, the first column switch input will be focused automatically.
204
+ * This helps to avoid input keyboard panel to popup automatically on touch devices.
205
+ * @default true
206
+ */
201
207
  autoFocusSearchField: PropTypes.bool,
208
+ /**
209
+ * If `true`, the `Hide all` button will not be displayed.
210
+ * @default false
211
+ */
202
212
  disableHideAllButton: PropTypes.bool,
213
+ /**
214
+ * If `true`, the `Show all` button will be disabled
215
+ * @default false
216
+ */
203
217
  disableShowAllButton: PropTypes.bool,
204
218
  /**
205
219
  * Returns the list of togglable columns.
@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export type GridFilterInputBooleanProps = GridFilterInputValueProps & TextFieldProps & {
5
- headerFilterMenu?: React.ReactNode | null;
6
5
  clearButton?: React.ReactNode | null;
7
6
  /**
8
7
  * It is `true` if the filter either has a value or an operator with no value
@@ -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", "apiRef", "focusElementRef", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "label"];
3
+ const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -10,8 +10,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
11
  const BooleanOperatorContainer = styled('div')({
12
12
  display: 'flex',
13
- alignItems: 'flex-end',
14
- width: '100%'
13
+ alignItems: 'center',
14
+ width: '100%',
15
+ [`& button`]: {
16
+ margin: 'auto 0px 5px 5px'
17
+ }
15
18
  });
16
19
  function GridFilterInputBoolean(props) {
17
20
  var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _rootProps$slotProps3;
@@ -20,8 +23,6 @@ function GridFilterInputBoolean(props) {
20
23
  applyValue,
21
24
  apiRef,
22
25
  focusElementRef,
23
- headerFilterMenu,
24
- isFilterActive,
25
26
  clearButton,
26
27
  tabIndex,
27
28
  label: labelProp
@@ -62,7 +63,6 @@ function GridFilterInputBoolean(props) {
62
63
  variant: "standard",
63
64
  native: isSelectNative,
64
65
  displayEmpty: true,
65
- startAdornment: isFilterActive ? headerFilterMenu : null,
66
66
  inputProps: {
67
67
  ref: focusElementRef,
68
68
  tabIndex
@@ -98,7 +98,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
98
98
  focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
99
99
  current: PropTypes.any.isRequired
100
100
  })]),
101
- headerFilterMenu: PropTypes.node,
102
101
  /**
103
102
  * It is `true` if the filter either has a value or an operator with no value
104
103
  * required is selected (e.g. `isEmpty`)
@@ -3,7 +3,6 @@ import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export type GridFilterInputDateProps = GridFilterInputValueProps & TextFieldProps & {
5
5
  type?: 'date' | 'datetime-local';
6
- headerFilterMenu?: React.ReactNode | null;
7
6
  clearButton?: React.ReactNode | null;
8
7
  /**
9
8
  * It is `true` if the filter either has a value or an operator with no value
@@ -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", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "disabled"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "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';
@@ -16,8 +16,6 @@ function GridFilterInputDate(props) {
16
16
  apiRef,
17
17
  focusElementRef,
18
18
  InputProps,
19
- headerFilterMenu,
20
- isFilterActive,
21
19
  clearButton,
22
20
  tabIndex,
23
21
  disabled
@@ -68,8 +66,6 @@ function GridFilterInputDate(props) {
68
66
  fontSize: "small",
69
67
  color: "action"
70
68
  }) : clearButton
71
- } : {}, headerFilterMenu && isFilterActive ? {
72
- startAdornment: headerFilterMenu
73
69
  } : {}, {
74
70
  disabled
75
71
  }, InputProps, {
@@ -91,7 +87,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
91
87
  applyValue: PropTypes.func.isRequired,
92
88
  clearButton: PropTypes.node,
93
89
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
94
- headerFilterMenu: PropTypes.node,
95
90
  /**
96
91
  * It is `true` if the filter either has a value or an operator with no value
97
92
  * required is selected (e.g. `isEmpty`)
@@ -3,7 +3,6 @@ import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  import { GridSingleSelectColDef } from '../../../models/colDef/gridColDef';
5
5
  export type GridFilterInputSingleSelectProps = GridFilterInputValueProps & TextFieldProps & Pick<GridSingleSelectColDef, 'getOptionLabel' | 'getOptionValue'> & {
6
- headerFilterMenu?: React.ReactNode | null;
7
6
  clearButton?: React.ReactNode | null;
8
7
  /**
9
8
  * It is `true` if the filter either has a value or an operator with no value
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "headerFilterMenu", "isFilterActive", "clearButton"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -37,7 +37,10 @@ const renderSingleSelectOptions = ({
37
37
  const SingleSelectOperatorContainer = styled('div')({
38
38
  display: 'flex',
39
39
  alignItems: 'flex-end',
40
- width: '100%'
40
+ width: '100%',
41
+ [`& button`]: {
42
+ margin: 'auto 0px 5px 5px'
43
+ }
41
44
  });
42
45
  function GridFilterInputSingleSelect(props) {
43
46
  var _item$value, _rootProps$slotProps$, _rootProps$slotProps, _rootProps$slotProps$2, _resolvedColumn, _resolvedColumn2, _rootProps$slotProps2, _rootProps$slotProps3, _rootProps$slotProps4;
@@ -52,8 +55,6 @@ function GridFilterInputSingleSelect(props) {
52
55
  placeholder,
53
56
  tabIndex,
54
57
  label: labelProp,
55
- headerFilterMenu,
56
- isFilterActive,
57
58
  clearButton
58
59
  } = props,
59
60
  others = _objectWithoutPropertiesLoose(props, _excluded);
@@ -128,7 +129,6 @@ function GridFilterInputSingleSelect(props) {
128
129
  labelId: labelId,
129
130
  value: filterValueState,
130
131
  onChange: onFilterChange,
131
- startAdornment: isFilterActive ? headerFilterMenu : null,
132
132
  variant: "standard",
133
133
  type: type || 'text',
134
134
  inputProps: {
@@ -173,7 +173,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
173
173
  * @returns {string} The value to be used.
174
174
  */
175
175
  getOptionValue: PropTypes.func,
176
- headerFilterMenu: PropTypes.node,
177
176
  /**
178
177
  * It is `true` if the filter either has a value or an operator with no value
179
178
  * required is selected (e.g. `isEmpty`)
@@ -4,7 +4,6 @@ import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export declare const SUBMIT_FILTER_STROKE_TIME = 500;
5
5
  export type GridTypeFilterInputValueProps = GridFilterInputValueProps & TextFieldProps & {
6
6
  type?: 'text' | 'number' | 'date' | 'datetime-local';
7
- headerFilterMenu?: React.ReactNode | null;
8
7
  clearButton?: React.ReactNode | null;
9
8
  /**
10
9
  * It is `true` if the filter either has a value or an operator with no value
@@ -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", "tabIndex", "disabled", "headerFilterMenu", "isFilterActive", "clearButton", "InputProps"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -17,8 +17,6 @@ function GridFilterInputValue(props) {
17
17
  focusElementRef,
18
18
  tabIndex,
19
19
  disabled,
20
- headerFilterMenu,
21
- isFilterActive,
22
20
  clearButton,
23
21
  InputProps
24
22
  } = props,
@@ -65,8 +63,6 @@ function GridFilterInputValue(props) {
65
63
  fontSize: "small",
66
64
  color: "action"
67
65
  }) : clearButton
68
- } : {}, headerFilterMenu && isFilterActive ? {
69
- startAdornment: headerFilterMenu
70
66
  } : {}, {
71
67
  disabled
72
68
  }, InputProps, {
@@ -91,7 +87,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
91
87
  applyValue: PropTypes.func.isRequired,
92
88
  clearButton: PropTypes.node,
93
89
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
94
- headerFilterMenu: PropTypes.node,
95
90
  /**
96
91
  * It is `true` if the filter either has a value or an operator with no value
97
92
  * required is selected (e.g. `isEmpty`)
@@ -22,7 +22,15 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOp
22
22
  * Props passed to each filter form.
23
23
  */
24
24
  filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'logicOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps' | 'filterColumns'>;
25
+ /**
26
+ * If `true`, the `Add filter` button will not be displayed.
27
+ * @default false
28
+ */
25
29
  disableAddFilterButton?: boolean;
30
+ /**
31
+ * If `true`, the `Remove all` button will be disabled
32
+ * @default false
33
+ */
26
34
  disableRemoveAllButton?: boolean;
27
35
  /**
28
36
  * @ignore - do not document.
@@ -179,7 +179,15 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
179
179
  * If not specified, the order is derived from the `columns` prop.
180
180
  */
181
181
  columnsSort: PropTypes.oneOf(['asc', 'desc']),
182
+ /**
183
+ * If `true`, the `Add filter` button will not be displayed.
184
+ * @default false
185
+ */
182
186
  disableAddFilterButton: PropTypes.bool,
187
+ /**
188
+ * If `true`, the `Remove all` button will be disabled
189
+ * @default false
190
+ */
183
191
  disableRemoveAllButton: PropTypes.bool,
184
192
  /**
185
193
  * Props passed to each filter form.
@@ -14,8 +14,8 @@ import { GridToolbarQuickFilter } from './GridToolbarQuickFilter';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  const GridToolbar = /*#__PURE__*/React.forwardRef(function GridToolbar(props, ref) {
17
- // TODO v6: think about where export option should be passed.
18
- // from componentProps={{ toolbarExport: { ...exportOption} }} seems to be more appropriate
17
+ // TODO v7: think about where export option should be passed.
18
+ // from slotProps={{ toolbarExport: { ...exportOption } }} seems to be more appropriate
19
19
  const {
20
20
  csvOptions,
21
21
  printOptions,
@@ -1,6 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["className"];
4
2
  import * as React from 'react';
5
3
  import clsx from 'clsx';
6
4
  import { styled } from '@mui/system';
@@ -31,16 +29,13 @@ const VirtualScrollerRoot = styled('div', {
31
29
  }
32
30
  });
33
31
  const GridVirtualScroller = /*#__PURE__*/React.forwardRef(function GridVirtualScroller(props, ref) {
34
- const {
35
- className
36
- } = props,
37
- other = _objectWithoutPropertiesLoose(props, _excluded);
38
32
  const rootProps = useGridRootProps();
39
33
  const classes = useUtilityClasses(rootProps);
40
34
  return /*#__PURE__*/_jsx(VirtualScrollerRoot, _extends({
41
- ref: ref,
42
- className: clsx(classes.root, className),
35
+ ref: ref
36
+ }, props, {
37
+ className: clsx(classes.root, props.className),
43
38
  ownerState: rootProps
44
- }, other));
39
+ }));
45
40
  });
46
41
  export { GridVirtualScroller };
@@ -1,6 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["className", "style"];
4
2
  import * as React from 'react';
5
3
  import clsx from 'clsx';
6
4
  import { styled } from '@mui/system';
@@ -8,11 +6,10 @@ import { unstable_composeClasses as composeClasses } from '@mui/utils';
8
6
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
9
7
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
10
8
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const useUtilityClasses = ownerState => {
9
+ const useUtilityClasses = (props, overflowedContent) => {
12
10
  const {
13
- classes,
14
- overflowedContent
15
- } = ownerState;
11
+ classes
12
+ } = props;
16
13
  const slots = {
17
14
  root: ['virtualScrollerContent', overflowedContent && 'virtualScrollerContent--overflowed']
18
15
  };
@@ -24,21 +21,15 @@ const VirtualScrollerContentRoot = styled('div', {
24
21
  overridesResolver: (props, styles) => styles.virtualScrollerContent
25
22
  })({});
26
23
  const GridVirtualScrollerContent = /*#__PURE__*/React.forwardRef(function GridVirtualScrollerContent(props, ref) {
27
- const {
28
- className,
29
- style
30
- } = props,
31
- other = _objectWithoutPropertiesLoose(props, _excluded);
24
+ var _props$style;
32
25
  const rootProps = useGridRootProps();
33
- const ownerState = _extends({}, rootProps, {
34
- overflowedContent: !rootProps.autoHeight && (style == null ? void 0 : style.minHeight) === 'auto'
35
- });
36
- const classes = useUtilityClasses(ownerState);
26
+ const overflowedContent = !rootProps.autoHeight && ((_props$style = props.style) == null ? void 0 : _props$style.minHeight) === 'auto';
27
+ const classes = useUtilityClasses(rootProps, overflowedContent);
37
28
  return /*#__PURE__*/_jsx(VirtualScrollerContentRoot, _extends({
38
- ref: ref,
39
- className: clsx(classes.root, className),
40
- ownerState: ownerState,
41
- style: style
42
- }, other));
29
+ ref: ref
30
+ }, props, {
31
+ ownerState: rootProps,
32
+ className: clsx(classes.root, props.className)
33
+ }));
43
34
  });
44
35
  export { GridVirtualScrollerContent };
@@ -1,11 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { GridCell, GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridPreferencesPanel, GridRow, GridColumnHeaderFilterIconButton } from '../components';
2
+ import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridPreferencesPanel, GridRow, GridColumnHeaderFilterIconButton } from '../components';
3
+ import { GridCellV7 } from '../components/cell/GridCell';
3
4
  import { GridColumnHeaders } from '../components/GridColumnHeaders';
4
5
  import { GridColumnMenu } from '../components/menu/columnMenu/GridColumnMenu';
5
6
  import { GridNoResultsOverlay } from '../components/GridNoResultsOverlay';
6
7
  import materialSlots from '../material';
8
+
9
+ // TODO: camelCase these key. It's a private helper now.
10
+ // Remove then need to call `uncapitalizeObjectKeys`.
7
11
  export const DATA_GRID_DEFAULT_SLOTS_COMPONENTS = _extends({}, materialSlots, {
8
- Cell: GridCell,
12
+ Cell: GridCellV7,
9
13
  SkeletonCell: GridSkeletonCell,
10
14
  ColumnHeaderFilterIconButton: GridColumnHeaderFilterIconButton,
11
15
  ColumnMenu: GridColumnMenu,
@@ -307,6 +307,10 @@ export interface GridClasses {
307
307
  * Styles applied to the column header separator icon element.
308
308
  */
309
309
  iconSeparator: string;
310
+ /**
311
+ * Styles applied to the column header filter row.
312
+ */
313
+ headerFilterRow: string;
310
314
  /**
311
315
  * Styles applied to the main container element.
312
316
  */
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_gen
2
2
  export function getDataGridUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiDataGrid', slot);
4
4
  }
5
- export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
5
+ export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
@@ -80,10 +80,10 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
80
80
  headerFilterOperatorIsAnyOf: 'Is any of',
81
81
  'headerFilterOperator=': 'Equals',
82
82
  'headerFilterOperator!=': 'Not equals',
83
- 'headerFilterOperator>': 'Is greater than',
84
- 'headerFilterOperator>=': 'Is greater than or equal to',
85
- 'headerFilterOperator<': 'Is less than',
86
- 'headerFilterOperator<=': 'Is less than or equal to',
83
+ 'headerFilterOperator>': 'Greater than',
84
+ 'headerFilterOperator>=': 'Greater than or equal to',
85
+ 'headerFilterOperator<': 'Less than',
86
+ 'headerFilterOperator<=': 'Less than or equal to',
87
87
  // Filter values text
88
88
  filterValueAny: 'any',
89
89
  filterValueTrue: 'true',
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { Store } from '../../utils/Store';
2
3
  import { useGridApiMethod } from '../utils/useGridApiMethod';
3
4
  import { GridSignature } from '../utils/useGridApiEventHandler';
4
5
  import { EventManager } from '../../utils/EventManager';
@@ -35,8 +36,10 @@ const wrapPublicApi = publicApi => {
35
36
  export function useGridApiInitialization(inputApiRef, props) {
36
37
  const publicApiRef = React.useRef();
37
38
  if (!publicApiRef.current) {
39
+ const state = {};
38
40
  publicApiRef.current = {
39
- state: {},
41
+ state,
42
+ store: Store.create(state),
40
43
  instanceId: {
41
44
  id: globalId
42
45
  }
@@ -1,6 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["stateId"];
4
2
  import * as React from 'react';
5
3
  import { GridSignature } from '../utils/useGridApiEventHandler';
6
4
  import { useGridApiMethod } from '../utils';
@@ -9,13 +7,7 @@ export const useGridStateInitialization = (apiRef, props) => {
9
7
  const controlStateMapRef = React.useRef({});
10
8
  const [, rawForceUpdate] = React.useState();
11
9
  const registerControlState = React.useCallback(controlStateItem => {
12
- const {
13
- stateId
14
- } = controlStateItem,
15
- others = _objectWithoutPropertiesLoose(controlStateItem, _excluded);
16
- controlStateMapRef.current[stateId] = _extends({}, others, {
17
- stateId
18
- });
10
+ controlStateMapRef.current[controlStateItem.stateId] = controlStateItem;
19
11
  }, []);
20
12
  const setState = React.useCallback((state, reason) => {
21
13
  let newState;
@@ -60,6 +52,7 @@ export const useGridStateInitialization = (apiRef, props) => {
60
52
  if (apiRef.current.publishEvent) {
61
53
  apiRef.current.publishEvent('stateChange', newState);
62
54
  }
55
+ apiRef.current.store.update(newState);
63
56
  }
64
57
  if (updatedControlStateIds.length === 1) {
65
58
  const {
@@ -54,10 +54,7 @@ export const useGridClipboard = (apiRef, props) => {
54
54
  const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
55
55
  const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
56
56
  const handleCopy = React.useCallback(event => {
57
- const isModifierKeyPressed = event.ctrlKey || event.metaKey;
58
- // event.code === 'KeyC' is not enough as event.code assume a QWERTY keyboard layout which would
59
- // be wrong with a Dvorak keyboard (as if pressing J).
60
- if (String.fromCharCode(event.keyCode) !== 'C' || !isModifierKeyPressed) {
57
+ if (!((event.ctrlKey || event.metaKey) && event.key === 'c')) {
61
58
  return;
62
59
  }
63
60
 
@@ -10,7 +10,7 @@ import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
10
10
  import { GridColumnHeaderItem } from '../../../components/columnHeaders/GridColumnHeaderItem';
11
11
  import { getFirstColumnIndexToRender, getTotalHeaderHeight } from '../columns/gridColumnsUtils';
12
12
  import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
13
- import { getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
13
+ import { areRenderContextsEqual, getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
14
14
  import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  const GridColumnHeaderRow = styled('div', {
@@ -49,12 +49,18 @@ export const useGridColumnHeaders = props => {
49
49
  const rootProps = useGridRootProps();
50
50
  const innerRef = React.useRef(null);
51
51
  const handleInnerRef = useForkRef(innerRefProp, innerRef);
52
- const [renderContext, setRenderContext] = React.useState(null);
52
+ const [renderContext, setRenderContextRaw] = React.useState(null);
53
53
  const prevRenderContext = React.useRef(renderContext);
54
54
  const prevScrollLeft = React.useRef(0);
55
55
  const currentPage = useGridVisibleRows(apiRef, rootProps);
56
56
  const totalHeaderHeight = getTotalHeaderHeight(apiRef, rootProps.columnHeaderHeight);
57
57
  const headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
58
+ const setRenderContext = React.useCallback(nextRenderContext => {
59
+ if (renderContext && nextRenderContext && areRenderContextsEqual(renderContext, nextRenderContext)) {
60
+ return;
61
+ }
62
+ setRenderContextRaw(nextRenderContext);
63
+ }, [renderContext]);
58
64
  React.useEffect(() => {
59
65
  apiRef.current.columnHeadersContainerElementRef.current.scrollLeft = 0;
60
66
  }, [apiRef]);
@@ -130,7 +136,7 @@ export const useGridColumnHeaders = props => {
130
136
  if (nextRenderContext && canUpdateInnerPosition) {
131
137
  updateInnerPosition(nextRenderContext);
132
138
  }
133
- }, [updateInnerPosition]);
139
+ }, [updateInnerPosition, setRenderContext]);
134
140
  const handleColumnResizeStart = React.useCallback(params => setResizeCol(params.field), []);
135
141
  const handleColumnResizeStop = React.useCallback(() => setResizeCol(''), []);
136
142
  const handleColumnReorderStart = React.useCallback(params => setDragCol(params.field), []);
@@ -14,7 +14,7 @@ import { buildWarning } from '../../../utils/warning';
14
14
  import { gridRowsDataRowIdToIdLookupSelector } from '../rows/gridRowsSelector';
15
15
  import { deepClone } from '../../../utils/utils';
16
16
  import { GridCellEditStartReasons, GridCellEditStopReasons } from '../../../models/params/gridEditCellParams';
17
- const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#persistence.'], 'error');
17
+ const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence.'], 'error');
18
18
  export const useGridCellEditing = (apiRef, props) => {
19
19
  const [cellModesModel, setCellModesModel] = React.useState({});
20
20
  const cellModesModelRef = React.useRef(cellModesModel);
@@ -122,7 +122,8 @@ export const useGridCellEditing = (apiRef, props) => {
122
122
  id,
123
123
  field,
124
124
  reason,
125
- key
125
+ key,
126
+ colDef
126
127
  } = params;
127
128
  const startCellEditModeParams = {
128
129
  id,
@@ -134,7 +135,8 @@ export const useGridCellEditing = (apiRef, props) => {
134
135
  // The sequence of events makes the key pressed by the end-users update the textbox directly.
135
136
  startCellEditModeParams.deleteValue = true;
136
137
  } else {
137
- startCellEditModeParams.initialValue = key;
138
+ const initialValue = colDef.valueParser ? colDef.valueParser(key) : key;
139
+ startCellEditModeParams.initialValue = initialValue;
138
140
  }
139
141
  } else if (reason === GridCellEditStartReasons.deleteKeyDown) {
140
142
  startCellEditModeParams.deleteValue = true;
@@ -15,7 +15,8 @@ import { buildWarning } from '../../../utils/warning';
15
15
  import { gridRowsDataRowIdToIdLookupSelector } from '../rows/gridRowsSelector';
16
16
  import { deepClone } from '../../../utils/utils';
17
17
  import { GridRowEditStopReasons, GridRowEditStartReasons } from '../../../models/params/gridRowParams';
18
- const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#persistence.'], 'error');
18
+ import { GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';
19
+ const missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence.'], 'error');
19
20
  export const useGridRowEditing = (apiRef, props) => {
20
21
  const [rowModesModel, setRowModesModel] = React.useState({});
21
22
  const rowModesModelRef = React.useRef(rowModesModel);
@@ -114,7 +115,13 @@ export const useGridRowEditing = (apiRef, props) => {
114
115
  } else if (event.key === 'Enter') {
115
116
  reason = GridRowEditStopReasons.enterKeyDown;
116
117
  } else if (event.key === 'Tab') {
117
- const columnFields = gridColumnFieldsSelector(apiRef).filter(field => apiRef.current.isCellEditable(apiRef.current.getCellParams(params.id, field)));
118
+ const columnFields = gridColumnFieldsSelector(apiRef).filter(field => {
119
+ const column = apiRef.current.getColumn(field);
120
+ if (column.type === GRID_ACTIONS_COLUMN_TYPE) {
121
+ return true;
122
+ }
123
+ return apiRef.current.isCellEditable(apiRef.current.getCellParams(params.id, field));
124
+ });
118
125
  if (event.shiftKey) {
119
126
  if (params.field === columnFields[0]) {
120
127
  // Exit if user pressed Shift+Tab on the first field
@@ -135,8 +142,7 @@ export const useGridRowEditing = (apiRef, props) => {
135
142
  }
136
143
  }
137
144
  if (reason) {
138
- const rowParams = apiRef.current.getRowParams(params.id);
139
- const newParams = _extends({}, rowParams, {
145
+ const newParams = _extends({}, apiRef.current.getRowParams(params.id), {
140
146
  reason,
141
147
  field: params.field
142
148
  });
@@ -178,7 +184,8 @@ export const useGridRowEditing = (apiRef, props) => {
178
184
  id,
179
185
  field,
180
186
  reason,
181
- key
187
+ key,
188
+ columns
182
189
  } = params;
183
190
  const startRowEditModeParams = {
184
191
  id,
@@ -190,7 +197,8 @@ export const useGridRowEditing = (apiRef, props) => {
190
197
  // The sequence of events makes the key pressed by the end-users update the textbox directly.
191
198
  startRowEditModeParams.deleteValue = !!field;
192
199
  } else {
193
- startRowEditModeParams.initialValue = key;
200
+ const colDef = columns.find(col => col.field === field);
201
+ startRowEditModeParams.initialValue = colDef.valueParser ? colDef.valueParser(key) : key;
194
202
  }
195
203
  } else if (reason === GridRowEditStartReasons.deleteKeyDown) {
196
204
  startRowEditModeParams.deleteValue = !!field;
@@ -29,5 +29,8 @@ export declare const buildAggregatedFilterItemsApplier: (filterModel: GridFilter
29
29
  */
30
30
  export declare const buildAggregatedQuickFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridFilterItemApplierNotAggregated | null;
31
31
  export declare const buildAggregatedFilterApplier: (filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => GridAggregatedFilterItemApplier;
32
- export declare const passFilterLogic: (allFilterItemResults: (null | GridFilterItemResult)[], allQuickFilterResults: (null | GridQuickFilterValueResult)[], filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>) => boolean;
32
+ type FilterCache = {
33
+ cleanedFilterItems?: GridFilterItem[];
34
+ };
35
+ export declare const passFilterLogic: (allFilterItemResults: (null | GridFilterItemResult)[], allQuickFilterResults: (null | GridQuickFilterValueResult)[], filterModel: GridFilterModel, apiRef: React.MutableRefObject<GridApiCommunity>, cache: FilterCache) => boolean;
33
36
  export {};