@mui/x-data-grid 5.12.1 → 5.13.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 (315) hide show
  1. package/CHANGELOG.md +155 -8
  2. package/DataGrid/DataGrid.js +4 -4
  3. package/colDef/gridCheckboxSelectionColDef.d.ts +1 -0
  4. package/colDef/gridCheckboxSelectionColDef.js +2 -1
  5. package/colDef/gridDateOperators.d.ts +1 -1
  6. package/colDef/gridNumericColDef.js +1 -1
  7. package/colDef/gridStringOperators.d.ts +1 -1
  8. package/colDef/gridStringOperators.js +11 -6
  9. package/components/GridRow.js +1 -1
  10. package/components/cell/GridActionsCellItem.d.ts +2 -2
  11. package/components/cell/GridBooleanCell.js +4 -3
  12. package/components/cell/GridEditBooleanCell.js +4 -3
  13. package/components/cell/GridEditDateCell.js +4 -3
  14. package/components/cell/GridEditInputCell.js +4 -3
  15. package/components/cell/GridEditSingleSelectCell.js +9 -7
  16. package/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  17. package/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  18. package/components/columnSelection/GridHeaderCheckbox.js +0 -1
  19. package/components/containers/GridRootStyles.js +1 -1
  20. package/components/panel/GridColumnsPanel.js +3 -6
  21. package/components/panel/GridPanel.d.ts +1 -1
  22. package/components/panel/filterPanel/GridFilterForm.js +11 -4
  23. package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  24. package/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  25. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +5 -9
  26. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +42 -19
  27. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +3 -7
  28. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +32 -14
  29. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  30. package/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  31. package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +6 -3
  32. package/components/panel/filterPanel/GridFilterPanel.js +1 -2
  33. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
  34. package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
  35. package/components/toolbar/GridToolbarColumnsButton.js +0 -1
  36. package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
  37. package/components/toolbar/GridToolbarDensitySelector.js +0 -1
  38. package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
  39. package/components/toolbar/GridToolbarExportContainer.js +0 -1
  40. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  41. package/components/toolbar/GridToolbarFilterButton.js +0 -1
  42. package/constants/localeTextConstants.js +1 -0
  43. package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
  44. package/hooks/features/columns/useGridColumnSpanning.js +1 -1
  45. package/hooks/features/columns/useGridColumns.d.ts +1 -1
  46. package/hooks/features/dimensions/gridDimensionsApi.d.ts +5 -0
  47. package/hooks/features/dimensions/useGridDimensions.js +37 -23
  48. package/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  49. package/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  50. package/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  51. package/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  52. package/hooks/features/filter/gridFilterState.d.ts +1 -1
  53. package/hooks/features/filter/gridFilterUtils.js +8 -5
  54. package/hooks/features/filter/useGridFilter.d.ts +1 -1
  55. package/hooks/features/rows/useGridRows.js +16 -3
  56. package/hooks/features/rows/useGridRowsMeta.js +79 -77
  57. package/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  58. package/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
  59. package/hooks/features/sorting/useGridSorting.d.ts +1 -1
  60. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
  61. package/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
  62. package/hooks/utils/useGridApiContext.js +1 -1
  63. package/hooks/utils/useGridRootProps.js +1 -1
  64. package/index.js +1 -1
  65. package/legacy/DataGrid/DataGrid.js +4 -4
  66. package/legacy/colDef/gridCheckboxSelectionColDef.js +2 -1
  67. package/legacy/colDef/gridNumericColDef.js +1 -1
  68. package/legacy/colDef/gridStringOperators.js +13 -5
  69. package/legacy/components/GridRow.js +1 -1
  70. package/legacy/components/cell/GridBooleanCell.js +3 -1
  71. package/legacy/components/cell/GridEditBooleanCell.js +4 -2
  72. package/legacy/components/cell/GridEditDateCell.js +4 -2
  73. package/legacy/components/cell/GridEditInputCell.js +4 -2
  74. package/legacy/components/cell/GridEditSingleSelectCell.js +9 -7
  75. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  76. package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  77. package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -1
  78. package/legacy/components/containers/GridRootStyles.js +1 -1
  79. package/legacy/components/panel/GridColumnsPanel.js +5 -6
  80. package/legacy/components/panel/filterPanel/GridFilterForm.js +9 -4
  81. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  82. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  83. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +34 -12
  84. package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +24 -7
  85. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  86. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  87. package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -2
  88. package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -1
  89. package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -1
  90. package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -1
  91. package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -1
  92. package/legacy/constants/localeTextConstants.js +1 -0
  93. package/legacy/hooks/features/columns/useGridColumnSpanning.js +1 -1
  94. package/legacy/hooks/features/dimensions/useGridDimensions.js +36 -23
  95. package/legacy/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  96. package/legacy/hooks/features/editRows/useGridCellEditing.old.js +16 -8
  97. package/legacy/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  98. package/legacy/hooks/features/editRows/useGridRowEditing.old.js +22 -14
  99. package/legacy/hooks/features/filter/gridFilterUtils.js +8 -5
  100. package/legacy/hooks/features/rows/useGridRows.js +18 -3
  101. package/legacy/hooks/features/rows/useGridRowsMeta.js +81 -77
  102. package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  103. package/legacy/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
  104. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
  105. package/legacy/hooks/utils/useGridApiContext.js +1 -1
  106. package/legacy/hooks/utils/useGridRootProps.js +1 -1
  107. package/legacy/index.js +1 -1
  108. package/legacy/locales/arSD.js +1 -0
  109. package/legacy/locales/bgBG.js +1 -0
  110. package/legacy/locales/csCZ.js +1 -0
  111. package/legacy/locales/daDK.js +1 -0
  112. package/legacy/locales/deDE.js +1 -0
  113. package/legacy/locales/elGR.js +1 -0
  114. package/legacy/locales/esES.js +1 -0
  115. package/legacy/locales/faIR.js +1 -0
  116. package/legacy/locales/fiFI.js +1 -0
  117. package/legacy/locales/frFR.js +1 -0
  118. package/legacy/locales/heIL.js +1 -0
  119. package/legacy/locales/huHU.js +1 -0
  120. package/legacy/locales/index.js +3 -0
  121. package/legacy/locales/itIT.js +1 -0
  122. package/legacy/locales/jaJP.js +1 -0
  123. package/legacy/locales/koKR.js +1 -0
  124. package/legacy/locales/nbNO.js +1 -0
  125. package/legacy/locales/nlNL.js +1 -0
  126. package/legacy/locales/plPL.js +1 -0
  127. package/legacy/locales/ptBR.js +1 -0
  128. package/legacy/locales/roRO.js +128 -0
  129. package/legacy/locales/ruRU.js +1 -0
  130. package/legacy/locales/skSK.js +16 -15
  131. package/legacy/locales/svSE.js +128 -0
  132. package/legacy/locales/trTR.js +1 -0
  133. package/legacy/locales/ukUA.js +1 -0
  134. package/legacy/locales/viVN.js +1 -0
  135. package/legacy/locales/zhCN.js +1 -0
  136. package/legacy/utils/keyboardUtils.js +4 -3
  137. package/locales/arSD.js +1 -0
  138. package/locales/bgBG.js +1 -0
  139. package/locales/csCZ.js +1 -0
  140. package/locales/daDK.js +1 -0
  141. package/locales/deDE.js +1 -0
  142. package/locales/elGR.js +1 -0
  143. package/locales/esES.js +1 -0
  144. package/locales/faIR.js +1 -0
  145. package/locales/fiFI.js +1 -0
  146. package/locales/frFR.js +1 -0
  147. package/locales/heIL.js +1 -0
  148. package/locales/huHU.js +1 -0
  149. package/locales/index.d.ts +3 -0
  150. package/locales/index.js +3 -0
  151. package/locales/itIT.js +1 -0
  152. package/locales/jaJP.js +1 -0
  153. package/locales/koKR.js +1 -0
  154. package/locales/nbNO.js +1 -0
  155. package/locales/nlNL.js +1 -0
  156. package/locales/plPL.js +1 -0
  157. package/locales/ptBR.js +1 -0
  158. package/locales/roRO.d.ts +2 -0
  159. package/locales/roRO.js +116 -0
  160. package/locales/ruRU.js +1 -0
  161. package/locales/skSK.js +16 -15
  162. package/locales/svSE.d.ts +2 -0
  163. package/locales/svSE.js +116 -0
  164. package/locales/trTR.js +1 -0
  165. package/locales/ukUA.js +1 -0
  166. package/locales/viVN.js +1 -0
  167. package/locales/zhCN.js +1 -0
  168. package/models/api/gridLocaleTextApi.d.ts +1 -0
  169. package/models/colDef/gridColDef.d.ts +1 -1
  170. package/modern/DataGrid/DataGrid.js +4 -4
  171. package/modern/colDef/gridCheckboxSelectionColDef.js +2 -1
  172. package/modern/colDef/gridNumericColDef.js +1 -1
  173. package/modern/colDef/gridStringOperators.js +11 -6
  174. package/modern/components/GridRow.js +1 -1
  175. package/modern/components/cell/GridBooleanCell.js +4 -3
  176. package/modern/components/cell/GridEditBooleanCell.js +4 -3
  177. package/modern/components/cell/GridEditDateCell.js +4 -3
  178. package/modern/components/cell/GridEditInputCell.js +4 -3
  179. package/modern/components/cell/GridEditSingleSelectCell.js +9 -7
  180. package/modern/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  181. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  182. package/modern/components/columnSelection/GridHeaderCheckbox.js +0 -1
  183. package/modern/components/containers/GridRootStyles.js +1 -1
  184. package/modern/components/panel/GridColumnsPanel.js +3 -6
  185. package/modern/components/panel/filterPanel/GridFilterForm.js +11 -4
  186. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  187. package/modern/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  188. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +32 -13
  189. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +22 -8
  190. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  191. package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  192. package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -2
  193. package/modern/components/toolbar/GridToolbarColumnsButton.js +0 -1
  194. package/modern/components/toolbar/GridToolbarDensitySelector.js +0 -1
  195. package/modern/components/toolbar/GridToolbarExportContainer.js +0 -1
  196. package/modern/components/toolbar/GridToolbarFilterButton.js +0 -1
  197. package/modern/constants/localeTextConstants.js +1 -0
  198. package/modern/hooks/features/columns/useGridColumnSpanning.js +1 -1
  199. package/modern/hooks/features/dimensions/useGridDimensions.js +37 -23
  200. package/modern/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  201. package/modern/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  202. package/modern/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  203. package/modern/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  204. package/modern/hooks/features/filter/gridFilterUtils.js +8 -5
  205. package/modern/hooks/features/rows/useGridRows.js +16 -3
  206. package/modern/hooks/features/rows/useGridRowsMeta.js +77 -75
  207. package/modern/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  208. package/modern/hooks/features/selection/useGridSelectionPreProcessors.js +8 -6
  209. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +42 -8
  210. package/modern/hooks/utils/useGridApiContext.js +1 -1
  211. package/modern/hooks/utils/useGridRootProps.js +1 -1
  212. package/modern/index.js +1 -1
  213. package/modern/locales/arSD.js +1 -0
  214. package/modern/locales/bgBG.js +1 -0
  215. package/modern/locales/csCZ.js +1 -0
  216. package/modern/locales/daDK.js +1 -0
  217. package/modern/locales/deDE.js +1 -0
  218. package/modern/locales/elGR.js +1 -0
  219. package/modern/locales/esES.js +1 -0
  220. package/modern/locales/faIR.js +1 -0
  221. package/modern/locales/fiFI.js +1 -0
  222. package/modern/locales/frFR.js +1 -0
  223. package/modern/locales/heIL.js +1 -0
  224. package/modern/locales/huHU.js +1 -0
  225. package/modern/locales/index.js +3 -0
  226. package/modern/locales/itIT.js +1 -0
  227. package/modern/locales/jaJP.js +1 -0
  228. package/modern/locales/koKR.js +1 -0
  229. package/modern/locales/nbNO.js +1 -0
  230. package/modern/locales/nlNL.js +1 -0
  231. package/modern/locales/plPL.js +1 -0
  232. package/modern/locales/ptBR.js +1 -0
  233. package/modern/locales/roRO.js +116 -0
  234. package/modern/locales/ruRU.js +1 -0
  235. package/modern/locales/skSK.js +16 -15
  236. package/modern/locales/svSE.js +116 -0
  237. package/modern/locales/trTR.js +1 -0
  238. package/modern/locales/ukUA.js +1 -0
  239. package/modern/locales/viVN.js +1 -0
  240. package/modern/locales/zhCN.js +1 -0
  241. package/modern/utils/keyboardUtils.js +4 -3
  242. package/node/DataGrid/DataGrid.js +4 -4
  243. package/node/colDef/gridCheckboxSelectionColDef.js +4 -2
  244. package/node/colDef/gridNumericColDef.js +1 -1
  245. package/node/colDef/gridStringOperators.js +11 -6
  246. package/node/components/GridRow.js +1 -1
  247. package/node/components/cell/GridBooleanCell.js +5 -3
  248. package/node/components/cell/GridEditBooleanCell.js +5 -3
  249. package/node/components/cell/GridEditDateCell.js +5 -3
  250. package/node/components/cell/GridEditInputCell.js +5 -3
  251. package/node/components/cell/GridEditSingleSelectCell.js +10 -7
  252. package/node/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  253. package/node/components/columnSelection/GridCellCheckboxRenderer.js +0 -1
  254. package/node/components/columnSelection/GridHeaderCheckbox.js +0 -1
  255. package/node/components/containers/GridRootStyles.js +1 -1
  256. package/node/components/panel/GridColumnsPanel.js +3 -6
  257. package/node/components/panel/filterPanel/GridFilterForm.js +9 -4
  258. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
  259. package/node/components/panel/filterPanel/GridFilterInputDate.js +4 -2
  260. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +43 -20
  261. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +33 -15
  262. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +8 -2
  263. package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -2
  264. package/node/components/panel/filterPanel/GridFilterPanel.js +1 -2
  265. package/node/components/toolbar/GridToolbarColumnsButton.js +0 -1
  266. package/node/components/toolbar/GridToolbarDensitySelector.js +0 -1
  267. package/node/components/toolbar/GridToolbarExportContainer.js +0 -1
  268. package/node/components/toolbar/GridToolbarFilterButton.js +0 -1
  269. package/node/constants/localeTextConstants.js +1 -0
  270. package/node/hooks/features/columns/useGridColumnSpanning.js +11 -16
  271. package/node/hooks/features/dimensions/useGridDimensions.js +37 -23
  272. package/node/hooks/features/editRows/useGridCellEditing.new.js +6 -0
  273. package/node/hooks/features/editRows/useGridCellEditing.old.js +6 -0
  274. package/node/hooks/features/editRows/useGridRowEditing.new.js +6 -0
  275. package/node/hooks/features/editRows/useGridRowEditing.old.js +6 -0
  276. package/node/hooks/features/filter/gridFilterUtils.js +7 -4
  277. package/node/hooks/features/rows/useGridRows.js +16 -3
  278. package/node/hooks/features/rows/useGridRowsMeta.js +80 -77
  279. package/node/hooks/features/rows/useGridRowsPreProcessors.js +1 -1
  280. package/node/hooks/features/selection/useGridSelectionPreProcessors.js +7 -5
  281. package/node/hooks/features/virtualization/useGridVirtualScroller.js +42 -9
  282. package/node/hooks/utils/useGridApiContext.js +1 -1
  283. package/node/hooks/utils/useGridRootProps.js +1 -1
  284. package/node/index.js +1 -1
  285. package/node/locales/arSD.js +1 -0
  286. package/node/locales/bgBG.js +1 -0
  287. package/node/locales/csCZ.js +1 -0
  288. package/node/locales/daDK.js +1 -0
  289. package/node/locales/deDE.js +1 -0
  290. package/node/locales/elGR.js +1 -0
  291. package/node/locales/esES.js +1 -0
  292. package/node/locales/faIR.js +1 -0
  293. package/node/locales/fiFI.js +1 -0
  294. package/node/locales/frFR.js +1 -0
  295. package/node/locales/heIL.js +1 -0
  296. package/node/locales/huHU.js +1 -0
  297. package/node/locales/index.js +39 -0
  298. package/node/locales/itIT.js +1 -0
  299. package/node/locales/jaJP.js +1 -0
  300. package/node/locales/koKR.js +1 -0
  301. package/node/locales/nbNO.js +1 -0
  302. package/node/locales/nlNL.js +1 -0
  303. package/node/locales/plPL.js +1 -0
  304. package/node/locales/ptBR.js +1 -0
  305. package/node/locales/roRO.js +126 -0
  306. package/node/locales/ruRU.js +1 -0
  307. package/node/locales/skSK.js +16 -15
  308. package/node/locales/svSE.js +126 -0
  309. package/node/locales/trTR.js +1 -0
  310. package/node/locales/ukUA.js +1 -0
  311. package/node/locales/viVN.js +1 -0
  312. package/node/locales/zhCN.js +1 -0
  313. package/node/utils/keyboardUtils.js +4 -3
  314. package/package.json +3 -3
  315. package/utils/keyboardUtils.js +4 -3
@@ -13,14 +13,15 @@ export const getGridStringQuickFilterFn = value => {
13
13
  return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
14
14
  };
15
15
  };
16
- export const getGridStringOperators = () => [{
16
+ export const getGridStringOperators = (disableTrim = false) => [{
17
17
  value: 'contains',
18
18
  getApplyFilterFn: filterItem => {
19
19
  if (!filterItem.value) {
20
20
  return null;
21
21
  }
22
22
 
23
- const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i');
23
+ const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
24
+ const filterRegex = new RegExp(escapeRegExp(filterItemValue), 'i');
24
25
  return ({
25
26
  value
26
27
  }) => {
@@ -35,6 +36,7 @@ export const getGridStringOperators = () => [{
35
36
  return null;
36
37
  }
37
38
 
39
+ const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
38
40
  const collator = new Intl.Collator(undefined, {
39
41
  sensitivity: 'base',
40
42
  usage: 'search'
@@ -42,7 +44,7 @@ export const getGridStringOperators = () => [{
42
44
  return ({
43
45
  value
44
46
  }) => {
45
- return value != null ? collator.compare(filterItem.value, value.toString()) === 0 : false;
47
+ return value != null ? collator.compare(filterItemValue, value.toString()) === 0 : false;
46
48
  };
47
49
  },
48
50
  InputComponent: GridFilterInputValue
@@ -53,7 +55,8 @@ export const getGridStringOperators = () => [{
53
55
  return null;
54
56
  }
55
57
 
56
- const filterRegex = new RegExp(`^${escapeRegExp(filterItem.value)}.*$`, 'i');
58
+ const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
59
+ const filterRegex = new RegExp(`^${escapeRegExp(filterItemValue)}.*$`, 'i');
57
60
  return ({
58
61
  value
59
62
  }) => {
@@ -68,7 +71,8 @@ export const getGridStringOperators = () => [{
68
71
  return null;
69
72
  }
70
73
 
71
- const filterRegex = new RegExp(`.*${escapeRegExp(filterItem.value)}$`, 'i');
74
+ const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
75
+ const filterRegex = new RegExp(`.*${escapeRegExp(filterItemValue)}$`, 'i');
72
76
  return ({
73
77
  value
74
78
  }) => {
@@ -101,13 +105,14 @@ export const getGridStringOperators = () => [{
101
105
  return null;
102
106
  }
103
107
 
108
+ const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());
104
109
  const collator = new Intl.Collator(undefined, {
105
110
  sensitivity: 'base',
106
111
  usage: 'search'
107
112
  });
108
113
  return ({
109
114
  value
110
- }) => value != null ? filterItem.value.some(filterValue => {
115
+ }) => value != null ? filterItemValue.some(filterValue => {
111
116
  return collator.compare(filterValue, value.toString() || '') === 0;
112
117
  }) : false;
113
118
  },
@@ -110,7 +110,7 @@ function GridRow(props) {
110
110
  // Fallback for IE
111
111
  apiRef.current.unstable_storeRowHeightMeasurement(rowId, ref.current.clientHeight);
112
112
  }
113
- });
113
+ }, [apiRef, rowHeight, rowId]);
114
114
  React.useLayoutEffect(() => {
115
115
  if (currentPage.range) {
116
116
  // The index prop is relative to the rows from all pages. As example, the index prop of the
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { unstable_composeClasses as composeClasses } from '@mui/material';
6
6
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
7
7
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
8
+ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
 
10
11
  const useUtilityClasses = ownerState => {
@@ -19,11 +20,11 @@ const useUtilityClasses = ownerState => {
19
20
 
20
21
  export const GridBooleanCell = /*#__PURE__*/React.memo(props => {
21
22
  const {
22
- value,
23
- api
23
+ value
24
24
  } = props,
25
25
  other = _objectWithoutPropertiesLoose(props, _excluded);
26
26
 
27
+ const apiRef = useGridApiContext();
27
28
  const rootProps = useGridRootProps();
28
29
  const ownerState = {
29
30
  classes: rootProps.classes
@@ -33,7 +34,7 @@ export const GridBooleanCell = /*#__PURE__*/React.memo(props => {
33
34
  return /*#__PURE__*/_jsx(Icon, _extends({
34
35
  fontSize: "small",
35
36
  className: classes.root,
36
- titleAccess: api.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
37
+ titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
37
38
  "data-value": Boolean(value)
38
39
  }, other));
39
40
  });
@@ -8,6 +8,7 @@ import { unstable_composeClasses as composeClasses } from '@mui/material';
8
8
  import { unstable_useId as useId, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
9
9
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
10
10
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
11
+ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
 
13
14
  const useUtilityClasses = ownerState => {
@@ -24,7 +25,6 @@ function GridEditBooleanCell(props) {
24
25
  const {
25
26
  id: idProp,
26
27
  value,
27
- api,
28
28
  field,
29
29
  className,
30
30
  hasFocus,
@@ -32,6 +32,7 @@ function GridEditBooleanCell(props) {
32
32
  } = props,
33
33
  other = _objectWithoutPropertiesLoose(props, _excluded);
34
34
 
35
+ const apiRef = useGridApiContext();
35
36
  const inputRef = React.useRef(null);
36
37
  const id = useId();
37
38
  const [valueState, setValueState] = React.useState(value);
@@ -48,12 +49,12 @@ function GridEditBooleanCell(props) {
48
49
  }
49
50
 
50
51
  setValueState(newValue);
51
- await api.setEditCellValue({
52
+ await apiRef.current.setEditCellValue({
52
53
  id: idProp,
53
54
  field,
54
55
  value: newValue
55
56
  }, event);
56
- }, [api, field, idProp, onValueChange]);
57
+ }, [apiRef, field, idProp, onValueChange]);
57
58
  React.useEffect(() => {
58
59
  setValueState(value);
59
60
  }, [value]);
@@ -8,6 +8,7 @@ import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/u
8
8
  import InputBase from '@mui/material/InputBase';
9
9
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
10
10
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
11
+ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
 
13
14
  const useUtilityClasses = ownerState => {
@@ -24,7 +25,6 @@ function GridEditDateCell(props) {
24
25
  const {
25
26
  id,
26
27
  value: valueProp,
27
- api,
28
28
  field,
29
29
  colDef,
30
30
  hasFocus,
@@ -34,6 +34,7 @@ function GridEditDateCell(props) {
34
34
  other = _objectWithoutPropertiesLoose(props, _excluded);
35
35
 
36
36
  const isDateTime = colDef.type === 'dateTime';
37
+ const apiRef = useGridApiContext();
37
38
  const inputRef = React.useRef();
38
39
  const valueTransformed = React.useMemo(() => {
39
40
  let parsedDate;
@@ -93,12 +94,12 @@ function GridEditDateCell(props) {
93
94
  parsed: newParsedDate,
94
95
  formatted: newFormattedDate
95
96
  });
96
- api.setEditCellValue({
97
+ apiRef.current.setEditCellValue({
97
98
  id,
98
99
  field,
99
100
  value: newParsedDate
100
101
  }, event);
101
- }, [api, field, id, onValueChange]);
102
+ }, [apiRef, field, id, onValueChange]);
102
103
  React.useEffect(() => {
103
104
  setValueState(state => {
104
105
  if (valueTransformed.parsed !== state.parsed && valueTransformed.parsed?.getTime() !== state.parsed?.getTime()) {
@@ -11,6 +11,7 @@ import { getDataGridUtilityClass } from '../../constants/gridClasses';
11
11
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
12
12
  import { GridLoadIcon } from '../icons/index';
13
13
  import { SUBMIT_FILTER_STROKE_TIME } from '../panel/filterPanel/GridFilterInputValue';
14
+ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
 
16
17
  const useUtilityClasses = ownerState => {
@@ -43,7 +44,6 @@ function GridEditInputCell(props) {
43
44
  const {
44
45
  id,
45
46
  value,
46
- api,
47
47
  field,
48
48
  colDef,
49
49
  hasFocus,
@@ -53,6 +53,7 @@ function GridEditInputCell(props) {
53
53
  } = props,
54
54
  other = _objectWithoutPropertiesLoose(props, _excluded);
55
55
 
56
+ const apiRef = useGridApiContext();
56
57
  const inputRef = React.useRef();
57
58
  const [valueState, setValueState] = React.useState(value);
58
59
  const ownerState = {
@@ -67,13 +68,13 @@ function GridEditInputCell(props) {
67
68
  }
68
69
 
69
70
  setValueState(newValue);
70
- api.setEditCellValue({
71
+ apiRef.current.setEditCellValue({
71
72
  id,
72
73
  field,
73
74
  value: newValue,
74
75
  debounceMs
75
76
  }, event);
76
- }, [api, debounceMs, field, id, onValueChange]);
77
+ }, [apiRef, debounceMs, field, id, onValueChange]);
77
78
  React.useEffect(() => {
78
79
  setValueState(value);
79
80
  }, [value]);
@@ -9,6 +9,7 @@ import { isEscapeKey } from '../../utils/keyboardUtils';
9
9
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
10
10
  import { GridEditModes } from '../../models/gridEditRowModel';
11
11
  import { getValueFromValueOptions } from '../panel/filterPanel/filterPanelUtils';
12
+ import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
 
14
15
  const renderSingleSelectOptions = (option, OptionComponent) => {
@@ -36,6 +37,7 @@ function GridEditSingleSelectCell(props) {
36
37
  } = props,
37
38
  other = _objectWithoutPropertiesLoose(props, _excluded);
38
39
 
40
+ const apiRef = useGridApiContext();
39
41
  const ref = React.useRef();
40
42
  const inputRef = React.useRef();
41
43
  const rootProps = useGridRootProps();
@@ -82,7 +84,7 @@ function GridEditSingleSelectCell(props) {
82
84
  await onValueChange(event, formattedTargetValue);
83
85
  }
84
86
 
85
- const isValid = await api.setEditCellValue({
87
+ const isValid = await apiRef.current.setEditCellValue({
86
88
  id,
87
89
  field,
88
90
  value: formattedTargetValue
@@ -97,18 +99,18 @@ function GridEditSingleSelectCell(props) {
97
99
  return;
98
100
  }
99
101
 
100
- const canCommit = await Promise.resolve(api.commitCellChange({
102
+ const canCommit = await Promise.resolve(apiRef.current.commitCellChange({
101
103
  id,
102
104
  field
103
105
  }, event));
104
106
 
105
107
  if (canCommit) {
106
- api.setCellMode(id, field, 'view');
108
+ apiRef.current.setCellMode(id, field, 'view');
107
109
 
108
110
  if (event.key) {
109
111
  // TODO v6: remove once we stop ignoring events fired from portals
110
- const params = api.getCellParams(id, field);
111
- api.publishEvent('cellNavigationKeyDown', params, event);
112
+ const params = apiRef.current.getCellParams(id, field);
113
+ apiRef.current.publishEvent('cellNavigationKeyDown', params, event);
112
114
  }
113
115
  }
114
116
  };
@@ -121,13 +123,13 @@ function GridEditSingleSelectCell(props) {
121
123
 
122
124
  if (reason === 'backdropClick' || isEscapeKey(event.key)) {
123
125
  if (rootProps.experimentalFeatures?.newEditingApi) {
124
- api.stopCellEditMode({
126
+ apiRef.current.stopCellEditMode({
125
127
  id,
126
128
  field,
127
129
  ignoreModifications: true
128
130
  });
129
131
  } else {
130
- api.setCellMode(id, field, 'view');
132
+ apiRef.current.setCellMode(id, field, 'view');
131
133
  }
132
134
  }
133
135
  };
@@ -165,6 +165,7 @@ function GridColumnHeaderItem(props) {
165
165
  field: column.field,
166
166
  colDef: column
167
167
  }) : column.headerClassName;
168
+ const label = column.headerName ?? column.field;
168
169
  return /*#__PURE__*/_jsxs("div", _extends({
169
170
  ref: headerCellRef,
170
171
  className: clsx(classes.root, headerClassName),
@@ -177,7 +178,8 @@ function GridColumnHeaderItem(props) {
177
178
  role: "columnheader",
178
179
  tabIndex: tabIndex,
179
180
  "aria-colindex": colIndex + 1,
180
- "aria-sort": ariaSort
181
+ "aria-sort": ariaSort,
182
+ "aria-label": column.renderHeader && headerComponent == null ? label : undefined
181
183
  }, mouseEventsHandlers, {
182
184
  children: [/*#__PURE__*/_jsxs("div", _extends({
183
185
  className: classes.draggableContainer,
@@ -187,8 +189,8 @@ function GridColumnHeaderItem(props) {
187
189
  className: classes.titleContainer,
188
190
  children: [/*#__PURE__*/_jsx("div", {
189
191
  className: classes.titleContainerContent,
190
- children: headerComponent || /*#__PURE__*/_jsx(GridColumnHeaderTitle, {
191
- label: column.headerName ?? column.field,
192
+ children: column.renderHeader ? headerComponent : /*#__PURE__*/_jsx(GridColumnHeaderTitle, {
193
+ label: label,
192
194
  description: column.description,
193
195
  columnWidth: width
194
196
  })
@@ -81,7 +81,6 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
81
81
  checked: isChecked,
82
82
  onChange: handleChange,
83
83
  className: classes.root,
84
- color: "primary",
85
84
  inputProps: {
86
85
  'aria-label': label
87
86
  },
@@ -109,7 +109,6 @@ const GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderChec
109
109
  checked: isChecked,
110
110
  onChange: handleChange,
111
111
  className: classes.root,
112
- color: "primary",
113
112
  inputProps: {
114
113
  'aria-label': label
115
114
  },
@@ -165,7 +165,7 @@ export const GridRootStyles = styled('div', {
165
165
  minWidth: 0,
166
166
  flex: 1,
167
167
  whiteSpace: 'nowrap',
168
- overflow: 'hidden'
168
+ overflowX: 'hidden'
169
169
  },
170
170
  [`& .${gridClasses.columnHeaderTitleContainerContent}`]: {
171
171
  overflow: 'hidden',
@@ -79,7 +79,7 @@ export function GridColumnsPanel(props) {
79
79
  return apiRef.current.setColumnVisibilityModel({});
80
80
  }
81
81
 
82
- return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.map(col => [col.field, false])));
82
+ return apiRef.current.setColumnVisibilityModel(Object.fromEntries(columns.filter(col => col.hideable !== false).map(col => [col.field, false])));
83
83
  } // TODO v6: Remove
84
84
 
85
85
 
@@ -130,7 +130,6 @@ export function GridColumnsPanel(props) {
130
130
  checked: columnVisibilityModel[column.field] !== false,
131
131
  onClick: toggleColumn,
132
132
  name: column.field,
133
- color: "primary",
134
133
  size: "small"
135
134
  }, rootProps.componentsProps?.baseSwitch)),
136
135
  label: column.headerName || column.field
@@ -146,13 +145,11 @@ export function GridColumnsPanel(props) {
146
145
  })
147
146
  }), /*#__PURE__*/_jsxs(GridPanelFooter, {
148
147
  children: [/*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
149
- onClick: () => toggleAllColumns(false),
150
- color: "primary"
148
+ onClick: () => toggleAllColumns(false)
151
149
  }, rootProps.componentsProps?.baseButton, {
152
150
  children: apiRef.current.getLocaleText('columnsPanelHideAllButton')
153
151
  })), /*#__PURE__*/_jsx(rootProps.components.BaseButton, _extends({
154
- onClick: () => toggleAllColumns(true),
155
- color: "primary"
152
+ onClick: () => toggleAllColumns(true)
156
153
  }, rootProps.componentsProps?.baseButton, {
157
154
  children: apiRef.current.getLocaleText('columnsPanelShowAllButton')
158
155
  }))]
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"];
3
+ const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "multiFilterOperator", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "linkOperators", "columnsSort", "deleteIconProps", "linkOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "children"],
4
+ _excluded2 = ["InputComponentProps"];
4
5
  import * as React from 'react';
5
6
  import PropTypes from 'prop-types';
6
7
  import { unstable_composeClasses as composeClasses } from '@mui/material';
@@ -143,6 +144,12 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
143
144
  const baseSelectProps = rootProps.componentsProps?.baseSelect || {};
144
145
  const isBaseSelectNative = baseSelectProps.native ?? true;
145
146
  const OptionComponent = isBaseSelectNative ? 'option' : MenuItem;
147
+
148
+ const {
149
+ InputComponentProps
150
+ } = valueInputProps,
151
+ valueInputPropsOther = _objectWithoutPropertiesLoose(valueInputProps, _excluded2);
152
+
146
153
  const sortedFilterableColumns = React.useMemo(() => {
147
154
  switch (columnsSort) {
148
155
  case 'asc':
@@ -309,14 +316,14 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
309
316
  })), /*#__PURE__*/_jsx(FilterFormValueInput, _extends({
310
317
  variant: "standard",
311
318
  as: rootProps.components.BaseFormControl
312
- }, baseFormControlProps, valueInputProps, {
313
- className: clsx(classes.valueInput, baseFormControlProps.className, valueInputProps.className),
319
+ }, baseFormControlProps, valueInputPropsOther, {
320
+ className: clsx(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
314
321
  children: currentOperator?.InputComponent ? /*#__PURE__*/_jsx(currentOperator.InputComponent, _extends({
315
322
  apiRef: apiRef,
316
323
  item: item,
317
324
  applyValue: applyFilterChanges,
318
325
  focusElementRef: valueRef
319
- }, currentOperator.InputComponentProps)) : null
326
+ }, currentOperator.InputComponentProps, InputComponentProps)) : null
320
327
  }))]
321
328
  }));
322
329
  });
@@ -34,8 +34,8 @@ export function GridFilterInputBoolean(props) {
34
34
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
35
35
  value: filterValueState,
36
36
  onChange: onFilterChange,
37
- variant: "standard",
38
37
  select: true,
38
+ variant: "standard",
39
39
  SelectProps: _extends({
40
40
  native: isSelectNative,
41
41
  displayEmpty: true
@@ -52,8 +52,8 @@ function GridFilterInputDate(props) {
52
52
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
53
53
  value: filterValueState,
54
54
  onChange: onFilterChange,
55
- type: type || 'text',
56
55
  variant: "standard",
56
+ type: type || 'text',
57
57
  InputLabelProps: {
58
58
  shrink: true
59
59
  },
@@ -73,7 +73,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
73
73
  // | These PropTypes are generated from the TypeScript type definitions |
74
74
  // | To update them edit the TypeScript types and run "yarn proptypes" |
75
75
  // ----------------------------------------------------------------------
76
- apiRef: PropTypes.any.isRequired,
76
+ apiRef: PropTypes.shape({
77
+ current: PropTypes.object.isRequired
78
+ }).isRequired,
77
79
  applyValue: PropTypes.func.isRequired,
78
80
  focusElementRef: PropTypes
79
81
  /* @typescript-to-proptypes-ignore */
@@ -1,13 +1,13 @@
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", "color", "error", "helperText", "size", "variant"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
7
7
  import Chip from '@mui/material/Chip';
8
- import TextField from '@mui/material/TextField';
9
8
  import { unstable_useId as useId } from '@mui/material/utils';
10
9
  import { getValueFromOption } from './filterPanelUtils';
10
+ import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
 
13
13
  const isOptionEqualToValue = (option, value) => getValueFromOption(option) === getValueFromOption(value);
@@ -19,16 +19,37 @@ function GridFilterInputMultipleSingleSelect(props) {
19
19
  item,
20
20
  applyValue,
21
21
  apiRef,
22
- focusElementRef
22
+ focusElementRef,
23
+ color,
24
+ error,
25
+ helperText,
26
+ size,
27
+ variant = 'standard'
23
28
  } = props,
24
29
  other = _objectWithoutPropertiesLoose(props, _excluded);
25
30
 
31
+ const TextFieldProps = {
32
+ color,
33
+ error,
34
+ helperText,
35
+ size,
36
+ variant
37
+ };
26
38
  const id = useId();
39
+ const rootProps = useGridRootProps();
27
40
  const resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
28
41
  const resolvedValueOptions = React.useMemo(() => {
29
- return typeof resolvedColumn?.valueOptions === 'function' ? resolvedColumn.valueOptions({
30
- field: resolvedColumn.field
31
- }) : resolvedColumn?.valueOptions;
42
+ if (!resolvedColumn?.valueOptions) {
43
+ return [];
44
+ }
45
+
46
+ if (typeof resolvedColumn.valueOptions === 'function') {
47
+ return resolvedColumn.valueOptions({
48
+ field: resolvedColumn.field
49
+ });
50
+ }
51
+
52
+ return resolvedColumn.valueOptions;
32
53
  }, [resolvedColumn]);
33
54
  const resolvedFormattedValueOptions = React.useMemo(() => {
34
55
  return resolvedValueOptions?.map(getValueFromOption);
@@ -59,7 +80,7 @@ function GridFilterInputMultipleSingleSelect(props) {
59
80
 
60
81
  if (resolvedValueOptions !== undefined) {
61
82
  const itemValueIndexes = item.value.map(element => {
62
- // get the index matching between values and valueoptions
83
+ // get the index matching between values and valueOptions
63
84
  const formattedElement = getValueFromOption(element);
64
85
  const index = resolvedFormattedValueOptions?.findIndex(formatedOption => formatedOption === formattedElement) || 0;
65
86
  return index;
@@ -85,8 +106,7 @@ function GridFilterInputMultipleSingleSelect(props) {
85
106
  return /*#__PURE__*/_jsx(Autocomplete, _extends({
86
107
  multiple: true,
87
108
  limitTags: 1,
88
- options: resolvedValueOptions // TODO: avoid `any`?
89
- ,
109
+ options: resolvedValueOptions,
90
110
  isOptionEqualToValue: isOptionEqualToValue,
91
111
  filterOptions: filter,
92
112
  id: id,
@@ -99,16 +119,15 @@ function GridFilterInputMultipleSingleSelect(props) {
99
119
  }, getTagProps({
100
120
  index
101
121
  })))),
102
- renderInput: params => /*#__PURE__*/_jsx(TextField, _extends({}, params, {
122
+ renderInput: params => /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({}, params, {
103
123
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
104
124
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
105
125
  InputLabelProps: _extends({}, params.InputLabelProps, {
106
126
  shrink: true
107
127
  }),
108
128
  inputRef: focusElementRef,
109
- type: 'singleSelect',
110
- variant: "standard"
111
- }))
129
+ type: "singleSelect"
130
+ }, TextFieldProps, rootProps.componentsProps?.baseTextField))
112
131
  }, other));
113
132
  }
114
133
 
@@ -1,12 +1,12 @@
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", "color", "error", "helperText", "size", "variant"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import Autocomplete from '@mui/material/Autocomplete';
7
7
  import Chip from '@mui/material/Chip';
8
- import TextField from '@mui/material/TextField';
9
8
  import { unstable_useId as useId } from '@mui/material/utils';
9
+ import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
 
12
12
  function GridFilterInputMultipleValue(props) {
@@ -15,12 +15,25 @@ function GridFilterInputMultipleValue(props) {
15
15
  applyValue,
16
16
  type,
17
17
  apiRef,
18
- focusElementRef
18
+ focusElementRef,
19
+ color,
20
+ error,
21
+ helperText,
22
+ size,
23
+ variant
19
24
  } = props,
20
25
  other = _objectWithoutPropertiesLoose(props, _excluded);
21
26
 
27
+ const TextFieldProps = {
28
+ color,
29
+ error,
30
+ helperText,
31
+ size,
32
+ variant
33
+ };
22
34
  const [filterValueState, setFilterValueState] = React.useState(item.value || []);
23
35
  const id = useId();
36
+ const rootProps = useGridRootProps();
24
37
  React.useEffect(() => {
25
38
  const itemValue = item.value ?? [];
26
39
  setFilterValueState(itemValue.map(String));
@@ -52,16 +65,15 @@ function GridFilterInputMultipleValue(props) {
52
65
  }, getTagProps({
53
66
  index
54
67
  })))),
55
- renderInput: params => /*#__PURE__*/_jsx(TextField, _extends({}, params, {
68
+ renderInput: params => /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({}, params, {
56
69
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
57
70
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
58
71
  InputLabelProps: _extends({}, params.InputLabelProps, {
59
72
  shrink: true
60
73
  }),
61
74
  inputRef: focusElementRef,
62
- type: type || 'text',
63
- variant: "standard"
64
- }))
75
+ type: type || 'text'
76
+ }, TextFieldProps, rootProps.componentsProps?.baseTextField))
65
77
  }, other));
66
78
  }
67
79
 
@@ -70,7 +82,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
70
82
  // | These PropTypes are generated from the TypeScript type definitions |
71
83
  // | To update them edit the TypeScript types and run "yarn proptypes" |
72
84
  // ----------------------------------------------------------------------
73
- apiRef: PropTypes.any.isRequired,
85
+ apiRef: PropTypes.shape({
86
+ current: PropTypes.object.isRequired
87
+ }).isRequired,
74
88
  applyValue: PropTypes.func.isRequired,
75
89
  focusElementRef: PropTypes
76
90
  /* @typescript-to-proptypes-ignore */
@@ -51,6 +51,10 @@ function GridFilterInputSingleSelect(props) {
51
51
  const isSelectNative = baseSelectProps.native ?? true;
52
52
  const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
53
53
  const currentValueOptions = React.useMemo(() => {
54
+ if (currentColumn === null) {
55
+ return undefined;
56
+ }
57
+
54
58
  return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({
55
59
  field: currentColumn.field
56
60
  }) : currentColumn.valueOptions;
@@ -90,8 +94,8 @@ function GridFilterInputSingleSelect(props) {
90
94
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
91
95
  value: filterValueState,
92
96
  onChange: onFilterChange,
93
- type: type || 'text',
94
97
  variant: "standard",
98
+ type: type || 'text',
95
99
  InputLabelProps: {
96
100
  shrink: true
97
101
  },
@@ -110,7 +114,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
110
114
  // | These PropTypes are generated from the TypeScript type definitions |
111
115
  // | To update them edit the TypeScript types and run "yarn proptypes" |
112
116
  // ----------------------------------------------------------------------
113
- apiRef: PropTypes.any.isRequired,
117
+ apiRef: PropTypes.shape({
118
+ current: PropTypes.object.isRequired
119
+ }).isRequired,
114
120
  applyValue: PropTypes.func.isRequired,
115
121
  focusElementRef: PropTypes
116
122
  /* @typescript-to-proptypes-ignore */