@mui/x-data-grid 6.3.1 → 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 (349) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/DataGrid/DataGrid.js +20 -1
  3. package/DataGrid/useDataGridComponent.js +2 -2
  4. package/DataGrid/useDataGridProps.js +8 -13
  5. package/colDef/gridBooleanColDef.js +19 -1
  6. package/colDef/gridDateColDef.js +6 -2
  7. package/colDef/gridNumericOperators.js +0 -6
  8. package/colDef/gridSingleSelectColDef.js +21 -1
  9. package/components/base/GridBody.js +2 -1
  10. package/components/cell/GridEditInputCell.js +4 -1
  11. package/components/containers/GridRootStyles.js +1 -0
  12. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +15 -2
  13. package/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
  14. package/components/panel/filterPanel/GridFilterInputDate.d.ts +8 -1
  15. package/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  16. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  17. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  18. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +8 -1
  19. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
  20. package/components/panel/filterPanel/GridFilterInputValue.d.ts +11 -4
  21. package/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  22. package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -1
  23. package/components/panel/filterPanel/GridFilterPanel.js +1 -1
  24. package/components/panel/filterPanel/index.d.ts +3 -1
  25. package/components/panel/filterPanel/index.js +2 -1
  26. package/constants/localeTextConstants.js +26 -0
  27. package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +12 -1
  28. package/hooks/features/clipboard/useGridClipboard.d.ts +2 -1
  29. package/hooks/features/clipboard/useGridClipboard.js +43 -26
  30. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +9 -2
  31. package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  32. package/hooks/features/dimensions/useGridDimensions.js +4 -6
  33. package/hooks/features/editing/useGridCellEditing.js +7 -3
  34. package/hooks/features/editing/useGridEditing.js +0 -3
  35. package/hooks/features/editing/useGridRowEditing.js +7 -3
  36. package/hooks/features/export/serializers/csvSerializer.d.ts +5 -0
  37. package/hooks/features/export/serializers/csvSerializer.js +46 -6
  38. package/hooks/features/export/useGridCsvExport.d.ts +2 -1
  39. package/hooks/features/export/useGridCsvExport.js +7 -5
  40. package/hooks/features/focus/gridFocusState.d.ts +2 -0
  41. package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
  42. package/hooks/features/focus/gridFocusStateSelector.js +6 -0
  43. package/hooks/features/focus/useGridFocus.js +55 -9
  44. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -0
  45. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
  46. package/hooks/features/headerFiltering/index.d.ts +1 -0
  47. package/hooks/features/headerFiltering/index.js +1 -0
  48. package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +6 -0
  49. package/hooks/features/headerFiltering/useGridHeaderFiltering.js +91 -0
  50. package/hooks/features/index.d.ts +1 -0
  51. package/hooks/features/index.js +2 -1
  52. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
  53. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +124 -4
  54. package/hooks/features/rows/useGridRows.js +16 -1
  55. package/index.js +1 -1
  56. package/internals/index.d.ts +9 -3
  57. package/internals/index.js +7 -2
  58. package/internals/utils/index.d.ts +1 -0
  59. package/internals/utils/index.js +2 -1
  60. package/internals/utils/useProps.d.ts +8 -0
  61. package/internals/utils/useProps.js +13 -0
  62. package/joy/icons.d.ts +33 -0
  63. package/joy/icons.js +433 -0
  64. package/joy/joySlots.js +114 -4
  65. package/legacy/DataGrid/DataGrid.js +20 -1
  66. package/legacy/DataGrid/useDataGridComponent.js +2 -2
  67. package/legacy/DataGrid/useDataGridProps.js +11 -9
  68. package/legacy/colDef/gridBooleanColDef.js +21 -1
  69. package/legacy/colDef/gridDateColDef.js +10 -2
  70. package/legacy/colDef/gridNumericOperators.js +0 -6
  71. package/legacy/colDef/gridSingleSelectColDef.js +21 -1
  72. package/legacy/components/base/GridBody.js +2 -1
  73. package/legacy/components/cell/GridEditInputCell.js +4 -1
  74. package/legacy/components/containers/GridRootStyles.js +1 -0
  75. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +79 -35
  76. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +26 -5
  77. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  78. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  79. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +54 -31
  80. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +28 -5
  81. package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
  82. package/legacy/components/panel/filterPanel/index.js +2 -1
  83. package/legacy/constants/localeTextConstants.js +26 -0
  84. package/legacy/hooks/features/clipboard/useGridClipboard.js +44 -26
  85. package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
  86. package/legacy/hooks/features/dimensions/useGridDimensions.js +4 -6
  87. package/legacy/hooks/features/editing/useGridCellEditing.js +7 -3
  88. package/legacy/hooks/features/editing/useGridEditing.js +0 -3
  89. package/legacy/hooks/features/editing/useGridRowEditing.js +7 -3
  90. package/legacy/hooks/features/export/serializers/csvSerializer.js +43 -6
  91. package/legacy/hooks/features/export/useGridCsvExport.js +8 -5
  92. package/legacy/hooks/features/focus/gridFocusStateSelector.js +10 -0
  93. package/legacy/hooks/features/focus/useGridFocus.js +58 -9
  94. package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +11 -0
  95. package/legacy/hooks/features/headerFiltering/index.js +1 -0
  96. package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +93 -0
  97. package/legacy/hooks/features/index.js +2 -1
  98. package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +123 -4
  99. package/legacy/hooks/features/rows/useGridRows.js +16 -1
  100. package/legacy/index.js +1 -1
  101. package/legacy/internals/index.js +7 -2
  102. package/legacy/internals/utils/index.js +2 -1
  103. package/legacy/internals/utils/useProps.js +11 -0
  104. package/legacy/joy/icons.js +432 -0
  105. package/legacy/joy/joySlots.js +118 -4
  106. package/legacy/locales/arSD.js +28 -0
  107. package/legacy/locales/beBY.js +28 -0
  108. package/legacy/locales/bgBG.js +28 -0
  109. package/legacy/locales/csCZ.js +36 -8
  110. package/legacy/locales/daDK.js +28 -0
  111. package/legacy/locales/deDE.js +30 -2
  112. package/legacy/locales/elGR.js +27 -0
  113. package/legacy/locales/esES.js +28 -0
  114. package/legacy/locales/faIR.js +28 -0
  115. package/legacy/locales/fiFI.js +28 -0
  116. package/legacy/locales/frFR.js +34 -6
  117. package/legacy/locales/heIL.js +30 -2
  118. package/legacy/locales/huHU.js +28 -0
  119. package/legacy/locales/itIT.js +28 -0
  120. package/legacy/locales/jaJP.js +28 -0
  121. package/legacy/locales/koKR.js +28 -0
  122. package/legacy/locales/nbNO.js +28 -0
  123. package/legacy/locales/nlNL.js +28 -0
  124. package/legacy/locales/plPL.js +28 -0
  125. package/legacy/locales/ptBR.js +29 -1
  126. package/legacy/locales/roRO.js +28 -0
  127. package/legacy/locales/ruRU.js +28 -0
  128. package/legacy/locales/skSK.js +28 -0
  129. package/legacy/locales/svSE.js +28 -0
  130. package/legacy/locales/trTR.js +28 -0
  131. package/legacy/locales/ukUA.js +36 -9
  132. package/legacy/locales/urPK.js +28 -0
  133. package/legacy/locales/viVN.js +27 -0
  134. package/legacy/locales/zhCN.js +28 -0
  135. package/legacy/locales/zhTW.js +28 -0
  136. package/legacy/material/index.js +5 -1
  137. package/legacy/models/api/index.js +0 -1
  138. package/legacy/models/index.js +0 -1
  139. package/legacy/utils/domUtils.js +14 -1
  140. package/locales/arSD.js +28 -0
  141. package/locales/beBY.js +28 -0
  142. package/locales/bgBG.js +28 -0
  143. package/locales/csCZ.js +36 -8
  144. package/locales/daDK.js +28 -0
  145. package/locales/deDE.js +30 -2
  146. package/locales/elGR.js +27 -0
  147. package/locales/esES.js +28 -0
  148. package/locales/faIR.js +28 -0
  149. package/locales/fiFI.js +28 -0
  150. package/locales/frFR.js +34 -6
  151. package/locales/heIL.js +30 -2
  152. package/locales/huHU.js +28 -0
  153. package/locales/itIT.js +28 -0
  154. package/locales/jaJP.js +28 -0
  155. package/locales/koKR.js +28 -0
  156. package/locales/nbNO.js +28 -0
  157. package/locales/nlNL.js +28 -0
  158. package/locales/plPL.js +28 -0
  159. package/locales/ptBR.js +29 -1
  160. package/locales/roRO.js +28 -0
  161. package/locales/ruRU.js +28 -0
  162. package/locales/skSK.js +28 -0
  163. package/locales/svSE.js +28 -0
  164. package/locales/trTR.js +28 -0
  165. package/locales/ukUA.js +36 -9
  166. package/locales/urPK.js +28 -0
  167. package/locales/viVN.js +27 -0
  168. package/locales/zhCN.js +28 -0
  169. package/locales/zhTW.js +28 -0
  170. package/material/index.d.ts +3 -65
  171. package/material/index.js +5 -1
  172. package/models/api/gridApiCommon.d.ts +3 -3
  173. package/models/api/gridCoreApi.d.ts +8 -0
  174. package/models/api/gridFocusApi.d.ts +6 -0
  175. package/models/api/gridHeaderFilteringApi.d.ts +30 -0
  176. package/models/api/gridLocaleTextApi.d.ts +25 -0
  177. package/models/api/index.d.ts +0 -1
  178. package/models/api/index.js +0 -1
  179. package/models/events/gridEventLookup.d.ts +33 -1
  180. package/models/gridFilterOperator.d.ts +4 -0
  181. package/models/gridHeaderFilteringModel.d.ts +5 -0
  182. package/models/gridHeaderFilteringModel.js +1 -0
  183. package/models/gridSlotsComponent.d.ts +21 -4
  184. package/models/gridSlotsComponentsProps.d.ts +4 -0
  185. package/models/gridStateCommunity.d.ts +2 -0
  186. package/models/index.d.ts +1 -1
  187. package/models/index.js +0 -1
  188. package/models/props/DataGridProps.d.ts +19 -0
  189. package/modern/DataGrid/DataGrid.js +20 -1
  190. package/modern/DataGrid/useDataGridComponent.js +2 -2
  191. package/modern/DataGrid/useDataGridProps.js +8 -13
  192. package/modern/colDef/gridBooleanColDef.js +19 -1
  193. package/modern/colDef/gridDateColDef.js +6 -2
  194. package/modern/colDef/gridNumericOperators.js +0 -6
  195. package/modern/colDef/gridSingleSelectColDef.js +21 -1
  196. package/modern/components/base/GridBody.js +2 -1
  197. package/modern/components/cell/GridEditInputCell.js +4 -1
  198. package/modern/components/containers/GridRootStyles.js +1 -0
  199. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
  200. package/modern/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  201. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  202. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  203. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
  204. package/modern/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  205. package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
  206. package/modern/components/panel/filterPanel/index.js +2 -1
  207. package/modern/constants/localeTextConstants.js +26 -0
  208. package/modern/hooks/features/clipboard/useGridClipboard.js +43 -26
  209. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  210. package/modern/hooks/features/dimensions/useGridDimensions.js +3 -5
  211. package/modern/hooks/features/editing/useGridCellEditing.js +7 -3
  212. package/modern/hooks/features/editing/useGridEditing.js +0 -3
  213. package/modern/hooks/features/editing/useGridRowEditing.js +7 -3
  214. package/modern/hooks/features/export/serializers/csvSerializer.js +44 -6
  215. package/modern/hooks/features/export/useGridCsvExport.js +7 -5
  216. package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -0
  217. package/modern/hooks/features/focus/useGridFocus.js +55 -9
  218. package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
  219. package/modern/hooks/features/headerFiltering/index.js +1 -0
  220. package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +90 -0
  221. package/modern/hooks/features/index.js +2 -1
  222. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +124 -4
  223. package/modern/hooks/features/rows/useGridRows.js +16 -1
  224. package/modern/index.js +1 -1
  225. package/modern/internals/index.js +7 -2
  226. package/modern/internals/utils/index.js +2 -1
  227. package/modern/internals/utils/useProps.js +13 -0
  228. package/modern/joy/icons.js +433 -0
  229. package/modern/joy/joySlots.js +110 -4
  230. package/modern/locales/arSD.js +28 -0
  231. package/modern/locales/beBY.js +28 -0
  232. package/modern/locales/bgBG.js +28 -0
  233. package/modern/locales/csCZ.js +36 -8
  234. package/modern/locales/daDK.js +28 -0
  235. package/modern/locales/deDE.js +30 -2
  236. package/modern/locales/elGR.js +27 -0
  237. package/modern/locales/esES.js +28 -0
  238. package/modern/locales/faIR.js +28 -0
  239. package/modern/locales/fiFI.js +28 -0
  240. package/modern/locales/frFR.js +34 -6
  241. package/modern/locales/heIL.js +30 -2
  242. package/modern/locales/huHU.js +28 -0
  243. package/modern/locales/itIT.js +28 -0
  244. package/modern/locales/jaJP.js +28 -0
  245. package/modern/locales/koKR.js +28 -0
  246. package/modern/locales/nbNO.js +28 -0
  247. package/modern/locales/nlNL.js +28 -0
  248. package/modern/locales/plPL.js +28 -0
  249. package/modern/locales/ptBR.js +29 -1
  250. package/modern/locales/roRO.js +28 -0
  251. package/modern/locales/ruRU.js +28 -0
  252. package/modern/locales/skSK.js +28 -0
  253. package/modern/locales/svSE.js +28 -0
  254. package/modern/locales/trTR.js +28 -0
  255. package/modern/locales/ukUA.js +36 -9
  256. package/modern/locales/urPK.js +28 -0
  257. package/modern/locales/viVN.js +27 -0
  258. package/modern/locales/zhCN.js +28 -0
  259. package/modern/locales/zhTW.js +28 -0
  260. package/modern/material/index.js +5 -1
  261. package/modern/models/api/gridHeaderFilteringApi.js +1 -0
  262. package/modern/models/api/index.js +0 -1
  263. package/modern/models/gridHeaderFilteringModel.js +1 -0
  264. package/modern/models/index.js +0 -1
  265. package/modern/utils/domUtils.js +13 -1
  266. package/node/DataGrid/DataGrid.js +20 -1
  267. package/node/DataGrid/useDataGridComponent.js +2 -2
  268. package/node/DataGrid/useDataGridProps.js +7 -12
  269. package/node/colDef/gridBooleanColDef.js +19 -1
  270. package/node/colDef/gridDateColDef.js +6 -2
  271. package/node/colDef/gridNumericOperators.js +0 -6
  272. package/node/colDef/gridSingleSelectColDef.js +21 -1
  273. package/node/components/base/GridBody.js +2 -1
  274. package/node/components/cell/GridEditInputCell.js +4 -1
  275. package/node/components/containers/GridRootStyles.js +1 -0
  276. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +78 -35
  277. package/node/components/panel/filterPanel/GridFilterInputDate.js +27 -6
  278. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
  279. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
  280. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -32
  281. package/node/components/panel/filterPanel/GridFilterInputValue.js +29 -6
  282. package/node/components/panel/filterPanel/GridFilterPanel.js +2 -1
  283. package/node/components/panel/filterPanel/index.js +26 -8
  284. package/node/constants/localeTextConstants.js +26 -0
  285. package/node/hooks/features/clipboard/useGridClipboard.js +42 -25
  286. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
  287. package/node/hooks/features/dimensions/useGridDimensions.js +3 -5
  288. package/node/hooks/features/editing/useGridCellEditing.js +7 -3
  289. package/node/hooks/features/editing/useGridEditing.js +0 -3
  290. package/node/hooks/features/editing/useGridRowEditing.js +7 -3
  291. package/node/hooks/features/export/serializers/csvSerializer.js +46 -6
  292. package/node/hooks/features/export/useGridCsvExport.js +6 -3
  293. package/node/hooks/features/focus/gridFocusStateSelector.js +9 -1
  294. package/node/hooks/features/focus/useGridFocus.js +55 -9
  295. package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +15 -0
  296. package/node/hooks/features/headerFiltering/index.js +16 -0
  297. package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +101 -0
  298. package/node/hooks/features/index.js +11 -0
  299. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +124 -4
  300. package/node/hooks/features/rows/useGridRows.js +16 -1
  301. package/node/index.js +1 -1
  302. package/node/internals/index.js +69 -1
  303. package/node/internals/utils/index.js +11 -0
  304. package/node/internals/utils/useProps.js +22 -0
  305. package/node/joy/icons.js +471 -0
  306. package/node/joy/joySlots.js +110 -3
  307. package/node/locales/arSD.js +28 -0
  308. package/node/locales/beBY.js +28 -0
  309. package/node/locales/bgBG.js +28 -0
  310. package/node/locales/csCZ.js +36 -8
  311. package/node/locales/daDK.js +28 -0
  312. package/node/locales/deDE.js +30 -2
  313. package/node/locales/elGR.js +27 -0
  314. package/node/locales/esES.js +28 -0
  315. package/node/locales/faIR.js +28 -0
  316. package/node/locales/fiFI.js +28 -0
  317. package/node/locales/frFR.js +34 -6
  318. package/node/locales/heIL.js +30 -2
  319. package/node/locales/huHU.js +28 -0
  320. package/node/locales/itIT.js +28 -0
  321. package/node/locales/jaJP.js +28 -0
  322. package/node/locales/koKR.js +28 -0
  323. package/node/locales/nbNO.js +28 -0
  324. package/node/locales/nlNL.js +28 -0
  325. package/node/locales/plPL.js +28 -0
  326. package/node/locales/ptBR.js +29 -1
  327. package/node/locales/roRO.js +28 -0
  328. package/node/locales/ruRU.js +28 -0
  329. package/node/locales/skSK.js +28 -0
  330. package/node/locales/svSE.js +28 -0
  331. package/node/locales/trTR.js +28 -0
  332. package/node/locales/ukUA.js +36 -9
  333. package/node/locales/urPK.js +28 -0
  334. package/node/locales/viVN.js +27 -0
  335. package/node/locales/zhCN.js +28 -0
  336. package/node/locales/zhTW.js +28 -0
  337. package/node/material/index.js +5 -1
  338. package/node/models/api/index.js +0 -11
  339. package/node/models/gridHeaderFilteringModel.js +5 -0
  340. package/node/models/index.js +0 -11
  341. package/node/utils/domUtils.js +15 -1
  342. package/package.json +1 -1
  343. package/utils/domUtils.d.ts +1 -0
  344. package/utils/domUtils.js +13 -1
  345. package/models/api/gridClipboardApi.d.ts +0 -11
  346. /package/legacy/models/api/{gridClipboardApi.js → gridHeaderFilteringApi.js} +0 -0
  347. /package/{models/api/gridClipboardApi.js → legacy/models/gridHeaderFilteringModel.js} +0 -0
  348. /package/{modern/models/api/gridClipboardApi.js → models/api/gridHeaderFilteringApi.js} +0 -0
  349. /package/node/models/api/{gridClipboardApi.js → gridHeaderFilteringApi.js} +0 -0
@@ -1,8 +1,15 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  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
+ clearButton?: React.ReactNode | null;
8
+ /**
9
+ * It is `true` if the filter either has a value or an operator with no value
10
+ * required is selected (e.g. `isEmpty`)
11
+ */
12
+ isFilterActive?: boolean;
6
13
  type?: 'singleSelect';
7
14
  };
8
15
  declare function GridFilterInputSingleSelect(props: GridFilterInputSingleSelectProps): JSX.Element | null;
@@ -1,9 +1,10 @@
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"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "headerFilterMenu", "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';
7
+ import { styled } from '@mui/material/styles';
7
8
  import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
8
9
  import { getValueFromValueOptions, isSingleSelectColDef } from './filterPanelUtils';
9
10
  import { createElement as _createElement } from "react";
@@ -33,6 +34,11 @@ const renderSingleSelectOptions = ({
33
34
  }), label);
34
35
  });
35
36
  };
37
+ const SingleSelectOperatorContainer = styled('div')({
38
+ display: 'flex',
39
+ alignItems: 'flex-end',
40
+ width: '100%'
41
+ });
36
42
  function GridFilterInputSingleSelect(props) {
37
43
  var _item$value, _rootProps$slotProps$, _rootProps$slotProps, _rootProps$slotProps$2, _resolvedColumn, _resolvedColumn2, _rootProps$slotProps2, _rootProps$slotProps3, _rootProps$slotProps4;
38
44
  const {
@@ -42,7 +48,13 @@ function GridFilterInputSingleSelect(props) {
42
48
  apiRef,
43
49
  focusElementRef,
44
50
  getOptionLabel: getOptionLabelProp,
45
- getOptionValue: getOptionValueProp
51
+ getOptionValue: getOptionValueProp,
52
+ placeholder,
53
+ tabIndex,
54
+ label: labelProp,
55
+ headerFilterMenu,
56
+ isFilterActive,
57
+ clearButton
46
58
  } = props,
47
59
  others = _objectWithoutPropertiesLoose(props, _excluded);
48
60
  const [filterValueState, setFilterValueState] = React.useState((_item$value = item.value) != null ? _item$value : '');
@@ -101,36 +113,40 @@ function GridFilterInputSingleSelect(props) {
101
113
  if (!isSingleSelectColDef(resolvedColumn)) {
102
114
  return null;
103
115
  }
104
- const label = apiRef.current.getLocaleText('filterPanelInputLabel');
105
- return /*#__PURE__*/_jsxs(React.Fragment, {
106
- children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseInputLabel, {
107
- id: labelId,
108
- shrink: true,
109
- variant: "standard",
110
- children: label
111
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
112
- id: id,
113
- label: label,
114
- labelId: labelId,
115
- value: filterValueState,
116
- onChange: onFilterChange,
117
- variant: "standard",
118
- type: type || 'text',
119
- inputProps: {
120
- ref: focusElementRef,
121
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder')
122
- },
123
- native: isSelectNative
124
- }, others, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
125
- children: renderSingleSelectOptions({
126
- column: resolvedColumn,
127
- OptionComponent: rootProps.slots.baseSelectOption,
128
- getOptionLabel,
129
- getOptionValue,
130
- isSelectNative,
131
- baseSelectOptionProps: (_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseSelectOption
132
- })
133
- }))]
116
+ const label = labelProp != null ? labelProp : apiRef.current.getLocaleText('filterPanelInputLabel');
117
+ return /*#__PURE__*/_jsxs(SingleSelectOperatorContainer, {
118
+ children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
119
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseInputLabel, {
120
+ id: labelId,
121
+ shrink: true,
122
+ variant: "standard",
123
+ children: label
124
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
125
+ id: id,
126
+ label: label,
127
+ labelId: labelId,
128
+ value: filterValueState,
129
+ onChange: onFilterChange,
130
+ startAdornment: isFilterActive ? headerFilterMenu : null,
131
+ variant: "standard",
132
+ type: type || 'text',
133
+ inputProps: {
134
+ tabIndex,
135
+ ref: focusElementRef,
136
+ placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
137
+ },
138
+ native: isSelectNative
139
+ }, others, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
140
+ children: renderSingleSelectOptions({
141
+ column: resolvedColumn,
142
+ OptionComponent: rootProps.slots.baseSelectOption,
143
+ getOptionLabel,
144
+ getOptionValue,
145
+ isSelectNative,
146
+ baseSelectOptionProps: (_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseSelectOption
147
+ })
148
+ }))]
149
+ }), clearButton]
134
150
  });
135
151
  }
136
152
  process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
@@ -142,6 +158,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
142
158
  current: PropTypes.object.isRequired
143
159
  }).isRequired,
144
160
  applyValue: PropTypes.func.isRequired,
161
+ clearButton: PropTypes.node,
145
162
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
146
163
  /**
147
164
  * Used to determine the label displayed for a given value option.
@@ -155,6 +172,12 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
155
172
  * @returns {string} The value to be used.
156
173
  */
157
174
  getOptionValue: PropTypes.func,
175
+ headerFilterMenu: PropTypes.node,
176
+ /**
177
+ * It is `true` if the filter either has a value or an operator with no value
178
+ * required is selected (e.g. `isEmpty`)
179
+ */
180
+ isFilterActive: PropTypes.bool,
158
181
  item: PropTypes.shape({
159
182
  field: PropTypes.string.isRequired,
160
183
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -1,11 +1,18 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export declare const SUBMIT_FILTER_STROKE_TIME = 500;
5
- export interface GridTypeFilterInputValueProps extends GridFilterInputValueProps {
5
+ export type GridTypeFilterInputValueProps = GridFilterInputValueProps & TextFieldProps & {
6
6
  type?: 'text' | 'number' | 'date' | 'datetime-local';
7
- }
8
- declare function GridFilterInputValue(props: GridTypeFilterInputValueProps & TextFieldProps): JSX.Element;
7
+ headerFilterMenu?: React.ReactNode | null;
8
+ clearButton?: React.ReactNode | null;
9
+ /**
10
+ * It is `true` if the filter either has a value or an operator with no value
11
+ * required is selected (e.g. `isEmpty`)
12
+ */
13
+ isFilterActive?: boolean;
14
+ };
15
+ declare function GridFilterInputValue(props: GridTypeFilterInputValueProps): JSX.Element;
9
16
  declare namespace GridFilterInputValue {
10
17
  var propTypes: any;
11
18
  }
@@ -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"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "headerFilterMenu", "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';
@@ -14,7 +14,13 @@ function GridFilterInputValue(props) {
14
14
  applyValue,
15
15
  type,
16
16
  apiRef,
17
- focusElementRef
17
+ focusElementRef,
18
+ tabIndex,
19
+ disabled,
20
+ headerFilterMenu,
21
+ isFilterActive,
22
+ clearButton,
23
+ InputProps
18
24
  } = props,
19
25
  others = _objectWithoutPropertiesLoose(props, _excluded);
20
26
  const filterTimeout = React.useRef();
@@ -46,9 +52,6 @@ function GridFilterInputValue(props) {
46
52
  const itemValue = (_item$value2 = item.value) != null ? _item$value2 : '';
47
53
  setFilterValueState(String(itemValue));
48
54
  }, [item.value]);
49
- const InputProps = applying ? {
50
- endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
51
- } : others.InputProps;
52
55
  return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
53
56
  id: id,
54
57
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
@@ -57,7 +60,20 @@ function GridFilterInputValue(props) {
57
60
  onChange: onFilterChange,
58
61
  variant: "standard",
59
62
  type: type || 'text',
60
- InputProps: InputProps,
63
+ InputProps: _extends({}, applying || clearButton ? {
64
+ endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
65
+ fontSize: "small",
66
+ color: "action"
67
+ }) : clearButton
68
+ } : {}, headerFilterMenu && isFilterActive ? {
69
+ startAdornment: headerFilterMenu
70
+ } : {}, {
71
+ disabled
72
+ }, InputProps, {
73
+ inputProps: _extends({
74
+ tabIndex
75
+ }, InputProps == null ? void 0 : InputProps.inputProps)
76
+ }),
61
77
  InputLabelProps: {
62
78
  shrink: true
63
79
  },
@@ -73,7 +89,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
73
89
  current: PropTypes.object.isRequired
74
90
  }).isRequired,
75
91
  applyValue: PropTypes.func.isRequired,
92
+ clearButton: PropTypes.node,
76
93
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
94
+ headerFilterMenu: PropTypes.node,
95
+ /**
96
+ * It is `true` if the filter either has a value or an operator with no value
97
+ * required is selected (e.g. `isEmpty`)
98
+ */
99
+ isFilterActive: PropTypes.bool,
77
100
  item: PropTypes.shape({
78
101
  field: PropTypes.string.isRequired,
79
102
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -29,5 +29,6 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOp
29
29
  */
30
30
  children?: React.ReactNode;
31
31
  }
32
+ declare const getGridFilter: (col: GridStateColDef) => GridFilterItem;
32
33
  declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
33
- export { GridFilterPanel };
34
+ export { GridFilterPanel, getGridFilter };
@@ -209,4 +209,4 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
209
209
  */
210
210
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
211
211
  } : void 0;
212
- export { GridFilterPanel };
212
+ export { GridFilterPanel, getGridFilter };
@@ -2,7 +2,9 @@ export * from './GridFilterForm';
2
2
  export * from './GridFilterInputValue';
3
3
  export * from './GridFilterInputDate';
4
4
  export * from './GridFilterInputSingleSelect';
5
+ export * from './GridFilterInputBoolean';
5
6
  export * from './GridFilterInputValueProps';
6
- export * from './GridFilterPanel';
7
+ export { GridFilterPanel } from './GridFilterPanel';
8
+ export type { GetColumnForNewFilterArgs } from './GridFilterPanel';
7
9
  export * from './GridFilterInputMultipleValue';
8
10
  export * from './GridFilterInputMultipleSingleSelect';
@@ -2,7 +2,8 @@ export * from './GridFilterForm';
2
2
  export * from './GridFilterInputValue';
3
3
  export * from './GridFilterInputDate';
4
4
  export * from './GridFilterInputSingleSelect';
5
+ export * from './GridFilterInputBoolean';
5
6
  export * from './GridFilterInputValueProps';
6
- export * from './GridFilterPanel';
7
+ export { GridFilterPanel } from './GridFilterPanel';
7
8
  export * from './GridFilterInputMultipleValue';
8
9
  export * from './GridFilterInputMultipleSingleSelect';
@@ -58,6 +58,32 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
58
58
  filterOperatorIsEmpty: 'is empty',
59
59
  filterOperatorIsNotEmpty: 'is not empty',
60
60
  filterOperatorIsAnyOf: 'is any of',
61
+ 'filterOperator=': '=',
62
+ 'filterOperator!=': '!=',
63
+ 'filterOperator>': '>',
64
+ 'filterOperator>=': '>=',
65
+ 'filterOperator<': '<',
66
+ 'filterOperator<=': '<=',
67
+ // Header filter operators text
68
+ headerFilterOperatorContains: 'Contains',
69
+ headerFilterOperatorEquals: 'Equals',
70
+ headerFilterOperatorStartsWith: 'Starts with',
71
+ headerFilterOperatorEndsWith: 'Ends with',
72
+ headerFilterOperatorIs: 'Is',
73
+ headerFilterOperatorNot: 'Is not',
74
+ headerFilterOperatorAfter: 'Is after',
75
+ headerFilterOperatorOnOrAfter: 'Is on or after',
76
+ headerFilterOperatorBefore: 'Is before',
77
+ headerFilterOperatorOnOrBefore: 'Is on or before',
78
+ headerFilterOperatorIsEmpty: 'Is empty',
79
+ headerFilterOperatorIsNotEmpty: 'Is not empty',
80
+ headerFilterOperatorIsAnyOf: 'Is any of',
81
+ 'headerFilterOperator=': 'Equals',
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',
61
87
  // Filter values text
62
88
  filterValueAny: 'any',
63
89
  filterValueTrue: 'true',
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { GridCellIndexCoordinates, GridScrollParams, GridColDef, GridCellCoordinates, GridCellParams } from '../../../models';
2
+ import { GridCellIndexCoordinates, GridScrollParams, GridColDef, GridCellCoordinates, GridCellParams, GridEditMode } from '../../../models';
3
3
  import { GridInitialStateCommunity } from '../../../models/gridStateCommunity';
4
4
  import { GridExportStateParams, GridRestoreStatePreProcessingContext, GridRestoreStatePreProcessingValue } from '../../features/statePersistence/gridStatePersistenceInterface';
5
5
  import { GridHydrateColumnsValue } from '../../features/columns/gridColumnsInterfaces';
@@ -64,6 +64,17 @@ export interface GridPipeProcessingLookup {
64
64
  cell: GridCellParams | null;
65
65
  };
66
66
  };
67
+ clipboardCopy: {
68
+ value: string;
69
+ };
70
+ canStartEditing: {
71
+ value: boolean;
72
+ context: {
73
+ event: React.KeyboardEvent;
74
+ cellParams: GridCellParams;
75
+ editMode: GridEditMode;
76
+ };
77
+ };
67
78
  }
68
79
  export type GridPipeProcessor<P extends GridPipeProcessorGroup> = (value: GridPipeProcessingLookup[P]['value'], context: GridPipeProcessingLookup[P] extends {
69
80
  context: any;
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommunity } from '../../../models/api/gridApiCommunity';
3
+ import type { DataGridProcessedProps } from '../../../models/props/DataGridProps';
3
4
  /**
4
5
  * @requires useGridCsvExport (method)
5
6
  * @requires useGridSelection (method)
6
7
  */
7
- export declare const useGridClipboard: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>) => void;
8
+ export declare const useGridClipboard: (apiRef: React.MutableRefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'unstable_ignoreValueFormatterDuringExport' | 'onClipboardCopy' | 'clipboardCopyCellDelimiter'>) => void;
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
- import { useGridApiMethod, useGridNativeEventListener } from '../../utils';
2
+ import { useGridApiOptionHandler, useGridNativeEventListener } from '../../utils';
3
+ import { gridFocusCellSelector } from '../focus/gridFocusStateSelector';
4
+ import { serializeCellValue } from '../export/serializers/csvSerializer';
3
5
  function writeToClipboardPolyfill(data) {
4
6
  const span = document.createElement('span');
5
7
  span.style.whiteSpace = 'pre';
@@ -18,6 +20,15 @@ function writeToClipboardPolyfill(data) {
18
20
  document.body.removeChild(span);
19
21
  }
20
22
  }
23
+ function copyToClipboard(data) {
24
+ if (navigator.clipboard) {
25
+ navigator.clipboard.writeText(data).catch(() => {
26
+ writeToClipboardPolyfill(data);
27
+ });
28
+ } else {
29
+ writeToClipboardPolyfill(data);
30
+ }
31
+ }
21
32
  function hasNativeSelection(element) {
22
33
  var _window$getSelection;
23
34
  // When getSelection is called on an <iframe> that is not displayed Firefox will return null.
@@ -38,24 +49,11 @@ function hasNativeSelection(element) {
38
49
  * @requires useGridCsvExport (method)
39
50
  * @requires useGridSelection (method)
40
51
  */
41
- export const useGridClipboard = apiRef => {
42
- const copySelectedRowsToClipboard = React.useCallback(() => {
43
- if (apiRef.current.getSelectedRows().size === 0) {
44
- return;
45
- }
46
- const data = apiRef.current.getDataAsCsv({
47
- includeHeaders: false,
48
- delimiter: '\t'
49
- });
50
- if (navigator.clipboard) {
51
- navigator.clipboard.writeText(data).catch(() => {
52
- writeToClipboardPolyfill(data);
53
- });
54
- } else {
55
- writeToClipboardPolyfill(data);
56
- }
57
- }, [apiRef]);
58
- const handleKeydown = React.useCallback(event => {
52
+ export const useGridClipboard = (apiRef, props) => {
53
+ const ignoreValueFormatterProp = props.unstable_ignoreValueFormatterDuringExport;
54
+ const ignoreValueFormatter = (typeof ignoreValueFormatterProp === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
55
+ const clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
56
+ const handleCopy = React.useCallback(event => {
59
57
  const isModifierKeyPressed = event.ctrlKey || event.metaKey;
60
58
  // event.code === 'KeyC' is not enough as event.code assume a QWERTY keyboard layout which would
61
59
  // be wrong with a Dvorak keyboard (as if pressing J).
@@ -67,11 +65,30 @@ export const useGridClipboard = apiRef => {
67
65
  if (hasNativeSelection(event.target)) {
68
66
  return;
69
67
  }
70
- apiRef.current.unstable_copySelectedRowsToClipboard();
71
- }, [apiRef]);
72
- useGridNativeEventListener(apiRef, apiRef.current.rootElementRef, 'keydown', handleKeydown);
73
- const clipboardApi = {
74
- unstable_copySelectedRowsToClipboard: copySelectedRowsToClipboard
75
- };
76
- useGridApiMethod(apiRef, clipboardApi, 'public');
68
+ let textToCopy = '';
69
+ const selectedRows = apiRef.current.getSelectedRows();
70
+ if (selectedRows.size > 0) {
71
+ textToCopy = apiRef.current.getDataAsCsv({
72
+ includeHeaders: false,
73
+ // TODO: make it configurable
74
+ delimiter: clipboardCopyCellDelimiter
75
+ });
76
+ } else {
77
+ const focusedCell = gridFocusCellSelector(apiRef);
78
+ if (focusedCell) {
79
+ const cellParams = apiRef.current.getCellParams(focusedCell.id, focusedCell.field);
80
+ textToCopy = serializeCellValue(cellParams, {
81
+ delimiterCharacter: clipboardCopyCellDelimiter,
82
+ ignoreValueFormatter
83
+ });
84
+ }
85
+ }
86
+ textToCopy = apiRef.current.unstable_applyPipeProcessors('clipboardCopy', textToCopy);
87
+ if (textToCopy) {
88
+ copyToClipboard(textToCopy);
89
+ apiRef.current.publishEvent('clipboardCopy', textToCopy);
90
+ }
91
+ }, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
92
+ useGridNativeEventListener(apiRef, apiRef.current.rootElementRef, 'keydown', handleCopy);
93
+ useGridApiOptionHandler(apiRef, 'clipboardCopy', props.onClipboardCopy);
77
94
  };
@@ -25,7 +25,7 @@ export interface UseGridColumnHeadersProps {
25
25
  columnGroupsHeaderStructure: GridGroupingStructure[][];
26
26
  hasOtherElementInTabSequence: boolean;
27
27
  }
28
- interface GetHeadersParams {
28
+ export interface GetHeadersParams {
29
29
  renderContext: GridRenderContext | null;
30
30
  minFirstColumn?: number;
31
31
  maxLastColumn?: number;
@@ -33,6 +33,13 @@ interface GetHeadersParams {
33
33
  export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
34
34
  renderContext: GridRenderContext | null;
35
35
  getColumnHeaders: (params?: GetHeadersParams, other?: {}) => JSX.Element | null;
36
+ getColumnsToRender: (params?: GetHeadersParams) => {
37
+ renderedColumns: GridStateColDef[];
38
+ firstColumnToRender: number;
39
+ lastColumnToRender: number;
40
+ minFirstColumn: number;
41
+ maxLastColumn: number;
42
+ } | null;
36
43
  getColumnGroupHeaders: (params?: GetHeadersParams) => JSX.Element[] | null;
37
44
  isDragging: boolean;
38
45
  getRootProps: (other?: {}) => {
@@ -46,5 +53,5 @@ export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) =>
46
53
  ref: ((instance: HTMLDivElement | null) => void) | null;
47
54
  role: string;
48
55
  };
56
+ headerHeight: number;
49
57
  };
50
- export {};
@@ -263,7 +263,7 @@ export const useGridColumnHeaders = props => {
263
263
  const tabIndex = columnGroupHeaderTabIndexState !== null && columnGroupHeaderTabIndexState.depth === depth && columnFields.includes(columnGroupHeaderTabIndexState.field) ? 0 : -1;
264
264
  const headerInfo = {
265
265
  groupId,
266
- width: columnFields.map(field => apiRef.current.getColumn(field).computedWidth).reduce((acc, val) => acc + val, 0),
266
+ width: columnFields.reduce((acc, field) => acc + apiRef.current.getColumn(field).computedWidth, 0),
267
267
  fields: columnFields,
268
268
  colIndex: columnIndex,
269
269
  hasFocus,
@@ -319,6 +319,7 @@ export const useGridColumnHeaders = props => {
319
319
  return {
320
320
  renderContext,
321
321
  getColumnHeaders,
322
+ getColumnsToRender,
322
323
  getColumnGroupHeaders,
323
324
  isDragging: !!dragCol,
324
325
  getRootProps: (other = {}) => _extends({
@@ -327,6 +328,7 @@ export const useGridColumnHeaders = props => {
327
328
  getInnerProps: () => ({
328
329
  ref: handleInnerRef,
329
330
  role: 'rowgroup'
330
- })
331
+ }),
332
+ headerHeight
331
333
  };
332
334
  };
@@ -10,7 +10,6 @@ import { getVisibleRows } from '../../utils/useGridVisibleRows';
10
10
  import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
11
11
  import { calculatePinnedRowsHeight } from '../rows/gridRowsUtils';
12
12
  import { getTotalHeaderHeight } from '../columns/gridColumnsUtils';
13
- import { gridClasses } from '../../../constants/gridClasses';
14
13
  const isTestEnvironment = process.env.NODE_ENV === 'test';
15
14
  const hasScroll = ({
16
15
  content,
@@ -151,14 +150,13 @@ export function useGridDimensions(apiRef, props) {
151
150
  return Math.min(maximumPageSizeWithoutScrollBar, currentPage.rows.length);
152
151
  }, [apiRef, props.pagination, props.paginationMode, props.getRowHeight, rowHeight]);
153
152
  const computeSizeAndPublishResizeEvent = React.useCallback(() => {
154
- var _apiRef$current$rootE2, _previousSize$current, _previousSize$current2;
155
- const rootEl = (_apiRef$current$rootE2 = apiRef.current.rootElementRef) == null ? void 0 : _apiRef$current$rootE2.current;
156
- const mainEl = rootEl == null ? void 0 : rootEl.querySelector(`.${gridClasses.main}`);
153
+ var _apiRef$current$mainE, _previousSize$current, _previousSize$current2;
154
+ const mainEl = (_apiRef$current$mainE = apiRef.current.mainElementRef) == null ? void 0 : _apiRef$current$mainE.current;
157
155
  if (!mainEl) {
158
156
  return;
159
157
  }
160
- const height = mainEl.offsetHeight || 0;
161
- const width = mainEl.offsetWidth || 0;
158
+ const height = mainEl.clientHeight || 0;
159
+ const width = mainEl.clientWidth || 0;
162
160
  const win = ownerWindow(mainEl);
163
161
  const computedStyle = win.getComputedStyle(mainEl);
164
162
  const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;
@@ -90,10 +90,14 @@ export const useGridCellEditing = (apiRef, props) => {
90
90
  }
91
91
  } else if (params.isEditable) {
92
92
  let reason;
93
- if (event.key === ' ') {
94
- return; // Space scrolls to the last row
93
+ const canStartEditing = apiRef.current.unstable_applyPipeProcessors('canStartEditing', true, {
94
+ event,
95
+ cellParams: params,
96
+ editMode: 'cell'
97
+ });
98
+ if (!canStartEditing) {
99
+ return;
95
100
  }
96
-
97
101
  if (isPrintableKey(event)) {
98
102
  reason = GridCellEditStartReasons.printableKeyDown;
99
103
  } else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
@@ -29,9 +29,6 @@ export const useGridEditing = (apiRef, props) => {
29
29
  if (isCellEditableProp) {
30
30
  return isCellEditableProp(params);
31
31
  }
32
- if (params.rowNode.type === 'pinnedRow') {
33
- return false;
34
- }
35
32
  return true;
36
33
  }, [isCellEditableProp]);
37
34
  const maybeDebounce = (id, field, debounceMs, callback) => {
@@ -144,10 +144,14 @@ export const useGridRowEditing = (apiRef, props) => {
144
144
  }
145
145
  } else if (params.isEditable) {
146
146
  let reason;
147
- if (event.key === ' ') {
148
- return; // Space scrolls to the last row
147
+ const canStartEditing = apiRef.current.unstable_applyPipeProcessors('canStartEditing', true, {
148
+ event,
149
+ cellParams: params,
150
+ editMode: 'row'
151
+ });
152
+ if (!canStartEditing) {
153
+ return;
149
154
  }
150
-
151
155
  if (isPrintableKey(event)) {
152
156
  reason = GridRowEditStartReasons.printableKeyDown;
153
157
  } else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
@@ -1,12 +1,17 @@
1
1
  import { GridRowId } from '../../../../models';
2
2
  import { GridCellParams } from '../../../../models/params/gridCellParams';
3
3
  import { GridStateColDef } from '../../../../models/colDef/gridColDef';
4
+ export declare const serializeCellValue: (cellParams: GridCellParams, options: {
5
+ delimiterCharacter: string;
6
+ ignoreValueFormatter: boolean;
7
+ }) => any;
4
8
  interface BuildCSVOptions {
5
9
  columns: GridStateColDef[];
6
10
  rowIds: GridRowId[];
7
11
  getCellParams: (id: GridRowId, field: string) => GridCellParams;
8
12
  delimiterCharacter: string;
9
13
  includeHeaders: boolean;
14
+ ignoreValueFormatter: boolean;
10
15
  }
11
16
  export declare function buildCSV(options: BuildCSVOptions): string;
12
17
  export {};