@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
@@ -9,6 +9,22 @@ function gridBooleanFormatter(_ref) {
9
9
  api = _ref.api;
10
10
  return value ? api.getLocaleText('booleanCellTrueLabel') : api.getLocaleText('booleanCellFalseLabel');
11
11
  }
12
+ var stringToBoolean = function stringToBoolean(value) {
13
+ switch (value.toLowerCase().trim()) {
14
+ case 'true':
15
+ case 'yes':
16
+ case '1':
17
+ return true;
18
+ case 'false':
19
+ case 'no':
20
+ case '0':
21
+ case 'null':
22
+ case 'undefined':
23
+ return false;
24
+ default:
25
+ return undefined;
26
+ }
27
+ };
12
28
  export var GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
13
29
  type: 'boolean',
14
30
  align: 'center',
@@ -20,5 +36,9 @@ export var GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
20
36
  filterOperators: getGridBooleanOperators(),
21
37
  getApplyQuickFilterFn: undefined,
22
38
  // @ts-ignore
23
- aggregable: false
39
+ aggregable: false,
40
+ // @ts-ignore
41
+ pastedValueParser: function pastedValueParser(value) {
42
+ return stringToBoolean(value);
43
+ }
24
44
  });
@@ -48,7 +48,11 @@ export var GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
48
48
  valueFormatter: gridDateFormatter,
49
49
  filterOperators: getGridDateOperators(),
50
50
  renderEditCell: renderEditDateCell,
51
- getApplyQuickFilterFn: undefined
51
+ getApplyQuickFilterFn: undefined,
52
+ // @ts-ignore
53
+ pastedValueParser: function pastedValueParser(value) {
54
+ return new Date(value);
55
+ }
52
56
  });
53
57
  export var GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
54
58
  type: 'dateTime',
@@ -56,5 +60,9 @@ export var GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
56
60
  valueFormatter: gridDateTimeFormatter,
57
61
  filterOperators: getGridDateOperators(true),
58
62
  renderEditCell: renderEditDateCell,
59
- getApplyQuickFilterFn: undefined
63
+ getApplyQuickFilterFn: undefined,
64
+ // @ts-ignore
65
+ pastedValueParser: function pastedValueParser(value) {
66
+ return new Date(value);
67
+ }
60
68
  });
@@ -17,7 +17,6 @@ export var getGridNumericQuickFilterFn = function getGridNumericQuickFilterFn(va
17
17
  };
18
18
  export var getGridNumericOperators = function getGridNumericOperators() {
19
19
  return [{
20
- label: '=',
21
20
  value: '=',
22
21
  getApplyFilterFn: function getApplyFilterFn(filterItem) {
23
22
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -33,7 +32,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
33
32
  type: 'number'
34
33
  }
35
34
  }, {
36
- label: '!=',
37
35
  value: '!=',
38
36
  getApplyFilterFn: function getApplyFilterFn(filterItem) {
39
37
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -49,7 +47,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
49
47
  type: 'number'
50
48
  }
51
49
  }, {
52
- label: '>',
53
50
  value: '>',
54
51
  getApplyFilterFn: function getApplyFilterFn(filterItem) {
55
52
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -68,7 +65,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
68
65
  type: 'number'
69
66
  }
70
67
  }, {
71
- label: '>=',
72
68
  value: '>=',
73
69
  getApplyFilterFn: function getApplyFilterFn(filterItem) {
74
70
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -87,7 +83,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
87
83
  type: 'number'
88
84
  }
89
85
  }, {
90
- label: '<',
91
86
  value: '<',
92
87
  getApplyFilterFn: function getApplyFilterFn(filterItem) {
93
88
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -106,7 +101,6 @@ export var getGridNumericOperators = function getGridNumericOperators() {
106
101
  type: 'number'
107
102
  }
108
103
  }, {
109
- label: '<=',
110
104
  value: '<=',
111
105
  getApplyFilterFn: function getApplyFilterFn(filterItem) {
112
106
  if (filterItem.value == null || Number.isNaN(filterItem.value)) {
@@ -52,5 +52,25 @@ export var GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
52
52
  return valueOption ? colDef.getOptionLabel(valueOption) : '';
53
53
  },
54
54
  renderEditCell: renderEditSingleSelectCell,
55
- filterOperators: getGridSingleSelectOperators()
55
+ filterOperators: getGridSingleSelectOperators(),
56
+ // @ts-ignore
57
+ pastedValueParser: function pastedValueParser(value, params) {
58
+ var colDef = params.colDef;
59
+ var colDefValueOptions = colDef.valueOptions;
60
+ var valueOptions = typeof colDefValueOptions === 'function' ? colDefValueOptions({
61
+ field: colDef.field
62
+ }) : colDefValueOptions || [];
63
+ var getOptionValue = colDef.getOptionValue;
64
+ var valueOption = valueOptions.find(function (option) {
65
+ if (getOptionValue(option) === value) {
66
+ return true;
67
+ }
68
+ return false;
69
+ });
70
+ if (valueOption) {
71
+ return value;
72
+ }
73
+ // do not paste the value if it is not in the valueOptions
74
+ return undefined;
75
+ }
56
76
  });
@@ -91,7 +91,8 @@ function GridBody(props) {
91
91
  apiRef.current.register('private', {
92
92
  columnHeadersContainerElementRef: columnsContainerRef,
93
93
  columnHeadersElementRef: columnHeadersRef,
94
- virtualScrollerRef: virtualScrollerRef
94
+ virtualScrollerRef: virtualScrollerRef,
95
+ mainElementRef: rootRef
95
96
  });
96
97
  var hasDimensions = !!apiRef.current.getRootDimensions();
97
98
  return /*#__PURE__*/_jsxs(GridMainContainer, {
@@ -120,7 +120,10 @@ var GridEditInputCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
120
120
  type: colDef.type === 'number' ? colDef.type : 'text',
121
121
  value: valueState != null ? valueState : '',
122
122
  onChange: handleChange,
123
- endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {}) : undefined
123
+ endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
124
+ fontSize: "small",
125
+ color: "action"
126
+ }) : undefined
124
127
  }, other));
125
128
  });
126
129
  process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
@@ -39,6 +39,7 @@ export var GridRootStyles = styled('div', {
39
39
  outline: 'none',
40
40
  height: '100%',
41
41
  display: 'flex',
42
+ overflow: 'hidden',
42
43
  flexDirection: 'column',
43
44
  overflowAnchor: 'none'
44
45
  }, _defineProperty(_extends2, "&.".concat(gridClasses.autoHeight), _defineProperty({
@@ -1,18 +1,30 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["item", "applyValue", "apiRef", "focusElementRef"];
4
+ var _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "label"];
5
5
  import * as React from 'react';
6
+ import PropTypes from 'prop-types';
6
7
  import { unstable_useId as useId } from '@mui/utils';
8
+ import { styled } from '@mui/material/styles';
7
9
  import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
8
10
  import { jsx as _jsx } from "react/jsx-runtime";
9
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- export function GridFilterInputBoolean(props) {
12
+ var BooleanOperatorContainer = styled('div')({
13
+ display: 'flex',
14
+ alignItems: 'flex-end',
15
+ width: '100%'
16
+ });
17
+ function GridFilterInputBoolean(props) {
11
18
  var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _rootProps$slotProps3;
12
19
  var item = props.item,
13
20
  applyValue = props.applyValue,
14
21
  apiRef = props.apiRef,
15
22
  focusElementRef = props.focusElementRef,
23
+ headerFilterMenu = props.headerFilterMenu,
24
+ isFilterActive = props.isFilterActive,
25
+ clearButton = props.clearButton,
26
+ tabIndex = props.tabIndex,
27
+ labelProp = props.label,
16
28
  others = _objectWithoutProperties(props, _excluded);
17
29
  var _React$useState = React.useState(item.value || ''),
18
30
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -34,39 +46,71 @@ export function GridFilterInputBoolean(props) {
34
46
  React.useEffect(function () {
35
47
  setFilterValueState(item.value || '');
36
48
  }, [item.value]);
37
- var label = apiRef.current.getLocaleText('filterPanelInputLabel');
38
- return /*#__PURE__*/_jsxs(React.Fragment, {
39
- children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
40
- id: labelId,
41
- shrink: true,
42
- variant: "standard",
43
- children: label
44
- })), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
45
- labelId: labelId,
46
- id: selectId,
47
- label: label,
48
- value: filterValueState,
49
- onChange: onFilterChange,
50
- variant: "standard",
51
- native: isSelectNative,
52
- displayEmpty: true,
53
- inputProps: {
54
- ref: focusElementRef
55
- }
56
- }, others, baseSelectProps, {
57
- children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
49
+ var label = labelProp != null ? labelProp : apiRef.current.getLocaleText('filterPanelInputLabel');
50
+ return /*#__PURE__*/_jsxs(BooleanOperatorContainer, {
51
+ children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
52
+ fullWidth: true,
53
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
54
+ id: labelId,
55
+ shrink: true,
56
+ variant: "standard",
57
+ children: label
58
+ })), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
59
+ labelId: labelId,
60
+ id: selectId,
61
+ label: label,
62
+ value: filterValueState,
63
+ onChange: onFilterChange,
64
+ variant: "standard",
58
65
  native: isSelectNative,
59
- value: "",
60
- children: apiRef.current.getLocaleText('filterValueAny')
61
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
62
- native: isSelectNative,
63
- value: "true",
64
- children: apiRef.current.getLocaleText('filterValueTrue')
65
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
66
- native: isSelectNative,
67
- value: "false",
68
- children: apiRef.current.getLocaleText('filterValueFalse')
66
+ displayEmpty: true,
67
+ startAdornment: isFilterActive ? headerFilterMenu : null,
68
+ inputProps: {
69
+ ref: focusElementRef,
70
+ tabIndex: tabIndex
71
+ }
72
+ }, others, baseSelectProps, {
73
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
74
+ native: isSelectNative,
75
+ value: "",
76
+ children: apiRef.current.getLocaleText('filterValueAny')
77
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
78
+ native: isSelectNative,
79
+ value: "true",
80
+ children: apiRef.current.getLocaleText('filterValueTrue')
81
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
82
+ native: isSelectNative,
83
+ value: "false",
84
+ children: apiRef.current.getLocaleText('filterValueFalse')
85
+ }))]
69
86
  }))]
70
- }))]
87
+ }), clearButton]
71
88
  });
72
- }
89
+ }
90
+ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
91
+ // ----------------------------- Warning --------------------------------
92
+ // | These PropTypes are generated from the TypeScript type definitions |
93
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
94
+ // ----------------------------------------------------------------------
95
+ apiRef: PropTypes.shape({
96
+ current: PropTypes.object.isRequired
97
+ }).isRequired,
98
+ applyValue: PropTypes.func.isRequired,
99
+ clearButton: PropTypes.node,
100
+ focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
101
+ current: PropTypes.any.isRequired
102
+ })]),
103
+ headerFilterMenu: PropTypes.node,
104
+ /**
105
+ * It is `true` if the filter either has a value or an operator with no value
106
+ * required is selected (e.g. `isEmpty`)
107
+ */
108
+ isFilterActive: PropTypes.bool,
109
+ item: PropTypes.shape({
110
+ field: PropTypes.string.isRequired,
111
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
112
+ operator: PropTypes.string.isRequired,
113
+ value: PropTypes.any
114
+ }).isRequired
115
+ } : void 0;
116
+ export { GridFilterInputBoolean };
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps"];
4
+ var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "disabled"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import { unstable_useId as useId } from '@mui/utils';
@@ -16,6 +16,11 @@ function GridFilterInputDate(props) {
16
16
  apiRef = props.apiRef,
17
17
  focusElementRef = props.focusElementRef,
18
18
  InputProps = props.InputProps,
19
+ headerFilterMenu = props.headerFilterMenu,
20
+ isFilterActive = props.isFilterActive,
21
+ clearButton = props.clearButton,
22
+ tabIndex = props.tabIndex,
23
+ disabled = props.disabled,
19
24
  other = _objectWithoutProperties(props, _excluded);
20
25
  var filterTimeout = React.useRef();
21
26
  var _React$useState = React.useState((_item$value = item.value) != null ? _item$value : ''),
@@ -51,6 +56,7 @@ function GridFilterInputDate(props) {
51
56
  setFilterValueState(String(itemValue));
52
57
  }, [item.value]);
53
58
  return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
59
+ fullWidth: true,
54
60
  id: id,
55
61
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
56
62
  placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
@@ -62,11 +68,19 @@ function GridFilterInputDate(props) {
62
68
  shrink: true
63
69
  },
64
70
  inputRef: focusElementRef,
65
- InputProps: _extends({}, applying ? {
66
- endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
67
- } : {}, InputProps, {
71
+ InputProps: _extends({}, applying || clearButton ? {
72
+ endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
73
+ fontSize: "small",
74
+ color: "action"
75
+ }) : clearButton
76
+ } : {}, headerFilterMenu && isFilterActive ? {
77
+ startAdornment: headerFilterMenu
78
+ } : {}, {
79
+ disabled: disabled
80
+ }, InputProps, {
68
81
  inputProps: _extends({
69
- max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'
82
+ max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
83
+ tabIndex: tabIndex
70
84
  }, InputProps == null ? void 0 : InputProps.inputProps)
71
85
  })
72
86
  }, other, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTextField));
@@ -80,7 +94,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
80
94
  current: PropTypes.object.isRequired
81
95
  }).isRequired,
82
96
  applyValue: PropTypes.func.isRequired,
97
+ clearButton: PropTypes.node,
83
98
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
99
+ headerFilterMenu: PropTypes.node,
100
+ /**
101
+ * It is `true` if the filter either has a value or an operator with no value
102
+ * required is selected (e.g. `isEmpty`)
103
+ */
104
+ isFilterActive: PropTypes.bool,
84
105
  item: PropTypes.shape({
85
106
  field: PropTypes.string.isRequired,
86
107
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -4,7 +4,6 @@ var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "col
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
7
- import Chip from '@mui/material/Chip';
8
7
  import { unstable_useId as useId } from '@mui/utils';
9
8
  import { isSingleSelectColDef } from './filterPanelUtils';
10
9
  import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
@@ -108,7 +107,7 @@ function GridFilterInputMultipleSingleSelect(props) {
108
107
  getOptionLabel: getOptionLabel,
109
108
  renderTags: function renderTags(value, getTagProps) {
110
109
  return value.map(function (option, index) {
111
- return /*#__PURE__*/_jsx(Chip, _extends({
110
+ return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
112
111
  variant: "outlined",
113
112
  size: "small",
114
113
  label: getOptionLabel(option)
@@ -6,7 +6,6 @@ var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "col
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import Autocomplete from '@mui/material/Autocomplete';
9
- import Chip from '@mui/material/Chip';
10
9
  import { unstable_useId as useId } from '@mui/utils';
11
10
  import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
12
11
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -59,7 +58,7 @@ function GridFilterInputMultipleValue(props) {
59
58
  onChange: handleChange,
60
59
  renderTags: function renderTags(value, getTagProps) {
61
60
  return value.map(function (option, index) {
62
- return /*#__PURE__*/_jsx(Chip, _extends({
61
+ return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
63
62
  variant: "outlined",
64
63
  size: "small",
65
64
  label: option
@@ -2,10 +2,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
- var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue"];
5
+ var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "headerFilterMenu", "isFilterActive", "clearButton"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { unstable_useId as useId } from '@mui/utils';
9
+ import { styled } from '@mui/material/styles';
9
10
  import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
10
11
  import { getValueFromValueOptions, isSingleSelectColDef } from './filterPanelUtils';
11
12
  import { createElement as _createElement } from "react";
@@ -33,6 +34,11 @@ var renderSingleSelectOptions = function renderSingleSelectOptions(_ref) {
33
34
  }), label);
34
35
  });
35
36
  };
37
+ var 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
  var item = props.item,
@@ -42,6 +48,12 @@ function GridFilterInputSingleSelect(props) {
42
48
  focusElementRef = props.focusElementRef,
43
49
  getOptionLabelProp = props.getOptionLabel,
44
50
  getOptionValueProp = props.getOptionValue,
51
+ placeholder = props.placeholder,
52
+ tabIndex = props.tabIndex,
53
+ labelProp = props.label,
54
+ headerFilterMenu = props.headerFilterMenu,
55
+ isFilterActive = props.isFilterActive,
56
+ clearButton = props.clearButton,
45
57
  others = _objectWithoutProperties(props, _excluded);
46
58
  var _React$useState = React.useState((_item$value = item.value) != null ? _item$value : ''),
47
59
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -102,36 +114,40 @@ function GridFilterInputSingleSelect(props) {
102
114
  if (!isSingleSelectColDef(resolvedColumn)) {
103
115
  return null;
104
116
  }
105
- var label = apiRef.current.getLocaleText('filterPanelInputLabel');
106
- return /*#__PURE__*/_jsxs(React.Fragment, {
107
- children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseInputLabel, {
108
- id: labelId,
109
- shrink: true,
110
- variant: "standard",
111
- children: label
112
- })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
113
- id: id,
114
- label: label,
115
- labelId: labelId,
116
- value: filterValueState,
117
- onChange: onFilterChange,
118
- variant: "standard",
119
- type: type || 'text',
120
- inputProps: {
121
- ref: focusElementRef,
122
- placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder')
123
- },
124
- native: isSelectNative
125
- }, others, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
126
- children: renderSingleSelectOptions({
127
- column: resolvedColumn,
128
- OptionComponent: rootProps.slots.baseSelectOption,
129
- getOptionLabel: getOptionLabel,
130
- getOptionValue: getOptionValue,
131
- isSelectNative: isSelectNative,
132
- baseSelectOptionProps: (_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseSelectOption
133
- })
134
- }))]
117
+ var label = labelProp != null ? labelProp : apiRef.current.getLocaleText('filterPanelInputLabel');
118
+ return /*#__PURE__*/_jsxs(SingleSelectOperatorContainer, {
119
+ children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
120
+ children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseInputLabel, {
121
+ id: labelId,
122
+ shrink: true,
123
+ variant: "standard",
124
+ children: label
125
+ })), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
126
+ id: id,
127
+ label: label,
128
+ labelId: labelId,
129
+ value: filterValueState,
130
+ onChange: onFilterChange,
131
+ startAdornment: isFilterActive ? headerFilterMenu : null,
132
+ variant: "standard",
133
+ type: type || 'text',
134
+ inputProps: {
135
+ tabIndex: tabIndex,
136
+ ref: focusElementRef,
137
+ placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
138
+ },
139
+ native: isSelectNative
140
+ }, others, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
141
+ children: renderSingleSelectOptions({
142
+ column: resolvedColumn,
143
+ OptionComponent: rootProps.slots.baseSelectOption,
144
+ getOptionLabel: getOptionLabel,
145
+ getOptionValue: getOptionValue,
146
+ isSelectNative: isSelectNative,
147
+ baseSelectOptionProps: (_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseSelectOption
148
+ })
149
+ }))]
150
+ }), clearButton]
135
151
  });
136
152
  }
137
153
  process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
@@ -143,6 +159,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
143
159
  current: PropTypes.object.isRequired
144
160
  }).isRequired,
145
161
  applyValue: PropTypes.func.isRequired,
162
+ clearButton: PropTypes.node,
146
163
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
147
164
  /**
148
165
  * Used to determine the label displayed for a given value option.
@@ -156,6 +173,12 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
156
173
  * @returns {string} The value to be used.
157
174
  */
158
175
  getOptionValue: PropTypes.func,
176
+ headerFilterMenu: PropTypes.node,
177
+ /**
178
+ * It is `true` if the filter either has a value or an operator with no value
179
+ * required is selected (e.g. `isEmpty`)
180
+ */
181
+ isFilterActive: PropTypes.bool,
159
182
  item: PropTypes.shape({
160
183
  field: PropTypes.string.isRequired,
161
184
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef"];
4
+ var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "headerFilterMenu", "isFilterActive", "clearButton", "InputProps"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import { unstable_useId as useId } from '@mui/utils';
@@ -15,6 +15,12 @@ function GridFilterInputValue(props) {
15
15
  type = props.type,
16
16
  apiRef = props.apiRef,
17
17
  focusElementRef = props.focusElementRef,
18
+ tabIndex = props.tabIndex,
19
+ disabled = props.disabled,
20
+ headerFilterMenu = props.headerFilterMenu,
21
+ isFilterActive = props.isFilterActive,
22
+ clearButton = props.clearButton,
23
+ InputProps = props.InputProps,
18
24
  others = _objectWithoutProperties(props, _excluded);
19
25
  var filterTimeout = React.useRef();
20
26
  var _React$useState = React.useState((_item$value = item.value) != null ? _item$value : ''),
@@ -49,9 +55,6 @@ function GridFilterInputValue(props) {
49
55
  var itemValue = (_item$value2 = item.value) != null ? _item$value2 : '';
50
56
  setFilterValueState(String(itemValue));
51
57
  }, [item.value]);
52
- var InputProps = applying ? {
53
- endAdornment: /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {})
54
- } : others.InputProps;
55
58
  return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
56
59
  id: id,
57
60
  label: apiRef.current.getLocaleText('filterPanelInputLabel'),
@@ -60,7 +63,20 @@ function GridFilterInputValue(props) {
60
63
  onChange: onFilterChange,
61
64
  variant: "standard",
62
65
  type: type || 'text',
63
- InputProps: InputProps,
66
+ InputProps: _extends({}, applying || clearButton ? {
67
+ endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
68
+ fontSize: "small",
69
+ color: "action"
70
+ }) : clearButton
71
+ } : {}, headerFilterMenu && isFilterActive ? {
72
+ startAdornment: headerFilterMenu
73
+ } : {}, {
74
+ disabled: disabled
75
+ }, InputProps, {
76
+ inputProps: _extends({
77
+ tabIndex: tabIndex
78
+ }, InputProps == null ? void 0 : InputProps.inputProps)
79
+ }),
64
80
  InputLabelProps: {
65
81
  shrink: true
66
82
  },
@@ -76,7 +92,14 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
76
92
  current: PropTypes.object.isRequired
77
93
  }).isRequired,
78
94
  applyValue: PropTypes.func.isRequired,
95
+ clearButton: PropTypes.node,
79
96
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
97
+ headerFilterMenu: PropTypes.node,
98
+ /**
99
+ * It is `true` if the filter either has a value or an operator with no value
100
+ * required is selected (e.g. `isEmpty`)
101
+ */
102
+ isFilterActive: PropTypes.bool,
80
103
  item: PropTypes.shape({
81
104
  field: PropTypes.string.isRequired,
82
105
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -218,4 +218,4 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
218
218
  */
219
219
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
220
220
  } : void 0;
221
- export { GridFilterPanel };
221
+ export { GridFilterPanel, getGridFilter };
@@ -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';