@mui/x-data-grid 8.0.0-alpha.12 → 8.0.0-alpha.14

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 (504) hide show
  1. package/CHANGELOG.md +430 -0
  2. package/DataGrid/DataGrid.js +31 -22
  3. package/DataGrid/useDataGridProps.js +1 -1
  4. package/colDef/gridActionsColDef.js +1 -1
  5. package/colDef/gridBooleanColDef.js +1 -1
  6. package/colDef/gridCheckboxSelectionColDef.js +2 -4
  7. package/components/GridFooter.js +1 -1
  8. package/components/GridHeader.js +1 -1
  9. package/components/GridPagination.js +5 -6
  10. package/components/GridRowCount.js +4 -5
  11. package/components/GridScrollArea.js +4 -3
  12. package/components/GridSelectedRowCount.js +5 -6
  13. package/components/GridShadowScrollArea.d.ts +8 -0
  14. package/components/GridShadowScrollArea.js +82 -0
  15. package/components/cell/GridEditInputCell.js +2 -3
  16. package/components/columnSelection/GridHeaderCheckbox.js +51 -17
  17. package/components/columnsManagement/GridColumnsManagement.js +60 -61
  18. package/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  19. package/components/columnsPanel/ColumnsPanelTrigger.js +209 -0
  20. package/components/columnsPanel/index.d.ts +1 -0
  21. package/components/columnsPanel/index.js +16 -0
  22. package/components/containers/GridOverlay.js +6 -8
  23. package/components/containers/GridRoot.js +4 -2
  24. package/components/containers/GridRootStyles.d.ts +1 -2
  25. package/components/containers/GridRootStyles.js +77 -100
  26. package/components/containers/GridToolbarContainer.js +5 -6
  27. package/components/export/ExportCsv.d.ts +30 -0
  28. package/components/export/ExportCsv.js +196 -0
  29. package/components/export/ExportPrint.d.ts +30 -0
  30. package/components/export/ExportPrint.js +196 -0
  31. package/components/export/index.d.ts +2 -0
  32. package/components/export/index.js +27 -0
  33. package/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  34. package/components/filterPanel/FilterPanelTrigger.js +212 -0
  35. package/components/filterPanel/index.d.ts +1 -0
  36. package/components/filterPanel/index.js +16 -0
  37. package/components/index.d.ts +6 -1
  38. package/components/index.js +60 -0
  39. package/components/menu/GridMenu.js +7 -6
  40. package/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -3
  41. package/components/panel/GridPanel.js +18 -20
  42. package/components/panel/GridPanelContent.js +6 -8
  43. package/components/panel/GridPanelFooter.js +5 -6
  44. package/components/panel/GridPanelHeader.js +4 -5
  45. package/components/panel/filterPanel/GridFilterForm.js +13 -20
  46. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
  47. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
  48. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
  49. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +20 -45
  50. package/components/panel/filterPanel/GridFilterInputValue.js +3 -6
  51. package/components/quickFilter/QuickFilter.d.ts +41 -0
  52. package/components/quickFilter/QuickFilter.js +110 -0
  53. package/components/quickFilter/QuickFilterClear.d.ts +28 -0
  54. package/components/quickFilter/QuickFilterClear.js +161 -0
  55. package/components/quickFilter/QuickFilterContext.d.ts +13 -0
  56. package/components/quickFilter/QuickFilterContext.js +17 -0
  57. package/components/quickFilter/QuickFilterControl.d.ts +28 -0
  58. package/components/quickFilter/QuickFilterControl.js +104 -0
  59. package/components/quickFilter/index.d.ts +3 -0
  60. package/components/quickFilter/index.js +38 -0
  61. package/components/toolbar/GridToolbar.d.ts +1 -1
  62. package/components/toolbar/GridToolbar.js +2 -2
  63. package/components/toolbar/GridToolbarFilterButton.js +5 -6
  64. package/components/toolbar/GridToolbarQuickFilter.js +57 -97
  65. package/components/toolbarV8/GridToolbar.d.ts +11 -0
  66. package/components/toolbarV8/GridToolbar.js +142 -0
  67. package/components/toolbarV8/Toolbar.d.ts +32 -0
  68. package/components/toolbarV8/Toolbar.js +132 -0
  69. package/components/toolbarV8/ToolbarButton.d.ts +23 -0
  70. package/components/toolbarV8/ToolbarButton.js +179 -0
  71. package/components/toolbarV8/ToolbarContext.d.ts +9 -0
  72. package/components/toolbarV8/ToolbarContext.js +17 -0
  73. package/components/toolbarV8/index.d.ts +2 -0
  74. package/components/toolbarV8/index.js +27 -0
  75. package/components/virtualization/GridVirtualScrollbar.js +15 -6
  76. package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  77. package/constants/cssVariables.d.ts +294 -0
  78. package/constants/cssVariables.js +168 -0
  79. package/constants/dataGridPropsDefaultValues.js +1 -0
  80. package/constants/defaultGridSlotsComponents.js +2 -1
  81. package/constants/gridClasses.d.ts +17 -0
  82. package/constants/gridClasses.js +1 -1
  83. package/context/GridContextProvider.js +4 -1
  84. package/esm/DataGrid/DataGrid.js +31 -22
  85. package/esm/DataGrid/useDataGridProps.js +1 -1
  86. package/esm/colDef/gridActionsColDef.js +1 -1
  87. package/esm/colDef/gridBooleanColDef.js +1 -1
  88. package/esm/colDef/gridCheckboxSelectionColDef.js +2 -4
  89. package/esm/components/GridFooter.js +2 -2
  90. package/esm/components/GridHeader.js +1 -1
  91. package/esm/components/GridPagination.js +5 -6
  92. package/esm/components/GridRowCount.js +4 -5
  93. package/esm/components/GridScrollArea.js +2 -1
  94. package/esm/components/GridSelectedRowCount.js +5 -6
  95. package/esm/components/GridShadowScrollArea.d.ts +8 -0
  96. package/esm/components/GridShadowScrollArea.js +74 -0
  97. package/esm/components/cell/GridEditInputCell.js +2 -3
  98. package/esm/components/columnSelection/GridHeaderCheckbox.js +51 -17
  99. package/esm/components/columnsManagement/GridColumnsManagement.js +61 -62
  100. package/esm/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  101. package/esm/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
  102. package/esm/components/columnsPanel/index.d.ts +1 -0
  103. package/esm/components/columnsPanel/index.js +1 -0
  104. package/esm/components/containers/GridOverlay.js +6 -8
  105. package/esm/components/containers/GridRoot.js +4 -2
  106. package/esm/components/containers/GridRootStyles.d.ts +1 -2
  107. package/esm/components/containers/GridRootStyles.js +78 -101
  108. package/esm/components/containers/GridToolbarContainer.js +5 -6
  109. package/esm/components/export/ExportCsv.d.ts +30 -0
  110. package/esm/components/export/ExportCsv.js +189 -0
  111. package/esm/components/export/ExportPrint.d.ts +30 -0
  112. package/esm/components/export/ExportPrint.js +189 -0
  113. package/esm/components/export/index.d.ts +2 -0
  114. package/esm/components/export/index.js +2 -0
  115. package/esm/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  116. package/esm/components/filterPanel/FilterPanelTrigger.js +205 -0
  117. package/esm/components/filterPanel/index.d.ts +1 -0
  118. package/esm/components/filterPanel/index.js +1 -0
  119. package/esm/components/index.d.ts +6 -1
  120. package/esm/components/index.js +6 -1
  121. package/esm/components/menu/GridMenu.js +7 -6
  122. package/esm/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
  123. package/esm/components/panel/GridPanel.js +18 -20
  124. package/esm/components/panel/GridPanelContent.js +6 -8
  125. package/esm/components/panel/GridPanelFooter.js +5 -6
  126. package/esm/components/panel/GridPanelHeader.js +4 -5
  127. package/esm/components/panel/filterPanel/GridFilterForm.js +13 -20
  128. package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
  129. package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
  130. package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
  131. package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
  132. package/esm/components/panel/filterPanel/GridFilterInputValue.js +3 -6
  133. package/esm/components/quickFilter/QuickFilter.d.ts +41 -0
  134. package/esm/components/quickFilter/QuickFilter.js +103 -0
  135. package/esm/components/quickFilter/QuickFilterClear.d.ts +28 -0
  136. package/esm/components/quickFilter/QuickFilterClear.js +154 -0
  137. package/esm/components/quickFilter/QuickFilterContext.d.ts +13 -0
  138. package/esm/components/quickFilter/QuickFilterContext.js +9 -0
  139. package/esm/components/quickFilter/QuickFilterControl.d.ts +28 -0
  140. package/esm/components/quickFilter/QuickFilterControl.js +97 -0
  141. package/esm/components/quickFilter/index.d.ts +3 -0
  142. package/esm/components/quickFilter/index.js +3 -0
  143. package/esm/components/toolbar/GridToolbar.d.ts +1 -1
  144. package/esm/components/toolbar/GridToolbar.js +2 -2
  145. package/esm/components/toolbar/GridToolbarFilterButton.js +5 -6
  146. package/esm/components/toolbar/GridToolbarQuickFilter.js +59 -97
  147. package/esm/components/toolbarV8/GridToolbar.d.ts +11 -0
  148. package/esm/components/toolbarV8/GridToolbar.js +135 -0
  149. package/esm/components/toolbarV8/Toolbar.d.ts +32 -0
  150. package/esm/components/toolbarV8/Toolbar.js +125 -0
  151. package/esm/components/toolbarV8/ToolbarButton.d.ts +23 -0
  152. package/esm/components/toolbarV8/ToolbarButton.js +172 -0
  153. package/esm/components/toolbarV8/ToolbarContext.d.ts +9 -0
  154. package/esm/components/toolbarV8/ToolbarContext.js +9 -0
  155. package/esm/components/toolbarV8/index.d.ts +2 -0
  156. package/esm/components/toolbarV8/index.js +2 -0
  157. package/esm/components/virtualization/GridVirtualScrollbar.js +10 -2
  158. package/esm/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  159. package/esm/constants/cssVariables.d.ts +294 -0
  160. package/esm/constants/cssVariables.js +161 -0
  161. package/esm/constants/dataGridPropsDefaultValues.js +1 -0
  162. package/esm/constants/defaultGridSlotsComponents.js +2 -1
  163. package/esm/constants/gridClasses.d.ts +17 -0
  164. package/esm/constants/gridClasses.js +1 -1
  165. package/esm/context/GridContextProvider.js +4 -1
  166. package/esm/hooks/features/clipboard/useGridClipboard.js +3 -2
  167. package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
  168. package/esm/hooks/features/columnResize/useGridColumnResize.js +2 -1
  169. package/esm/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
  170. package/esm/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
  171. package/esm/hooks/features/columns/gridColumnsSelector.js +8 -0
  172. package/esm/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
  173. package/esm/hooks/features/columns/gridColumnsUtils.js +6 -3
  174. package/esm/hooks/features/columns/index.d.ts +1 -1
  175. package/esm/hooks/features/columns/index.js +1 -1
  176. package/esm/hooks/features/columns/useGridColumns.js +4 -2
  177. package/esm/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
  178. package/esm/hooks/features/dataSource/gridDataSourceError.js +32 -0
  179. package/esm/hooks/features/dataSource/index.d.ts +2 -0
  180. package/esm/hooks/features/dataSource/index.js +2 -0
  181. package/esm/hooks/features/dataSource/models.d.ts +1 -1
  182. package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  183. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
  184. package/esm/hooks/features/dimensions/useGridDimensions.js +11 -10
  185. package/esm/hooks/features/editing/useGridCellEditing.js +2 -1
  186. package/esm/hooks/features/editing/useGridRowEditing.js +2 -1
  187. package/esm/hooks/features/export/utils.js +4 -2
  188. package/esm/hooks/features/focus/useGridFocus.js +3 -2
  189. package/esm/hooks/features/index.d.ts +1 -1
  190. package/esm/hooks/features/index.js +1 -1
  191. package/esm/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
  192. package/esm/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
  193. package/esm/hooks/features/rowSelection/useGridRowSelection.js +148 -81
  194. package/esm/hooks/features/rowSelection/utils.d.ts +2 -2
  195. package/esm/hooks/features/rowSelection/utils.js +11 -11
  196. package/esm/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
  197. package/esm/hooks/features/rows/gridRowsUtils.d.ts +2 -1
  198. package/esm/hooks/features/rows/gridRowsUtils.js +8 -0
  199. package/esm/hooks/features/rows/useGridParamsApi.js +2 -8
  200. package/esm/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
  201. package/esm/hooks/features/rows/useGridRows.d.ts +2 -2
  202. package/esm/hooks/features/rows/useGridRows.js +7 -7
  203. package/esm/hooks/features/rows/useGridRowsMeta.js +8 -0
  204. package/esm/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  205. package/esm/hooks/features/virtualization/useGridVirtualScroller.js +5 -11
  206. package/esm/hooks/utils/index.d.ts +2 -1
  207. package/esm/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  208. package/esm/hooks/utils/useGridComponentRenderer.js +36 -0
  209. package/esm/hooks/utils/useGridSelector.js +4 -1
  210. package/esm/hooks/utils/useIsSSR.js +4 -1
  211. package/esm/index.js +1 -1
  212. package/esm/internals/demo/TailwindDemoContainer.d.ts +11 -0
  213. package/esm/internals/demo/TailwindDemoContainer.js +55 -0
  214. package/esm/internals/demo/index.d.ts +1 -0
  215. package/esm/internals/demo/index.js +1 -0
  216. package/esm/internals/index.d.ts +6 -1
  217. package/esm/internals/index.js +5 -1
  218. package/esm/internals/utils/propValidation.js +1 -1
  219. package/esm/locales/bnBD.d.ts +2 -0
  220. package/esm/locales/bnBD.js +167 -0
  221. package/esm/locales/deDE.js +3 -5
  222. package/esm/locales/huHU.js +10 -13
  223. package/esm/locales/index.d.ts +1 -0
  224. package/esm/locales/index.js +1 -0
  225. package/esm/locales/ruRU.js +17 -21
  226. package/esm/material/icons/index.d.ts +3 -3
  227. package/esm/material/icons/index.js +6 -6
  228. package/esm/material/index.d.ts +1 -0
  229. package/esm/material/index.js +167 -52
  230. package/esm/material/variables.d.ts +5 -0
  231. package/esm/material/variables.js +89 -0
  232. package/esm/models/api/gridRowSelectionApi.d.ts +4 -2
  233. package/esm/models/api/gridSortApi.d.ts +1 -1
  234. package/esm/models/configuration/gridConfiguration.d.ts +7 -1
  235. package/esm/models/gridBaseSlots.d.ts +61 -7
  236. package/esm/models/gridDataSource.d.ts +9 -4
  237. package/esm/models/gridIconSlotsComponent.d.ts +1 -1
  238. package/esm/models/gridRowSelectionManager.d.ts +9 -0
  239. package/esm/models/gridRowSelectionManager.js +36 -0
  240. package/esm/models/gridRowSelectionModel.d.ts +4 -2
  241. package/esm/models/gridSlotsComponent.d.ts +7 -28
  242. package/esm/models/gridSlotsComponentsProps.d.ts +3 -11
  243. package/esm/models/gridSortModel.d.ts +1 -1
  244. package/esm/models/index.d.ts +2 -1
  245. package/esm/models/index.js +2 -3
  246. package/esm/models/props/DataGridProps.d.ts +22 -17
  247. package/esm/utils/css/context.d.ts +14 -0
  248. package/esm/utils/css/context.js +54 -0
  249. package/esm/utils/index.d.ts +2 -1
  250. package/esm/utils/index.js +1 -1
  251. package/hooks/features/clipboard/useGridClipboard.js +3 -2
  252. package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
  253. package/hooks/features/columnResize/useGridColumnResize.js +28 -27
  254. package/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
  255. package/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
  256. package/hooks/features/columns/gridColumnsSelector.js +9 -1
  257. package/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
  258. package/hooks/features/columns/gridColumnsUtils.js +6 -3
  259. package/hooks/features/columns/index.d.ts +1 -1
  260. package/hooks/features/columns/index.js +94 -10
  261. package/hooks/features/columns/useGridColumns.js +4 -2
  262. package/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
  263. package/hooks/features/dataSource/gridDataSourceError.js +40 -0
  264. package/hooks/features/dataSource/index.d.ts +2 -0
  265. package/hooks/features/dataSource/index.js +25 -0
  266. package/hooks/features/dataSource/models.d.ts +1 -1
  267. package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  268. package/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
  269. package/hooks/features/dimensions/useGridDimensions.js +19 -18
  270. package/hooks/features/editing/useGridCellEditing.js +10 -9
  271. package/hooks/features/editing/useGridRowEditing.js +11 -10
  272. package/hooks/features/export/utils.js +4 -2
  273. package/hooks/features/focus/useGridFocus.js +8 -7
  274. package/hooks/features/index.d.ts +1 -1
  275. package/hooks/features/index.js +11 -28
  276. package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
  277. package/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
  278. package/hooks/features/rowSelection/useGridRowSelection.js +146 -79
  279. package/hooks/features/rowSelection/utils.d.ts +2 -2
  280. package/hooks/features/rowSelection/utils.js +10 -10
  281. package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
  282. package/hooks/features/rows/gridRowsUtils.d.ts +2 -1
  283. package/hooks/features/rows/gridRowsUtils.js +10 -1
  284. package/hooks/features/rows/useGridParamsApi.js +2 -8
  285. package/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
  286. package/hooks/features/rows/useGridRows.d.ts +2 -2
  287. package/hooks/features/rows/useGridRows.js +7 -7
  288. package/hooks/features/rows/useGridRowsMeta.js +8 -0
  289. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  290. package/hooks/features/virtualization/useGridVirtualScroller.js +21 -27
  291. package/hooks/utils/index.d.ts +2 -1
  292. package/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  293. package/hooks/utils/useGridComponentRenderer.js +44 -0
  294. package/hooks/utils/useGridSelector.js +6 -2
  295. package/hooks/utils/useIsSSR.js +6 -2
  296. package/index.js +1 -1
  297. package/internals/demo/TailwindDemoContainer.d.ts +11 -0
  298. package/internals/demo/TailwindDemoContainer.js +63 -0
  299. package/internals/demo/index.d.ts +1 -0
  300. package/internals/demo/index.js +12 -0
  301. package/internals/index.d.ts +6 -1
  302. package/internals/index.js +43 -0
  303. package/internals/utils/propValidation.js +1 -1
  304. package/locales/bnBD.d.ts +2 -0
  305. package/locales/bnBD.js +173 -0
  306. package/locales/deDE.js +3 -5
  307. package/locales/huHU.js +10 -13
  308. package/locales/index.d.ts +1 -0
  309. package/locales/index.js +11 -0
  310. package/locales/ruRU.js +17 -21
  311. package/material/icons/index.d.ts +3 -3
  312. package/material/icons/index.js +7 -7
  313. package/material/index.d.ts +1 -0
  314. package/material/index.js +172 -51
  315. package/material/variables.d.ts +5 -0
  316. package/material/variables.js +95 -0
  317. package/models/api/gridRowSelectionApi.d.ts +4 -2
  318. package/models/api/gridSortApi.d.ts +1 -1
  319. package/models/configuration/gridConfiguration.d.ts +7 -1
  320. package/models/gridBaseSlots.d.ts +61 -7
  321. package/models/gridDataSource.d.ts +9 -4
  322. package/models/gridIconSlotsComponent.d.ts +1 -1
  323. package/models/gridRowSelectionManager.d.ts +9 -0
  324. package/models/gridRowSelectionManager.js +43 -0
  325. package/models/gridRowSelectionModel.d.ts +4 -2
  326. package/models/gridSlotsComponent.d.ts +7 -28
  327. package/models/gridSlotsComponentsProps.d.ts +3 -11
  328. package/models/gridSortModel.d.ts +1 -1
  329. package/models/index.d.ts +2 -1
  330. package/models/index.js +34 -11
  331. package/models/props/DataGridProps.d.ts +22 -17
  332. package/modern/DataGrid/DataGrid.js +31 -22
  333. package/modern/DataGrid/useDataGridProps.js +1 -1
  334. package/modern/colDef/gridActionsColDef.js +1 -1
  335. package/modern/colDef/gridBooleanColDef.js +1 -1
  336. package/modern/colDef/gridCheckboxSelectionColDef.js +2 -4
  337. package/modern/components/GridFooter.js +2 -2
  338. package/modern/components/GridHeader.js +1 -1
  339. package/modern/components/GridPagination.js +5 -6
  340. package/modern/components/GridRowCount.js +4 -5
  341. package/modern/components/GridScrollArea.js +2 -1
  342. package/modern/components/GridSelectedRowCount.js +5 -6
  343. package/modern/components/GridShadowScrollArea.d.ts +8 -0
  344. package/modern/components/GridShadowScrollArea.js +74 -0
  345. package/modern/components/cell/GridEditInputCell.js +2 -3
  346. package/modern/components/columnSelection/GridHeaderCheckbox.js +51 -17
  347. package/modern/components/columnsManagement/GridColumnsManagement.js +61 -62
  348. package/modern/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  349. package/modern/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
  350. package/modern/components/columnsPanel/index.d.ts +1 -0
  351. package/modern/components/columnsPanel/index.js +1 -0
  352. package/modern/components/containers/GridOverlay.js +6 -8
  353. package/modern/components/containers/GridRoot.js +4 -2
  354. package/modern/components/containers/GridRootStyles.d.ts +1 -2
  355. package/modern/components/containers/GridRootStyles.js +78 -101
  356. package/modern/components/containers/GridToolbarContainer.js +5 -6
  357. package/modern/components/export/ExportCsv.d.ts +30 -0
  358. package/modern/components/export/ExportCsv.js +189 -0
  359. package/modern/components/export/ExportPrint.d.ts +30 -0
  360. package/modern/components/export/ExportPrint.js +189 -0
  361. package/modern/components/export/index.d.ts +2 -0
  362. package/modern/components/export/index.js +2 -0
  363. package/modern/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  364. package/modern/components/filterPanel/FilterPanelTrigger.js +205 -0
  365. package/modern/components/filterPanel/index.d.ts +1 -0
  366. package/modern/components/filterPanel/index.js +1 -0
  367. package/modern/components/index.d.ts +6 -1
  368. package/modern/components/index.js +6 -1
  369. package/modern/components/menu/GridMenu.js +7 -6
  370. package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
  371. package/modern/components/panel/GridPanel.js +18 -20
  372. package/modern/components/panel/GridPanelContent.js +6 -8
  373. package/modern/components/panel/GridPanelFooter.js +5 -6
  374. package/modern/components/panel/GridPanelHeader.js +4 -5
  375. package/modern/components/panel/filterPanel/GridFilterForm.js +13 -20
  376. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
  377. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
  378. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
  379. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
  380. package/modern/components/panel/filterPanel/GridFilterInputValue.js +3 -6
  381. package/modern/components/quickFilter/QuickFilter.d.ts +41 -0
  382. package/modern/components/quickFilter/QuickFilter.js +103 -0
  383. package/modern/components/quickFilter/QuickFilterClear.d.ts +28 -0
  384. package/modern/components/quickFilter/QuickFilterClear.js +154 -0
  385. package/modern/components/quickFilter/QuickFilterContext.d.ts +13 -0
  386. package/modern/components/quickFilter/QuickFilterContext.js +9 -0
  387. package/modern/components/quickFilter/QuickFilterControl.d.ts +28 -0
  388. package/modern/components/quickFilter/QuickFilterControl.js +97 -0
  389. package/modern/components/quickFilter/index.d.ts +3 -0
  390. package/modern/components/quickFilter/index.js +3 -0
  391. package/modern/components/toolbar/GridToolbar.d.ts +1 -1
  392. package/modern/components/toolbar/GridToolbar.js +2 -2
  393. package/modern/components/toolbar/GridToolbarFilterButton.js +5 -6
  394. package/modern/components/toolbar/GridToolbarQuickFilter.js +59 -97
  395. package/modern/components/toolbarV8/GridToolbar.d.ts +11 -0
  396. package/modern/components/toolbarV8/GridToolbar.js +135 -0
  397. package/modern/components/toolbarV8/Toolbar.d.ts +32 -0
  398. package/modern/components/toolbarV8/Toolbar.js +125 -0
  399. package/modern/components/toolbarV8/ToolbarButton.d.ts +23 -0
  400. package/modern/components/toolbarV8/ToolbarButton.js +172 -0
  401. package/modern/components/toolbarV8/ToolbarContext.d.ts +9 -0
  402. package/modern/components/toolbarV8/ToolbarContext.js +9 -0
  403. package/modern/components/toolbarV8/index.d.ts +2 -0
  404. package/modern/components/toolbarV8/index.js +2 -0
  405. package/modern/components/virtualization/GridVirtualScrollbar.js +10 -2
  406. package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
  407. package/modern/constants/cssVariables.d.ts +294 -0
  408. package/modern/constants/cssVariables.js +161 -0
  409. package/modern/constants/dataGridPropsDefaultValues.js +1 -0
  410. package/modern/constants/defaultGridSlotsComponents.js +2 -1
  411. package/modern/constants/gridClasses.d.ts +17 -0
  412. package/modern/constants/gridClasses.js +1 -1
  413. package/modern/context/GridContextProvider.js +4 -1
  414. package/modern/hooks/features/clipboard/useGridClipboard.js +3 -2
  415. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
  416. package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
  417. package/modern/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
  418. package/modern/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
  419. package/modern/hooks/features/columns/gridColumnsSelector.js +8 -0
  420. package/modern/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
  421. package/modern/hooks/features/columns/gridColumnsUtils.js +6 -3
  422. package/modern/hooks/features/columns/index.d.ts +1 -1
  423. package/modern/hooks/features/columns/index.js +1 -1
  424. package/modern/hooks/features/columns/useGridColumns.js +4 -2
  425. package/modern/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
  426. package/modern/hooks/features/dataSource/gridDataSourceError.js +32 -0
  427. package/modern/hooks/features/dataSource/index.d.ts +2 -0
  428. package/modern/hooks/features/dataSource/index.js +2 -0
  429. package/modern/hooks/features/dataSource/models.d.ts +1 -1
  430. package/modern/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  431. package/modern/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
  432. package/modern/hooks/features/dimensions/useGridDimensions.js +11 -10
  433. package/modern/hooks/features/editing/useGridCellEditing.js +2 -1
  434. package/modern/hooks/features/editing/useGridRowEditing.js +2 -1
  435. package/modern/hooks/features/export/utils.js +4 -2
  436. package/modern/hooks/features/focus/useGridFocus.js +3 -2
  437. package/modern/hooks/features/index.d.ts +1 -1
  438. package/modern/hooks/features/index.js +1 -1
  439. package/modern/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
  440. package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
  441. package/modern/hooks/features/rowSelection/useGridRowSelection.js +148 -81
  442. package/modern/hooks/features/rowSelection/utils.d.ts +2 -2
  443. package/modern/hooks/features/rowSelection/utils.js +11 -11
  444. package/modern/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
  445. package/modern/hooks/features/rows/gridRowsUtils.d.ts +2 -1
  446. package/modern/hooks/features/rows/gridRowsUtils.js +8 -0
  447. package/modern/hooks/features/rows/useGridParamsApi.js +2 -8
  448. package/modern/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
  449. package/modern/hooks/features/rows/useGridRows.d.ts +2 -2
  450. package/modern/hooks/features/rows/useGridRows.js +7 -7
  451. package/modern/hooks/features/rows/useGridRowsMeta.js +8 -0
  452. package/modern/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  453. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -11
  454. package/modern/hooks/utils/index.d.ts +2 -1
  455. package/modern/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  456. package/modern/hooks/utils/useGridComponentRenderer.js +36 -0
  457. package/modern/hooks/utils/useGridSelector.js +4 -1
  458. package/modern/hooks/utils/useIsSSR.js +4 -1
  459. package/modern/index.js +1 -1
  460. package/modern/internals/demo/TailwindDemoContainer.d.ts +11 -0
  461. package/modern/internals/demo/TailwindDemoContainer.js +55 -0
  462. package/modern/internals/demo/index.d.ts +1 -0
  463. package/modern/internals/demo/index.js +1 -0
  464. package/modern/internals/index.d.ts +6 -1
  465. package/modern/internals/index.js +5 -1
  466. package/modern/internals/utils/propValidation.js +1 -1
  467. package/modern/locales/bnBD.d.ts +2 -0
  468. package/modern/locales/bnBD.js +167 -0
  469. package/modern/locales/deDE.js +3 -5
  470. package/modern/locales/huHU.js +10 -13
  471. package/modern/locales/index.d.ts +1 -0
  472. package/modern/locales/index.js +1 -0
  473. package/modern/locales/ruRU.js +17 -21
  474. package/modern/material/icons/index.d.ts +3 -3
  475. package/modern/material/icons/index.js +6 -6
  476. package/modern/material/index.d.ts +1 -0
  477. package/modern/material/index.js +167 -52
  478. package/modern/material/variables.d.ts +5 -0
  479. package/modern/material/variables.js +89 -0
  480. package/modern/models/api/gridRowSelectionApi.d.ts +4 -2
  481. package/modern/models/api/gridSortApi.d.ts +1 -1
  482. package/modern/models/configuration/gridConfiguration.d.ts +7 -1
  483. package/modern/models/gridBaseSlots.d.ts +61 -7
  484. package/modern/models/gridDataSource.d.ts +9 -4
  485. package/modern/models/gridIconSlotsComponent.d.ts +1 -1
  486. package/modern/models/gridRowSelectionManager.d.ts +9 -0
  487. package/modern/models/gridRowSelectionManager.js +36 -0
  488. package/modern/models/gridRowSelectionModel.d.ts +4 -2
  489. package/modern/models/gridSlotsComponent.d.ts +7 -28
  490. package/modern/models/gridSlotsComponentsProps.d.ts +3 -11
  491. package/modern/models/gridSortModel.d.ts +1 -1
  492. package/modern/models/index.d.ts +2 -1
  493. package/modern/models/index.js +2 -3
  494. package/modern/models/props/DataGridProps.d.ts +22 -17
  495. package/modern/utils/css/context.d.ts +14 -0
  496. package/modern/utils/css/context.js +54 -0
  497. package/modern/utils/index.d.ts +2 -1
  498. package/modern/utils/index.js +1 -1
  499. package/package.json +2 -2
  500. package/tsconfig.build.tsbuildinfo +1 -1
  501. package/utils/css/context.d.ts +14 -0
  502. package/utils/css/context.js +64 -0
  503. package/utils/index.d.ts +2 -1
  504. package/utils/index.js +8 -1
@@ -0,0 +1,89 @@
1
+ import * as React from 'react';
2
+ import { alpha, darken, lighten } from '@mui/material/styles';
3
+ import { useTheme } from '@mui/material/styles';
4
+ import { hash } from '@mui/x-internals/hash';
5
+ import { vars } from "../constants/cssVariables.js";
6
+ export function useMaterialCSSVariables() {
7
+ const theme = useTheme();
8
+ return React.useMemo(() => {
9
+ const id = hash(JSON.stringify(theme));
10
+ const variables = transformTheme(theme);
11
+ return {
12
+ id,
13
+ variables
14
+ };
15
+ }, [theme]);
16
+ }
17
+ function transformTheme(t) {
18
+ const borderColor = getBorderColor(t);
19
+ const dataGridPalette = t.palette.DataGrid; // FIXME: docs typecheck error
20
+
21
+ const backgroundBase = dataGridPalette?.bg ?? (t.vars || t).palette.background.default;
22
+ const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
23
+ const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
24
+ const backgroundBackdrop = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : alpha(t.palette.background.default, t.palette.action.disabledOpacity);
25
+ const selectedColor = t.vars ? `rgb(${t.vars.palette.primary.mainChannel})` : t.palette.primary.main;
26
+ const k = vars.keys;
27
+ return {
28
+ [k.spacingUnit]: t.spacing(1),
29
+ [k.colors.border.base]: borderColor,
30
+ [k.colors.background.base]: backgroundBase,
31
+ [k.colors.background.overlay]: t.palette.mode === 'dark' ? `color-mix(in srgb, ${t.palette.background.paper} 95%, #fff)` : t.palette.background.paper,
32
+ [k.colors.background.backdrop]: backgroundBackdrop,
33
+ [k.colors.foreground.base]: t.palette.text.primary,
34
+ [k.colors.foreground.muted]: t.palette.text.secondary,
35
+ [k.colors.foreground.accent]: t.palette.primary.dark,
36
+ [k.colors.foreground.disabled]: t.palette.text.disabled,
37
+ [k.colors.interactive.hover]: removeOpacity(t.palette.action.hover),
38
+ [k.colors.interactive.hoverOpacity]: t.palette.action.hoverOpacity,
39
+ [k.colors.interactive.focus]: removeOpacity(t.palette.primary.main),
40
+ [k.colors.interactive.focusOpacity]: t.palette.action.focusOpacity,
41
+ [k.colors.interactive.disabled]: removeOpacity(t.palette.action.disabled),
42
+ [k.colors.interactive.disabledOpacity]: t.palette.action.disabledOpacity,
43
+ [k.colors.interactive.selected]: selectedColor,
44
+ [k.colors.interactive.selectedOpacity]: t.palette.action.selectedOpacity,
45
+ [k.header.background.base]: backgroundHeader,
46
+ [k.cell.background.pinned]: backgroundPinned,
47
+ [k.radius.base]: typeof t.shape.borderRadius === 'number' ? `${t.shape.borderRadius}px` : t.shape.borderRadius,
48
+ [k.typography.fontFamily.base]: t.typography.fontFamily,
49
+ [k.typography.fontWeight.light]: t.typography.fontWeightLight,
50
+ [k.typography.fontWeight.regular]: t.typography.fontWeightRegular,
51
+ [k.typography.fontWeight.medium]: t.typography.fontWeightMedium,
52
+ [k.typography.fontWeight.bold]: t.typography.fontWeightBold,
53
+ [k.typography.body.fontFamily]: t.typography.body2.fontFamily,
54
+ [k.typography.body.fontSize]: t.typography.body2.fontSize,
55
+ [k.typography.body.fontWeight]: t.typography.body2.fontWeight,
56
+ [k.typography.body.letterSpacing]: t.typography.body2.letterSpacing,
57
+ [k.typography.body.lineHeight]: t.typography.body2.lineHeight,
58
+ [k.typography.small.fontFamily]: t.typography.caption.fontFamily,
59
+ [k.typography.small.fontSize]: t.typography.caption.fontSize,
60
+ [k.typography.small.fontWeight]: t.typography.caption.fontWeight,
61
+ [k.typography.small.letterSpacing]: t.typography.caption.letterSpacing,
62
+ [k.typography.small.lineHeight]: t.typography.caption.lineHeight,
63
+ [k.transitions.easing.easeIn]: t.transitions.easing.easeIn,
64
+ [k.transitions.easing.easeOut]: t.transitions.easing.easeOut,
65
+ [k.transitions.easing.easeInOut]: t.transitions.easing.easeInOut,
66
+ [k.transitions.duration.short]: `${t.transitions.duration.shorter}ms`,
67
+ [k.transitions.duration.base]: `${t.transitions.duration.short}ms`,
68
+ [k.transitions.duration.long]: `${t.transitions.duration.standard}ms`,
69
+ [k.shadows.base]: t.shadows[2],
70
+ [k.shadows.overlay]: t.shadows[8],
71
+ [k.zIndex.panel]: t.zIndex.modal,
72
+ [k.zIndex.menu]: t.zIndex.modal
73
+ };
74
+ }
75
+ function getBorderColor(theme) {
76
+ if (theme.vars) {
77
+ return theme.vars.palette.TableCell.border;
78
+ }
79
+ if (theme.palette.mode === 'light') {
80
+ return lighten(alpha(theme.palette.divider, 1), 0.88);
81
+ }
82
+ return darken(alpha(theme.palette.divider, 1), 0.68);
83
+ }
84
+ function setOpacity(color, opacity) {
85
+ return `rgba(from ${color} r g b / ${opacity})`;
86
+ }
87
+ function removeOpacity(color) {
88
+ return setOpacity(color, 1);
89
+ }
@@ -1,4 +1,5 @@
1
- import { GridRowId, GridRowModel } from "../gridRows.js";
1
+ import type { GridRowId, GridRowModel } from '../gridRows';
2
+ import type { GridRowSelectionModel } from '../gridRowSelectionModel';
2
3
  /**
3
4
  * The selection API interface that is available in the grid [[apiRef]].
4
5
  */
@@ -25,6 +26,7 @@ export interface GridRowSelectionApi {
25
26
  /**
26
27
  * Returns an array of the selected rows.
27
28
  * @returns {Map<GridRowId, GridRowModel>} A `Map` with the selected rows.
29
+ * @deprecated Use `gridRowSelectionIdsSelector`, `gridRowSelectionCountSelector`, or `gridRowSelectionManagerSelector` instead.
28
30
  */
29
31
  getSelectedRows: () => Map<GridRowId, GridRowModel>;
30
32
  /**
@@ -32,7 +34,7 @@ export interface GridRowSelectionApi {
32
34
  * Any row already selected will be unselected.
33
35
  * @param {readonly GridRowId[]} rowIds The row ids to select.
34
36
  */
35
- setRowSelectionModel: (rowIds: readonly GridRowId[]) => void;
37
+ setRowSelectionModel: (rowIds: GridRowSelectionModel) => void;
36
38
  }
37
39
  export interface GridRowMultiSelectionApi {
38
40
  /**
@@ -23,7 +23,7 @@ export interface GridSortApi {
23
23
  * Sorts a column.
24
24
  * @param {GridColDef['field']} field The field identifier of the column to be sorted.
25
25
  * @param {GridSortDirection} direction The direction to be sorted. By default, the next in the `sortingOrder` prop.
26
- * @param {boolean} allowMultipleSorting Whether to keep the existing [[GridSortItem]]. Default is `false`.
26
+ * @param {boolean} allowMultipleSorting Whether to keep the existing [GridSortModel]. Default is `false`.
27
27
  */
28
28
  sortColumn: (field: GridColDef['field'], direction?: GridSortDirection, allowMultipleSorting?: boolean) => void;
29
29
  /**
@@ -1,9 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { GridRowAriaAttributesInternalHook } from "./gridRowConfiguration.js";
3
+ import type { GridCSSVariablesInterface } from '../../constants/cssVariables';
3
4
  export interface GridAriaAttributesInternalHook {
4
5
  useGridAriaAttributes: () => React.HTMLAttributes<HTMLElement>;
5
6
  }
6
- export interface GridInternalHook extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook {}
7
+ export interface GridInternalHook extends GridAriaAttributesInternalHook, GridRowAriaAttributesInternalHook {
8
+ useCSSVariables: () => {
9
+ id: string;
10
+ variables: GridCSSVariablesInterface;
11
+ };
12
+ }
7
13
  export interface GridConfiguration {
8
14
  hooks: GridInternalHook;
9
15
  }
@@ -1,4 +1,59 @@
1
1
  type Ref<T = HTMLElement> = React.RefCallback<T | null> | React.RefObject<T | null> | null;
2
+ export interface AutocompleteFilterOptionsState<Value> {
3
+ inputValue: string;
4
+ getOptionLabel: (option: Value) => string;
5
+ }
6
+ type AcValueMap<FreeSolo> = FreeSolo extends true ? string : never;
7
+ type AcValue<Value, Multiple, DisableClearable, FreeSolo> = Multiple extends true ? Array<Value | AcValueMap<FreeSolo>> : DisableClearable extends true ? NonNullable<Value | AcValueMap<FreeSolo>> : Value | null | AcValueMap<FreeSolo>;
8
+ export type AutocompleteProps<Value = string, Multiple extends boolean = false, DisableClearable extends boolean = false, FreeSolo extends boolean = false> = {
9
+ id?: string;
10
+ /** Allow multiple selection. */
11
+ multiple?: Multiple;
12
+ /** Allow to add new options. */
13
+ freeSolo?: FreeSolo;
14
+ value?: AcValue<Value, Multiple, DisableClearable, FreeSolo>;
15
+ options: ReadonlyArray<Value>;
16
+ /**
17
+ * Used to determine the string value for a given option.
18
+ * It's used to fill the input (and the list box options if `renderOption` is not provided).
19
+ *
20
+ * If used in free solo mode, it must accept both the type of the options and a string.
21
+ *
22
+ * @param {Value} option The option
23
+ * @returns {string} The label
24
+ * @default (option) => option.label ?? option
25
+ */
26
+ getOptionLabel?: (option: Value | AcValueMap<FreeSolo>) => string;
27
+ /**
28
+ * Used to determine if the option represents the given value.
29
+ * Uses strict equality by default.
30
+ * ⚠️ Both arguments need to be handled, an option can only match with one value.
31
+ *
32
+ * @param {Value} option The option to test.
33
+ * @param {Value} value The value to test against.
34
+ * @returns {boolean} true if value matches
35
+ */
36
+ isOptionEqualToValue?: (option: Value, value: Value) => boolean;
37
+ /**
38
+ * Callback fired when the value changes.
39
+ *
40
+ * @param {React.SyntheticEvent} event The event source of the callback.
41
+ * @param {Value|Value[]} value The new value of the component.
42
+ */
43
+ onChange?: (event: React.SyntheticEvent, value: AcValue<Value, Multiple, DisableClearable, FreeSolo>) => void;
44
+ /**
45
+ * Callback fired when the input value changes.
46
+ *
47
+ * @param {React.SyntheticEvent} event The event source of the callback.
48
+ * @param {string} value The new value of the input.
49
+ */
50
+ onInputChange?: (event: React.SyntheticEvent, value: string) => void;
51
+ label?: React.ReactNode;
52
+ placeholder?: string;
53
+ slotProps?: {
54
+ textField: TextFieldProps;
55
+ };
56
+ };
2
57
  export type BadgeProps = {
3
58
  badgeContent?: React.ReactNode;
4
59
  children: React.ReactNode;
@@ -53,7 +108,9 @@ export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
53
108
  color?: 'default' | 'inherit' | 'primary';
54
109
  edge?: 'start' | 'end' | false;
55
110
  };
56
- export type DividerProps = {};
111
+ export type DividerProps = {
112
+ orientation?: 'horizontal' | 'vertical';
113
+ };
57
114
  export type MenuListProps = {
58
115
  ref?: Ref<HTMLUListElement>;
59
116
  id?: string;
@@ -90,7 +147,6 @@ export type PopperProps = {
90
147
  clickAwayMouseEvent?: false | ClickAwayMouseEventHandler;
91
148
  flip?: boolean;
92
149
  focusTrap?: boolean;
93
- focusTrapEnabled?: boolean;
94
150
  onExited?: (node: HTMLElement | null) => void;
95
151
  onClickAway?: (event: MouseEvent | TouchEvent) => void;
96
152
  onDidShow?: () => void;
@@ -169,6 +225,7 @@ export type SwitchProps = {
169
225
  size?: 'small' | 'medium';
170
226
  };
171
227
  export type TextFieldProps = {
228
+ role?: string;
172
229
  autoComplete?: string;
173
230
  className?: string;
174
231
  color?: 'primary' | 'error';
@@ -184,11 +241,7 @@ export type TextFieldProps = {
184
241
  placeholder?: string;
185
242
  size?: 'small' | 'medium';
186
243
  slotProps?: {
187
- input?: {
188
- disabled?: boolean;
189
- endAdornment?: React.ReactNode;
190
- startAdornment?: React.ReactNode;
191
- };
244
+ input?: Partial<InputProps>;
192
245
  inputLabel?: {};
193
246
  htmlInput?: React.InputHTMLAttributes<HTMLInputElement>;
194
247
  };
@@ -196,6 +249,7 @@ export type TextFieldProps = {
196
249
  tabIndex?: number;
197
250
  type?: React.HTMLInputTypeAttribute;
198
251
  value?: string;
252
+ ref?: Ref<HTMLInputElement>;
199
253
  };
200
254
  export type TooltipProps = {
201
255
  children: React.ReactElement<any, any>;
@@ -1,4 +1,4 @@
1
- import type { GridSortModel, GridFilterModel, GridRowModel, GridPaginationModel } from '.';
1
+ import type { GridSortModel, GridFilterModel, GridRowModel, GridPaginationModel, GridRowId } from '.';
2
2
  export interface GridGetRowsParams {
3
3
  sortModel: GridSortModel;
4
4
  filterModel: GridFilterModel;
@@ -15,6 +15,11 @@ export interface GridGetRowsParams {
15
15
  */
16
16
  end: number;
17
17
  }
18
+ export interface GridUpdateRowParams {
19
+ rowId: GridRowId;
20
+ updatedRow: GridRowModel;
21
+ previousRow: GridRowModel;
22
+ }
18
23
  export interface GridGetRowsResponse {
19
24
  rows: GridRowModel[];
20
25
  /**
@@ -39,11 +44,11 @@ export interface GridDataSource {
39
44
  */
40
45
  getRows(params: GridGetRowsParams): Promise<GridGetRowsResponse>;
41
46
  /**
42
- * This method will be called when the user updates a row [Not yet implemented].
43
- * @param {GridRowModel} updatedRow The updated row.
47
+ * This method will be called when the user updates a row.
48
+ * @param {GridUpdateRowParams} params The parameters required to update the row.
44
49
  * @returns {Promise<any>} If resolved (synced on the backend), the grid will update the row and mutate the cache.
45
50
  */
46
- updateRow?(updatedRow: GridRowModel): Promise<any>;
51
+ updateRow?(params: GridUpdateRowParams): Promise<any>;
47
52
  }
48
53
  export interface GridDataSourceCache {
49
54
  /**
@@ -70,7 +70,7 @@ export interface GridIconSlotsComponent {
70
70
  densityComfortableIcon: React.JSXElementConstructor<any>;
71
71
  /**
72
72
  * Icon displayed on the open export button present in the toolbar by default.
73
- * @default GridSaveAltIcon
73
+ * @default GridDownloadIcon
74
74
  */
75
75
  exportIcon: React.JSXElementConstructor<any>;
76
76
  /**
@@ -0,0 +1,9 @@
1
+ import type { GridRowId } from './gridRows';
2
+ import type { GridRowSelectionModel } from './gridRowSelectionModel';
3
+ export interface RowSelectionManager {
4
+ data: Set<GridRowId>;
5
+ has(id: GridRowId): boolean;
6
+ select(id: GridRowId): void;
7
+ unselect(id: GridRowId): void;
8
+ }
9
+ export declare const createRowSelectionManager: (model: GridRowSelectionModel) => RowSelectionManager;
@@ -0,0 +1,36 @@
1
+ class IncludeManager {
2
+ constructor(model) {
3
+ this.data = void 0;
4
+ this.data = model.ids;
5
+ }
6
+ has(id) {
7
+ return this.data.has(id);
8
+ }
9
+ select(id) {
10
+ this.data.add(id);
11
+ }
12
+ unselect(id) {
13
+ this.data.delete(id);
14
+ }
15
+ }
16
+ class ExcludeManager {
17
+ constructor(model) {
18
+ this.data = void 0;
19
+ this.data = model.ids;
20
+ }
21
+ has(id) {
22
+ return !this.data.has(id);
23
+ }
24
+ select(id) {
25
+ this.data.delete(id);
26
+ }
27
+ unselect(id) {
28
+ this.data.add(id);
29
+ }
30
+ }
31
+ export const createRowSelectionManager = model => {
32
+ if (model.type === 'include') {
33
+ return new IncludeManager(model);
34
+ }
35
+ return new ExcludeManager(model);
36
+ };
@@ -3,5 +3,7 @@ export type GridRowSelectionPropagation = {
3
3
  descendants?: boolean;
4
4
  parents?: boolean;
5
5
  };
6
- export type GridInputRowSelectionModel = readonly GridRowId[] | GridRowId;
7
- export type GridRowSelectionModel = readonly GridRowId[];
6
+ export type GridRowSelectionModel = {
7
+ type: 'include' | 'exclude';
8
+ ids: Set<GridRowId>;
9
+ };
@@ -3,6 +3,11 @@ import type { GridSlotProps } from './gridSlotsComponentsProps';
3
3
  import type { GridIconSlotsComponent } from './gridIconSlotsComponent';
4
4
  export type { GridSlotProps } from './gridSlotsComponentsProps';
5
5
  export interface GridBaseSlots {
6
+ /**
7
+ * The custom Autocomplete component used in the grid for both header and cells.
8
+ * @default Autocomplete
9
+ */
10
+ baseAutocomplete: React.JSXElementConstructor<GridSlotProps['baseAutocomplete']>;
6
11
  /**
7
12
  * The custom Badge component used in the grid for both header and cells.
8
13
  * @default Badge
@@ -18,11 +23,6 @@ export interface GridBaseSlots {
18
23
  * @default CircularProgress
19
24
  */
20
25
  baseCircularProgress: React.JSXElementConstructor<GridSlotProps['baseCircularProgress']>;
21
- /**
22
- * The custom Chip component used in the grid.
23
- * @default Chip
24
- */
25
- baseChip: React.JSXElementConstructor<GridSlotProps['baseChip']>;
26
26
  /**
27
27
  * The custom Divider component used in the grid.
28
28
  * @default Divider
@@ -43,21 +43,11 @@ export interface GridBaseSlots {
43
43
  * @default MenuItem
44
44
  */
45
45
  baseMenuItem: React.JSXElementConstructor<GridSlotProps['baseMenuItem']>;
46
- /**
47
- * The custom InputAdornment component used in the grid.
48
- * @default InputAdornment
49
- */
50
- baseInputAdornment: React.JSXElementConstructor<GridSlotProps['baseInputAdornment']>;
51
46
  /**
52
47
  * The custom TextField component used in the grid.
53
48
  * @default TextField
54
49
  */
55
50
  baseTextField: React.JSXElementConstructor<GridSlotProps['baseTextField']>;
56
- /**
57
- * The custom FormControl component used in the grid.
58
- * @default FormControl
59
- */
60
- baseFormControl: React.JSXElementConstructor<GridSlotProps['baseFormControl']>;
61
51
  /**
62
52
  * The custom Select component used in the grid.
63
53
  * @default Select
@@ -88,11 +78,6 @@ export interface GridBaseSlots {
88
78
  * @default Popper
89
79
  */
90
80
  basePopper: React.JSXElementConstructor<GridSlotProps['basePopper']>;
91
- /**
92
- * The custom InputLabel component used in the grid.
93
- * @default InputLabel
94
- */
95
- baseInputLabel: React.JSXElementConstructor<GridSlotProps['baseInputLabel']>;
96
81
  /**
97
82
  * The custom SelectOption component used in the grid.
98
83
  * @default SelectOption
@@ -113,11 +98,6 @@ export interface GridBaseSlots {
113
98
  * Grid components React prop interface containing all the overridable components.
114
99
  */
115
100
  export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponent {
116
- /**
117
- * The custom Chip component used in the grid.
118
- * @default Chip
119
- */
120
- baseChip: React.JSXElementConstructor<GridSlotProps['baseChip']>;
121
101
  /**
122
102
  * Component rendered for the bottom container.
123
103
  * @default GridBottomContainer
@@ -169,10 +149,9 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen
169
149
  */
170
150
  footerRowCount: React.JSXElementConstructor<GridSlotProps['footerRowCount']>;
171
151
  /**
172
- * Toolbar component rendered inside the Header component.
173
- * @default null
152
+ * Toolbar component rendered in the grid header.
174
153
  */
175
- toolbar: React.JSXElementConstructor<GridSlotProps['toolbar']> | null;
154
+ toolbar: React.JSXElementConstructor<GridSlotProps['toolbar']>;
176
155
  /**
177
156
  * Pinned rows container.
178
157
  * @ignore - do not document
@@ -4,13 +4,9 @@ import type { ButtonProps as MUIButtonProps } from '@mui/material/Button';
4
4
  import type { CircularProgressProps as MUICircularProgressProps } from '@mui/material/CircularProgress';
5
5
  import type { LinearProgressProps as MUILinearProgressProps } from '@mui/material/LinearProgress';
6
6
  import type { MenuItemProps as MUIMenuItemProps } from '@mui/material/MenuItem';
7
- import type { FormControlProps } from '@mui/material/FormControl';
8
7
  import type { IconButtonProps as MUIIconButtonProps } from '@mui/material/IconButton';
9
- import type { InputAdornmentProps } from '@mui/material/InputAdornment';
10
8
  import type { TooltipProps as MUITooltipProps } from '@mui/material/Tooltip';
11
- import type { InputLabelProps } from '@mui/material/InputLabel';
12
9
  import type { TablePaginationProps } from '@mui/material/TablePagination';
13
- import type { ChipProps } from '@mui/material/Chip';
14
10
  import type { GridToolbarProps } from '../components/toolbar/GridToolbar';
15
11
  import type { ColumnHeaderFilterIconButtonProps } from '../components/columnHeaders/GridColumnHeaderFilterIconButton';
16
12
  import type { GridColumnMenuProps } from '../components/menu/columnMenu/GridColumnMenuProps';
@@ -30,9 +26,10 @@ import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
30
26
  import type { GridRowCountProps } from '../components/GridRowCount';
31
27
  import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
32
28
  import type { GridBottomContainerProps } from '../components/virtualization/GridBottomContainer';
33
- import type { BadgeProps, ButtonProps, CheckboxProps, CircularProgressProps, DividerProps, IconButtonProps, InputProps, LinearProgressProps, MenuListProps, MenuItemProps, PopperProps, SelectProps, SelectOptionProps, SkeletonProps, SwitchProps, TooltipProps, TextFieldProps } from './gridBaseSlots';
29
+ import type { AutocompleteProps, BadgeProps, ButtonProps, CheckboxProps, CircularProgressProps, DividerProps, IconButtonProps, InputProps, LinearProgressProps, MenuListProps, MenuItemProps, PopperProps, SelectProps, SelectOptionProps, SkeletonProps, SwitchProps, TooltipProps, TextFieldProps } from './gridBaseSlots';
34
30
  type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
35
31
  type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
32
+ export interface BaseAutocompletePropsOverrides {}
36
33
  export interface BaseBadgePropsOverrides {}
37
34
  export interface BaseCheckboxPropsOverrides {}
38
35
  export interface BaseCircularProgressPropsOverrides {}
@@ -41,12 +38,10 @@ export interface BaseLinearProgressPropsOverrides {}
41
38
  export interface BaseMenuListPropsOverrides {}
42
39
  export interface BaseMenuItemPropsOverrides {}
43
40
  export interface BaseTextFieldPropsOverrides {}
44
- export interface BaseFormControlPropsOverrides {}
45
41
  export interface BaseSelectPropsOverrides {}
46
42
  export interface BaseSwitchPropsOverrides {}
47
43
  export interface BaseButtonPropsOverrides {}
48
44
  export interface BaseIconButtonPropsOverrides {}
49
- export interface BaseInputAdornmentPropsOverrides {}
50
45
  export interface BaseTooltipPropsOverrides {}
51
46
  export interface BasePopperPropsOverrides {}
52
47
  export interface BaseInputPropsOverrides {}
@@ -76,6 +71,7 @@ export interface SkeletonCellPropsOverrides {}
76
71
  export interface RowPropsOverrides {}
77
72
  export interface BottomContainerPropsOverrides {}
78
73
  interface BaseSlotProps {
74
+ baseAutocomplete: AutocompleteProps<string, true, false, true> & BaseAutocompletePropsOverrides;
79
75
  baseBadge: BadgeProps & BaseBadgePropsOverrides;
80
76
  baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides;
81
77
  baseCircularProgress: CircularProgressProps & BaseCircularProgressPropsOverrides;
@@ -84,19 +80,15 @@ interface BaseSlotProps {
84
80
  baseMenuList: MenuListProps & BaseMenuListPropsOverrides;
85
81
  baseMenuItem: MenuItemProps & BaseMenuItemPropsOverrides;
86
82
  baseTextField: TextFieldProps & BaseTextFieldPropsOverrides;
87
- baseFormControl: FormControlProps & BaseFormControlPropsOverrides;
88
83
  baseSwitch: SwitchProps & BaseSwitchPropsOverrides;
89
84
  baseButton: ButtonProps & BaseButtonPropsOverrides;
90
85
  baseIconButton: IconButtonProps & BaseIconButtonPropsOverrides;
91
86
  basePopper: PopperProps & BasePopperPropsOverrides;
92
87
  baseTooltip: TooltipProps & BaseTooltipPropsOverrides;
93
88
  baseInput: InputProps & BaseInputPropsOverrides;
94
- baseInputLabel: InputLabelProps & BaseInputLabelPropsOverrides;
95
- baseInputAdornment: InputAdornmentProps & BaseInputAdornmentPropsOverrides;
96
89
  baseSelect: SelectProps & BaseSelectPropsOverrides;
97
90
  baseSelectOption: SelectOptionProps & BaseSelectOptionPropsOverrides;
98
91
  baseSkeleton: SkeletonProps & BaseSkeletonPropsOverrides;
99
- baseChip: ChipProps & BaseChipPropsOverrides;
100
92
  }
101
93
  interface MaterialSlotProps {
102
94
  baseBadge: MUIBadgeProps;
@@ -27,4 +27,4 @@ export interface GridSortItem {
27
27
  /**
28
28
  * The model used for sorting the grid.
29
29
  */
30
- export type GridSortModel = GridSortItem[];
30
+ export type GridSortModel = readonly GridSortItem[];
@@ -10,6 +10,7 @@ export * from "./gridPaginationProps.js";
10
10
  export * from "./gridRenderContextProps.js";
11
11
  export * from "./gridRows.js";
12
12
  export * from "./gridRowSelectionModel.js";
13
+ export { createRowSelectionManager } from "./gridRowSelectionManager.js";
13
14
  export * from "./params/index.js";
14
15
  export * from "./gridCellClass.js";
15
16
  export * from "./gridCell.js";
@@ -22,7 +23,7 @@ export * from "./gridDensity.js";
22
23
  export * from "./logger.js";
23
24
  export * from "./muiEvent.js";
24
25
  export * from "./events/index.js";
25
- export * from "./gridSortModel.js";
26
+ export type { GridSortCellParams, GridSortDirection, GridComparatorFn, GridSortModel } from './gridSortModel';
26
27
  export * from "./gridColumnGrouping.js";
27
28
  export type { GridDataSourceCache } from './gridDataSource';
28
29
  export type { GridExportOptions, GridFileExportOptions, GridGetRowsToExportParams, GridCsvGetRowsToExportParams, GridPrintGetRowsToExportParams, GridCsvExportOptions, GridPrintExportOptions } from './gridExport';
@@ -9,6 +9,7 @@ export * from "./gridPaginationProps.js";
9
9
  export * from "./gridRenderContextProps.js";
10
10
  export * from "./gridRows.js";
11
11
  export * from "./gridRowSelectionModel.js";
12
+ export { createRowSelectionManager } from "./gridRowSelectionManager.js";
12
13
  export * from "./params/index.js";
13
14
  export * from "./gridCellClass.js";
14
15
  export * from "./gridCell.js";
@@ -20,12 +21,10 @@ export * from "./gridDensity.js";
20
21
  export * from "./logger.js";
21
22
  export * from "./muiEvent.js";
22
23
  export * from "./events/index.js";
23
- export * from "./gridSortModel.js";
24
24
  export * from "./gridColumnGrouping.js";
25
25
 
26
26
  // Do not export GridExportFormat and GridExportExtension which are override in pro package
27
27
 
28
28
  export * from "./gridFilterOperator.js";
29
29
 
30
- // Utils shared across the X packages
31
- export {};
30
+ // Utils shared across the X packages
@@ -18,7 +18,7 @@ import { GridClasses } from "../../constants/gridClasses.js";
18
18
  import { GridRowHeightParams, GridRowHeightReturnValue, GridRowParams, GridRowSpacing, GridRowSpacingParams, GridRowClassNameParams } from "../params/index.js";
19
19
  import { GridCellParams } from "../params/gridCellParams.js";
20
20
  import { GridFilterModel } from "../gridFilterModel.js";
21
- import { GridInputRowSelectionModel, GridRowSelectionModel } from "../gridRowSelectionModel.js";
21
+ import { GridRowSelectionModel } from "../gridRowSelectionModel.js";
22
22
  import { GridInitialStateCommunity } from "../gridStateCommunity.js";
23
23
  import { GridSlotsComponentsProps } from "../gridSlotsComponentsProps.js";
24
24
  import { GridColumnVisibilityModel } from "../../hooks/features/columns/gridColumnsInterfaces.js";
@@ -26,8 +26,9 @@ import { GridCellModesModel, GridRowModesModel } from "../api/gridEditingApi.js"
26
26
  import { GridColumnGroupingModel } from "../gridColumnGrouping.js";
27
27
  import { GridPaginationMeta, GridPaginationModel } from "../gridPaginationProps.js";
28
28
  import type { GridAutosizeOptions } from '../../hooks/features/columnResize';
29
- import type { GridDataSource, GridDataSourceCache, GridGetRowsParams } from '../gridDataSource';
29
+ import type { GridDataSource, GridDataSourceCache } from '../gridDataSource';
30
30
  import type { GridRowSelectionPropagation } from '../gridRowSelectionModel';
31
+ import type { GridGetRowsError, GridUpdateRowError } from '../../hooks/features/dataSource/gridDataSourceError';
31
32
  export interface GridExperimentalFeatures {
32
33
  /**
33
34
  * Emits a warning if the cell receives focus without also syncing the focus state.
@@ -291,6 +292,11 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
291
292
  * @default false
292
293
  */
293
294
  showColumnVerticalBorder: boolean;
295
+ /**
296
+ * If `true`, the toolbar is displayed.
297
+ * @default false
298
+ */
299
+ showToolbar: boolean;
294
300
  /**
295
301
  * The order of the sorting sequence.
296
302
  * @default ['asc', 'desc', null]
@@ -381,6 +387,14 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
381
387
  * Override or extend the styles applied to the component.
382
388
  */
383
389
  classes?: Partial<GridClasses>;
390
+ /**
391
+ * The data source object.
392
+ */
393
+ dataSource?: GridDataSource;
394
+ /**
395
+ * Data source cache object.
396
+ */
397
+ dataSourceCache?: GridDataSourceCache | null;
384
398
  /**
385
399
  * Set the density of the Data Grid.
386
400
  * @default "standard"
@@ -464,6 +478,11 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
464
478
  * @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
465
479
  */
466
480
  onCellEditStop?: GridEventListener<'cellEditStop'>;
481
+ /**
482
+ * Callback fired when a data source request fails.
483
+ * @param {GridGetRowsError | GridUpdateRowError} error The data source error object.
484
+ */
485
+ onDataSourceError?: (error: GridGetRowsError | GridUpdateRowError) => void;
467
486
  /**
468
487
  * Callback fired when the row turns to edit mode.
469
488
  * @param {GridRowParams} params With all properties from [[GridRowParams]].
@@ -673,7 +692,7 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
673
692
  /**
674
693
  * Sets the row selection model of the Data Grid.
675
694
  */
676
- rowSelectionModel?: GridInputRowSelectionModel;
695
+ rowSelectionModel?: GridRowSelectionModel;
677
696
  /**
678
697
  * Callback fired when the selection state of one or multiple rows changes.
679
698
  * @param {GridRowSelectionModel} rowSelectionModel With all the row ids [[GridSelectionModel]].
@@ -787,20 +806,6 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
787
806
  * @param {GridCallbackDetails} details Additional details for this callback.
788
807
  */
789
808
  onColumnWidthChange?: GridEventListener<'columnWidthChange'>;
790
- /**
791
- * The data source object.
792
- */
793
- unstable_dataSource?: GridDataSource;
794
- /**
795
- * Data source cache object.
796
- */
797
- unstable_dataSourceCache?: GridDataSourceCache | null;
798
- /**
799
- * Callback fired when the data source request fails.
800
- * @param {Error} error The error object.
801
- * @param {GridGetRowsParams} params With all properties from [[GridGetRowsParams]].
802
- */
803
- unstable_onDataSourceError?: (error: Error, params: GridGetRowsParams) => void;
804
809
  }
805
810
  export interface DataGridProSharedPropsWithDefaultValue {
806
811
  /**
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ export declare function useCSSVariablesClass(): string;
3
+ export declare function useCSSVariablesContext(): {
4
+ className: string;
5
+ tag: React.JSX.Element;
6
+ };
7
+ export declare function GridPortalWrapper({
8
+ children
9
+ }: {
10
+ children: React.ReactNode;
11
+ }): React.JSX.Element;
12
+ export declare function GridCSSVariablesContext(props: {
13
+ children: any;
14
+ }): React.JSX.Element;