@mui/x-data-grid 6.5.0 → 6.7.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 (329) hide show
  1. package/CHANGELOG.md +150 -2
  2. package/DataGrid/DataGrid.js +10 -3
  3. package/README.md +2 -2
  4. package/components/GridColumnHeaders.js +4 -9
  5. package/components/GridHeader.d.ts +2 -2
  6. package/components/base/GridBody.d.ts +1 -1
  7. package/components/base/GridFooterPlaceholder.d.ts +2 -2
  8. package/components/base/GridOverlays.d.ts +2 -2
  9. package/components/cell/GridActionsCell.d.ts +3 -3
  10. package/components/cell/GridActionsCell.js +3 -3
  11. package/components/cell/GridBooleanCell.d.ts +1 -1
  12. package/components/cell/GridEditBooleanCell.d.ts +2 -2
  13. package/components/cell/GridEditDateCell.d.ts +2 -2
  14. package/components/cell/GridEditInputCell.d.ts +1 -1
  15. package/components/cell/GridEditSingleSelectCell.d.ts +3 -3
  16. package/components/cell/GridEditSingleSelectCell.js +5 -5
  17. package/components/cell/GridSkeletonCell.d.ts +1 -1
  18. package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
  19. package/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  20. package/components/columnHeaders/GridColumnGroupHeader.d.ts +2 -2
  21. package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
  22. package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
  23. package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -2
  24. package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
  25. package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -1
  26. package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
  27. package/components/containers/GridRoot.js +1 -3
  28. package/components/containers/GridRootStyles.js +8 -1
  29. package/components/index.d.ts +0 -1
  30. package/components/index.js +1 -2
  31. package/components/menu/GridMenu.d.ts +1 -1
  32. package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
  33. package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -2
  34. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -2
  35. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -2
  36. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -2
  37. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -2
  38. package/components/panel/GridColumnsPanel.d.ts +16 -2
  39. package/components/panel/GridColumnsPanel.js +14 -0
  40. package/components/panel/GridPanelContent.d.ts +1 -1
  41. package/components/panel/GridPanelFooter.d.ts +1 -1
  42. package/components/panel/GridPanelHeader.d.ts +1 -1
  43. package/components/panel/GridPreferencesPanel.js +3 -1
  44. package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -2
  45. package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  46. package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -2
  47. package/components/panel/filterPanel/GridFilterInputDate.js +1 -6
  48. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
  49. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
  50. package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -2
  51. package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
  52. package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -2
  53. package/components/panel/filterPanel/GridFilterInputValue.js +1 -6
  54. package/components/panel/filterPanel/GridFilterPanel.d.ts +8 -0
  55. package/components/panel/filterPanel/GridFilterPanel.js +8 -0
  56. package/components/toolbar/GridToolbarColumnsButton.js +11 -6
  57. package/components/toolbar/GridToolbarDensitySelector.js +2 -2
  58. package/components/toolbar/GridToolbarExport.d.ts +2 -2
  59. package/components/toolbar/GridToolbarExportContainer.js +7 -7
  60. package/components/toolbar/GridToolbarFilterButton.js +11 -4
  61. package/components/toolbar/GridToolbarQuickFilter.d.ts +2 -2
  62. package/constants/gridClasses.d.ts +4 -0
  63. package/constants/gridClasses.js +1 -1
  64. package/constants/localeTextConstants.js +4 -4
  65. package/context/GridContextProvider.d.ts +1 -1
  66. package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +10 -2
  67. package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  68. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
  69. package/hooks/features/filter/gridFilterSelector.d.ts +2 -2
  70. package/hooks/features/filter/gridFilterSelector.js +2 -2
  71. package/hooks/features/filter/gridFilterState.d.ts +6 -6
  72. package/hooks/features/filter/gridFilterState.js +6 -0
  73. package/hooks/features/filter/useGridFilter.js +31 -10
  74. package/hooks/features/focus/useGridFocus.js +1 -0
  75. package/hooks/features/preferencesPanel/gridPreferencePanelState.d.ts +2 -0
  76. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  77. package/hooks/features/rows/useGridRowsMeta.js +12 -13
  78. package/hooks/features/sorting/useGridSorting.js +2 -1
  79. package/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  80. package/index.js +1 -1
  81. package/internals/utils/useProps.js +21 -1
  82. package/legacy/DataGrid/DataGrid.js +10 -3
  83. package/legacy/components/GridColumnHeaders.js +4 -9
  84. package/legacy/components/cell/GridActionsCell.js +3 -3
  85. package/legacy/components/cell/GridEditSingleSelectCell.js +5 -5
  86. package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  87. package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
  88. package/legacy/components/containers/GridRoot.js +1 -3
  89. package/legacy/components/containers/GridRootStyles.js +8 -4
  90. package/legacy/components/index.js +1 -2
  91. package/legacy/components/panel/GridColumnsPanel.js +14 -0
  92. package/legacy/components/panel/GridPreferencesPanel.js +3 -1
  93. package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +7 -7
  94. package/legacy/components/panel/filterPanel/GridFilterInputDate.js +1 -5
  95. package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -6
  96. package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -5
  97. package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -0
  98. package/legacy/components/toolbar/GridToolbarColumnsButton.js +11 -5
  99. package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -2
  100. package/legacy/components/toolbar/GridToolbarExportContainer.js +7 -7
  101. package/legacy/components/toolbar/GridToolbarFilterButton.js +11 -4
  102. package/legacy/constants/gridClasses.js +1 -1
  103. package/legacy/constants/localeTextConstants.js +4 -4
  104. package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  105. package/legacy/hooks/features/filter/gridFilterSelector.js +4 -4
  106. package/legacy/hooks/features/filter/gridFilterState.js +6 -0
  107. package/legacy/hooks/features/filter/useGridFilter.js +31 -10
  108. package/legacy/hooks/features/focus/useGridFocus.js +1 -0
  109. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  110. package/legacy/hooks/features/rows/useGridRowsMeta.js +13 -21
  111. package/legacy/hooks/features/sorting/useGridSorting.js +2 -1
  112. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  113. package/legacy/index.js +1 -1
  114. package/legacy/internals/utils/useProps.js +23 -1
  115. package/legacy/locales/arSD.js +12 -12
  116. package/legacy/locales/beBY.js +12 -12
  117. package/legacy/locales/bgBG.js +12 -12
  118. package/legacy/locales/csCZ.js +25 -27
  119. package/legacy/locales/daDK.js +12 -12
  120. package/legacy/locales/deDE.js +25 -27
  121. package/legacy/locales/elGR.js +12 -12
  122. package/legacy/locales/esES.js +12 -12
  123. package/legacy/locales/faIR.js +12 -12
  124. package/legacy/locales/fiFI.js +12 -12
  125. package/legacy/locales/frFR.js +25 -27
  126. package/legacy/locales/heIL.js +12 -12
  127. package/legacy/locales/huHU.js +12 -12
  128. package/legacy/locales/itIT.js +12 -12
  129. package/legacy/locales/jaJP.js +12 -12
  130. package/legacy/locales/koKR.js +12 -12
  131. package/legacy/locales/nbNO.js +12 -12
  132. package/legacy/locales/nlNL.js +25 -27
  133. package/legacy/locales/plPL.js +12 -12
  134. package/legacy/locales/ptBR.js +12 -12
  135. package/legacy/locales/roRO.js +12 -12
  136. package/legacy/locales/ruRU.js +12 -12
  137. package/legacy/locales/skSK.js +12 -12
  138. package/legacy/locales/svSE.js +12 -12
  139. package/legacy/locales/trTR.js +18 -19
  140. package/legacy/locales/ukUA.js +12 -12
  141. package/legacy/locales/urPK.js +12 -12
  142. package/legacy/locales/viVN.js +12 -12
  143. package/legacy/locales/zhCN.js +12 -12
  144. package/legacy/locales/zhTW.js +12 -12
  145. package/legacy/models/gridFilterItem.js +1 -1
  146. package/legacy/utils/EventManager.js +2 -2
  147. package/locales/arSD.js +12 -12
  148. package/locales/beBY.js +12 -12
  149. package/locales/bgBG.js +12 -12
  150. package/locales/csCZ.js +25 -27
  151. package/locales/daDK.js +12 -12
  152. package/locales/deDE.js +25 -27
  153. package/locales/elGR.js +12 -12
  154. package/locales/esES.js +12 -12
  155. package/locales/faIR.js +12 -12
  156. package/locales/fiFI.js +12 -12
  157. package/locales/frFR.js +25 -27
  158. package/locales/heIL.js +12 -12
  159. package/locales/huHU.js +12 -12
  160. package/locales/itIT.js +12 -12
  161. package/locales/jaJP.js +12 -12
  162. package/locales/koKR.js +12 -12
  163. package/locales/nbNO.js +12 -12
  164. package/locales/nlNL.js +25 -27
  165. package/locales/plPL.js +12 -12
  166. package/locales/ptBR.js +12 -12
  167. package/locales/roRO.js +12 -12
  168. package/locales/ruRU.js +12 -12
  169. package/locales/skSK.js +12 -12
  170. package/locales/svSE.js +12 -12
  171. package/locales/trTR.js +18 -19
  172. package/locales/ukUA.js +12 -12
  173. package/locales/urPK.js +12 -12
  174. package/locales/viVN.js +12 -12
  175. package/locales/zhCN.js +12 -12
  176. package/locales/zhTW.js +12 -12
  177. package/material/components/MUISelectOption.d.ts +2 -2
  178. package/models/api/gridFilterApi.d.ts +3 -1
  179. package/models/api/gridPreferencesPanelApi.d.ts +3 -1
  180. package/models/events/gridEventLookup.d.ts +8 -0
  181. package/models/gridFilterItem.d.ts +1 -1
  182. package/models/gridFilterItem.js +1 -1
  183. package/models/gridFilterOperator.d.ts +1 -1
  184. package/models/gridStateCommunity.d.ts +2 -0
  185. package/models/props/DataGridProps.d.ts +5 -0
  186. package/modern/DataGrid/DataGrid.js +10 -3
  187. package/modern/components/GridColumnHeaders.js +4 -9
  188. package/modern/components/cell/GridActionsCell.js +3 -3
  189. package/modern/components/cell/GridEditSingleSelectCell.js +5 -5
  190. package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  191. package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
  192. package/modern/components/containers/GridRoot.js +1 -3
  193. package/modern/components/containers/GridRootStyles.js +8 -1
  194. package/modern/components/index.js +1 -2
  195. package/modern/components/panel/GridColumnsPanel.js +14 -0
  196. package/modern/components/panel/GridPreferencesPanel.js +3 -1
  197. package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  198. package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -6
  199. package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
  200. package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -6
  201. package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -0
  202. package/modern/components/toolbar/GridToolbarColumnsButton.js +11 -6
  203. package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
  204. package/modern/components/toolbar/GridToolbarExportContainer.js +7 -7
  205. package/modern/components/toolbar/GridToolbarFilterButton.js +11 -4
  206. package/modern/constants/gridClasses.js +1 -1
  207. package/modern/constants/localeTextConstants.js +4 -4
  208. package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  209. package/modern/hooks/features/filter/gridFilterSelector.js +2 -2
  210. package/modern/hooks/features/filter/gridFilterState.js +6 -0
  211. package/modern/hooks/features/filter/useGridFilter.js +31 -10
  212. package/modern/hooks/features/focus/useGridFocus.js +1 -0
  213. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  214. package/modern/hooks/features/rows/useGridRowsMeta.js +12 -13
  215. package/modern/hooks/features/sorting/useGridSorting.js +2 -1
  216. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  217. package/modern/index.js +1 -1
  218. package/modern/internals/utils/useProps.js +20 -1
  219. package/modern/locales/arSD.js +12 -12
  220. package/modern/locales/beBY.js +12 -12
  221. package/modern/locales/bgBG.js +12 -12
  222. package/modern/locales/csCZ.js +25 -27
  223. package/modern/locales/daDK.js +12 -12
  224. package/modern/locales/deDE.js +25 -27
  225. package/modern/locales/elGR.js +12 -12
  226. package/modern/locales/esES.js +12 -12
  227. package/modern/locales/faIR.js +12 -12
  228. package/modern/locales/fiFI.js +12 -12
  229. package/modern/locales/frFR.js +25 -27
  230. package/modern/locales/heIL.js +12 -12
  231. package/modern/locales/huHU.js +12 -12
  232. package/modern/locales/itIT.js +12 -12
  233. package/modern/locales/jaJP.js +12 -12
  234. package/modern/locales/koKR.js +12 -12
  235. package/modern/locales/nbNO.js +12 -12
  236. package/modern/locales/nlNL.js +25 -27
  237. package/modern/locales/plPL.js +12 -12
  238. package/modern/locales/ptBR.js +12 -12
  239. package/modern/locales/roRO.js +12 -12
  240. package/modern/locales/ruRU.js +12 -12
  241. package/modern/locales/skSK.js +12 -12
  242. package/modern/locales/svSE.js +12 -12
  243. package/modern/locales/trTR.js +18 -19
  244. package/modern/locales/ukUA.js +12 -12
  245. package/modern/locales/urPK.js +12 -12
  246. package/modern/locales/viVN.js +12 -12
  247. package/modern/locales/zhCN.js +12 -12
  248. package/modern/locales/zhTW.js +12 -12
  249. package/modern/models/gridFilterItem.js +1 -1
  250. package/modern/utils/EventManager.js +2 -2
  251. package/node/DataGrid/DataGrid.js +10 -3
  252. package/node/components/GridColumnHeaders.js +3 -8
  253. package/node/components/cell/GridActionsCell.js +3 -3
  254. package/node/components/cell/GridEditSingleSelectCell.js +5 -5
  255. package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
  256. package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +12 -3
  257. package/node/components/containers/GridRoot.js +1 -3
  258. package/node/components/containers/GridRootStyles.js +8 -1
  259. package/node/components/index.js +0 -11
  260. package/node/components/panel/GridColumnsPanel.js +14 -0
  261. package/node/components/panel/GridPreferencesPanel.js +3 -1
  262. package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
  263. package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -6
  264. package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -6
  265. package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -6
  266. package/node/components/panel/filterPanel/GridFilterPanel.js +8 -0
  267. package/node/components/toolbar/GridToolbarColumnsButton.js +11 -6
  268. package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
  269. package/node/components/toolbar/GridToolbarExportContainer.js +7 -7
  270. package/node/components/toolbar/GridToolbarFilterButton.js +10 -3
  271. package/node/constants/gridClasses.js +1 -1
  272. package/node/constants/localeTextConstants.js +4 -4
  273. package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
  274. package/node/hooks/features/filter/gridFilterSelector.js +2 -2
  275. package/node/hooks/features/filter/gridFilterState.js +6 -0
  276. package/node/hooks/features/filter/useGridFilter.js +35 -14
  277. package/node/hooks/features/focus/useGridFocus.js +1 -0
  278. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
  279. package/node/hooks/features/rows/useGridRowsMeta.js +12 -13
  280. package/node/hooks/features/sorting/useGridSorting.js +2 -1
  281. package/node/hooks/features/virtualization/useGridVirtualScroller.js +2 -2
  282. package/node/index.js +1 -1
  283. package/node/internals/utils/useProps.js +20 -1
  284. package/node/locales/arSD.js +12 -12
  285. package/node/locales/beBY.js +12 -12
  286. package/node/locales/bgBG.js +12 -12
  287. package/node/locales/csCZ.js +25 -27
  288. package/node/locales/daDK.js +12 -12
  289. package/node/locales/deDE.js +25 -27
  290. package/node/locales/elGR.js +12 -12
  291. package/node/locales/esES.js +12 -12
  292. package/node/locales/faIR.js +12 -12
  293. package/node/locales/fiFI.js +12 -12
  294. package/node/locales/frFR.js +25 -27
  295. package/node/locales/heIL.js +12 -12
  296. package/node/locales/huHU.js +12 -12
  297. package/node/locales/itIT.js +12 -12
  298. package/node/locales/jaJP.js +12 -12
  299. package/node/locales/koKR.js +12 -12
  300. package/node/locales/nbNO.js +12 -12
  301. package/node/locales/nlNL.js +25 -27
  302. package/node/locales/plPL.js +12 -12
  303. package/node/locales/ptBR.js +12 -12
  304. package/node/locales/roRO.js +12 -12
  305. package/node/locales/ruRU.js +12 -12
  306. package/node/locales/skSK.js +12 -12
  307. package/node/locales/svSE.js +12 -12
  308. package/node/locales/trTR.js +18 -19
  309. package/node/locales/ukUA.js +12 -12
  310. package/node/locales/urPK.js +12 -12
  311. package/node/locales/viVN.js +12 -12
  312. package/node/locales/zhCN.js +12 -12
  313. package/node/locales/zhTW.js +12 -12
  314. package/node/models/gridFilterItem.js +1 -1
  315. package/node/utils/EventManager.js +2 -2
  316. package/package.json +4 -4
  317. package/themeAugmentation/overrides.d.ts +1 -1
  318. package/utils/EventManager.js +2 -2
  319. package/components/GridScrollArea.d.ts +0 -10
  320. package/components/GridScrollArea.js +0 -117
  321. package/legacy/components/GridScrollArea.js +0 -119
  322. package/legacy/lib/createDetectElementResize/index.js +0 -145
  323. package/lib/createDetectElementResize/index.d.ts +0 -18
  324. package/lib/createDetectElementResize/index.js +0 -145
  325. package/lib/createDetectElementResize/types.d.ts +0 -9
  326. package/modern/components/GridScrollArea.js +0 -117
  327. package/modern/lib/createDetectElementResize/index.js +0 -145
  328. package/node/components/GridScrollArea.js +0 -126
  329. package/node/lib/createDetectElementResize/index.js +0 -151
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { GridColumnMenuItemProps } from '../GridColumnMenuItemProps';
3
- declare function GridColumnMenuColumnsItem(props: GridColumnMenuItemProps): JSX.Element;
3
+ declare function GridColumnMenuColumnsItem(props: GridColumnMenuItemProps): React.JSX.Element;
4
4
  declare namespace GridColumnMenuColumnsItem {
5
5
  var propTypes: any;
6
6
  }
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { GridColumnMenuItemProps } from '../GridColumnMenuItemProps';
3
- declare function GridColumnMenuFilterItem(props: GridColumnMenuItemProps): JSX.Element | null;
3
+ declare function GridColumnMenuFilterItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
4
4
  declare namespace GridColumnMenuFilterItem {
5
5
  var propTypes: any;
6
6
  }
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { GridColumnMenuItemProps } from '../GridColumnMenuItemProps';
3
- declare function GridColumnMenuHideItem(props: GridColumnMenuItemProps): JSX.Element | null;
3
+ declare function GridColumnMenuHideItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
4
4
  declare namespace GridColumnMenuHideItem {
5
5
  var propTypes: any;
6
6
  }
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { GridColumnMenuItemProps } from '../GridColumnMenuItemProps';
3
- declare function GridColumnMenuManageItem(props: GridColumnMenuItemProps): JSX.Element | null;
3
+ declare function GridColumnMenuManageItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
4
4
  declare namespace GridColumnMenuManageItem {
5
5
  var propTypes: any;
6
6
  }
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { GridColumnMenuItemProps } from '../GridColumnMenuItemProps';
3
- declare function GridColumnMenuSortItem(props: GridColumnMenuItemProps): JSX.Element | null;
3
+ declare function GridColumnMenuSortItem(props: GridColumnMenuItemProps): React.JSX.Element | null;
4
4
  declare namespace GridColumnMenuSortItem {
5
5
  var propTypes: any;
6
6
  }
@@ -1,11 +1,25 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { GridPanelWrapperProps } from './GridPanelWrapper';
3
3
  import type { GridColDef } from '../../models/colDef/gridColDef';
4
4
  export interface GridColumnsPanelProps extends GridPanelWrapperProps {
5
5
  sort?: 'asc' | 'desc';
6
6
  searchPredicate?: (column: GridColDef, searchValue: string) => boolean;
7
+ /**
8
+ * If `true`, the column search field will be focused automatically.
9
+ * If `false`, the first column switch input will be focused automatically.
10
+ * This helps to avoid input keyboard panel to popup automatically on touch devices.
11
+ * @default true
12
+ */
7
13
  autoFocusSearchField?: boolean;
14
+ /**
15
+ * If `true`, the `Hide all` button will not be displayed.
16
+ * @default false
17
+ */
8
18
  disableHideAllButton?: boolean;
19
+ /**
20
+ * If `true`, the `Show all` button will be disabled
21
+ * @default false
22
+ */
9
23
  disableShowAllButton?: boolean;
10
24
  /**
11
25
  * Returns the list of togglable columns.
@@ -16,7 +30,7 @@ export interface GridColumnsPanelProps extends GridPanelWrapperProps {
16
30
  */
17
31
  getTogglableColumns?: (columns: GridColDef[]) => GridColDef['field'][];
18
32
  }
19
- declare function GridColumnsPanel(props: GridColumnsPanelProps): JSX.Element;
33
+ declare function GridColumnsPanel(props: GridColumnsPanelProps): React.JSX.Element;
20
34
  declare namespace GridColumnsPanel {
21
35
  var propTypes: any;
22
36
  }
@@ -198,8 +198,22 @@ process.env.NODE_ENV !== "production" ? GridColumnsPanel.propTypes = {
198
198
  // | These PropTypes are generated from the TypeScript type definitions |
199
199
  // | To update them edit the TypeScript types and run "yarn proptypes" |
200
200
  // ----------------------------------------------------------------------
201
+ /**
202
+ * If `true`, the column search field will be focused automatically.
203
+ * If `false`, the first column switch input will be focused automatically.
204
+ * This helps to avoid input keyboard panel to popup automatically on touch devices.
205
+ * @default true
206
+ */
201
207
  autoFocusSearchField: PropTypes.bool,
208
+ /**
209
+ * If `true`, the `Hide all` button will not be displayed.
210
+ * @default false
211
+ */
202
212
  disableHideAllButton: PropTypes.bool,
213
+ /**
214
+ * If `true`, the `Show all` button will be disabled
215
+ * @default false
216
+ */
203
217
  disableShowAllButton: PropTypes.bool,
204
218
  /**
205
219
  * Returns the list of togglable columns.
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SxProps, Theme } from '@mui/system';
3
3
  declare function GridPanelContent(props: React.HTMLAttributes<HTMLDivElement> & {
4
4
  sx?: SxProps<Theme>;
5
- }): JSX.Element;
5
+ }): React.JSX.Element;
6
6
  declare namespace GridPanelContent {
7
7
  var propTypes: any;
8
8
  }
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SxProps, Theme } from '@mui/system';
3
3
  declare function GridPanelFooter(props: React.HTMLAttributes<HTMLDivElement> & {
4
4
  sx?: SxProps<Theme>;
5
- }): JSX.Element;
5
+ }): React.JSX.Element;
6
6
  declare namespace GridPanelFooter {
7
7
  var propTypes: any;
8
8
  }
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SxProps, Theme } from '@mui/system';
3
3
  declare function GridPanelHeader(props: React.HTMLAttributes<HTMLDivElement> & {
4
4
  sx?: SxProps<Theme>;
5
- }): JSX.Element;
5
+ }): React.JSX.Element;
6
6
  declare namespace GridPanelHeader {
7
7
  var propTypes: any;
8
8
  }
@@ -17,7 +17,9 @@ export const GridPreferencesPanel = /*#__PURE__*/React.forwardRef(function GridP
17
17
  return /*#__PURE__*/_jsx(rootProps.slots.panel, _extends({
18
18
  ref: ref,
19
19
  as: rootProps.slots.basePopper,
20
- open: columns.length > 0 && preferencePanelState.open
20
+ open: columns.length > 0 && preferencePanelState.open,
21
+ id: preferencePanelState.panelId,
22
+ "aria-labelledby": preferencePanelState.labelId
21
23
  }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.panel, props, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.basePopper, {
22
24
  children: panelContent
23
25
  }));
@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export type GridFilterInputBooleanProps = GridFilterInputValueProps & TextFieldProps & {
5
- headerFilterMenu?: React.ReactNode | null;
6
5
  clearButton?: React.ReactNode | null;
7
6
  /**
8
7
  * It is `true` if the filter either has a value or an operator with no value
@@ -10,7 +9,7 @@ export type GridFilterInputBooleanProps = GridFilterInputValueProps & TextFieldP
10
9
  */
11
10
  isFilterActive?: boolean;
12
11
  };
13
- declare function GridFilterInputBoolean(props: GridFilterInputBooleanProps): JSX.Element;
12
+ declare function GridFilterInputBoolean(props: GridFilterInputBooleanProps): React.JSX.Element;
14
13
  declare namespace GridFilterInputBoolean {
15
14
  var propTypes: any;
16
15
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "label"];
3
+ const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -10,8 +10,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
11
  const BooleanOperatorContainer = styled('div')({
12
12
  display: 'flex',
13
- alignItems: 'flex-end',
14
- width: '100%'
13
+ alignItems: 'center',
14
+ width: '100%',
15
+ [`& button`]: {
16
+ margin: 'auto 0px 5px 5px'
17
+ }
15
18
  });
16
19
  function GridFilterInputBoolean(props) {
17
20
  var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2, _rootProps$slotProps3;
@@ -20,8 +23,6 @@ function GridFilterInputBoolean(props) {
20
23
  applyValue,
21
24
  apiRef,
22
25
  focusElementRef,
23
- headerFilterMenu,
24
- isFilterActive,
25
26
  clearButton,
26
27
  tabIndex,
27
28
  label: labelProp
@@ -62,7 +63,6 @@ function GridFilterInputBoolean(props) {
62
63
  variant: "standard",
63
64
  native: isSelectNative,
64
65
  displayEmpty: true,
65
- startAdornment: isFilterActive ? headerFilterMenu : null,
66
66
  inputProps: {
67
67
  ref: focusElementRef,
68
68
  tabIndex
@@ -98,7 +98,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
98
98
  focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
99
99
  current: PropTypes.any.isRequired
100
100
  })]),
101
- headerFilterMenu: PropTypes.node,
102
101
  /**
103
102
  * It is `true` if the filter either has a value or an operator with no value
104
103
  * required is selected (e.g. `isEmpty`)
@@ -3,7 +3,6 @@ import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export type GridFilterInputDateProps = GridFilterInputValueProps & TextFieldProps & {
5
5
  type?: 'date' | 'datetime-local';
6
- headerFilterMenu?: React.ReactNode | null;
7
6
  clearButton?: React.ReactNode | null;
8
7
  /**
9
8
  * It is `true` if the filter either has a value or an operator with no value
@@ -12,7 +11,7 @@ export type GridFilterInputDateProps = GridFilterInputValueProps & TextFieldProp
12
11
  isFilterActive?: boolean;
13
12
  };
14
13
  export declare const SUBMIT_FILTER_DATE_STROKE_TIME = 500;
15
- declare function GridFilterInputDate(props: GridFilterInputDateProps): JSX.Element;
14
+ declare function GridFilterInputDate(props: GridFilterInputDateProps): React.JSX.Element;
16
15
  declare namespace GridFilterInputDate {
17
16
  var propTypes: any;
18
17
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "headerFilterMenu", "isFilterActive", "clearButton", "tabIndex", "disabled"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "clearButton", "tabIndex", "disabled"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -16,8 +16,6 @@ function GridFilterInputDate(props) {
16
16
  apiRef,
17
17
  focusElementRef,
18
18
  InputProps,
19
- headerFilterMenu,
20
- isFilterActive,
21
19
  clearButton,
22
20
  tabIndex,
23
21
  disabled
@@ -68,8 +66,6 @@ function GridFilterInputDate(props) {
68
66
  fontSize: "small",
69
67
  color: "action"
70
68
  }) : clearButton
71
- } : {}, headerFilterMenu && isFilterActive ? {
72
- startAdornment: headerFilterMenu
73
69
  } : {}, {
74
70
  disabled
75
71
  }, InputProps, {
@@ -91,7 +87,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
91
87
  applyValue: PropTypes.func.isRequired,
92
88
  clearButton: PropTypes.node,
93
89
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
94
- headerFilterMenu: PropTypes.node,
95
90
  /**
96
91
  * It is `true` if the filter either has a value or an operator with no value
97
92
  * required is selected (e.g. `isEmpty`)
@@ -1,11 +1,11 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { AutocompleteProps } from '@mui/material/Autocomplete';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  import type { GridSingleSelectColDef, ValueOptions } from '../../../models/colDef/gridColDef';
5
5
  export interface GridFilterInputMultipleSingleSelectProps extends Omit<AutocompleteProps<ValueOptions, true, false, true>, 'options' | 'renderInput' | 'onChange' | 'value' | 'id' | 'filterOptions' | 'isOptionEqualToValue' | 'multiple' | 'color' | 'getOptionLabel'>, Pick<GridSingleSelectColDef, 'getOptionLabel' | 'getOptionValue'>, GridFilterInputValueProps {
6
6
  type?: 'singleSelect';
7
7
  }
8
- declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): JSX.Element;
8
+ declare function GridFilterInputMultipleSingleSelect(props: GridFilterInputMultipleSingleSelectProps): React.JSX.Element;
9
9
  declare namespace GridFilterInputMultipleSingleSelect {
10
10
  var propTypes: any;
11
11
  }
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { AutocompleteProps } from '@mui/material/Autocomplete';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export type GridFilterInputMultipleValueProps = {
5
5
  type?: 'text' | 'number';
6
6
  } & GridFilterInputValueProps & Omit<AutocompleteProps<string, true, false, true>, 'options' | 'renderInput'>;
7
- declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): JSX.Element;
7
+ declare function GridFilterInputMultipleValue(props: GridFilterInputMultipleValueProps): React.JSX.Element;
8
8
  declare namespace GridFilterInputMultipleValue {
9
9
  var propTypes: any;
10
10
  }
@@ -3,7 +3,6 @@ import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  import { GridSingleSelectColDef } from '../../../models/colDef/gridColDef';
5
5
  export type GridFilterInputSingleSelectProps = GridFilterInputValueProps & TextFieldProps & Pick<GridSingleSelectColDef, 'getOptionLabel' | 'getOptionValue'> & {
6
- headerFilterMenu?: React.ReactNode | null;
7
6
  clearButton?: React.ReactNode | null;
8
7
  /**
9
8
  * It is `true` if the filter either has a value or an operator with no value
@@ -12,7 +11,7 @@ export type GridFilterInputSingleSelectProps = GridFilterInputValueProps & TextF
12
11
  isFilterActive?: boolean;
13
12
  type?: 'singleSelect';
14
13
  };
15
- declare function GridFilterInputSingleSelect(props: GridFilterInputSingleSelectProps): JSX.Element | null;
14
+ declare function GridFilterInputSingleSelect(props: GridFilterInputSingleSelectProps): React.JSX.Element | null;
16
15
  declare namespace GridFilterInputSingleSelect {
17
16
  var propTypes: any;
18
17
  }
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "headerFilterMenu", "isFilterActive", "clearButton"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "getOptionLabel", "getOptionValue", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -37,7 +37,10 @@ const renderSingleSelectOptions = ({
37
37
  const SingleSelectOperatorContainer = styled('div')({
38
38
  display: 'flex',
39
39
  alignItems: 'flex-end',
40
- width: '100%'
40
+ width: '100%',
41
+ [`& button`]: {
42
+ margin: 'auto 0px 5px 5px'
43
+ }
41
44
  });
42
45
  function GridFilterInputSingleSelect(props) {
43
46
  var _item$value, _rootProps$slotProps$, _rootProps$slotProps, _rootProps$slotProps$2, _resolvedColumn, _resolvedColumn2, _rootProps$slotProps2, _rootProps$slotProps3, _rootProps$slotProps4;
@@ -52,8 +55,6 @@ function GridFilterInputSingleSelect(props) {
52
55
  placeholder,
53
56
  tabIndex,
54
57
  label: labelProp,
55
- headerFilterMenu,
56
- isFilterActive,
57
58
  clearButton
58
59
  } = props,
59
60
  others = _objectWithoutPropertiesLoose(props, _excluded);
@@ -118,6 +119,7 @@ function GridFilterInputSingleSelect(props) {
118
119
  children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
119
120
  children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseInputLabel, {
120
121
  id: labelId,
122
+ htmlFor: id,
121
123
  shrink: true,
122
124
  variant: "standard",
123
125
  children: label
@@ -127,7 +129,6 @@ function GridFilterInputSingleSelect(props) {
127
129
  labelId: labelId,
128
130
  value: filterValueState,
129
131
  onChange: onFilterChange,
130
- startAdornment: isFilterActive ? headerFilterMenu : null,
131
132
  variant: "standard",
132
133
  type: type || 'text',
133
134
  inputProps: {
@@ -172,7 +173,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
172
173
  * @returns {string} The value to be used.
173
174
  */
174
175
  getOptionValue: PropTypes.func,
175
- headerFilterMenu: PropTypes.node,
176
176
  /**
177
177
  * It is `true` if the filter either has a value or an operator with no value
178
178
  * required is selected (e.g. `isEmpty`)
@@ -4,7 +4,6 @@ import { GridFilterInputValueProps } from './GridFilterInputValueProps';
4
4
  export declare const SUBMIT_FILTER_STROKE_TIME = 500;
5
5
  export type GridTypeFilterInputValueProps = GridFilterInputValueProps & TextFieldProps & {
6
6
  type?: 'text' | 'number' | 'date' | 'datetime-local';
7
- headerFilterMenu?: React.ReactNode | null;
8
7
  clearButton?: React.ReactNode | null;
9
8
  /**
10
9
  * It is `true` if the filter either has a value or an operator with no value
@@ -12,7 +11,7 @@ export type GridTypeFilterInputValueProps = GridFilterInputValueProps & TextFiel
12
11
  */
13
12
  isFilterActive?: boolean;
14
13
  };
15
- declare function GridFilterInputValue(props: GridTypeFilterInputValueProps): JSX.Element;
14
+ declare function GridFilterInputValue(props: GridTypeFilterInputValueProps): React.JSX.Element;
16
15
  declare namespace GridFilterInputValue {
17
16
  var propTypes: any;
18
17
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "headerFilterMenu", "isFilterActive", "clearButton", "InputProps"];
3
+ const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_useId as useId } from '@mui/utils';
@@ -17,8 +17,6 @@ function GridFilterInputValue(props) {
17
17
  focusElementRef,
18
18
  tabIndex,
19
19
  disabled,
20
- headerFilterMenu,
21
- isFilterActive,
22
20
  clearButton,
23
21
  InputProps
24
22
  } = props,
@@ -65,8 +63,6 @@ function GridFilterInputValue(props) {
65
63
  fontSize: "small",
66
64
  color: "action"
67
65
  }) : clearButton
68
- } : {}, headerFilterMenu && isFilterActive ? {
69
- startAdornment: headerFilterMenu
70
66
  } : {}, {
71
67
  disabled
72
68
  }, InputProps, {
@@ -91,7 +87,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
91
87
  applyValue: PropTypes.func.isRequired,
92
88
  clearButton: PropTypes.node,
93
89
  focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
94
- headerFilterMenu: PropTypes.node,
95
90
  /**
96
91
  * It is `true` if the filter either has a value or an operator with no value
97
92
  * required is selected (e.g. `isEmpty`)
@@ -22,7 +22,15 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOp
22
22
  * Props passed to each filter form.
23
23
  */
24
24
  filterFormProps?: Pick<GridFilterFormProps, 'columnsSort' | 'deleteIconProps' | 'logicOperatorInputProps' | 'operatorInputProps' | 'columnInputProps' | 'valueInputProps' | 'filterColumns'>;
25
+ /**
26
+ * If `true`, the `Add filter` button will not be displayed.
27
+ * @default false
28
+ */
25
29
  disableAddFilterButton?: boolean;
30
+ /**
31
+ * If `true`, the `Remove all` button will be disabled
32
+ * @default false
33
+ */
26
34
  disableRemoveAllButton?: boolean;
27
35
  /**
28
36
  * @ignore - do not document.
@@ -179,7 +179,15 @@ process.env.NODE_ENV !== "production" ? GridFilterPanel.propTypes = {
179
179
  * If not specified, the order is derived from the `columns` prop.
180
180
  */
181
181
  columnsSort: PropTypes.oneOf(['asc', 'desc']),
182
+ /**
183
+ * If `true`, the `Add filter` button will not be displayed.
184
+ * @default false
185
+ */
182
186
  disableAddFilterButton: PropTypes.bool,
187
+ /**
188
+ * If `true`, the `Remove all` button will be disabled
189
+ * @default false
190
+ */
183
191
  disableRemoveAllButton: PropTypes.bool,
184
192
  /**
185
193
  * Props passed to each filter form.
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["onClick"];
4
4
  import * as React from 'react';
5
+ import { unstable_useId as useId } from '@mui/material/utils';
5
6
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
6
7
  import { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector';
7
8
  import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue';
@@ -14,17 +15,16 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
14
15
  onClick
15
16
  } = props,
16
17
  other = _objectWithoutPropertiesLoose(props, _excluded);
18
+ const columnButtonId = useId();
19
+ const columnPanelId = useId();
17
20
  const apiRef = useGridApiContext();
18
21
  const rootProps = useGridRootProps();
19
- const {
20
- open,
21
- openedPanelValue
22
- } = useGridSelector(apiRef, gridPreferencePanelStateSelector);
22
+ const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
23
23
  const showColumns = event => {
24
- if (open && openedPanelValue === GridPreferencePanelsValue.columns) {
24
+ if (preferencePanel.open && preferencePanel.openedPanelValue === GridPreferencePanelsValue.columns) {
25
25
  apiRef.current.hidePreferences();
26
26
  } else {
27
- apiRef.current.showPreferences(GridPreferencePanelsValue.columns);
27
+ apiRef.current.showPreferences(GridPreferencePanelsValue.columns, columnPanelId, columnButtonId);
28
28
  }
29
29
  onClick == null ? void 0 : onClick(event);
30
30
  };
@@ -33,10 +33,15 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
33
33
  if (rootProps.disableColumnSelector) {
34
34
  return null;
35
35
  }
36
+ const isOpen = preferencePanel.open && preferencePanel.panelId === columnPanelId;
36
37
  return /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
37
38
  ref: ref,
39
+ id: columnButtonId,
38
40
  size: "small",
39
41
  "aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
42
+ "aria-haspopup": "menu",
43
+ "aria-expanded": isOpen,
44
+ "aria-controls": isOpen ? columnPanelId : undefined,
40
45
  startIcon: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {})
41
46
  }, other, {
42
47
  onClick: showColumns
@@ -94,9 +94,9 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
94
94
  size: "small",
95
95
  startIcon: startIcon,
96
96
  "aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
97
- "aria-expanded": open ? 'true' : undefined,
98
97
  "aria-haspopup": "menu",
99
- "aria-controls": densityMenuId,
98
+ "aria-expanded": open,
99
+ "aria-controls": open ? densityMenuId : undefined,
100
100
  id: densityButtonId
101
101
  }, other, {
102
102
  onClick: handleDensitySelectorOpen
@@ -19,7 +19,7 @@ export interface GridToolbarExportProps extends ButtonProps {
19
19
  printOptions?: GridPrintExportOptions & GridExportDisplayOptions;
20
20
  [key: string]: any;
21
21
  }
22
- export declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): JSX.Element;
23
- export declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): JSX.Element;
22
+ export declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): React.JSX.Element;
23
+ export declare function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps): React.JSX.Element;
24
24
  declare const GridToolbarExport: React.ForwardRefExoticComponent<Omit<GridToolbarExportProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
25
25
  export { GridToolbarExport };
@@ -20,8 +20,8 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
20
20
  other = _objectWithoutPropertiesLoose(props, _excluded);
21
21
  const apiRef = useGridApiContext();
22
22
  const rootProps = useGridRootProps();
23
- const buttonId = useId();
24
- const menuId = useId();
23
+ const exportButtonId = useId();
24
+ const exportMenuId = useId();
25
25
  const [open, setOpen] = React.useState(false);
26
26
  const buttonRef = React.useRef(null);
27
27
  const handleRef = useForkRef(ref, buttonRef);
@@ -54,11 +54,11 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
54
54
  ref: handleRef,
55
55
  size: "small",
56
56
  startIcon: /*#__PURE__*/_jsx(rootProps.slots.exportIcon, {}),
57
- "aria-expanded": open ? 'true' : undefined,
57
+ "aria-expanded": open,
58
58
  "aria-label": apiRef.current.getLocaleText('toolbarExportLabel'),
59
59
  "aria-haspopup": "menu",
60
- "aria-labelledby": menuId,
61
- id: buttonId
60
+ "aria-controls": open ? exportMenuId : undefined,
61
+ id: exportButtonId
62
62
  }, other, {
63
63
  onClick: handleMenuOpen
64
64
  }, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseButton, {
@@ -69,9 +69,9 @@ export const GridToolbarExportContainer = /*#__PURE__*/React.forwardRef(function
69
69
  onClickAway: handleMenuClickAway,
70
70
  position: "bottom-start",
71
71
  children: /*#__PURE__*/_jsx(MenuList, {
72
- id: menuId,
72
+ id: exportMenuId,
73
73
  className: gridClasses.menuList,
74
- "aria-labelledby": buttonId,
74
+ "aria-labelledby": exportButtonId,
75
75
  onKeyDown: handleListKeyDown,
76
76
  autoFocusItem: open,
77
77
  children: React.Children.map(children, child => {
@@ -4,7 +4,7 @@ const _excluded = ["componentsProps"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { styled } from '@mui/material/styles';
7
- import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize } from '@mui/utils';
7
+ import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';
8
8
  import Badge from '@mui/material/Badge';
9
9
  import { gridColumnLookupSelector } from '../../hooks/features/columns/gridColumnsSelector';
10
10
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
@@ -28,7 +28,7 @@ const useUtilityClasses = ownerState => {
28
28
  const GridToolbarFilterListRoot = styled('ul', {
29
29
  name: 'MuiDataGrid',
30
30
  slot: 'ToolbarFilterList',
31
- overridesResolver: (props, styles) => styles.toolbarFilterList
31
+ overridesResolver: (_props, styles) => styles.toolbarFilterList
32
32
  })(({
33
33
  theme
34
34
  }) => ({
@@ -48,6 +48,8 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
48
48
  const lookup = useGridSelector(apiRef, gridColumnLookupSelector);
49
49
  const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
50
50
  const classes = useUtilityClasses(rootProps);
51
+ const filterButtonId = useId();
52
+ const filterPanelId = useId();
51
53
  const tooltipContentNode = React.useMemo(() => {
52
54
  if (preferencePanel.open) {
53
55
  return apiRef.current.getLocaleText('toolbarFiltersTooltipHide');
@@ -83,9 +85,9 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
83
85
  openedPanelValue
84
86
  } = preferencePanel;
85
87
  if (open && openedPanelValue === GridPreferencePanelsValue.filters) {
86
- apiRef.current.hideFilterPanel();
88
+ apiRef.current.hidePreferences();
87
89
  } else {
88
- apiRef.current.showFilterPanel();
90
+ apiRef.current.showPreferences(GridPreferencePanelsValue.filters, filterPanelId, filterButtonId);
89
91
  }
90
92
  (_buttonProps$onClick = buttonProps.onClick) == null ? void 0 : _buttonProps$onClick.call(buttonProps, event);
91
93
  };
@@ -94,14 +96,19 @@ const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolb
94
96
  if (rootProps.disableColumnFilter) {
95
97
  return null;
96
98
  }
99
+ const isOpen = preferencePanel.open && preferencePanel.panelId === filterPanelId;
97
100
  return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
98
101
  title: tooltipContentNode,
99
102
  enterDelay: 1000
100
103
  }, other, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
101
104
  children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
102
105
  ref: ref,
106
+ id: filterButtonId,
103
107
  size: "small",
104
108
  "aria-label": apiRef.current.getLocaleText('toolbarFiltersLabel'),
109
+ "aria-controls": isOpen ? filterPanelId : undefined,
110
+ "aria-expanded": isOpen,
111
+ "aria-haspopup": true,
105
112
  startIcon: /*#__PURE__*/_jsx(Badge, {
106
113
  badgeContent: activeFilters.length,
107
114
  color: "primary",
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
3
  import { GridFilterModel } from '../../models/gridFilterModel';
4
4
  export type GridToolbarQuickFilterProps = TextFieldProps & {
@@ -20,7 +20,7 @@ export type GridToolbarQuickFilterProps = TextFieldProps & {
20
20
  */
21
21
  debounceMs?: number;
22
22
  };
23
- declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): JSX.Element;
23
+ declare function GridToolbarQuickFilter(props: GridToolbarQuickFilterProps): React.JSX.Element;
24
24
  declare namespace GridToolbarQuickFilter {
25
25
  var propTypes: any;
26
26
  }