@mui/x-data-grid-premium 8.0.0-beta.3 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (492) hide show
  1. package/CHANGELOG.md +388 -96
  2. package/DataGridPremium/DataGridPremium.js +165 -9
  3. package/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
  4. package/DataGridPremium/useDataGridPremiumComponent.js +22 -3
  5. package/DataGridPremium/useDataGridPremiumProps.js +5 -1
  6. package/components/GridColumnMenuPivotItem.d.ts +3 -0
  7. package/components/GridColumnMenuPivotItem.js +33 -0
  8. package/components/GridEmptyPivotOverlay.d.ts +6 -0
  9. package/components/GridEmptyPivotOverlay.js +29 -0
  10. package/components/GridFooterCell.js +1 -2
  11. package/components/GridGroupingCriteriaCell.js +8 -3
  12. package/components/GridPremiumColumnMenu.d.ts +5 -0
  13. package/components/GridPremiumColumnMenu.js +6 -1
  14. package/components/GridPremiumToolbar.d.ts +1 -1
  15. package/components/GridPremiumToolbar.js +29 -1
  16. package/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
  17. package/components/aiAssistantPanel/AiAssistantPanelTrigger.js +107 -0
  18. package/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
  19. package/components/aiAssistantPanel/GridAiAssistantPanel.js +195 -0
  20. package/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
  21. package/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +71 -0
  22. package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
  23. package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +89 -0
  24. package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
  25. package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +86 -0
  26. package/components/aiAssistantPanel/index.d.ts +2 -0
  27. package/components/aiAssistantPanel/index.js +27 -0
  28. package/components/collapsible/Collapsible.d.ts +4 -0
  29. package/components/collapsible/Collapsible.js +70 -0
  30. package/components/collapsible/CollapsibleContext.d.ts +8 -0
  31. package/components/collapsible/CollapsibleContext.js +17 -0
  32. package/components/collapsible/CollapsiblePanel.d.ts +4 -0
  33. package/components/collapsible/CollapsiblePanel.js +64 -0
  34. package/components/collapsible/CollapsibleTrigger.d.ts +4 -0
  35. package/components/collapsible/CollapsibleTrigger.js +106 -0
  36. package/components/collapsible/index.d.ts +4 -0
  37. package/components/collapsible/index.js +49 -0
  38. package/components/index.d.ts +5 -2
  39. package/components/index.js +40 -4
  40. package/components/pivotPanel/GridPivotPanel.d.ts +3 -0
  41. package/components/pivotPanel/GridPivotPanel.js +22 -0
  42. package/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
  43. package/components/pivotPanel/GridPivotPanelBody.js +368 -0
  44. package/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
  45. package/components/pivotPanel/GridPivotPanelField.js +338 -0
  46. package/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
  47. package/components/pivotPanel/GridPivotPanelFieldMenu.js +177 -0
  48. package/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
  49. package/components/pivotPanel/GridPivotPanelHeader.js +101 -0
  50. package/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
  51. package/components/pivotPanel/GridPivotPanelSearch.js +77 -0
  52. package/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
  53. package/components/pivotPanel/PivotPanelTrigger.js +93 -0
  54. package/components/pivotPanel/index.d.ts +2 -0
  55. package/components/pivotPanel/index.js +27 -0
  56. package/components/prompt/GridPrompt.d.ts +7 -0
  57. package/components/prompt/GridPrompt.js +364 -0
  58. package/components/prompt/index.d.ts +1 -0
  59. package/components/prompt/index.js +12 -0
  60. package/components/promptField/GridPromptField.d.ts +4 -0
  61. package/components/promptField/GridPromptField.js +86 -0
  62. package/components/promptField/PromptField.d.ts +66 -0
  63. package/components/promptField/PromptField.js +95 -0
  64. package/components/promptField/PromptFieldContext.d.ts +16 -0
  65. package/components/promptField/PromptFieldContext.js +17 -0
  66. package/components/promptField/PromptFieldControl.d.ts +27 -0
  67. package/components/promptField/PromptFieldControl.js +102 -0
  68. package/components/promptField/PromptFieldRecord.d.ts +27 -0
  69. package/components/promptField/PromptFieldRecord.js +158 -0
  70. package/components/promptField/PromptFieldSend.d.ts +27 -0
  71. package/components/promptField/PromptFieldSend.js +83 -0
  72. package/components/promptField/index.d.ts +4 -0
  73. package/components/promptField/index.js +49 -0
  74. package/components/resizablePanel/ResizablePanel.d.ts +10 -0
  75. package/components/resizablePanel/ResizablePanel.js +59 -0
  76. package/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
  77. package/components/resizablePanel/ResizablePanelContext.js +17 -0
  78. package/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
  79. package/components/resizablePanel/ResizablePanelHandle.js +115 -0
  80. package/components/resizablePanel/index.d.ts +3 -0
  81. package/components/resizablePanel/index.js +38 -0
  82. package/components/sidebar/Sidebar.d.ts +4 -0
  83. package/components/sidebar/Sidebar.js +54 -0
  84. package/components/sidebar/SidebarHeader.d.ts +4 -0
  85. package/components/sidebar/SidebarHeader.js +51 -0
  86. package/components/sidebar/index.d.ts +2 -0
  87. package/components/sidebar/index.js +27 -0
  88. package/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
  89. package/esm/DataGridPremium/DataGridPremium.js +167 -11
  90. package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
  91. package/esm/DataGridPremium/useDataGridPremiumComponent.js +20 -3
  92. package/esm/DataGridPremium/useDataGridPremiumProps.js +5 -1
  93. package/esm/components/GridColumnMenuPivotItem.d.ts +3 -0
  94. package/esm/components/GridColumnMenuPivotItem.js +26 -0
  95. package/esm/components/GridEmptyPivotOverlay.d.ts +6 -0
  96. package/esm/components/GridEmptyPivotOverlay.js +22 -0
  97. package/esm/components/GridFooterCell.js +1 -2
  98. package/esm/components/GridGroupingCriteriaCell.js +9 -4
  99. package/esm/components/GridPremiumColumnMenu.d.ts +5 -0
  100. package/esm/components/GridPremiumColumnMenu.js +6 -1
  101. package/esm/components/GridPremiumToolbar.d.ts +1 -1
  102. package/esm/components/GridPremiumToolbar.js +30 -2
  103. package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
  104. package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.js +100 -0
  105. package/esm/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
  106. package/esm/components/aiAssistantPanel/GridAiAssistantPanel.js +188 -0
  107. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
  108. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +64 -0
  109. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
  110. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +82 -0
  111. package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
  112. package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +80 -0
  113. package/esm/components/aiAssistantPanel/index.d.ts +2 -0
  114. package/esm/components/aiAssistantPanel/index.js +2 -0
  115. package/esm/components/collapsible/Collapsible.d.ts +4 -0
  116. package/esm/components/collapsible/Collapsible.js +63 -0
  117. package/esm/components/collapsible/CollapsibleContext.d.ts +8 -0
  118. package/esm/components/collapsible/CollapsibleContext.js +9 -0
  119. package/esm/components/collapsible/CollapsiblePanel.d.ts +4 -0
  120. package/esm/components/collapsible/CollapsiblePanel.js +57 -0
  121. package/esm/components/collapsible/CollapsibleTrigger.d.ts +4 -0
  122. package/esm/components/collapsible/CollapsibleTrigger.js +99 -0
  123. package/esm/components/collapsible/index.d.ts +4 -0
  124. package/esm/components/collapsible/index.js +4 -0
  125. package/esm/components/index.d.ts +5 -2
  126. package/esm/components/index.js +5 -2
  127. package/esm/components/pivotPanel/GridPivotPanel.d.ts +3 -0
  128. package/esm/components/pivotPanel/GridPivotPanel.js +16 -0
  129. package/esm/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
  130. package/esm/components/pivotPanel/GridPivotPanelBody.js +361 -0
  131. package/esm/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
  132. package/esm/components/pivotPanel/GridPivotPanelField.js +331 -0
  133. package/esm/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
  134. package/esm/components/pivotPanel/GridPivotPanelFieldMenu.js +170 -0
  135. package/esm/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
  136. package/esm/components/pivotPanel/GridPivotPanelHeader.js +94 -0
  137. package/esm/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
  138. package/esm/components/pivotPanel/GridPivotPanelSearch.js +70 -0
  139. package/esm/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
  140. package/esm/components/pivotPanel/PivotPanelTrigger.js +86 -0
  141. package/esm/components/pivotPanel/index.d.ts +2 -0
  142. package/esm/components/pivotPanel/index.js +2 -0
  143. package/esm/components/prompt/GridPrompt.d.ts +7 -0
  144. package/esm/components/prompt/GridPrompt.js +357 -0
  145. package/esm/components/prompt/index.d.ts +1 -0
  146. package/esm/components/prompt/index.js +1 -0
  147. package/esm/components/promptField/GridPromptField.d.ts +4 -0
  148. package/esm/components/promptField/GridPromptField.js +79 -0
  149. package/esm/components/promptField/PromptField.d.ts +66 -0
  150. package/esm/components/promptField/PromptField.js +88 -0
  151. package/esm/components/promptField/PromptFieldContext.d.ts +16 -0
  152. package/esm/components/promptField/PromptFieldContext.js +9 -0
  153. package/esm/components/promptField/PromptFieldControl.d.ts +27 -0
  154. package/esm/components/promptField/PromptFieldControl.js +95 -0
  155. package/esm/components/promptField/PromptFieldRecord.d.ts +27 -0
  156. package/esm/components/promptField/PromptFieldRecord.js +151 -0
  157. package/esm/components/promptField/PromptFieldSend.d.ts +27 -0
  158. package/{modern/components/export/ExportExcel.js → esm/components/promptField/PromptFieldSend.js} +30 -38
  159. package/esm/components/promptField/index.d.ts +4 -0
  160. package/esm/components/promptField/index.js +4 -0
  161. package/esm/components/resizablePanel/ResizablePanel.d.ts +10 -0
  162. package/esm/components/resizablePanel/ResizablePanel.js +52 -0
  163. package/esm/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
  164. package/esm/components/resizablePanel/ResizablePanelContext.js +9 -0
  165. package/esm/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
  166. package/esm/components/resizablePanel/ResizablePanelHandle.js +108 -0
  167. package/esm/components/resizablePanel/index.d.ts +3 -0
  168. package/esm/components/resizablePanel/index.js +3 -0
  169. package/esm/components/sidebar/Sidebar.d.ts +4 -0
  170. package/esm/components/sidebar/Sidebar.js +47 -0
  171. package/esm/components/sidebar/SidebarHeader.d.ts +4 -0
  172. package/esm/components/sidebar/SidebarHeader.js +44 -0
  173. package/esm/components/sidebar/index.d.ts +2 -0
  174. package/esm/components/sidebar/index.js +2 -0
  175. package/esm/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
  176. package/esm/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
  177. package/esm/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
  178. package/esm/hooks/features/aggregation/gridAggregationSelectors.js +28 -1
  179. package/esm/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
  180. package/esm/hooks/features/aggregation/index.d.ts +1 -1
  181. package/esm/hooks/features/aggregation/index.js +1 -1
  182. package/esm/hooks/features/aggregation/useGridAggregation.js +3 -7
  183. package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
  184. package/esm/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
  185. package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +23 -10
  186. package/esm/hooks/features/aiAssistant/api.d.ts +12 -0
  187. package/esm/hooks/features/aiAssistant/api.js +31 -0
  188. package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
  189. package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
  190. package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.js +5 -0
  191. package/esm/hooks/features/aiAssistant/index.d.ts +2 -0
  192. package/esm/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
  193. package/esm/hooks/features/aiAssistant/useGridAiAssistant.js +293 -0
  194. package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +4 -1
  195. package/esm/hooks/features/index.d.ts +1 -1
  196. package/esm/hooks/features/index.js +1 -1
  197. package/esm/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
  198. package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
  199. package/esm/hooks/features/pivoting/gridPivotingSelectors.js +5 -0
  200. package/esm/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
  201. package/esm/hooks/features/pivoting/useGridPivoting.js +339 -0
  202. package/esm/hooks/features/pivoting/utils.d.ts +21 -0
  203. package/esm/hooks/features/pivoting/utils.js +259 -0
  204. package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
  205. package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +0 -1
  206. package/esm/hooks/utils/useResize.d.ts +9 -0
  207. package/esm/hooks/utils/useResize.js +52 -0
  208. package/esm/index.d.ts +4 -1
  209. package/esm/index.js +4 -2
  210. package/esm/material/icons.d.ts +15 -15
  211. package/esm/material/icons.js +32 -5
  212. package/esm/material/index.d.ts +31 -5
  213. package/esm/material/index.js +31 -3
  214. package/esm/models/dataGridPremiumProps.d.ts +96 -2
  215. package/esm/models/gridApiPremium.d.ts +4 -2
  216. package/esm/models/gridPremiumIconSlotsComponent.d.ts +141 -8
  217. package/esm/models/gridPremiumSlotsComponent.d.ts +13 -1
  218. package/esm/models/gridStatePremium.d.ts +6 -0
  219. package/esm/package.json +1 -1
  220. package/esm/setupExcelExportWebWorker/index.d.ts +1 -0
  221. package/esm/setupExcelExportWebWorker/index.js +1 -0
  222. package/esm/typeOverloads/modules.d.ts +32 -1
  223. package/esm/utils/speechRecognition.d.ts +2 -0
  224. package/esm/utils/speechRecognition.js +2 -0
  225. package/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
  226. package/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
  227. package/hooks/features/aggregation/gridAggregationSelectors.js +29 -2
  228. package/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
  229. package/hooks/features/aggregation/index.d.ts +1 -1
  230. package/hooks/features/aggregation/index.js +21 -11
  231. package/hooks/features/aggregation/useGridAggregation.js +3 -7
  232. package/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
  233. package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
  234. package/hooks/features/aggregation/wrapColumnWithAggregation.js +24 -11
  235. package/hooks/features/aiAssistant/api.d.ts +12 -0
  236. package/hooks/features/aiAssistant/api.js +37 -0
  237. package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
  238. package/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
  239. package/hooks/features/aiAssistant/gridAiAssistantSelectors.js +11 -0
  240. package/hooks/features/aiAssistant/index.d.ts +2 -0
  241. package/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
  242. package/hooks/features/aiAssistant/useGridAiAssistant.js +303 -0
  243. package/hooks/features/dataSource/useGridDataSourcePremium.js +3 -0
  244. package/hooks/features/index.d.ts +1 -1
  245. package/hooks/features/index.js +4 -4
  246. package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
  247. package/hooks/features/pivoting/gridPivotingInterfaces.js +5 -0
  248. package/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
  249. package/hooks/features/pivoting/gridPivotingSelectors.js +30 -0
  250. package/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
  251. package/hooks/features/pivoting/useGridPivoting.js +349 -0
  252. package/hooks/features/pivoting/utils.d.ts +21 -0
  253. package/hooks/features/pivoting/utils.js +270 -0
  254. package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
  255. package/hooks/features/rowGrouping/useGridRowGrouping.js +0 -1
  256. package/hooks/utils/useResize.d.ts +9 -0
  257. package/hooks/utils/useResize.js +60 -0
  258. package/index.d.ts +4 -1
  259. package/index.js +19 -3
  260. package/material/icons.d.ts +15 -15
  261. package/material/icons.js +36 -9
  262. package/material/index.d.ts +31 -5
  263. package/material/index.js +30 -2
  264. package/models/dataGridPremiumProps.d.ts +96 -2
  265. package/models/gridApiPremium.d.ts +4 -2
  266. package/models/gridPremiumIconSlotsComponent.d.ts +141 -8
  267. package/models/gridPremiumSlotsComponent.d.ts +13 -1
  268. package/models/gridStatePremium.d.ts +6 -0
  269. package/package.json +9 -15
  270. package/setupExcelExportWebWorker/index.d.ts +1 -0
  271. package/{setupExcelExportWebWorker.js → setupExcelExportWebWorker/index.js} +1 -1
  272. package/typeOverloads/modules.d.ts +32 -1
  273. package/utils/speechRecognition.d.ts +2 -0
  274. package/utils/speechRecognition.js +8 -0
  275. package/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
  276. package/components/promptControl/GridToolbarPromptControl.js +0 -222
  277. package/components/promptControl/RecordButton.d.ts +0 -16
  278. package/components/promptControl/RecordButton.js +0 -119
  279. package/components/promptControl/index.d.ts +0 -1
  280. package/components/promptControl/index.js +0 -12
  281. package/esm/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
  282. package/esm/components/promptControl/GridToolbarPromptControl.js +0 -215
  283. package/esm/components/promptControl/RecordButton.d.ts +0 -16
  284. package/esm/components/promptControl/RecordButton.js +0 -111
  285. package/esm/components/promptControl/index.d.ts +0 -1
  286. package/esm/components/promptControl/index.js +0 -1
  287. package/esm/hooks/features/promptControl/api.d.ts +0 -2
  288. package/esm/hooks/features/promptControl/api.js +0 -22
  289. package/esm/hooks/features/promptControl/index.d.ts +0 -2
  290. package/esm/hooks/features/promptControl/types.d.ts +0 -25
  291. package/esm/setupExcelExportWebWorker.d.ts +0 -1
  292. package/esm/setupExcelExportWebWorker.js +0 -1
  293. package/esm/utils/releaseInfo.d.ts +0 -1
  294. package/esm/utils/releaseInfo.js +0 -13
  295. package/hooks/features/promptControl/api.d.ts +0 -2
  296. package/hooks/features/promptControl/api.js +0 -28
  297. package/hooks/features/promptControl/index.d.ts +0 -2
  298. package/hooks/features/promptControl/types.d.ts +0 -25
  299. package/modern/DataGridPremium/DataGrid.d.ts +0 -8
  300. package/modern/DataGridPremium/DataGrid.js +0 -19
  301. package/modern/DataGridPremium/DataGridPremium.d.ts +0 -16
  302. package/modern/DataGridPremium/DataGridPremium.js +0 -1127
  303. package/modern/DataGridPremium/index.d.ts +0 -3
  304. package/modern/DataGridPremium/index.js +0 -3
  305. package/modern/DataGridPremium/useDataGridPremiumComponent.d.ts +0 -4
  306. package/modern/DataGridPremium/useDataGridPremiumComponent.js +0 -108
  307. package/modern/DataGridPremium/useDataGridPremiumProps.d.ts +0 -6
  308. package/modern/DataGridPremium/useDataGridPremiumProps.js +0 -54
  309. package/modern/components/GridAggregationHeader.d.ts +0 -7
  310. package/modern/components/GridAggregationHeader.js +0 -89
  311. package/modern/components/GridAggregationRowOverlay.d.ts +0 -3
  312. package/modern/components/GridAggregationRowOverlay.js +0 -37
  313. package/modern/components/GridBottomContainer.d.ts +0 -3
  314. package/modern/components/GridBottomContainer.js +0 -43
  315. package/modern/components/GridColumnMenuAggregationItem.d.ts +0 -7
  316. package/modern/components/GridColumnMenuAggregationItem.js +0 -124
  317. package/modern/components/GridColumnMenuRowGroupItem.d.ts +0 -3
  318. package/modern/components/GridColumnMenuRowGroupItem.js +0 -42
  319. package/modern/components/GridColumnMenuRowUngroupItem.d.ts +0 -3
  320. package/modern/components/GridColumnMenuRowUngroupItem.js +0 -44
  321. package/modern/components/GridDataSourceGroupingCriteriaCell.d.ts +0 -7
  322. package/modern/components/GridDataSourceGroupingCriteriaCell.js +0 -121
  323. package/modern/components/GridExcelExportMenuItem.d.ts +0 -9
  324. package/modern/components/GridExcelExportMenuItem.js +0 -48
  325. package/modern/components/GridFooterCell.d.ts +0 -9
  326. package/modern/components/GridFooterCell.js +0 -43
  327. package/modern/components/GridGroupingColumnFooterCell.d.ts +0 -4
  328. package/modern/components/GridGroupingColumnFooterCell.js +0 -23
  329. package/modern/components/GridGroupingColumnLeafCell.d.ts +0 -4
  330. package/modern/components/GridGroupingColumnLeafCell.js +0 -17
  331. package/modern/components/GridGroupingCriteriaCell.d.ts +0 -7
  332. package/modern/components/GridGroupingCriteriaCell.js +0 -87
  333. package/modern/components/GridPremiumColumnMenu.d.ts +0 -33
  334. package/modern/components/GridPremiumColumnMenu.js +0 -37
  335. package/modern/components/GridPremiumToolbar.d.ts +0 -3
  336. package/modern/components/GridPremiumToolbar.js +0 -23
  337. package/modern/components/export/ExportExcel.d.ts +0 -29
  338. package/modern/components/export/index.d.ts +0 -1
  339. package/modern/components/export/index.js +0 -1
  340. package/modern/components/index.d.ts +0 -6
  341. package/modern/components/index.js +0 -6
  342. package/modern/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
  343. package/modern/components/promptControl/GridToolbarPromptControl.js +0 -215
  344. package/modern/components/promptControl/RecordButton.d.ts +0 -16
  345. package/modern/components/promptControl/RecordButton.js +0 -111
  346. package/modern/components/promptControl/index.d.ts +0 -1
  347. package/modern/components/promptControl/index.js +0 -1
  348. package/modern/components/reexports.d.ts +0 -1
  349. package/modern/components/reexports.js +0 -1
  350. package/modern/constants/dataGridPremiumDefaultSlotsComponents.d.ts +0 -2
  351. package/modern/constants/dataGridPremiumDefaultSlotsComponents.js +0 -11
  352. package/modern/hooks/features/aggregation/createAggregationLookup.d.ts +0 -17
  353. package/modern/hooks/features/aggregation/createAggregationLookup.js +0 -111
  354. package/modern/hooks/features/aggregation/gridAggregationFunctions.d.ts +0 -8
  355. package/modern/hooks/features/aggregation/gridAggregationFunctions.js +0 -93
  356. package/modern/hooks/features/aggregation/gridAggregationInterfaces.d.ts +0 -129
  357. package/modern/hooks/features/aggregation/gridAggregationSelectors.d.ts +0 -13
  358. package/modern/hooks/features/aggregation/gridAggregationSelectors.js +0 -15
  359. package/modern/hooks/features/aggregation/gridAggregationUtils.d.ts +0 -62
  360. package/modern/hooks/features/aggregation/gridAggregationUtils.js +0 -180
  361. package/modern/hooks/features/aggregation/index.d.ts +0 -4
  362. package/modern/hooks/features/aggregation/index.js +0 -3
  363. package/modern/hooks/features/aggregation/useGridAggregation.d.ts +0 -6
  364. package/modern/hooks/features/aggregation/useGridAggregation.js +0 -103
  365. package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +0 -4
  366. package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +0 -96
  367. package/modern/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +0 -81
  368. package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +0 -215
  369. package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.d.ts +0 -40
  370. package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.js +0 -1
  371. package/modern/hooks/features/cellSelection/gridCellSelectionSelector.d.ts +0 -2
  372. package/modern/hooks/features/cellSelection/gridCellSelectionSelector.js +0 -2
  373. package/modern/hooks/features/cellSelection/index.d.ts +0 -1
  374. package/modern/hooks/features/cellSelection/index.js +0 -1
  375. package/modern/hooks/features/cellSelection/useGridCellSelection.d.ts +0 -6
  376. package/modern/hooks/features/cellSelection/useGridCellSelection.js +0 -486
  377. package/modern/hooks/features/clipboard/useGridClipboardImport.d.ts +0 -4
  378. package/modern/hooks/features/clipboard/useGridClipboardImport.js +0 -335
  379. package/modern/hooks/features/dataSource/models.d.ts +0 -54
  380. package/modern/hooks/features/dataSource/models.js +0 -1
  381. package/modern/hooks/features/dataSource/useGridDataSourcePremium.d.ts +0 -4
  382. package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +0 -59
  383. package/modern/hooks/features/export/gridExcelExportInterface.d.ts +0 -71
  384. package/modern/hooks/features/export/gridExcelExportInterface.js +0 -1
  385. package/modern/hooks/features/export/index.d.ts +0 -2
  386. package/modern/hooks/features/export/index.js +0 -2
  387. package/modern/hooks/features/export/serializer/excelSerializer.d.ts +0 -40
  388. package/modern/hooks/features/export/serializer/excelSerializer.js +0 -269
  389. package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.d.ts +0 -2
  390. package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.js +0 -53
  391. package/modern/hooks/features/export/serializer/utils.d.ts +0 -36
  392. package/modern/hooks/features/export/serializer/utils.js +0 -93
  393. package/modern/hooks/features/export/useGridExcelExport.d.ts +0 -11
  394. package/modern/hooks/features/export/useGridExcelExport.js +0 -139
  395. package/modern/hooks/features/index.d.ts +0 -5
  396. package/modern/hooks/features/index.js +0 -6
  397. package/modern/hooks/features/promptControl/api.d.ts +0 -2
  398. package/modern/hooks/features/promptControl/api.js +0 -22
  399. package/modern/hooks/features/promptControl/index.d.ts +0 -2
  400. package/modern/hooks/features/promptControl/index.js +0 -1
  401. package/modern/hooks/features/promptControl/types.d.ts +0 -25
  402. package/modern/hooks/features/promptControl/types.js +0 -1
  403. package/modern/hooks/features/rowGrouping/createGroupingColDef.d.ts +0 -57
  404. package/modern/hooks/features/rowGrouping/createGroupingColDef.js +0 -272
  405. package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +0 -44
  406. package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -1
  407. package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +0 -3
  408. package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -5
  409. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +0 -54
  410. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -173
  411. package/modern/hooks/features/rowGrouping/index.d.ts +0 -3
  412. package/modern/hooks/features/rowGrouping/index.js +0 -3
  413. package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +0 -4
  414. package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +0 -73
  415. package/modern/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -11
  416. package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +0 -182
  417. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +0 -4
  418. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -157
  419. package/modern/hooks/features/rows/index.d.ts +0 -1
  420. package/modern/hooks/features/rows/index.js +0 -1
  421. package/modern/hooks/features/rows/useGridRowAriaAttributes.d.ts +0 -1
  422. package/modern/hooks/features/rows/useGridRowAriaAttributes.js +0 -8
  423. package/modern/hooks/index.d.ts +0 -2
  424. package/modern/hooks/index.js +0 -3
  425. package/modern/hooks/utils/index.d.ts +0 -1
  426. package/modern/hooks/utils/index.js +0 -1
  427. package/modern/hooks/utils/useGridApiContext.d.ts +0 -4
  428. package/modern/hooks/utils/useGridApiContext.js +0 -2
  429. package/modern/hooks/utils/useGridApiRef.d.ts +0 -4
  430. package/modern/hooks/utils/useGridApiRef.js +0 -2
  431. package/modern/hooks/utils/useGridAriaAttributes.d.ts +0 -2
  432. package/modern/hooks/utils/useGridAriaAttributes.js +0 -13
  433. package/modern/hooks/utils/useGridPrivateApiContext.d.ts +0 -2
  434. package/modern/hooks/utils/useGridPrivateApiContext.js +0 -2
  435. package/modern/hooks/utils/useGridRootProps.d.ts +0 -2
  436. package/modern/hooks/utils/useGridRootProps.js +0 -2
  437. package/modern/hooks/utils/useKeepGroupedColumnsHidden.d.ts +0 -12
  438. package/modern/hooks/utils/useKeepGroupedColumnsHidden.js +0 -43
  439. package/modern/index.d.ts +0 -23
  440. package/modern/index.js +0 -26
  441. package/modern/locales.d.ts +0 -1
  442. package/modern/locales.js +0 -1
  443. package/modern/material/icons.d.ts +0 -15
  444. package/modern/material/icons.js +0 -20
  445. package/modern/material/index.d.ts +0 -8
  446. package/modern/material/index.js +0 -11
  447. package/modern/models/dataGridPremiumProps.d.ts +0 -162
  448. package/modern/models/dataGridPremiumProps.js +0 -1
  449. package/modern/models/gridApiPremium.d.ts +0 -14
  450. package/modern/models/gridApiPremium.js +0 -1
  451. package/modern/models/gridGroupingValueGetter.d.ts +0 -4
  452. package/modern/models/gridGroupingValueGetter.js +0 -1
  453. package/modern/models/gridPastedValueParser.d.ts +0 -4
  454. package/modern/models/gridPastedValueParser.js +0 -1
  455. package/modern/models/gridPremiumIconSlotsComponent.d.ts +0 -28
  456. package/modern/models/gridPremiumIconSlotsComponent.js +0 -1
  457. package/modern/models/gridPremiumSlotsComponent.d.ts +0 -7
  458. package/modern/models/gridPremiumSlotsComponent.js +0 -1
  459. package/modern/models/gridStatePremium.d.ts +0 -18
  460. package/modern/models/gridStatePremium.js +0 -1
  461. package/modern/models/index.d.ts +0 -4
  462. package/modern/models/index.js +0 -4
  463. package/modern/package.json +0 -1
  464. package/modern/setupExcelExportWebWorker.d.ts +0 -1
  465. package/modern/setupExcelExportWebWorker.js +0 -1
  466. package/modern/themeAugmentation/index.d.ts +0 -2
  467. package/modern/themeAugmentation/index.js +0 -4
  468. package/modern/themeAugmentation/overrides.d.ts +0 -7
  469. package/modern/themeAugmentation/overrides.js +0 -1
  470. package/modern/themeAugmentation/props.d.ts +0 -15
  471. package/modern/themeAugmentation/props.js +0 -1
  472. package/modern/typeOverloads/index.d.ts +0 -2
  473. package/modern/typeOverloads/index.js +0 -2
  474. package/modern/typeOverloads/modules.d.ts +0 -97
  475. package/modern/typeOverloads/modules.js +0 -1
  476. package/modern/typeOverloads/reexports.d.ts +0 -17
  477. package/modern/typeOverloads/reexports.js +0 -15
  478. package/modern/utils/releaseInfo.d.ts +0 -1
  479. package/modern/utils/releaseInfo.js +0 -13
  480. package/setupExcelExportWebWorker.d.ts +0 -1
  481. package/tsconfig.build.tsbuildinfo +0 -1
  482. package/utils/releaseInfo.d.ts +0 -1
  483. package/utils/releaseInfo.js +0 -20
  484. /package/esm/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
  485. /package/esm/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
  486. /package/{modern/hooks/features/aggregation/gridAggregationInterfaces.js → esm/hooks/features/pivoting/gridPivotingInterfaces.js} +0 -0
  487. /package/esm/{locales.d.ts → locales/index.d.ts} +0 -0
  488. /package/esm/{locales.js → locales/index.js} +0 -0
  489. /package/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
  490. /package/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
  491. /package/{locales.d.ts → locales/index.d.ts} +0 -0
  492. /package/{locales.js → locales/index.js} +0 -0
@@ -1,129 +0,0 @@
1
- import { GridRowId, GridRowModel, GridColDef, GridValueFormatter } from '@mui/x-data-grid-pro';
2
- export interface GridAggregationState {
3
- model: GridAggregationModel;
4
- lookup: GridAggregationLookup;
5
- }
6
- export interface GridAggregationInitialState {
7
- model?: GridAggregationModel;
8
- }
9
- export interface GridAggregationInternalCache {
10
- rulesOnLastColumnHydration: GridAggregationRules;
11
- rulesOnLastRowHydration: GridAggregationRules;
12
- }
13
- export interface GridAggregationApi {
14
- /**
15
- * Sets the aggregation model to the one given by `model`.
16
- * @param {GridAggregationModel} model The aggregation model.
17
- */
18
- setAggregationModel: (model: GridAggregationModel) => void;
19
- }
20
- export interface GridAggregationPrivateApi {
21
- /**
22
- * Applies the aggregation to the rows.
23
- */
24
- applyAggregation: () => void;
25
- }
26
- export interface GridAggregationGetCellValueParams {
27
- /**
28
- * The row model of the row that the current cell belongs to.
29
- */
30
- row: GridRowModel;
31
- }
32
- /**
33
- * Grid aggregation function definition interface.
34
- * @demos
35
- * - [Aggregation functions](/x/react-data-grid/aggregation/#aggregation-functions)
36
- */
37
- export interface GridAggregationFunction<V = any, AV = V> {
38
- /**
39
- * Function that takes the current cell values and generates the aggregated value.
40
- * @template V, AV
41
- * @param {GridAggregationParams<V>} params The params of the current aggregated cell.
42
- * @returns {AV} The aggregated value.
43
- */
44
- apply: (params: GridAggregationParams<V>) => AV | null | undefined;
45
- /**
46
- * Label of the aggregation function.
47
- * Used for adding a label to the footer of the grouping column when this aggregation function is the only one being used.
48
- * @default apiRef.current.getLocaleText('aggregationFunctionLabel{capitalize(name)})
49
- */
50
- label?: string;
51
- /**
52
- * Column types supported by this aggregation function.
53
- * If not defined, all types are supported (in most cases this property should be defined).
54
- */
55
- columnTypes?: string[];
56
- /**
57
- * Function for applying a formatter to the aggregated value.
58
- * If not defined, the grid uses the formatter of the column.
59
- */
60
- valueFormatter?: GridValueFormatter;
61
- /**
62
- * Indicates if the aggregated value has the same unit as the cells used to generate it.
63
- * It can be used to apply a custom cell renderer only if the aggregated value has the same unit.
64
- * @default true
65
- */
66
- hasCellUnit?: boolean;
67
- /**
68
- * Function that allows to transform the value of the cell passed to the aggregation function applier.
69
- * Useful for aggregating data from multiple row fields.
70
- * @demo https://mui.com/x/react-data-grid/aggregation/#aggregating-data-from-multiple-row-fields
71
- * @param {GridAggregationGetCellValueParams} params The params of the current cell
72
- * @returns {V} The value of the cell that will be passed to the aggregation `apply` function
73
- */
74
- getCellValue?: (params: GridAggregationGetCellValueParams) => V;
75
- }
76
- /**
77
- * Grid aggregation function data source definition interface.
78
- * @demos
79
- * - [Server-side aggregation](/x/react-data-grid/server-side-data/aggregation/)
80
- */
81
- export interface GridAggregationFunctionDataSource extends Omit<GridAggregationFunction, 'apply' | 'getCellValue'> {}
82
- export interface GridAggregationParams<V = any> {
83
- values: (V | undefined)[];
84
- groupId: GridRowId;
85
- field: GridColDef['field'];
86
- }
87
- export type GridAggregationModel = {
88
- [field: string]: string;
89
- };
90
- export type GridAggregationLookup = {
91
- [rowId: GridRowId]: {
92
- [field: string]: {
93
- position: GridAggregationPosition;
94
- value: any;
95
- };
96
- };
97
- };
98
- export type GridAggregationPosition = 'inline' | 'footer';
99
- export interface GridAggregationCellMeta {
100
- /**
101
- * If `true`, the current aggregated value has the same unit as the value of the other cells of this row.
102
- * For instance, "min" / "max" aggregation have the same unit as the other cells.
103
- * If `false`, the current aggregated value has another unit or not unit.
104
- * For instance, "size" aggregation has no unit.
105
- */
106
- hasCellUnit: boolean;
107
- /**
108
- * Name of the aggregation function currently applied on this cell.
109
- */
110
- aggregationFunctionName: string;
111
- }
112
- export interface GridAggregationHeaderMeta {
113
- aggregationRule: GridAggregationRule;
114
- }
115
- export interface GridAggregationRule {
116
- aggregationFunctionName: string;
117
- aggregationFunction: GridAggregationFunction | GridAggregationFunctionDataSource;
118
- }
119
- /**
120
- * Object containing all the aggregation rules that must be applied to the current columns.
121
- * Unlike the aggregation model, those rules are sanitized and do not contain:
122
- * - items for non-existing columns
123
- * - items for non-aggregable columns (GridColDef.aggregable = false)
124
- * - items for non-existing aggregation function
125
- * - items for non-available aggregation function on the column (GridColDef.availableAggregationFunctions)
126
- */
127
- export type GridAggregationRules = {
128
- [field: string]: GridAggregationRule;
129
- };
@@ -1,13 +0,0 @@
1
- import { GridStatePremium } from "../../../models/gridStatePremium.js";
2
- export declare const gridAggregationStateSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, unknown, import("./gridAggregationInterfaces").GridAggregationState>;
3
- /**
4
- * Get the aggregation model, containing the aggregation function of each column.
5
- * If a column is not in the model, it is not aggregated.
6
- * @category Aggregation
7
- */
8
- export declare const gridAggregationModelSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationState, import("./gridAggregationInterfaces").GridAggregationModel>;
9
- /**
10
- * Get the aggregation results as a lookup.
11
- * @category Aggregation
12
- */
13
- export declare const gridAggregationLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationState, import("./gridAggregationInterfaces").GridAggregationLookup>;
@@ -1,15 +0,0 @@
1
- import { createSelector, createRootSelector } from '@mui/x-data-grid-pro/internals';
2
- export const gridAggregationStateSelector = createRootSelector(state => state.aggregation);
3
-
4
- /**
5
- * Get the aggregation model, containing the aggregation function of each column.
6
- * If a column is not in the model, it is not aggregated.
7
- * @category Aggregation
8
- */
9
- export const gridAggregationModelSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.model);
10
-
11
- /**
12
- * Get the aggregation results as a lookup.
13
- * @category Aggregation
14
- */
15
- export const gridAggregationLookupSelector = createSelector(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
@@ -1,62 +0,0 @@
1
- import { RefObject } from '@mui/x-internals/types';
2
- import { GridColDef, GridRowId } from '@mui/x-data-grid-pro';
3
- import { GridColumnRawLookup, GridHydrateRowsValue } from '@mui/x-data-grid-pro/internals';
4
- import { GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationModel, GridAggregationRule, GridAggregationRules } from "./gridAggregationInterfaces.js";
5
- import { GridStatePremium } from "../../../models/gridStatePremium.js";
6
- import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
7
- import { GridApiPremium, GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
8
- export declare const GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = "auto-generated-group-footer-root";
9
- export declare const getAggregationFooterRowIdFromGroupId: (groupId: GridRowId | null) => string;
10
- type AggregationFunction = GridAggregationFunction | GridAggregationFunctionDataSource | undefined;
11
- export declare const canColumnHaveAggregationFunction: ({
12
- colDef,
13
- aggregationFunctionName,
14
- aggregationFunction,
15
- isDataSource
16
- }: {
17
- colDef: GridColDef | undefined;
18
- aggregationFunctionName: string;
19
- aggregationFunction: AggregationFunction;
20
- isDataSource: boolean;
21
- }) => boolean;
22
- export declare const getAvailableAggregationFunctions: ({
23
- aggregationFunctions,
24
- colDef,
25
- isDataSource
26
- }: {
27
- aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>;
28
- colDef: GridColDef;
29
- isDataSource: boolean;
30
- }) => string[];
31
- export declare const mergeStateWithAggregationModel: (aggregationModel: GridAggregationModel) => (state: GridStatePremium) => GridStatePremium;
32
- export declare const getAggregationRules: (columnsLookup: GridColumnRawLookup, aggregationModel: GridAggregationModel, aggregationFunctions: Record<string, GridAggregationFunction> | Record<string, GridAggregationFunctionDataSource>, isDataSource: boolean) => GridAggregationRules;
33
- interface AddFooterRowsParams {
34
- groupingParams: GridHydrateRowsValue;
35
- getAggregationPosition: DataGridPremiumProcessedProps['getAggregationPosition'];
36
- /**
37
- * If `true`, there are some aggregation rules to apply
38
- */
39
- hasAggregationRule: boolean;
40
- apiRef: RefObject<GridPrivateApiPremium>;
41
- }
42
- /**
43
- * Add a footer for each group that has at least one column with an aggregated value.
44
- */
45
- export declare const addFooterRows: ({
46
- groupingParams,
47
- apiRef,
48
- getAggregationPosition,
49
- hasAggregationRule
50
- }: AddFooterRowsParams) => GridHydrateRowsValue;
51
- /**
52
- * Compares two sets of aggregation rules to determine if they are equal or not.
53
- */
54
- export declare const areAggregationRulesEqual: (previousValue: GridAggregationRules | undefined, newValue: GridAggregationRules) => boolean;
55
- export declare const getAggregationFunctionLabel: ({
56
- apiRef,
57
- aggregationRule
58
- }: {
59
- apiRef: RefObject<GridApiPremium>;
60
- aggregationRule: GridAggregationRule;
61
- }) => string;
62
- export {};
@@ -1,180 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { unstable_capitalize as capitalize } from '@mui/utils';
3
- import { GRID_ID_AUTOGENERATED } from '@mui/x-data-grid/internals';
4
- import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid-pro';
5
- import { addPinnedRow, insertNodeInTree, removeNodeFromTree } from '@mui/x-data-grid-pro/internals';
6
- import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
7
- export const GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = 'auto-generated-group-footer-root';
8
- export const getAggregationFooterRowIdFromGroupId = groupId => {
9
- if (groupId == null) {
10
- return GRID_AGGREGATION_ROOT_FOOTER_ROW_ID;
11
- }
12
- return `auto-generated-group-footer-${groupId}`;
13
- };
14
- const isClientSideAggregateFunction = aggregationFunction => !!aggregationFunction && 'apply' in aggregationFunction;
15
- export const canColumnHaveAggregationFunction = ({
16
- colDef,
17
- aggregationFunctionName,
18
- aggregationFunction,
19
- isDataSource
20
- }) => {
21
- if (!colDef) {
22
- return false;
23
- }
24
- if (!isClientSideAggregateFunction(aggregationFunction) && !isDataSource) {
25
- return false;
26
- }
27
- if (colDef.availableAggregationFunctions != null) {
28
- return colDef.availableAggregationFunctions.includes(aggregationFunctionName);
29
- }
30
- if (!aggregationFunction?.columnTypes) {
31
- return true;
32
- }
33
- return aggregationFunction.columnTypes.includes(colDef.type);
34
- };
35
- export const getAvailableAggregationFunctions = ({
36
- aggregationFunctions,
37
- colDef,
38
- isDataSource
39
- }) => Object.keys(aggregationFunctions).filter(aggregationFunctionName => canColumnHaveAggregationFunction({
40
- colDef,
41
- aggregationFunctionName,
42
- aggregationFunction: aggregationFunctions[aggregationFunctionName],
43
- isDataSource
44
- }));
45
- export const mergeStateWithAggregationModel = aggregationModel => state => _extends({}, state, {
46
- aggregation: _extends({}, state.aggregation, {
47
- model: aggregationModel
48
- })
49
- });
50
- export const getAggregationRules = (columnsLookup, aggregationModel, aggregationFunctions, isDataSource) => {
51
- const aggregationRules = {};
52
-
53
- // eslint-disable-next-line guard-for-in
54
- for (const field in aggregationModel) {
55
- const columnItem = aggregationModel[field];
56
- if (columnsLookup[field] && canColumnHaveAggregationFunction({
57
- colDef: columnsLookup[field],
58
- aggregationFunctionName: columnItem,
59
- aggregationFunction: aggregationFunctions[columnItem],
60
- isDataSource
61
- })) {
62
- aggregationRules[field] = {
63
- aggregationFunctionName: columnItem,
64
- aggregationFunction: aggregationFunctions[columnItem]
65
- };
66
- }
67
- }
68
- return aggregationRules;
69
- };
70
- /**
71
- * Add a footer for each group that has at least one column with an aggregated value.
72
- */
73
- export const addFooterRows = ({
74
- groupingParams,
75
- apiRef,
76
- getAggregationPosition,
77
- hasAggregationRule
78
- }) => {
79
- let newGroupingParams = _extends({}, groupingParams, {
80
- tree: _extends({}, groupingParams.tree),
81
- treeDepths: _extends({}, groupingParams.treeDepths)
82
- });
83
- const updateChildGroupFooter = groupNode => {
84
- const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer';
85
- if (shouldHaveFooter) {
86
- const footerId = getAggregationFooterRowIdFromGroupId(groupNode.id);
87
- if (groupNode.footerId !== footerId) {
88
- if (groupNode.footerId != null) {
89
- removeNodeFromTree({
90
- node: newGroupingParams.tree[groupNode.footerId],
91
- tree: newGroupingParams.tree,
92
- treeDepths: newGroupingParams.treeDepths
93
- });
94
- }
95
- const footerNode = {
96
- id: footerId,
97
- parent: groupNode.id,
98
- depth: groupNode ? groupNode.depth + 1 : 0,
99
- type: 'footer'
100
- };
101
- insertNodeInTree(footerNode, newGroupingParams.tree, newGroupingParams.treeDepths, null);
102
- }
103
- } else if (groupNode.footerId != null) {
104
- removeNodeFromTree({
105
- node: newGroupingParams.tree[groupNode.footerId],
106
- tree: newGroupingParams.tree,
107
- treeDepths: newGroupingParams.treeDepths
108
- });
109
- newGroupingParams.tree[groupNode.id] = _extends({}, newGroupingParams.tree[groupNode.id], {
110
- footerId: null
111
- });
112
- }
113
- };
114
- const updateRootGroupFooter = groupNode => {
115
- const shouldHaveFooter = hasAggregationRule && getAggregationPosition(groupNode) === 'footer' && groupNode.children.length > 0;
116
- if (shouldHaveFooter) {
117
- const rowId = getAggregationFooterRowIdFromGroupId(null);
118
- newGroupingParams = addPinnedRow({
119
- groupingParams: newGroupingParams,
120
- rowModel: {
121
- [GRID_ID_AUTOGENERATED]: rowId
122
- },
123
- rowId,
124
- position: 'bottom',
125
- apiRef,
126
- isAutoGenerated: true
127
- });
128
- }
129
- };
130
- const updateGroupFooter = groupNode => {
131
- if (groupNode.id === GRID_ROOT_GROUP_ID) {
132
- updateRootGroupFooter(groupNode);
133
- } else {
134
- updateChildGroupFooter(groupNode);
135
- }
136
- groupNode.children.forEach(childId => {
137
- const childNode = newGroupingParams.tree[childId];
138
- if (childNode.type === 'group') {
139
- updateGroupFooter(childNode);
140
- }
141
- });
142
- };
143
- updateGroupFooter(newGroupingParams.tree[GRID_ROOT_GROUP_ID]);
144
- return newGroupingParams;
145
- };
146
-
147
- /**
148
- * Compares two sets of aggregation rules to determine if they are equal or not.
149
- */
150
- export const areAggregationRulesEqual = (previousValue, newValue) => {
151
- const previousFields = Object.keys(previousValue ?? {});
152
- const newFields = Object.keys(newValue);
153
- if (!isDeepEqual(previousFields, newFields)) {
154
- return false;
155
- }
156
- return newFields.every(field => {
157
- const previousRule = previousValue?.[field];
158
- const newRule = newValue[field];
159
- if (previousRule?.aggregationFunction !== newRule?.aggregationFunction) {
160
- return false;
161
- }
162
- if (previousRule?.aggregationFunctionName !== newRule?.aggregationFunctionName) {
163
- return false;
164
- }
165
- return true;
166
- });
167
- };
168
- export const getAggregationFunctionLabel = ({
169
- apiRef,
170
- aggregationRule
171
- }) => {
172
- if (aggregationRule.aggregationFunction.label != null) {
173
- return aggregationRule.aggregationFunction.label;
174
- }
175
- try {
176
- return apiRef.current.getLocaleText(`aggregationFunctionLabel${capitalize(aggregationRule.aggregationFunctionName)}`);
177
- } catch {
178
- return aggregationRule.aggregationFunctionName;
179
- }
180
- };
@@ -1,4 +0,0 @@
1
- export type { GridAggregationState, GridAggregationInitialState, GridAggregationInternalCache, GridAggregationApi, GridAggregationGetCellValueParams, GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationParams, GridAggregationModel, GridAggregationLookup, GridAggregationPosition, GridAggregationCellMeta, GridAggregationHeaderMeta, GridAggregationRule, GridAggregationRules } from './gridAggregationInterfaces';
2
- export * from "./gridAggregationSelectors.js";
3
- export * from "./gridAggregationFunctions.js";
4
- export { GRID_AGGREGATION_ROOT_FOOTER_ROW_ID, getAggregationFooterRowIdFromGroupId } from "./gridAggregationUtils.js";
@@ -1,3 +0,0 @@
1
- export * from "./gridAggregationSelectors.js";
2
- export * from "./gridAggregationFunctions.js";
3
- export { GRID_AGGREGATION_ROOT_FOOTER_ROW_ID, getAggregationFooterRowIdFromGroupId } from "./gridAggregationUtils.js";
@@ -1,6 +0,0 @@
1
- import { RefObject } from '@mui/x-internals/types';
2
- import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
3
- import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
4
- import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
5
- export declare const aggregationStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'aggregationModel' | 'initialState'>, GridPrivateApiPremium>;
6
- export declare const useGridAggregation: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "onAggregationModelChange" | "initialState" | "aggregationModel" | "getAggregationPosition" | "aggregationFunctions" | "aggregationRowsScope" | "disableAggregation" | "rowGroupingColumnMode" | "dataSource">) => void;
@@ -1,103 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import { gridColumnLookupSelector, useGridEvent, useGridApiMethod } from '@mui/x-data-grid-pro';
4
- import { useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
5
- import { gridAggregationModelSelector } from "./gridAggregationSelectors.js";
6
- import { getAggregationRules, mergeStateWithAggregationModel, areAggregationRulesEqual } from "./gridAggregationUtils.js";
7
- import { createAggregationLookup } from "./createAggregationLookup.js";
8
- export const aggregationStateInitializer = (state, props, apiRef) => {
9
- apiRef.current.caches.aggregation = {
10
- rulesOnLastColumnHydration: {},
11
- rulesOnLastRowHydration: {}
12
- };
13
- return _extends({}, state, {
14
- aggregation: {
15
- model: props.aggregationModel ?? props.initialState?.aggregation?.model ?? {}
16
- }
17
- });
18
- };
19
- export const useGridAggregation = (apiRef, props) => {
20
- apiRef.current.registerControlState({
21
- stateId: 'aggregation',
22
- propModel: props.aggregationModel,
23
- propOnChange: props.onAggregationModelChange,
24
- stateSelector: gridAggregationModelSelector,
25
- changeEvent: 'aggregationModelChange'
26
- });
27
-
28
- /**
29
- * API METHODS
30
- */
31
- const setAggregationModel = React.useCallback(model => {
32
- const currentModel = gridAggregationModelSelector(apiRef);
33
- if (currentModel !== model) {
34
- apiRef.current.setState(mergeStateWithAggregationModel(model));
35
- }
36
- }, [apiRef]);
37
- const applyAggregation = React.useCallback(() => {
38
- const aggregationLookup = createAggregationLookup({
39
- apiRef,
40
- getAggregationPosition: props.getAggregationPosition,
41
- aggregationFunctions: props.aggregationFunctions,
42
- aggregationRowsScope: props.aggregationRowsScope,
43
- isDataSource: !!props.dataSource
44
- });
45
- apiRef.current.setState(state => _extends({}, state, {
46
- aggregation: _extends({}, state.aggregation, {
47
- lookup: aggregationLookup
48
- })
49
- }));
50
- }, [apiRef, props.getAggregationPosition, props.aggregationFunctions, props.aggregationRowsScope, props.dataSource]);
51
- const aggregationApi = {
52
- setAggregationModel
53
- };
54
- const aggregationPrivateApi = {
55
- applyAggregation
56
- };
57
- useGridApiMethod(apiRef, aggregationApi, 'public');
58
- useGridApiMethod(apiRef, aggregationPrivateApi, 'private');
59
- const addGetRowsParams = React.useCallback(params => {
60
- return _extends({}, params, {
61
- aggregationModel: gridAggregationModelSelector(apiRef)
62
- });
63
- }, [apiRef]);
64
- useGridRegisterPipeProcessor(apiRef, 'getRowsParams', addGetRowsParams);
65
-
66
- /**
67
- * EVENTS
68
- */
69
- const checkAggregationRulesDiff = React.useCallback(() => {
70
- const {
71
- rulesOnLastRowHydration,
72
- rulesOnLastColumnHydration
73
- } = apiRef.current.caches.aggregation;
74
- const aggregationRules = props.disableAggregation ? {} : getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
75
-
76
- // Re-apply the row hydration to add / remove the aggregation footers
77
- if (!areAggregationRulesEqual(rulesOnLastRowHydration, aggregationRules)) {
78
- if (props.dataSource) {
79
- apiRef.current.dataSource.fetchRows();
80
- } else {
81
- apiRef.current.requestPipeProcessorsApplication('hydrateRows');
82
- applyAggregation();
83
- }
84
- }
85
-
86
- // Re-apply the column hydration to wrap / unwrap the aggregated columns
87
- if (!areAggregationRulesEqual(rulesOnLastColumnHydration, aggregationRules)) {
88
- apiRef.current.requestPipeProcessorsApplication('hydrateColumns');
89
- }
90
- }, [apiRef, applyAggregation, props.aggregationFunctions, props.disableAggregation, props.dataSource]);
91
- useGridEvent(apiRef, 'aggregationModelChange', checkAggregationRulesDiff);
92
- useGridEvent(apiRef, 'columnsChange', checkAggregationRulesDiff);
93
- useGridEvent(apiRef, 'filteredRowsSet', applyAggregation);
94
-
95
- /**
96
- * EFFECTS
97
- */
98
- React.useEffect(() => {
99
- if (props.aggregationModel !== undefined) {
100
- apiRef.current.setAggregationModel(props.aggregationModel);
101
- }
102
- }, [apiRef, props.aggregationModel]);
103
- };
@@ -1,4 +0,0 @@
1
- import { RefObject } from '@mui/x-internals/types';
2
- import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
3
- import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
4
- export declare const useGridAggregationPreProcessors: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "aggregationFunctions" | "disableAggregation" | "getAggregationPosition" | "slotProps" | "slots" | "dataSource">) => void;
@@ -1,96 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import { gridColumnLookupSelector } from '@mui/x-data-grid-pro';
4
- import { useGridRegisterPipeProcessor } from '@mui/x-data-grid-pro/internals';
5
- import { getAvailableAggregationFunctions, addFooterRows, getAggregationRules, mergeStateWithAggregationModel } from "./gridAggregationUtils.js";
6
- import { wrapColumnWithAggregationValue, unwrapColumnFromAggregation } from "./wrapColumnWithAggregation.js";
7
- import { gridAggregationModelSelector } from "./gridAggregationSelectors.js";
8
- export const useGridAggregationPreProcessors = (apiRef, props) => {
9
- // apiRef.current.caches.aggregation.rulesOnLastColumnHydration is not used because by the time
10
- // that the pre-processor is called it will already have been updated with the current rules.
11
- const rulesOnLastColumnHydration = React.useRef({});
12
- const updateAggregatedColumns = React.useCallback(columnsState => {
13
- const aggregationRules = props.disableAggregation ? {} : getAggregationRules(columnsState.lookup, gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
14
- columnsState.orderedFields.forEach(field => {
15
- const shouldHaveAggregationValue = !!aggregationRules[field];
16
- const haveAggregationColumnValue = !!rulesOnLastColumnHydration.current[field];
17
- let column = columnsState.lookup[field];
18
- if (haveAggregationColumnValue) {
19
- column = unwrapColumnFromAggregation({
20
- column
21
- });
22
- }
23
- if (shouldHaveAggregationValue) {
24
- column = wrapColumnWithAggregationValue({
25
- column,
26
- aggregationRule: aggregationRules[field],
27
- apiRef
28
- });
29
- }
30
- columnsState.lookup[field] = column;
31
- });
32
- rulesOnLastColumnHydration.current = aggregationRules;
33
- apiRef.current.caches.aggregation.rulesOnLastColumnHydration = aggregationRules;
34
- return columnsState;
35
- }, [apiRef, props.aggregationFunctions, props.disableAggregation, props.dataSource]);
36
- const addGroupFooterRows = React.useCallback(value => {
37
- const aggregationRules = props.disableAggregation ? {} : getAggregationRules(gridColumnLookupSelector(apiRef), gridAggregationModelSelector(apiRef), props.aggregationFunctions, !!props.dataSource);
38
- const hasAggregationRule = Object.keys(aggregationRules).length > 0;
39
-
40
- // If we did not have any aggregation footer before, and we still don't have any,
41
- // Then we can skip this step
42
- if (Object.keys(apiRef.current.caches.aggregation.rulesOnLastRowHydration).length === 0 && !hasAggregationRule) {
43
- return value;
44
- }
45
- apiRef.current.caches.aggregation.rulesOnLastRowHydration = aggregationRules;
46
- return addFooterRows({
47
- apiRef,
48
- groupingParams: value,
49
- getAggregationPosition: props.getAggregationPosition,
50
- hasAggregationRule
51
- });
52
- }, [apiRef, props.disableAggregation, props.getAggregationPosition, props.aggregationFunctions, props.dataSource]);
53
- const addColumnMenuButtons = React.useCallback((columnMenuItems, colDef) => {
54
- if (props.disableAggregation || !colDef.aggregable) {
55
- return columnMenuItems;
56
- }
57
- const availableAggregationFunctions = getAvailableAggregationFunctions({
58
- aggregationFunctions: props.aggregationFunctions,
59
- colDef,
60
- isDataSource: !!props.dataSource
61
- });
62
- if (availableAggregationFunctions.length === 0) {
63
- return columnMenuItems;
64
- }
65
- return [...columnMenuItems, 'columnMenuAggregationItem'];
66
- }, [props.aggregationFunctions, props.disableAggregation, props.dataSource]);
67
- const stateExportPreProcessing = React.useCallback(prevState => {
68
- if (props.disableAggregation) {
69
- return prevState;
70
- }
71
- const aggregationModelToExport = gridAggregationModelSelector(apiRef);
72
- if (Object.values(aggregationModelToExport).length === 0) {
73
- return prevState;
74
- }
75
- return _extends({}, prevState, {
76
- aggregation: {
77
- model: aggregationModelToExport
78
- }
79
- });
80
- }, [apiRef, props.disableAggregation]);
81
- const stateRestorePreProcessing = React.useCallback((params, context) => {
82
- if (props.disableAggregation) {
83
- return params;
84
- }
85
- const aggregationModel = context.stateToRestore.aggregation?.model;
86
- if (aggregationModel != null) {
87
- apiRef.current.setState(mergeStateWithAggregationModel(aggregationModel));
88
- }
89
- return params;
90
- }, [apiRef, props.disableAggregation]);
91
- useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateAggregatedColumns);
92
- useGridRegisterPipeProcessor(apiRef, 'hydrateRows', addGroupFooterRows);
93
- useGridRegisterPipeProcessor(apiRef, 'columnMenu', addColumnMenuButtons);
94
- useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);
95
- useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);
96
- };