@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
@@ -8,17 +8,9 @@ exports.GridRootStyles = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _styles = require("@mui/material/styles");
10
10
  var _gridClasses = require("../../constants/gridClasses");
11
+ var _cssVariables = require("../../constants/cssVariables");
11
12
  var _useGridSelector = require("../../hooks/utils/useGridSelector");
12
13
  var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
13
- function getBorderColor(theme) {
14
- if (theme.vars) {
15
- return theme.vars.palette.TableCell.border;
16
- }
17
- if (theme.palette.mode === 'light') {
18
- return (0, _styles.lighten)((0, _styles.alpha)(theme.palette.divider, 1), 0.88);
19
- }
20
- return (0, _styles.darken)((0, _styles.alpha)(theme.palette.divider, 1), 0.68);
21
- }
22
14
  const columnHeaderStyles = {
23
15
  [`& .${_gridClasses.gridClasses.iconButtonContainer}`]: {
24
16
  visibility: 'visible',
@@ -268,42 +260,38 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
268
260
  }, {
269
261
  [`& .${_gridClasses.gridClasses.withBorderColor}`]: styles.withBorderColor
270
262
  }]
271
- })(({
272
- theme: t
273
- }) => {
263
+ })(() => {
274
264
  const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
275
265
  const shouldShowBorderTopRightRadius = (0, _useGridSelector.useGridSelector)(apiRef, shouldShowBorderTopRightRadiusSelector);
276
- const borderColor = getBorderColor(t);
277
- const radius = t.shape.borderRadius;
278
- const background = (t.vars || t).palette.DataGrid?.bg ?? (t.vars || t).palette.background.default;
279
- const headerBackground = (t.vars || t).palette.DataGrid?.headerBg ?? background;
280
- const pinnedBackground = (t.vars || t).palette.DataGrid?.pinnedBg ?? background;
281
- const overlayBackground = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : (0, _styles.alpha)(t.palette.background.default, t.palette.action.disabledOpacity);
282
- const hoverOpacity = (t.vars || t).palette.action.hoverOpacity;
283
- const hoverColor = (t.vars || t).palette.action.hover;
284
- const selectedOpacity = (t.vars || t).palette.action.selectedOpacity;
285
- const selectedHoverOpacity = t.vars ? `calc(${hoverOpacity} + ${selectedOpacity})` // TODO: Improve type
286
- : hoverOpacity + selectedOpacity;
287
- const selectedBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedOpacity})` : (0, _styles.alpha)(t.palette.primary.main, selectedOpacity);
288
- const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedHoverOpacity})` : (0, _styles.alpha)(t.palette.primary.main, selectedHoverOpacity);
289
- const blendFn = t.vars ? blendCssVars : blend;
266
+ const baseBackground = _cssVariables.vars.colors.background.base;
267
+ const headerBackground = _cssVariables.vars.header.background.base;
268
+ const pinnedBackground = _cssVariables.vars.cell.background.pinned;
269
+ const hoverColor = _cssVariables.vars.colors.interactive.hover;
270
+ const hoverOpacity = _cssVariables.vars.colors.interactive.hoverOpacity;
271
+ const selectedColor = _cssVariables.vars.colors.interactive.selected;
272
+ const selectedOpacity = _cssVariables.vars.colors.interactive.selectedOpacity;
273
+ const selectedHoverColor = selectedColor;
274
+ const selectedHoverOpacity = `calc(${selectedOpacity} + ${hoverOpacity})`;
275
+ const hoverBackground = mix(baseBackground, hoverColor, hoverOpacity);
276
+ const selectedBackground = mix(baseBackground, selectedColor, selectedOpacity);
277
+ const selectedHoverBackground = mix(baseBackground, selectedHoverColor, selectedHoverOpacity);
278
+ const pinnedHoverBackground = mix(pinnedBackground, hoverColor, hoverOpacity);
279
+ const pinnedSelectedBackground = mix(pinnedBackground, selectedColor, selectedOpacity);
280
+ const pinnedSelectedHoverBackground = mix(pinnedBackground, selectedHoverColor, selectedHoverOpacity);
290
281
  const getPinnedBackgroundStyles = backgroundColor => ({
291
282
  [`& .${_gridClasses.gridClasses['cell--pinnedLeft']}, & .${_gridClasses.gridClasses['cell--pinnedRight']}`]: {
292
283
  backgroundColor,
293
284
  '&.Mui-selected': {
294
- backgroundColor: blendFn(backgroundColor, selectedBackground, selectedOpacity),
285
+ backgroundColor: mix(backgroundColor, selectedBackground, selectedOpacity),
295
286
  '&:hover': {
296
- backgroundColor: blendFn(backgroundColor, selectedBackground, selectedHoverOpacity)
287
+ backgroundColor: mix(backgroundColor, selectedHoverBackground, selectedHoverOpacity)
297
288
  }
298
289
  }
299
290
  }
300
291
  });
301
- const pinnedHoverBackgroundColor = blendFn(pinnedBackground, hoverColor, hoverOpacity);
302
- const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedHoverBackgroundColor);
303
- const pinnedSelectedBackgroundColor = blendFn(pinnedBackground, selectedBackground, selectedOpacity);
304
- const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackgroundColor);
305
- const pinnedSelectedHoverBackgroundColor = blendFn(pinnedBackground, selectedHoverBackground, selectedHoverOpacity);
306
- const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackgroundColor);
292
+ const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedHoverBackground);
293
+ const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackground);
294
+ const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackground);
307
295
  const selectedStyles = {
308
296
  backgroundColor: selectedBackground,
309
297
  '&:hover': {
@@ -315,13 +303,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
315
303
  }
316
304
  };
317
305
  const gridStyle = (0, _extends2.default)({
318
- '--unstable_DataGrid-radius': typeof radius === 'number' ? `${radius}px` : radius,
319
- '--unstable_DataGrid-headWeight': t.typography.fontWeightMedium,
320
- '--unstable_DataGrid-overlayBackground': overlayBackground,
321
- '--DataGrid-background': background,
322
- '--DataGrid-headerBackground': headerBackground,
323
- '--DataGrid-pinnedBackground': pinnedBackground,
324
- '--DataGrid-rowBorderColor': borderColor,
306
+ '--unstable_DataGrid-radius': _cssVariables.vars.radius.base,
307
+ '--unstable_DataGrid-headWeight': _cssVariables.vars.typography.fontWeight.medium,
308
+ '--DataGrid-rowBorderColor': _cssVariables.vars.colors.border.base,
325
309
  '--DataGrid-cellOffsetMultiplier': 2,
326
310
  '--DataGrid-width': '0px',
327
311
  '--DataGrid-hasScrollX': '0',
@@ -340,11 +324,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
340
324
  position: 'relative',
341
325
  borderWidth: '1px',
342
326
  borderStyle: 'solid',
343
- borderColor,
327
+ borderColor: _cssVariables.vars.colors.border.base,
344
328
  borderRadius: 'var(--unstable_DataGrid-radius)',
345
- backgroundColor: 'var(--DataGrid-background)',
346
- color: (t.vars || t).palette.text.primary
347
- }, t.typography.body2, {
329
+ backgroundColor: _cssVariables.vars.colors.background.base,
330
+ color: _cssVariables.vars.colors.foreground.base
331
+ }, _cssVariables.vars.typography.body, {
348
332
  outline: 'none',
349
333
  height: '100%',
350
334
  display: 'flex',
@@ -391,11 +375,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
391
375
  boxSizing: 'border-box'
392
376
  },
393
377
  [`& .${_gridClasses.gridClasses.columnHeader}:focus-within, & .${_gridClasses.gridClasses.cell}:focus-within`]: {
394
- outline: `solid ${t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / 0.5)` : (0, _styles.alpha)(t.palette.primary.main, 0.5)} ${focusOutlineWidth}px`,
378
+ outline: `solid ${setOpacity(_cssVariables.vars.colors.interactive.focus, 0.5)} ${focusOutlineWidth}px`,
395
379
  outlineOffset: focusOutlineWidth * -1
396
380
  },
397
381
  [`& .${_gridClasses.gridClasses.columnHeader}:focus, & .${_gridClasses.gridClasses.cell}:focus`]: {
398
- outline: `solid ${t.palette.primary.main} ${focusOutlineWidth}px`,
382
+ outline: `solid ${_cssVariables.vars.colors.interactive.focus} ${focusOutlineWidth}px`,
399
383
  outlineOffset: focusOutlineWidth * -1
400
384
  },
401
385
  // Hide the column separator when:
@@ -437,7 +421,8 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
437
421
  [`& .${_gridClasses.gridClasses.columnHeader}`]: {
438
422
  position: 'relative',
439
423
  display: 'flex',
440
- alignItems: 'center'
424
+ alignItems: 'center',
425
+ backgroundColor: headerBackground
441
426
  },
442
427
  [`& .${_gridClasses.gridClasses['columnHeader--filter']}`]: {
443
428
  paddingTop: 8,
@@ -455,14 +440,14 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
455
440
  },
456
441
  [`& .${_gridClasses.gridClasses.columnHeader}:not(.${_gridClasses.gridClasses['columnHeader--sorted']}) .${_gridClasses.gridClasses.sortIcon}`]: {
457
442
  opacity: 0,
458
- transition: t.transitions.create(['opacity'], {
459
- duration: t.transitions.duration.shorter
443
+ transition: _cssVariables.vars.transition(['opacity'], {
444
+ duration: _cssVariables.vars.transitions.duration.short
460
445
  })
461
446
  },
462
447
  [`& .${_gridClasses.gridClasses.columnHeaderTitleContainer}`]: {
463
448
  display: 'flex',
464
449
  alignItems: 'center',
465
- gap: t.spacing(0.25),
450
+ gap: _cssVariables.vars.spacing(0.25),
466
451
  minWidth: 0,
467
452
  flex: 1,
468
453
  whiteSpace: 'nowrap',
@@ -498,13 +483,13 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
498
483
  marginLeft: -5
499
484
  },
500
485
  [`& .${_gridClasses.gridClasses['columnHeader--moving']}`]: {
501
- backgroundColor: (t.vars || t).palette.action.hover
486
+ backgroundColor: hoverBackground
502
487
  },
503
488
  [`& .${_gridClasses.gridClasses['columnHeader--pinnedLeft']}, & .${_gridClasses.gridClasses['columnHeader--pinnedRight']}`]: {
504
489
  position: 'sticky',
505
490
  zIndex: 4,
506
491
  // Should be above the column separator
507
- background: 'var(--DataGrid-headerBackground)'
492
+ background: _cssVariables.vars.header.background.base
508
493
  },
509
494
  [`& .${_gridClasses.gridClasses.columnSeparator}`]: {
510
495
  position: 'absolute',
@@ -515,11 +500,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
515
500
  justifyContent: 'center',
516
501
  alignItems: 'center',
517
502
  maxWidth: columnSeparatorTargetSize,
518
- color: borderColor
503
+ color: _cssVariables.vars.colors.border.base
519
504
  },
520
505
  [`& .${_gridClasses.gridClasses.columnHeaders}`]: {
521
506
  width: 'var(--DataGrid-rowWidth)',
522
- backgroundColor: 'var(--DataGrid-headerBackground)'
507
+ backgroundColor: headerBackground
523
508
  },
524
509
  '@media (hover: hover)': {
525
510
  [`& .${_gridClasses.gridClasses.columnHeader}:hover`]: columnHeaderStyles,
@@ -532,7 +517,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
532
517
  [`& .${_gridClasses.gridClasses.columnHeader}:focus,
533
518
  & .${_gridClasses.gridClasses['columnHeader--siblingFocused']}`]: {
534
519
  [`.${_gridClasses.gridClasses['columnSeparator--resizable']}`]: {
535
- color: (t.vars || t).palette.primary.main
520
+ color: _cssVariables.vars.colors.foreground.accent
536
521
  }
537
522
  }
538
523
  },
@@ -552,7 +537,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
552
537
  cursor: 'col-resize',
553
538
  touchAction: 'none',
554
539
  [`&.${_gridClasses.gridClasses['columnSeparator--resizing']}`]: {
555
- color: (t.vars || t).palette.primary.main
540
+ color: _cssVariables.vars.colors.foreground.accent
556
541
  },
557
542
  // Always appear as draggable on touch devices
558
543
  '@media (hover: none)': {
@@ -560,7 +545,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
560
545
  },
561
546
  '@media (hover: hover)': {
562
547
  '&:hover': {
563
- color: (t.vars || t).palette.primary.main,
548
+ color: _cssVariables.vars.colors.foreground.accent,
564
549
  [`& .${_gridClasses.gridClasses.iconSeparator} rect`]: separatorIconDragStyles
565
550
  }
566
551
  },
@@ -570,8 +555,8 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
570
555
  },
571
556
  [`& .${_gridClasses.gridClasses.iconSeparator}`]: {
572
557
  color: 'inherit',
573
- transition: t.transitions.create(['color', 'width'], {
574
- duration: t.transitions.duration.shortest
558
+ transition: _cssVariables.vars.transition(['color', 'width'], {
559
+ duration: _cssVariables.vars.transitions.duration.short
575
560
  })
576
561
  },
577
562
  [`& .${_gridClasses.gridClasses.menuIcon}`]: {
@@ -613,7 +598,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
613
598
  '--rowBorderColor': 'transparent'
614
599
  },
615
600
  '&:hover': {
616
- backgroundColor: (t.vars || t).palette.action.hover,
601
+ backgroundColor: hoverBackground,
617
602
  // Reset on touch devices, it doesn't add specificity
618
603
  '@media (hover: none)': {
619
604
  backgroundColor: 'transparent'
@@ -624,6 +609,11 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
624
609
  },
625
610
  '&.Mui-selected': selectedStyles
626
611
  },
612
+ [`& .${_gridClasses.gridClasses['container--top']}, & .${_gridClasses.gridClasses['container--bottom']}`]: {
613
+ '[role=row]': {
614
+ background: _cssVariables.vars.colors.background.base
615
+ }
616
+ },
627
617
  /* Cell styles */
628
618
  [`& .${_gridClasses.gridClasses.cell}`]: {
629
619
  flex: '0 0 auto',
@@ -643,9 +633,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
643
633
  borderTopColor: 'transparent'
644
634
  },
645
635
  [`& .${_gridClasses.gridClasses.pinnedRows} .${_gridClasses.gridClasses.row}, .${_gridClasses.gridClasses.aggregationRowOverlayWrapper} .${_gridClasses.gridClasses.row}`]: {
646
- backgroundColor: 'var(--DataGrid-pinnedBackground)',
636
+ backgroundColor: pinnedBackground,
647
637
  '&:hover': {
648
- backgroundColor: pinnedHoverBackgroundColor
638
+ backgroundColor: pinnedHoverBackground
649
639
  }
650
640
  },
651
641
  [`& .${_gridClasses.gridClasses['pinnedRows--top']} :first-of-type`]: {
@@ -671,19 +661,19 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
671
661
  [`& .${_gridClasses.gridClasses.cell}.${_gridClasses.gridClasses['cell--editing']}`]: {
672
662
  padding: 1,
673
663
  display: 'flex',
674
- boxShadow: t.shadows[2],
675
- backgroundColor: (t.vars || t).palette.background.paper,
664
+ boxShadow: _cssVariables.vars.shadows.base,
665
+ backgroundColor: _cssVariables.vars.colors.background.overlay,
676
666
  '&:focus-within': {
677
- outline: `${focusOutlineWidth}px solid ${(t.vars || t).palette.primary.main}`,
667
+ outline: `${focusOutlineWidth}px solid ${_cssVariables.vars.colors.interactive.focus}`,
678
668
  outlineOffset: focusOutlineWidth * -1
679
669
  }
680
670
  },
681
671
  [`& .${_gridClasses.gridClasses['row--editing']}`]: {
682
- boxShadow: t.shadows[2]
672
+ boxShadow: _cssVariables.vars.shadows.base
683
673
  },
684
674
  [`& .${_gridClasses.gridClasses['row--editing']} .${_gridClasses.gridClasses.cell}`]: {
685
- boxShadow: t.shadows[0],
686
- backgroundColor: (t.vars || t).palette.background.paper
675
+ boxShadow: 'none',
676
+ backgroundColor: _cssVariables.vars.colors.background.overlay
687
677
  },
688
678
  [`& .${_gridClasses.gridClasses.editBooleanCell}`]: {
689
679
  display: 'flex',
@@ -693,22 +683,22 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
693
683
  justifyContent: 'center'
694
684
  },
695
685
  [`& .${_gridClasses.gridClasses.booleanCell}[data-value="true"]`]: {
696
- color: (t.vars || t).palette.text.secondary
686
+ color: _cssVariables.vars.colors.foreground.muted
697
687
  },
698
688
  [`& .${_gridClasses.gridClasses.booleanCell}[data-value="false"]`]: {
699
- color: (t.vars || t).palette.text.disabled
689
+ color: _cssVariables.vars.colors.foreground.disabled
700
690
  },
701
691
  [`& .${_gridClasses.gridClasses.actionsCell}`]: {
702
692
  display: 'inline-flex',
703
693
  alignItems: 'center',
704
- gridGap: t.spacing(1)
694
+ gridGap: _cssVariables.vars.spacing(1)
705
695
  },
706
696
  [`& .${_gridClasses.gridClasses.rowReorderCell}`]: {
707
697
  display: 'inline-flex',
708
698
  flex: 1,
709
699
  alignItems: 'center',
710
700
  justifyContent: 'center',
711
- opacity: (t.vars || t).palette.action.disabledOpacity
701
+ opacity: _cssVariables.vars.colors.interactive.disabledOpacity
712
702
  },
713
703
  [`& .${_gridClasses.gridClasses['rowReorderCell--draggable']}`]: {
714
704
  cursor: 'move',
@@ -720,7 +710,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
720
710
  alignItems: 'stretch'
721
711
  },
722
712
  [`.${_gridClasses.gridClasses.withBorderColor}`]: {
723
- borderColor
713
+ borderColor: _cssVariables.vars.colors.border.base
724
714
  },
725
715
  [`& .${_gridClasses.gridClasses['cell--withLeftBorder']}, & .${_gridClasses.gridClasses['columnHeader--withLeftBorder']}`]: {
726
716
  borderLeftColor: 'var(--DataGrid-rowBorderColor)',
@@ -752,9 +742,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
752
742
  [`& .${_gridClasses.gridClasses['cell--pinnedLeft']}, & .${_gridClasses.gridClasses['cell--pinnedRight']}`]: {
753
743
  position: 'sticky',
754
744
  zIndex: 3,
755
- background: 'var(--DataGrid-pinnedBackground)',
745
+ background: _cssVariables.vars.cell.background.pinned,
756
746
  '&.Mui-selected': {
757
- backgroundColor: pinnedSelectedBackgroundColor
747
+ backgroundColor: pinnedSelectedBackground
758
748
  }
759
749
  },
760
750
  [`& .${_gridClasses.gridClasses.row}`]: {
@@ -781,16 +771,16 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
781
771
  display: 'none'
782
772
  },
783
773
  [`& .${_gridClasses.gridClasses['columnHeader--dragging']}, & .${_gridClasses.gridClasses['row--dragging']}`]: {
784
- background: (t.vars || t).palette.background.paper,
774
+ background: _cssVariables.vars.colors.background.overlay,
785
775
  padding: '0 12px',
786
776
  borderRadius: 'var(--unstable_DataGrid-radius)',
787
- opacity: (t.vars || t).palette.action.disabledOpacity
777
+ opacity: _cssVariables.vars.colors.interactive.disabledOpacity
788
778
  },
789
779
  [`& .${_gridClasses.gridClasses['row--dragging']}`]: {
790
- background: (t.vars || t).palette.background.paper,
780
+ background: _cssVariables.vars.colors.background.overlay,
791
781
  padding: '0 12px',
792
782
  borderRadius: 'var(--unstable_DataGrid-radius)',
793
- opacity: (t.vars || t).palette.action.disabledOpacity,
783
+ opacity: _cssVariables.vars.colors.interactive.disabledOpacity,
794
784
  [`& .${_gridClasses.gridClasses.rowReorderCellPlaceholder}`]: {
795
785
  display: 'flex'
796
786
  }
@@ -803,7 +793,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
803
793
  [`& .${_gridClasses.gridClasses.treeDataGroupingCellToggle}`]: {
804
794
  flex: '0 0 28px',
805
795
  alignSelf: 'stretch',
806
- marginRight: t.spacing(2)
796
+ marginRight: _cssVariables.vars.spacing(2)
807
797
  },
808
798
  [`& .${_gridClasses.gridClasses.treeDataGroupingCellLoadingContainer}, .${_gridClasses.gridClasses.groupingCriteriaCellLoadingContainer}`]: {
809
799
  display: 'flex',
@@ -819,7 +809,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
819
809
  [`& .${_gridClasses.gridClasses.groupingCriteriaCellToggle}`]: {
820
810
  flex: '0 0 28px',
821
811
  alignSelf: 'stretch',
822
- marginRight: t.spacing(2)
812
+ marginRight: _cssVariables.vars.spacing(2)
823
813
  },
824
814
  /* ScrollbarFiller styles */
825
815
  [`.${_gridClasses.gridClasses.scrollbarFiller}`]: {
@@ -832,7 +822,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
832
822
  borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
833
823
  },
834
824
  [`&.${_gridClasses.gridClasses['scrollbarFiller--pinnedRight']}`]: {
835
- backgroundColor: 'var(--DataGrid-pinnedBackground)',
825
+ backgroundColor: _cssVariables.vars.cell.background.pinned,
836
826
  position: 'sticky',
837
827
  right: 0
838
828
  }
@@ -859,22 +849,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
859
849
  });
860
850
  return gridStyle;
861
851
  });
862
-
863
- /**
864
- * Blend a transparent overlay color with a background color, resulting in a single
865
- * RGB color.
866
- */
867
- function blend(background, overlay, opacity, gamma = 1) {
868
- const f = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
869
- const backgroundColor = (0, _styles.decomposeColor)(background);
870
- const overlayColor = (0, _styles.decomposeColor)(overlay);
871
- const rgb = [f(backgroundColor.values[0], overlayColor.values[0]), f(backgroundColor.values[1], overlayColor.values[1]), f(backgroundColor.values[2], overlayColor.values[2])];
872
- return (0, _styles.recomposeColor)({
873
- type: 'rgb',
874
- values: rgb
875
- });
852
+ function setOpacity(color, opacity) {
853
+ return `rgba(from ${color} r g b / ${opacity})`;
876
854
  }
877
- const removeOpacity = color => `rgb(from ${color} r g b / 1)`;
878
- function blendCssVars(background, overlay, opacity) {
879
- return `color-mix(in srgb,${background}, ${removeOpacity(overlay)} calc(${opacity} * 100%))`;
855
+ function mix(background, overlay, opacity) {
856
+ return `color-mix(in srgb,${background}, ${overlay} calc(${opacity} * 100%))`;
880
857
  }
@@ -14,6 +14,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _system = require("@mui/system");
15
15
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
16
16
  var _forwardRef = require("@mui/x-internals/forwardRef");
17
+ var _cssVariables = require("../../constants/cssVariables");
17
18
  var _gridClasses = require("../../constants/gridClasses");
18
19
  var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
@@ -31,15 +32,13 @@ const GridToolbarContainerRoot = (0, _system.styled)('div', {
31
32
  name: 'MuiDataGrid',
32
33
  slot: 'ToolbarContainer',
33
34
  overridesResolver: (_, styles) => styles.toolbarContainer
34
- })(({
35
- theme
36
- }) => ({
35
+ })({
37
36
  display: 'flex',
38
37
  alignItems: 'center',
39
38
  flexWrap: 'wrap',
40
- gap: theme.spacing(1),
41
- padding: theme.spacing(0.5, 0.5, 0)
42
- }));
39
+ gap: _cssVariables.vars.spacing(1),
40
+ padding: _cssVariables.vars.spacing(0.5, 0.5, 0)
41
+ });
43
42
  const GridToolbarContainer = exports.GridToolbarContainer = (0, _forwardRef.forwardRef)(function GridToolbarContainer(props, ref) {
44
43
  const {
45
44
  className,
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
3
+ import { GridCsvExportOptions } from "../../models/gridExport.js";
4
+ import type { GridSlotProps } from '../../models';
5
+ export type ExportCsvProps = GridSlotProps['baseButton'] & {
6
+ /**
7
+ * A function to customize rendering of the component.
8
+ */
9
+ render?: RenderProp<GridSlotProps['baseButton']>;
10
+ /**
11
+ * The options to apply on the CSV export.
12
+ * @demos
13
+ * - [CSV export](/x/react-data-grid/export/#csv-export)
14
+ */
15
+ options?: GridCsvExportOptions;
16
+ };
17
+ /**
18
+ * A button that triggers a CSV export.
19
+ * It renders the `baseButton` slot.
20
+ *
21
+ * Demos:
22
+ *
23
+ * - [Export](https://mui.com/x/react-data-grid/components/export/)
24
+ *
25
+ * API:
26
+ *
27
+ * - [ExportCsv API](https://mui.com/x/api/data-grid/export-csv/)
28
+ */
29
+ declare const ExportCsv: React.ForwardRefExoticComponent<ExportCsvProps> | React.ForwardRefExoticComponent<Omit<ExportCsvProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
30
+ export { ExportCsv };
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ExportCsv = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _forwardRef = require("@mui/x-internals/forwardRef");
14
+ var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
15
+ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
16
+ var _useGridComponentRenderer = require("../../hooks/utils/useGridComponentRenderer");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ const _excluded = ["render", "options", "onClick"];
19
+ /**
20
+ * A button that triggers a CSV export.
21
+ * It renders the `baseButton` slot.
22
+ *
23
+ * Demos:
24
+ *
25
+ * - [Export](https://mui.com/x/react-data-grid/components/export/)
26
+ *
27
+ * API:
28
+ *
29
+ * - [ExportCsv API](https://mui.com/x/api/data-grid/export-csv/)
30
+ */
31
+ const ExportCsv = exports.ExportCsv = (0, _forwardRef.forwardRef)(function ExportCsv(props, ref) {
32
+ const {
33
+ render,
34
+ options,
35
+ onClick
36
+ } = props,
37
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
38
+ const rootProps = (0, _useGridRootProps.useGridRootProps)();
39
+ const apiRef = (0, _useGridApiContext.useGridApiContext)();
40
+ const handleClick = event => {
41
+ apiRef.current.exportDataAsCsv(options);
42
+ onClick?.(event);
43
+ };
44
+ const element = (0, _useGridComponentRenderer.useGridComponentRenderer)(rootProps.slots.baseButton, render, (0, _extends2.default)({}, rootProps.slotProps?.baseButton, {
45
+ onClick: handleClick
46
+ }, other, {
47
+ ref
48
+ }));
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
50
+ children: element
51
+ });
52
+ });
53
+ process.env.NODE_ENV !== "production" ? ExportCsv.propTypes = {
54
+ // ----------------------------- Warning --------------------------------
55
+ // | These PropTypes are generated from the TypeScript type definitions |
56
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
57
+ // ----------------------------------------------------------------------
58
+ /**
59
+ * A ref for imperative actions.
60
+ * It currently only supports `focusVisible()` action.
61
+ */
62
+ action: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
63
+ current: _propTypes.default.shape({
64
+ focusVisible: _propTypes.default.func.isRequired
65
+ })
66
+ })]),
67
+ /**
68
+ * If `true`, the ripples are centered.
69
+ * They won't start at the cursor interaction position.
70
+ * @default false
71
+ */
72
+ centerRipple: _propTypes.default.bool,
73
+ className: _propTypes.default.string,
74
+ /**
75
+ * The color of the component.
76
+ * It supports both default and custom theme colors, which can be added as shown in the
77
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
78
+ * @default 'primary'
79
+ */
80
+ color: _propTypes.default.oneOf(['error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
81
+ component: _propTypes.default.elementType,
82
+ /**
83
+ * If `true`, the component is disabled.
84
+ */
85
+ disabled: _propTypes.default.bool,
86
+ /**
87
+ * If `true`, no elevation is used.
88
+ * @default false
89
+ */
90
+ disableElevation: _propTypes.default.bool,
91
+ /**
92
+ * If `true`, the keyboard focus ripple is disabled.
93
+ * @default false
94
+ */
95
+ disableFocusRipple: _propTypes.default.bool,
96
+ /**
97
+ * If `true`, the ripple effect is disabled.
98
+ *
99
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
100
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
101
+ * @default false
102
+ */
103
+ disableRipple: _propTypes.default.bool,
104
+ /**
105
+ * If `true`, the touch ripple effect is disabled.
106
+ * @default false
107
+ */
108
+ disableTouchRipple: _propTypes.default.bool,
109
+ /**
110
+ * Element placed after the children.
111
+ */
112
+ endIcon: _propTypes.default.node,
113
+ /**
114
+ * If `true`, the base button will have a keyboard focus ripple.
115
+ * @default false
116
+ */
117
+ focusRipple: _propTypes.default.bool,
118
+ /**
119
+ * This prop can help identify which element has keyboard focus.
120
+ * The class name will be applied when the element gains the focus through keyboard interaction.
121
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
122
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
123
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
124
+ * if needed.
125
+ */
126
+ focusVisibleClassName: _propTypes.default.string,
127
+ /**
128
+ * If `true`, the button will take up the full width of its container.
129
+ * @default false
130
+ */
131
+ fullWidth: _propTypes.default.bool,
132
+ /**
133
+ * The URL to link to when the button is clicked.
134
+ * If defined, an `a` element will be used as the root node.
135
+ */
136
+ href: _propTypes.default.string,
137
+ /**
138
+ * The component used to render a link when the `href` prop is provided.
139
+ * @default 'a'
140
+ */
141
+ LinkComponent: _propTypes.default.elementType,
142
+ /**
143
+ * Callback fired when the component is focused with a keyboard.
144
+ * We trigger a `onFocus` callback too.
145
+ */
146
+ onFocusVisible: _propTypes.default.func,
147
+ /**
148
+ * The options to apply on the CSV export.
149
+ * @demos
150
+ * - [CSV export](/x/react-data-grid/export/#csv-export)
151
+ */
152
+ options: _propTypes.default.shape({
153
+ allColumns: _propTypes.default.bool,
154
+ delimiter: _propTypes.default.string,
155
+ escapeFormulas: _propTypes.default.bool,
156
+ fields: _propTypes.default.arrayOf(_propTypes.default.string),
157
+ fileName: _propTypes.default.string,
158
+ getRowsToExport: _propTypes.default.func,
159
+ includeColumnGroupsHeaders: _propTypes.default.bool,
160
+ includeHeaders: _propTypes.default.bool,
161
+ shouldAppendQuotes: _propTypes.default.bool,
162
+ utf8WithBom: _propTypes.default.bool
163
+ }),
164
+ /**
165
+ * A function to customize rendering of the component.
166
+ */
167
+ render: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
168
+ /**
169
+ * The size of the component.
170
+ * `small` is equivalent to the dense button styling.
171
+ */
172
+ size: _propTypes.default.oneOf(['large', 'medium', 'small']),
173
+ /**
174
+ * Element placed before the children.
175
+ */
176
+ startIcon: _propTypes.default.node,
177
+ style: _propTypes.default.object,
178
+ /**
179
+ * The system prop that allows defining system overrides as well as additional CSS styles.
180
+ */
181
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
182
+ tabIndex: _propTypes.default.number,
183
+ /**
184
+ * Props applied to the `TouchRipple` element.
185
+ */
186
+ TouchRippleProps: _propTypes.default.object,
187
+ /**
188
+ * A ref that points to the `TouchRipple` element.
189
+ */
190
+ touchRippleRef: _propTypes.default.any,
191
+ /**
192
+ * The variant to use.
193
+ * @default 'text'
194
+ */
195
+ variant: _propTypes.default.oneOf(['contained', 'outlined', 'text'])
196
+ } : void 0;