@mui/x-data-grid-premium 8.0.0-beta.3 → 8.0.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 (486) hide show
  1. package/CHANGELOG.md +282 -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/GridGroupingCriteriaCell.js +8 -3
  11. package/components/GridPremiumColumnMenu.d.ts +5 -0
  12. package/components/GridPremiumColumnMenu.js +6 -1
  13. package/components/GridPremiumToolbar.d.ts +1 -1
  14. package/components/GridPremiumToolbar.js +29 -1
  15. package/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
  16. package/components/aiAssistantPanel/AiAssistantPanelTrigger.js +107 -0
  17. package/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
  18. package/components/aiAssistantPanel/GridAiAssistantPanel.js +195 -0
  19. package/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
  20. package/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +71 -0
  21. package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
  22. package/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +92 -0
  23. package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
  24. package/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +86 -0
  25. package/components/aiAssistantPanel/index.d.ts +2 -0
  26. package/components/aiAssistantPanel/index.js +27 -0
  27. package/components/collapsible/Collapsible.d.ts +4 -0
  28. package/components/collapsible/Collapsible.js +70 -0
  29. package/components/collapsible/CollapsibleContext.d.ts +8 -0
  30. package/components/collapsible/CollapsibleContext.js +17 -0
  31. package/components/collapsible/CollapsiblePanel.d.ts +4 -0
  32. package/components/collapsible/CollapsiblePanel.js +64 -0
  33. package/components/collapsible/CollapsibleTrigger.d.ts +4 -0
  34. package/components/collapsible/CollapsibleTrigger.js +106 -0
  35. package/components/collapsible/index.d.ts +4 -0
  36. package/components/collapsible/index.js +49 -0
  37. package/components/index.d.ts +5 -2
  38. package/components/index.js +40 -4
  39. package/components/pivotPanel/GridPivotPanel.d.ts +3 -0
  40. package/components/pivotPanel/GridPivotPanel.js +22 -0
  41. package/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
  42. package/components/pivotPanel/GridPivotPanelBody.js +368 -0
  43. package/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
  44. package/components/pivotPanel/GridPivotPanelField.js +338 -0
  45. package/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
  46. package/components/pivotPanel/GridPivotPanelFieldMenu.js +177 -0
  47. package/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
  48. package/components/pivotPanel/GridPivotPanelHeader.js +101 -0
  49. package/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
  50. package/components/pivotPanel/GridPivotPanelSearch.js +77 -0
  51. package/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
  52. package/components/pivotPanel/PivotPanelTrigger.js +93 -0
  53. package/components/pivotPanel/index.d.ts +2 -0
  54. package/components/pivotPanel/index.js +27 -0
  55. package/components/prompt/GridPrompt.d.ts +7 -0
  56. package/components/prompt/GridPrompt.js +364 -0
  57. package/components/prompt/index.d.ts +1 -0
  58. package/components/prompt/index.js +12 -0
  59. package/components/promptField/GridPromptField.d.ts +4 -0
  60. package/components/promptField/GridPromptField.js +86 -0
  61. package/components/promptField/PromptField.d.ts +66 -0
  62. package/components/promptField/PromptField.js +95 -0
  63. package/components/promptField/PromptFieldContext.d.ts +16 -0
  64. package/components/promptField/PromptFieldContext.js +17 -0
  65. package/components/promptField/PromptFieldControl.d.ts +27 -0
  66. package/components/promptField/PromptFieldControl.js +102 -0
  67. package/components/promptField/PromptFieldRecord.d.ts +27 -0
  68. package/components/promptField/PromptFieldRecord.js +158 -0
  69. package/components/promptField/PromptFieldSend.d.ts +27 -0
  70. package/components/promptField/PromptFieldSend.js +83 -0
  71. package/components/promptField/index.d.ts +4 -0
  72. package/components/promptField/index.js +49 -0
  73. package/components/resizablePanel/ResizablePanel.d.ts +10 -0
  74. package/components/resizablePanel/ResizablePanel.js +59 -0
  75. package/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
  76. package/components/resizablePanel/ResizablePanelContext.js +17 -0
  77. package/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
  78. package/components/resizablePanel/ResizablePanelHandle.js +115 -0
  79. package/components/resizablePanel/index.d.ts +3 -0
  80. package/components/resizablePanel/index.js +38 -0
  81. package/components/sidebar/Sidebar.d.ts +4 -0
  82. package/components/sidebar/Sidebar.js +54 -0
  83. package/components/sidebar/SidebarHeader.d.ts +4 -0
  84. package/components/sidebar/SidebarHeader.js +51 -0
  85. package/components/sidebar/index.d.ts +2 -0
  86. package/components/sidebar/index.js +27 -0
  87. package/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
  88. package/esm/DataGridPremium/DataGridPremium.js +167 -11
  89. package/esm/DataGridPremium/useDataGridPremiumComponent.d.ts +2 -2
  90. package/esm/DataGridPremium/useDataGridPremiumComponent.js +20 -3
  91. package/esm/DataGridPremium/useDataGridPremiumProps.js +5 -1
  92. package/esm/components/GridColumnMenuPivotItem.d.ts +3 -0
  93. package/esm/components/GridColumnMenuPivotItem.js +26 -0
  94. package/esm/components/GridEmptyPivotOverlay.d.ts +6 -0
  95. package/esm/components/GridEmptyPivotOverlay.js +22 -0
  96. package/esm/components/GridGroupingCriteriaCell.js +9 -4
  97. package/esm/components/GridPremiumColumnMenu.d.ts +5 -0
  98. package/esm/components/GridPremiumColumnMenu.js +6 -1
  99. package/esm/components/GridPremiumToolbar.d.ts +1 -1
  100. package/esm/components/GridPremiumToolbar.js +30 -2
  101. package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.d.ts +33 -0
  102. package/esm/components/aiAssistantPanel/AiAssistantPanelTrigger.js +100 -0
  103. package/esm/components/aiAssistantPanel/GridAiAssistantPanel.d.ts +3 -0
  104. package/esm/components/aiAssistantPanel/GridAiAssistantPanel.js +188 -0
  105. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.d.ts +7 -0
  106. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversation.js +64 -0
  107. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.d.ts +3 -0
  108. package/esm/components/aiAssistantPanel/GridAiAssistantPanelConversationsMenu.js +85 -0
  109. package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.d.ts +7 -0
  110. package/esm/components/aiAssistantPanel/GridAiAssistantPanelSuggestions.js +80 -0
  111. package/esm/components/aiAssistantPanel/index.d.ts +2 -0
  112. package/esm/components/aiAssistantPanel/index.js +2 -0
  113. package/esm/components/collapsible/Collapsible.d.ts +4 -0
  114. package/esm/components/collapsible/Collapsible.js +63 -0
  115. package/esm/components/collapsible/CollapsibleContext.d.ts +8 -0
  116. package/esm/components/collapsible/CollapsibleContext.js +9 -0
  117. package/esm/components/collapsible/CollapsiblePanel.d.ts +4 -0
  118. package/esm/components/collapsible/CollapsiblePanel.js +57 -0
  119. package/esm/components/collapsible/CollapsibleTrigger.d.ts +4 -0
  120. package/esm/components/collapsible/CollapsibleTrigger.js +99 -0
  121. package/esm/components/collapsible/index.d.ts +4 -0
  122. package/esm/components/collapsible/index.js +4 -0
  123. package/esm/components/index.d.ts +5 -2
  124. package/esm/components/index.js +5 -2
  125. package/esm/components/pivotPanel/GridPivotPanel.d.ts +3 -0
  126. package/esm/components/pivotPanel/GridPivotPanel.js +16 -0
  127. package/esm/components/pivotPanel/GridPivotPanelBody.d.ts +11 -0
  128. package/esm/components/pivotPanel/GridPivotPanelBody.js +361 -0
  129. package/esm/components/pivotPanel/GridPivotPanelField.d.ts +22 -0
  130. package/esm/components/pivotPanel/GridPivotPanelField.js +331 -0
  131. package/esm/components/pivotPanel/GridPivotPanelFieldMenu.d.ts +8 -0
  132. package/esm/components/pivotPanel/GridPivotPanelFieldMenu.js +170 -0
  133. package/esm/components/pivotPanel/GridPivotPanelHeader.d.ts +7 -0
  134. package/esm/components/pivotPanel/GridPivotPanelHeader.js +94 -0
  135. package/esm/components/pivotPanel/GridPivotPanelSearch.d.ts +7 -0
  136. package/esm/components/pivotPanel/GridPivotPanelSearch.js +70 -0
  137. package/esm/components/pivotPanel/PivotPanelTrigger.d.ts +37 -0
  138. package/esm/components/pivotPanel/PivotPanelTrigger.js +86 -0
  139. package/esm/components/pivotPanel/index.d.ts +2 -0
  140. package/esm/components/pivotPanel/index.js +2 -0
  141. package/esm/components/prompt/GridPrompt.d.ts +7 -0
  142. package/esm/components/prompt/GridPrompt.js +357 -0
  143. package/esm/components/prompt/index.d.ts +1 -0
  144. package/esm/components/prompt/index.js +1 -0
  145. package/esm/components/promptField/GridPromptField.d.ts +4 -0
  146. package/esm/components/promptField/GridPromptField.js +79 -0
  147. package/esm/components/promptField/PromptField.d.ts +66 -0
  148. package/esm/components/promptField/PromptField.js +88 -0
  149. package/esm/components/promptField/PromptFieldContext.d.ts +16 -0
  150. package/esm/components/promptField/PromptFieldContext.js +9 -0
  151. package/esm/components/promptField/PromptFieldControl.d.ts +27 -0
  152. package/esm/components/promptField/PromptFieldControl.js +95 -0
  153. package/esm/components/promptField/PromptFieldRecord.d.ts +27 -0
  154. package/esm/components/promptField/PromptFieldRecord.js +151 -0
  155. package/esm/components/promptField/PromptFieldSend.d.ts +27 -0
  156. package/{modern/components/export/ExportExcel.js → esm/components/promptField/PromptFieldSend.js} +30 -38
  157. package/esm/components/promptField/index.d.ts +4 -0
  158. package/esm/components/promptField/index.js +4 -0
  159. package/esm/components/resizablePanel/ResizablePanel.d.ts +10 -0
  160. package/esm/components/resizablePanel/ResizablePanel.js +52 -0
  161. package/esm/components/resizablePanel/ResizablePanelContext.d.ts +7 -0
  162. package/esm/components/resizablePanel/ResizablePanelContext.js +9 -0
  163. package/esm/components/resizablePanel/ResizablePanelHandle.d.ts +4 -0
  164. package/esm/components/resizablePanel/ResizablePanelHandle.js +108 -0
  165. package/esm/components/resizablePanel/index.d.ts +3 -0
  166. package/esm/components/resizablePanel/index.js +3 -0
  167. package/esm/components/sidebar/Sidebar.d.ts +4 -0
  168. package/esm/components/sidebar/Sidebar.js +47 -0
  169. package/esm/components/sidebar/SidebarHeader.d.ts +4 -0
  170. package/esm/components/sidebar/SidebarHeader.js +44 -0
  171. package/esm/components/sidebar/index.d.ts +2 -0
  172. package/esm/components/sidebar/index.js +2 -0
  173. package/esm/constants/dataGridPremiumDefaultSlotsComponents.js +3 -0
  174. package/esm/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
  175. package/esm/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
  176. package/esm/hooks/features/aggregation/gridAggregationSelectors.js +28 -1
  177. package/esm/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
  178. package/esm/hooks/features/aggregation/index.d.ts +1 -1
  179. package/esm/hooks/features/aggregation/index.js +1 -1
  180. package/esm/hooks/features/aggregation/useGridAggregation.js +3 -7
  181. package/esm/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
  182. package/esm/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
  183. package/esm/hooks/features/aggregation/wrapColumnWithAggregation.js +23 -10
  184. package/esm/hooks/features/aiAssistant/api.d.ts +12 -0
  185. package/esm/hooks/features/aiAssistant/api.js +31 -0
  186. package/esm/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
  187. package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
  188. package/esm/hooks/features/aiAssistant/gridAiAssistantSelectors.js +5 -0
  189. package/esm/hooks/features/aiAssistant/index.d.ts +2 -0
  190. package/esm/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
  191. package/esm/hooks/features/aiAssistant/useGridAiAssistant.js +293 -0
  192. package/esm/hooks/features/dataSource/useGridDataSourcePremium.js +4 -1
  193. package/esm/hooks/features/index.d.ts +1 -1
  194. package/esm/hooks/features/index.js +1 -1
  195. package/esm/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
  196. package/esm/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
  197. package/esm/hooks/features/pivoting/gridPivotingSelectors.js +5 -0
  198. package/esm/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
  199. package/esm/hooks/features/pivoting/useGridPivoting.js +339 -0
  200. package/esm/hooks/features/pivoting/utils.d.ts +21 -0
  201. package/esm/hooks/features/pivoting/utils.js +259 -0
  202. package/esm/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
  203. package/esm/hooks/features/rowGrouping/useGridRowGrouping.js +0 -1
  204. package/esm/hooks/utils/useResize.d.ts +9 -0
  205. package/esm/hooks/utils/useResize.js +52 -0
  206. package/esm/index.d.ts +4 -1
  207. package/esm/index.js +4 -2
  208. package/esm/material/icons.d.ts +15 -15
  209. package/esm/material/icons.js +32 -5
  210. package/esm/material/index.d.ts +31 -5
  211. package/esm/material/index.js +31 -3
  212. package/esm/models/dataGridPremiumProps.d.ts +96 -2
  213. package/esm/models/gridApiPremium.d.ts +4 -2
  214. package/esm/models/gridPremiumIconSlotsComponent.d.ts +141 -8
  215. package/esm/models/gridPremiumSlotsComponent.d.ts +13 -1
  216. package/esm/models/gridStatePremium.d.ts +6 -0
  217. package/esm/package.json +1 -1
  218. package/esm/setupExcelExportWebWorker/index.d.ts +1 -0
  219. package/esm/setupExcelExportWebWorker/index.js +1 -0
  220. package/esm/typeOverloads/modules.d.ts +32 -1
  221. package/esm/utils/speechRecognition.d.ts +2 -0
  222. package/esm/utils/speechRecognition.js +2 -0
  223. package/hooks/features/aggregation/gridAggregationFunctions.js +13 -0
  224. package/hooks/features/aggregation/gridAggregationSelectors.d.ts +10 -1
  225. package/hooks/features/aggregation/gridAggregationSelectors.js +29 -2
  226. package/hooks/features/aggregation/gridAggregationUtils.d.ts +1 -1
  227. package/hooks/features/aggregation/index.d.ts +1 -1
  228. package/hooks/features/aggregation/index.js +21 -11
  229. package/hooks/features/aggregation/useGridAggregation.js +3 -7
  230. package/hooks/features/aggregation/useGridAggregationPreProcessors.js +2 -8
  231. package/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +5 -25
  232. package/hooks/features/aggregation/wrapColumnWithAggregation.js +24 -11
  233. package/hooks/features/aiAssistant/api.d.ts +12 -0
  234. package/hooks/features/aiAssistant/api.js +37 -0
  235. package/hooks/features/aiAssistant/gridAiAssistantInterfaces.d.ts +82 -0
  236. package/hooks/features/aiAssistant/gridAiAssistantSelectors.d.ts +5 -0
  237. package/hooks/features/aiAssistant/gridAiAssistantSelectors.js +11 -0
  238. package/hooks/features/aiAssistant/index.d.ts +2 -0
  239. package/hooks/features/aiAssistant/useGridAiAssistant.d.ts +6 -0
  240. package/hooks/features/aiAssistant/useGridAiAssistant.js +303 -0
  241. package/hooks/features/dataSource/useGridDataSourcePremium.js +3 -0
  242. package/hooks/features/index.d.ts +1 -1
  243. package/hooks/features/index.js +4 -4
  244. package/hooks/features/pivoting/gridPivotingInterfaces.d.ts +69 -0
  245. package/hooks/features/pivoting/gridPivotingInterfaces.js +5 -0
  246. package/hooks/features/pivoting/gridPivotingSelectors.d.ts +4 -0
  247. package/hooks/features/pivoting/gridPivotingSelectors.js +30 -0
  248. package/hooks/features/pivoting/useGridPivoting.d.ts +7 -0
  249. package/hooks/features/pivoting/useGridPivoting.js +349 -0
  250. package/hooks/features/pivoting/utils.d.ts +21 -0
  251. package/hooks/features/pivoting/utils.js +270 -0
  252. package/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +1 -4
  253. package/hooks/features/rowGrouping/useGridRowGrouping.js +0 -1
  254. package/hooks/utils/useResize.d.ts +9 -0
  255. package/hooks/utils/useResize.js +60 -0
  256. package/index.d.ts +4 -1
  257. package/index.js +19 -3
  258. package/material/icons.d.ts +15 -15
  259. package/material/icons.js +36 -9
  260. package/material/index.d.ts +31 -5
  261. package/material/index.js +30 -2
  262. package/models/dataGridPremiumProps.d.ts +96 -2
  263. package/models/gridApiPremium.d.ts +4 -2
  264. package/models/gridPremiumIconSlotsComponent.d.ts +141 -8
  265. package/models/gridPremiumSlotsComponent.d.ts +13 -1
  266. package/models/gridStatePremium.d.ts +6 -0
  267. package/package.json +9 -15
  268. package/setupExcelExportWebWorker/index.d.ts +1 -0
  269. package/{setupExcelExportWebWorker.js → setupExcelExportWebWorker/index.js} +1 -1
  270. package/typeOverloads/modules.d.ts +32 -1
  271. package/utils/speechRecognition.d.ts +2 -0
  272. package/utils/speechRecognition.js +8 -0
  273. package/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
  274. package/components/promptControl/GridToolbarPromptControl.js +0 -222
  275. package/components/promptControl/RecordButton.d.ts +0 -16
  276. package/components/promptControl/RecordButton.js +0 -119
  277. package/components/promptControl/index.d.ts +0 -1
  278. package/components/promptControl/index.js +0 -12
  279. package/esm/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
  280. package/esm/components/promptControl/GridToolbarPromptControl.js +0 -215
  281. package/esm/components/promptControl/RecordButton.d.ts +0 -16
  282. package/esm/components/promptControl/RecordButton.js +0 -111
  283. package/esm/components/promptControl/index.d.ts +0 -1
  284. package/esm/components/promptControl/index.js +0 -1
  285. package/esm/hooks/features/promptControl/api.d.ts +0 -2
  286. package/esm/hooks/features/promptControl/api.js +0 -22
  287. package/esm/hooks/features/promptControl/index.d.ts +0 -2
  288. package/esm/hooks/features/promptControl/types.d.ts +0 -25
  289. package/esm/setupExcelExportWebWorker.d.ts +0 -1
  290. package/esm/setupExcelExportWebWorker.js +0 -1
  291. package/esm/utils/releaseInfo.d.ts +0 -1
  292. package/esm/utils/releaseInfo.js +0 -13
  293. package/hooks/features/promptControl/api.d.ts +0 -2
  294. package/hooks/features/promptControl/api.js +0 -28
  295. package/hooks/features/promptControl/index.d.ts +0 -2
  296. package/hooks/features/promptControl/types.d.ts +0 -25
  297. package/modern/DataGridPremium/DataGrid.d.ts +0 -8
  298. package/modern/DataGridPremium/DataGrid.js +0 -19
  299. package/modern/DataGridPremium/DataGridPremium.d.ts +0 -16
  300. package/modern/DataGridPremium/DataGridPremium.js +0 -1127
  301. package/modern/DataGridPremium/index.d.ts +0 -3
  302. package/modern/DataGridPremium/index.js +0 -3
  303. package/modern/DataGridPremium/useDataGridPremiumComponent.d.ts +0 -4
  304. package/modern/DataGridPremium/useDataGridPremiumComponent.js +0 -108
  305. package/modern/DataGridPremium/useDataGridPremiumProps.d.ts +0 -6
  306. package/modern/DataGridPremium/useDataGridPremiumProps.js +0 -54
  307. package/modern/components/GridAggregationHeader.d.ts +0 -7
  308. package/modern/components/GridAggregationHeader.js +0 -89
  309. package/modern/components/GridAggregationRowOverlay.d.ts +0 -3
  310. package/modern/components/GridAggregationRowOverlay.js +0 -37
  311. package/modern/components/GridBottomContainer.d.ts +0 -3
  312. package/modern/components/GridBottomContainer.js +0 -43
  313. package/modern/components/GridColumnMenuAggregationItem.d.ts +0 -7
  314. package/modern/components/GridColumnMenuAggregationItem.js +0 -124
  315. package/modern/components/GridColumnMenuRowGroupItem.d.ts +0 -3
  316. package/modern/components/GridColumnMenuRowGroupItem.js +0 -42
  317. package/modern/components/GridColumnMenuRowUngroupItem.d.ts +0 -3
  318. package/modern/components/GridColumnMenuRowUngroupItem.js +0 -44
  319. package/modern/components/GridDataSourceGroupingCriteriaCell.d.ts +0 -7
  320. package/modern/components/GridDataSourceGroupingCriteriaCell.js +0 -121
  321. package/modern/components/GridExcelExportMenuItem.d.ts +0 -9
  322. package/modern/components/GridExcelExportMenuItem.js +0 -48
  323. package/modern/components/GridFooterCell.d.ts +0 -9
  324. package/modern/components/GridFooterCell.js +0 -43
  325. package/modern/components/GridGroupingColumnFooterCell.d.ts +0 -4
  326. package/modern/components/GridGroupingColumnFooterCell.js +0 -23
  327. package/modern/components/GridGroupingColumnLeafCell.d.ts +0 -4
  328. package/modern/components/GridGroupingColumnLeafCell.js +0 -17
  329. package/modern/components/GridGroupingCriteriaCell.d.ts +0 -7
  330. package/modern/components/GridGroupingCriteriaCell.js +0 -87
  331. package/modern/components/GridPremiumColumnMenu.d.ts +0 -33
  332. package/modern/components/GridPremiumColumnMenu.js +0 -37
  333. package/modern/components/GridPremiumToolbar.d.ts +0 -3
  334. package/modern/components/GridPremiumToolbar.js +0 -23
  335. package/modern/components/export/ExportExcel.d.ts +0 -29
  336. package/modern/components/export/index.d.ts +0 -1
  337. package/modern/components/export/index.js +0 -1
  338. package/modern/components/index.d.ts +0 -6
  339. package/modern/components/index.js +0 -6
  340. package/modern/components/promptControl/GridToolbarPromptControl.d.ts +0 -26
  341. package/modern/components/promptControl/GridToolbarPromptControl.js +0 -215
  342. package/modern/components/promptControl/RecordButton.d.ts +0 -16
  343. package/modern/components/promptControl/RecordButton.js +0 -111
  344. package/modern/components/promptControl/index.d.ts +0 -1
  345. package/modern/components/promptControl/index.js +0 -1
  346. package/modern/components/reexports.d.ts +0 -1
  347. package/modern/components/reexports.js +0 -1
  348. package/modern/constants/dataGridPremiumDefaultSlotsComponents.d.ts +0 -2
  349. package/modern/constants/dataGridPremiumDefaultSlotsComponents.js +0 -11
  350. package/modern/hooks/features/aggregation/createAggregationLookup.d.ts +0 -17
  351. package/modern/hooks/features/aggregation/createAggregationLookup.js +0 -111
  352. package/modern/hooks/features/aggregation/gridAggregationFunctions.d.ts +0 -8
  353. package/modern/hooks/features/aggregation/gridAggregationFunctions.js +0 -93
  354. package/modern/hooks/features/aggregation/gridAggregationInterfaces.d.ts +0 -129
  355. package/modern/hooks/features/aggregation/gridAggregationSelectors.d.ts +0 -13
  356. package/modern/hooks/features/aggregation/gridAggregationSelectors.js +0 -15
  357. package/modern/hooks/features/aggregation/gridAggregationUtils.d.ts +0 -62
  358. package/modern/hooks/features/aggregation/gridAggregationUtils.js +0 -180
  359. package/modern/hooks/features/aggregation/index.d.ts +0 -4
  360. package/modern/hooks/features/aggregation/index.js +0 -3
  361. package/modern/hooks/features/aggregation/useGridAggregation.d.ts +0 -6
  362. package/modern/hooks/features/aggregation/useGridAggregation.js +0 -103
  363. package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.d.ts +0 -4
  364. package/modern/hooks/features/aggregation/useGridAggregationPreProcessors.js +0 -96
  365. package/modern/hooks/features/aggregation/wrapColumnWithAggregation.d.ts +0 -81
  366. package/modern/hooks/features/aggregation/wrapColumnWithAggregation.js +0 -215
  367. package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.d.ts +0 -40
  368. package/modern/hooks/features/cellSelection/gridCellSelectionInterfaces.js +0 -1
  369. package/modern/hooks/features/cellSelection/gridCellSelectionSelector.d.ts +0 -2
  370. package/modern/hooks/features/cellSelection/gridCellSelectionSelector.js +0 -2
  371. package/modern/hooks/features/cellSelection/index.d.ts +0 -1
  372. package/modern/hooks/features/cellSelection/index.js +0 -1
  373. package/modern/hooks/features/cellSelection/useGridCellSelection.d.ts +0 -6
  374. package/modern/hooks/features/cellSelection/useGridCellSelection.js +0 -486
  375. package/modern/hooks/features/clipboard/useGridClipboardImport.d.ts +0 -4
  376. package/modern/hooks/features/clipboard/useGridClipboardImport.js +0 -335
  377. package/modern/hooks/features/dataSource/models.d.ts +0 -54
  378. package/modern/hooks/features/dataSource/models.js +0 -1
  379. package/modern/hooks/features/dataSource/useGridDataSourcePremium.d.ts +0 -4
  380. package/modern/hooks/features/dataSource/useGridDataSourcePremium.js +0 -59
  381. package/modern/hooks/features/export/gridExcelExportInterface.d.ts +0 -71
  382. package/modern/hooks/features/export/gridExcelExportInterface.js +0 -1
  383. package/modern/hooks/features/export/index.d.ts +0 -2
  384. package/modern/hooks/features/export/index.js +0 -2
  385. package/modern/hooks/features/export/serializer/excelSerializer.d.ts +0 -40
  386. package/modern/hooks/features/export/serializer/excelSerializer.js +0 -269
  387. package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.d.ts +0 -2
  388. package/modern/hooks/features/export/serializer/setupExcelExportWebWorker.js +0 -53
  389. package/modern/hooks/features/export/serializer/utils.d.ts +0 -36
  390. package/modern/hooks/features/export/serializer/utils.js +0 -93
  391. package/modern/hooks/features/export/useGridExcelExport.d.ts +0 -11
  392. package/modern/hooks/features/export/useGridExcelExport.js +0 -139
  393. package/modern/hooks/features/index.d.ts +0 -5
  394. package/modern/hooks/features/index.js +0 -6
  395. package/modern/hooks/features/promptControl/api.d.ts +0 -2
  396. package/modern/hooks/features/promptControl/api.js +0 -22
  397. package/modern/hooks/features/promptControl/index.d.ts +0 -2
  398. package/modern/hooks/features/promptControl/index.js +0 -1
  399. package/modern/hooks/features/promptControl/types.d.ts +0 -25
  400. package/modern/hooks/features/promptControl/types.js +0 -1
  401. package/modern/hooks/features/rowGrouping/createGroupingColDef.d.ts +0 -57
  402. package/modern/hooks/features/rowGrouping/createGroupingColDef.js +0 -272
  403. package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +0 -44
  404. package/modern/hooks/features/rowGrouping/gridRowGroupingInterfaces.js +0 -1
  405. package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.d.ts +0 -3
  406. package/modern/hooks/features/rowGrouping/gridRowGroupingSelector.js +0 -5
  407. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.d.ts +0 -54
  408. package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +0 -173
  409. package/modern/hooks/features/rowGrouping/index.d.ts +0 -3
  410. package/modern/hooks/features/rowGrouping/index.js +0 -3
  411. package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.d.ts +0 -4
  412. package/modern/hooks/features/rowGrouping/useGridDataSourceRowGroupingPreProcessors.js +0 -73
  413. package/modern/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -11
  414. package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +0 -182
  415. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.d.ts +0 -4
  416. package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +0 -157
  417. package/modern/hooks/features/rows/index.d.ts +0 -1
  418. package/modern/hooks/features/rows/index.js +0 -1
  419. package/modern/hooks/features/rows/useGridRowAriaAttributes.d.ts +0 -1
  420. package/modern/hooks/features/rows/useGridRowAriaAttributes.js +0 -8
  421. package/modern/hooks/index.d.ts +0 -2
  422. package/modern/hooks/index.js +0 -3
  423. package/modern/hooks/utils/index.d.ts +0 -1
  424. package/modern/hooks/utils/index.js +0 -1
  425. package/modern/hooks/utils/useGridApiContext.d.ts +0 -4
  426. package/modern/hooks/utils/useGridApiContext.js +0 -2
  427. package/modern/hooks/utils/useGridApiRef.d.ts +0 -4
  428. package/modern/hooks/utils/useGridApiRef.js +0 -2
  429. package/modern/hooks/utils/useGridAriaAttributes.d.ts +0 -2
  430. package/modern/hooks/utils/useGridAriaAttributes.js +0 -13
  431. package/modern/hooks/utils/useGridPrivateApiContext.d.ts +0 -2
  432. package/modern/hooks/utils/useGridPrivateApiContext.js +0 -2
  433. package/modern/hooks/utils/useGridRootProps.d.ts +0 -2
  434. package/modern/hooks/utils/useGridRootProps.js +0 -2
  435. package/modern/hooks/utils/useKeepGroupedColumnsHidden.d.ts +0 -12
  436. package/modern/hooks/utils/useKeepGroupedColumnsHidden.js +0 -43
  437. package/modern/index.d.ts +0 -23
  438. package/modern/index.js +0 -26
  439. package/modern/locales.d.ts +0 -1
  440. package/modern/locales.js +0 -1
  441. package/modern/material/icons.d.ts +0 -15
  442. package/modern/material/icons.js +0 -20
  443. package/modern/material/index.d.ts +0 -8
  444. package/modern/material/index.js +0 -11
  445. package/modern/models/dataGridPremiumProps.d.ts +0 -162
  446. package/modern/models/dataGridPremiumProps.js +0 -1
  447. package/modern/models/gridApiPremium.d.ts +0 -14
  448. package/modern/models/gridApiPremium.js +0 -1
  449. package/modern/models/gridGroupingValueGetter.d.ts +0 -4
  450. package/modern/models/gridGroupingValueGetter.js +0 -1
  451. package/modern/models/gridPastedValueParser.d.ts +0 -4
  452. package/modern/models/gridPastedValueParser.js +0 -1
  453. package/modern/models/gridPremiumIconSlotsComponent.d.ts +0 -28
  454. package/modern/models/gridPremiumIconSlotsComponent.js +0 -1
  455. package/modern/models/gridPremiumSlotsComponent.d.ts +0 -7
  456. package/modern/models/gridPremiumSlotsComponent.js +0 -1
  457. package/modern/models/gridStatePremium.d.ts +0 -18
  458. package/modern/models/gridStatePremium.js +0 -1
  459. package/modern/models/index.d.ts +0 -4
  460. package/modern/models/index.js +0 -4
  461. package/modern/package.json +0 -1
  462. package/modern/setupExcelExportWebWorker.d.ts +0 -1
  463. package/modern/setupExcelExportWebWorker.js +0 -1
  464. package/modern/themeAugmentation/index.d.ts +0 -2
  465. package/modern/themeAugmentation/index.js +0 -4
  466. package/modern/themeAugmentation/overrides.d.ts +0 -7
  467. package/modern/themeAugmentation/overrides.js +0 -1
  468. package/modern/themeAugmentation/props.d.ts +0 -15
  469. package/modern/themeAugmentation/props.js +0 -1
  470. package/modern/typeOverloads/index.d.ts +0 -2
  471. package/modern/typeOverloads/index.js +0 -2
  472. package/modern/typeOverloads/modules.d.ts +0 -97
  473. package/modern/typeOverloads/modules.js +0 -1
  474. package/modern/typeOverloads/reexports.d.ts +0 -17
  475. package/modern/typeOverloads/reexports.js +0 -15
  476. package/modern/utils/releaseInfo.d.ts +0 -1
  477. package/modern/utils/releaseInfo.js +0 -13
  478. package/setupExcelExportWebWorker.d.ts +0 -1
  479. package/tsconfig.build.tsbuildinfo +0 -1
  480. package/utils/releaseInfo.d.ts +0 -1
  481. package/utils/releaseInfo.js +0 -20
  482. /package/esm/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
  483. /package/esm/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
  484. /package/{modern/hooks/features/aggregation/gridAggregationInterfaces.js → esm/hooks/features/pivoting/gridPivotingInterfaces.js} +0 -0
  485. /package/hooks/features/{promptControl/types.js → aiAssistant/gridAiAssistantInterfaces.js} +0 -0
  486. /package/hooks/features/{promptControl → aiAssistant}/index.js +0 -0
@@ -1,10 +1,11 @@
1
1
  import { GridExportDisplayOptions, GridValidRowModel } from '@mui/x-data-grid-pro';
2
2
  import type { GridControlledStateEventLookupPro, GridApiCachesPro, GridEventLookupPro } from '@mui/x-data-grid-pro/typeOverloads';
3
3
  import type { GridGroupingValueGetter, GridPastedValueParser } from '../models';
4
- import type { GridRowGroupingModel, GridAggregationModel, GridAggregationCellMeta, GridAggregationHeaderMeta, GridCellSelectionModel } from '../hooks';
4
+ import type { GridRowGroupingModel, GridAggregationModel, GridAggregationCellMeta, GridAggregationHeaderMeta, GridCellSelectionModel, Conversation } from '../hooks';
5
5
  import { GridRowGroupingInternalCache } from "../hooks/features/rowGrouping/gridRowGroupingInterfaces.js";
6
6
  import { GridAggregationInternalCache } from "../hooks/features/aggregation/gridAggregationInterfaces.js";
7
7
  import type { GridExcelExportOptions } from '../hooks/features/export/gridExcelExportInterface';
8
+ import type { GridPivotModel } from '../hooks/features/pivoting/gridPivotingInterfaces';
8
9
  export interface GridControlledStateEventLookupPremium {
9
10
  /**
10
11
  * Fired when the aggregation model changes.
@@ -30,6 +31,30 @@ export interface GridControlledStateEventLookupPremium {
30
31
  excelExportStateChange: {
31
32
  params: 'pending' | 'finished';
32
33
  };
34
+ /**
35
+ * Fired when the pivot model changes.
36
+ */
37
+ pivotModelChange: {
38
+ params: GridPivotModel;
39
+ };
40
+ pivotModeChange: {
41
+ params: boolean;
42
+ };
43
+ pivotPanelOpenChange: {
44
+ params: boolean;
45
+ };
46
+ /**
47
+ * Fired when the AI Assistant conversation state changes.
48
+ */
49
+ aiAssistantConversationsChange: {
50
+ params: Conversation[];
51
+ };
52
+ /**
53
+ * Fired when the AI Assistant active conversation index changes.
54
+ */
55
+ aiAssistantActiveConversationIndexChange: {
56
+ params: number;
57
+ };
33
58
  }
34
59
  interface GridEventLookupPremium extends GridEventLookupPro {
35
60
  /**
@@ -58,6 +83,7 @@ export interface GridColDefPremium<R extends GridValidRowModel = any, V = any, F
58
83
  availableAggregationFunctions?: string[];
59
84
  /**
60
85
  * Function that transforms a complex cell value into a key that be used for grouping the rows.
86
+ * Not supported with the server-side row grouping. Use `dataSource.getGroupKey()` instead.
61
87
  * @returns {GridKeyValue | null | undefined} The cell key.
62
88
  */
63
89
  groupingValueGetter?: GridGroupingValueGetter<R>;
@@ -66,6 +92,11 @@ export interface GridColDefPremium<R extends GridValidRowModel = any, V = any, F
66
92
  * @returns {V} The converted value.
67
93
  */
68
94
  pastedValueParser?: GridPastedValueParser<R, V, F>;
95
+ /**
96
+ * If `false`, the column will not be available for pivoting in the pivot panel.
97
+ * @default true
98
+ */
99
+ pivotable?: boolean;
69
100
  }
70
101
  export interface GridRenderCellParamsPremium<R extends GridValidRowModel = any, V = any, F = V> {
71
102
  aggregation?: GridAggregationCellMeta;
@@ -0,0 +1,2 @@
1
+ export declare const BrowserSpeechRecognition: any;
2
+ export declare const IS_SPEECH_RECOGNITION_SUPPORTED: boolean;
@@ -0,0 +1,2 @@
1
+ export const BrowserSpeechRecognition = globalThis.SpeechRecognition || globalThis.webkitSpeechRecognition;
2
+ export const IS_SPEECH_RECOGNITION_SUPPORTED = !!BrowserSpeechRecognition;
@@ -36,6 +36,9 @@ const avgAgg = {
36
36
  sum += value;
37
37
  }
38
38
  }
39
+ if (sum === 0) {
40
+ return null;
41
+ }
39
42
  return sum / valuesCount;
40
43
  },
41
44
  columnTypes: ['number']
@@ -47,13 +50,18 @@ const minAgg = {
47
50
  if (values.length === 0) {
48
51
  return null;
49
52
  }
53
+ let hasValidValue = false;
50
54
  let min = +Infinity;
51
55
  for (let i = 0; i < values.length; i += 1) {
52
56
  const value = values[i];
53
57
  if (value != null && value < min) {
54
58
  min = value;
59
+ hasValidValue = true;
55
60
  }
56
61
  }
62
+ if (!hasValidValue) {
63
+ return null;
64
+ }
57
65
  return min;
58
66
  },
59
67
  columnTypes: ['number', 'date', 'dateTime']
@@ -65,13 +73,18 @@ const maxAgg = {
65
73
  if (values.length === 0) {
66
74
  return null;
67
75
  }
76
+ let hasValidValue = false;
68
77
  let max = -Infinity;
69
78
  for (let i = 0; i < values.length; i += 1) {
70
79
  const value = values[i];
71
80
  if (value != null && value > max) {
72
81
  max = value;
82
+ hasValidValue = true;
73
83
  }
74
84
  }
85
+ if (!hasValidValue) {
86
+ return null;
87
+ }
75
88
  return max;
76
89
  },
77
90
  columnTypes: ['number', 'date', 'dateTime']
@@ -1,4 +1,6 @@
1
+ import { GridRowId } from '@mui/x-data-grid';
1
2
  import { GridStatePremium } from "../../../models/gridStatePremium.js";
3
+ import { GridAggregationPosition } from "./gridAggregationInterfaces.js";
2
4
  export declare const gridAggregationStateSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, unknown, import("./gridAggregationInterfaces").GridAggregationState>;
3
5
  /**
4
6
  * Get the aggregation model, containing the aggregation function of each column.
@@ -10,4 +12,11 @@ export declare const gridAggregationModelSelector: import("@mui/x-data-grid").Ou
10
12
  * Get the aggregation results as a lookup.
11
13
  * @category Aggregation
12
14
  */
13
- export declare const gridAggregationLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationState, import("./gridAggregationInterfaces").GridAggregationLookup>;
15
+ export declare const gridAggregationLookupSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAggregationInterfaces").GridAggregationState, import("./gridAggregationInterfaces").GridAggregationLookup>;
16
+ export declare const gridCellAggregationResultSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, {
17
+ id: GridRowId;
18
+ field: string;
19
+ }, {
20
+ position: GridAggregationPosition;
21
+ value: any;
22
+ } | null>;
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.gridAggregationStateSelector = exports.gridAggregationModelSelector = exports.gridAggregationLookupSelector = void 0;
6
+ exports.gridCellAggregationResultSelector = exports.gridAggregationStateSelector = exports.gridAggregationModelSelector = exports.gridAggregationLookupSelector = void 0;
7
7
  var _internals = require("@mui/x-data-grid-pro/internals");
8
+ var _xDataGrid = require("@mui/x-data-grid");
8
9
  const gridAggregationStateSelector = exports.gridAggregationStateSelector = (0, _internals.createRootSelector)(state => state.aggregation);
9
10
 
10
11
  /**
@@ -18,4 +19,30 @@ const gridAggregationModelSelector = exports.gridAggregationModelSelector = (0,
18
19
  * Get the aggregation results as a lookup.
19
20
  * @category Aggregation
20
21
  */
21
- const gridAggregationLookupSelector = exports.gridAggregationLookupSelector = (0, _internals.createSelector)(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
22
+ const gridAggregationLookupSelector = exports.gridAggregationLookupSelector = (0, _internals.createSelector)(gridAggregationStateSelector, aggregationState => aggregationState.lookup);
23
+ const gridCellAggregationResultSelector = exports.gridCellAggregationResultSelector = (0, _internals.createSelector)(_xDataGrid.gridRowTreeSelector, gridAggregationLookupSelector, (rowTree, aggregationLookup, {
24
+ id,
25
+ field
26
+ }) => {
27
+ let cellAggregationPosition = null;
28
+ const rowNode = rowTree[id];
29
+ if (!rowNode) {
30
+ return null;
31
+ }
32
+ if (rowNode.type === 'group') {
33
+ cellAggregationPosition = 'inline';
34
+ } else if (id.toString().startsWith('auto-generated-group-footer-')) {
35
+ cellAggregationPosition = 'footer';
36
+ }
37
+ if (cellAggregationPosition == null) {
38
+ return null;
39
+ }
40
+
41
+ // TODO: Add custom root id
42
+ const groupId = cellAggregationPosition === 'inline' ? id : rowNode.parent ?? '';
43
+ const aggregationResult = aggregationLookup?.[groupId]?.[field];
44
+ if (!aggregationResult || aggregationResult.position !== cellAggregationPosition) {
45
+ return null;
46
+ }
47
+ return aggregationResult;
48
+ });
@@ -3,7 +3,7 @@ import { GridColDef, GridRowId } from '@mui/x-data-grid-pro';
3
3
  import { GridColumnRawLookup, GridHydrateRowsValue } from '@mui/x-data-grid-pro/internals';
4
4
  import { GridAggregationFunction, GridAggregationFunctionDataSource, GridAggregationModel, GridAggregationRule, GridAggregationRules } from "./gridAggregationInterfaces.js";
5
5
  import { GridStatePremium } from "../../../models/gridStatePremium.js";
6
- import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
6
+ import type { DataGridPremiumProcessedProps } from '../../../models/dataGridPremiumProps';
7
7
  import { GridApiPremium, GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
8
8
  export declare const GRID_AGGREGATION_ROOT_FOOTER_ROW_ID = "auto-generated-group-footer-root";
9
9
  export declare const getAggregationFooterRowIdFromGroupId: (groupId: GridRowId | null) => string;
@@ -1,4 +1,4 @@
1
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";
2
+ export { gridAggregationStateSelector, gridAggregationLookupSelector, gridAggregationModelSelector } from "./gridAggregationSelectors.js";
3
3
  export * from "./gridAggregationFunctions.js";
4
4
  export { GRID_AGGREGATION_ROOT_FOOTER_ROW_ID, getAggregationFooterRowIdFromGroupId } from "./gridAggregationUtils.js";
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
+ gridAggregationStateSelector: true,
8
+ gridAggregationLookupSelector: true,
9
+ gridAggregationModelSelector: true,
7
10
  GRID_AGGREGATION_ROOT_FOOTER_ROW_ID: true,
8
11
  getAggregationFooterRowIdFromGroupId: true
9
12
  };
@@ -19,18 +22,25 @@ Object.defineProperty(exports, "getAggregationFooterRowIdFromGroupId", {
19
22
  return _gridAggregationUtils.getAggregationFooterRowIdFromGroupId;
20
23
  }
21
24
  });
22
- var _gridAggregationSelectors = require("./gridAggregationSelectors");
23
- Object.keys(_gridAggregationSelectors).forEach(function (key) {
24
- if (key === "default" || key === "__esModule") return;
25
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
- if (key in exports && exports[key] === _gridAggregationSelectors[key]) return;
27
- Object.defineProperty(exports, key, {
28
- enumerable: true,
29
- get: function () {
30
- return _gridAggregationSelectors[key];
31
- }
32
- });
25
+ Object.defineProperty(exports, "gridAggregationLookupSelector", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _gridAggregationSelectors.gridAggregationLookupSelector;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "gridAggregationModelSelector", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return _gridAggregationSelectors.gridAggregationModelSelector;
35
+ }
33
36
  });
37
+ Object.defineProperty(exports, "gridAggregationStateSelector", {
38
+ enumerable: true,
39
+ get: function () {
40
+ return _gridAggregationSelectors.gridAggregationStateSelector;
41
+ }
42
+ });
43
+ var _gridAggregationSelectors = require("./gridAggregationSelectors");
34
44
  var _gridAggregationFunctions = require("./gridAggregationFunctions");
35
45
  Object.keys(_gridAggregationFunctions).forEach(function (key) {
36
46
  if (key === "default" || key === "__esModule") return;
@@ -83,13 +83,9 @@ const useGridAggregation = (apiRef, props) => {
83
83
  const aggregationRules = props.disableAggregation ? {} : (0, _gridAggregationUtils.getAggregationRules)((0, _xDataGridPro.gridColumnLookupSelector)(apiRef), (0, _gridAggregationSelectors.gridAggregationModelSelector)(apiRef), props.aggregationFunctions, !!props.dataSource);
84
84
 
85
85
  // Re-apply the row hydration to add / remove the aggregation footers
86
- if (!(0, _gridAggregationUtils.areAggregationRulesEqual)(rulesOnLastRowHydration, aggregationRules)) {
87
- if (props.dataSource) {
88
- apiRef.current.dataSource.fetchRows();
89
- } else {
90
- apiRef.current.requestPipeProcessorsApplication('hydrateRows');
91
- applyAggregation();
92
- }
86
+ if (!props.dataSource && !(0, _gridAggregationUtils.areAggregationRulesEqual)(rulesOnLastRowHydration, aggregationRules)) {
87
+ apiRef.current.requestPipeProcessorsApplication('hydrateRows');
88
+ applyAggregation();
93
89
  }
94
90
 
95
91
  // Re-apply the column hydration to wrap / unwrap the aggregated columns
@@ -24,16 +24,10 @@ const useGridAggregationPreProcessors = (apiRef, props) => {
24
24
  const haveAggregationColumnValue = !!rulesOnLastColumnHydration.current[field];
25
25
  let column = columnsState.lookup[field];
26
26
  if (haveAggregationColumnValue) {
27
- column = (0, _wrapColumnWithAggregation.unwrapColumnFromAggregation)({
28
- column
29
- });
27
+ column = (0, _wrapColumnWithAggregation.unwrapColumnFromAggregation)(column);
30
28
  }
31
29
  if (shouldHaveAggregationValue) {
32
- column = (0, _wrapColumnWithAggregation.wrapColumnWithAggregationValue)({
33
- column,
34
- aggregationRule: aggregationRules[field],
35
- apiRef
36
- });
30
+ column = (0, _wrapColumnWithAggregation.wrapColumnWithAggregationValue)(column, aggregationRules[field], apiRef);
37
31
  }
38
32
  columnsState.lookup[field] = column;
39
33
  });
@@ -4,34 +4,14 @@ import { GridColDef, GridFilterOperator } from '@mui/x-data-grid-pro';
4
4
  import { type GridBaseColDef } from '@mui/x-data-grid-pro/internals';
5
5
  import { GridApiPremium } from "../../../models/gridApiPremium.js";
6
6
  import type { GridAggregationRule } from './gridAggregationInterfaces';
7
- type WrappableColumnProperty = 'valueGetter' | 'valueFormatter' | 'renderCell' | 'renderHeader' | 'filterOperators';
8
- interface GridColDefWithAggregationWrappers extends GridBaseColDef {
9
- aggregationWrappedProperties: {
10
- name: WrappableColumnProperty;
11
- originalValue: GridBaseColDef[WrappableColumnProperty];
12
- wrappedValue: GridBaseColDef[WrappableColumnProperty];
13
- }[];
14
- }
15
7
  /**
16
8
  * Add a wrapper around each wrappable property of the column to customize the behavior of the aggregation cells.
17
9
  */
18
- export declare const wrapColumnWithAggregationValue: ({
19
- column,
20
- apiRef,
21
- aggregationRule
22
- }: {
23
- column: GridBaseColDef;
24
- apiRef: RefObject<GridApiPremium>;
25
- aggregationRule: GridAggregationRule;
26
- }) => GridBaseColDef;
10
+ export declare const wrapColumnWithAggregationValue: (column: GridBaseColDef, aggregationRule: GridAggregationRule, apiRef: RefObject<GridApiPremium>) => GridBaseColDef;
27
11
  /**
28
12
  * Remove the aggregation wrappers around the wrappable properties of the column.
29
13
  */
30
- export declare const unwrapColumnFromAggregation: ({
31
- column
32
- }: {
33
- column: GridColDef | GridColDefWithAggregationWrappers;
34
- }) => GridBaseColDef<any, any, any> | {
14
+ export declare const unwrapColumnFromAggregation: (column: GridColDef) => GridBaseColDef<any, any, any> | {
35
15
  field: string;
36
16
  headerName?: string;
37
17
  description?: string;
@@ -71,11 +51,11 @@ export declare const unwrapColumnFromAggregation: ({
71
51
  disableReorder?: boolean;
72
52
  disableExport?: boolean;
73
53
  colSpan?: number | import("@mui/x-data-grid").GridColSpanFn<import("@mui/x-data-grid").GridValidRowModel, any, any> | undefined;
74
- unstable_examples?: any[] | undefined;
54
+ examples?: any[] | undefined;
75
55
  renderHeaderFilter?: (params: import("@mui/x-data-grid-pro").GridRenderHeaderFilterProps) => React.ReactNode;
76
56
  aggregable?: boolean;
77
57
  availableAggregationFunctions?: string[];
78
58
  groupingValueGetter?: import("../../..").GridGroupingValueGetter<import("@mui/x-data-grid").GridValidRowModel> | undefined;
79
59
  pastedValueParser?: import("../../..").GridPastedValueParser<import("@mui/x-data-grid").GridValidRowModel, any, any> | undefined;
80
- };
81
- export {};
60
+ pivotable?: boolean;
61
+ };
@@ -13,6 +13,7 @@ var _xDataGridPro = require("@mui/x-data-grid-pro");
13
13
  var _gridAggregationSelectors = require("./gridAggregationSelectors");
14
14
  var _GridFooterCell = require("../../../components/GridFooterCell");
15
15
  var _GridAggregationHeader = require("../../../components/GridAggregationHeader");
16
+ var _gridPivotingSelectors = require("../pivoting/gridPivotingSelectors");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  const _excluded = ["aggregationWrappedProperties"];
18
19
  const getAggregationValueWrappedValueGetter = ({
@@ -60,8 +61,10 @@ const getAggregationValueWrappedValueFormatter = ({
60
61
  const getAggregationValueWrappedRenderCell = ({
61
62
  value: renderCell,
62
63
  aggregationRule,
63
- getCellAggregationResult
64
+ getCellAggregationResult,
65
+ apiRef
64
66
  }) => {
67
+ const pivotActive = (0, _gridPivotingSelectors.gridPivotActiveSelector)(apiRef);
65
68
  const wrappedRenderCell = params => {
66
69
  const cellAggregationResult = getCellAggregationResult(params.id, params.field);
67
70
  if (cellAggregationResult != null) {
@@ -69,8 +72,14 @@ const getAggregationValueWrappedRenderCell = ({
69
72
  if (cellAggregationResult.position === 'footer') {
70
73
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridFooterCell.GridFooterCell, (0, _extends2.default)({}, params));
71
74
  }
75
+ if (pivotActive && cellAggregationResult.value === 0) {
76
+ return null;
77
+ }
72
78
  return params.formattedValue;
73
79
  }
80
+ if (pivotActive && cellAggregationResult.value === 0) {
81
+ return null;
82
+ }
74
83
  const aggregationMeta = {
75
84
  hasCellUnit: aggregationRule.aggregationFunction.hasCellUnit ?? true,
76
85
  aggregationFunctionName: aggregationRule.aggregationFunctionName
@@ -122,6 +131,10 @@ const getWrappedRenderHeader = ({
122
131
  aggregationRule
123
132
  }) => {
124
133
  const wrappedRenderHeader = params => {
134
+ // TODO: investigate why colDef is undefined
135
+ if (!params.colDef) {
136
+ return null;
137
+ }
125
138
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridAggregationHeader.GridAggregationHeader, (0, _extends2.default)({}, params, {
126
139
  aggregation: {
127
140
  aggregationRule
@@ -135,14 +148,13 @@ const getWrappedRenderHeader = ({
135
148
  /**
136
149
  * Add a wrapper around each wrappable property of the column to customize the behavior of the aggregation cells.
137
150
  */
138
- const wrapColumnWithAggregationValue = ({
139
- column,
140
- apiRef,
141
- aggregationRule
142
- }) => {
151
+ const wrapColumnWithAggregationValue = (column, aggregationRule, apiRef) => {
143
152
  const getCellAggregationResult = (id, field) => {
144
153
  let cellAggregationPosition = null;
145
154
  const rowNode = (0, _xDataGridPro.gridRowNodeSelector)(apiRef, id);
155
+ if (!rowNode) {
156
+ return null;
157
+ }
146
158
  if (rowNode.type === 'group') {
147
159
  cellAggregationPosition = 'inline';
148
160
  } else if (id.toString().startsWith('auto-generated-group-footer-')) {
@@ -193,15 +205,16 @@ const wrapColumnWithAggregationValue = ({
193
205
  }
194
206
  return wrappedColumn;
195
207
  };
208
+ exports.wrapColumnWithAggregationValue = wrapColumnWithAggregationValue;
209
+ const isColumnWrappedWithAggregation = column => {
210
+ return typeof column.aggregationWrappedProperties !== 'undefined';
211
+ };
196
212
 
197
213
  /**
198
214
  * Remove the aggregation wrappers around the wrappable properties of the column.
199
215
  */
200
- exports.wrapColumnWithAggregationValue = wrapColumnWithAggregationValue;
201
- const unwrapColumnFromAggregation = ({
202
- column
203
- }) => {
204
- if (!column.aggregationWrappedProperties) {
216
+ const unwrapColumnFromAggregation = column => {
217
+ if (!isColumnWrappedWithAggregation(column)) {
205
218
  return column;
206
219
  }
207
220
  const _ref = column,
@@ -0,0 +1,12 @@
1
+ import { PromptResponse } from "./gridAiAssistantInterfaces.js";
2
+ /**
3
+ * Prompt resolver for the <DataGridPremium /> component.
4
+ * @param {string} url The URL to send the request to.
5
+ * @param {string} query The query to be processed.
6
+ * @param {string} context The prompt context containing necessary information about the current columns definition.
7
+ * Either use the `context` parameter of the `onPrompt` callback or the return value of the `unstable_getPromptContext()` API method.
8
+ * @param {string} conversationId The id of the conversation the prompt is part of. If not passed, prompt response will return a new conversation id that can be used to continue the newly started conversation.
9
+ * @param {string} additionalContext Optional, additional context to make the processing results more accurate.
10
+ * @returns {Promise<PromptResponse>} The grid state updates to be applied.
11
+ */
12
+ export declare function gridDefaultPromptResolver(url: string, query: string, context: string, conversationId?: string, additionalContext?: string): Promise<PromptResponse>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gridDefaultPromptResolver = gridDefaultPromptResolver;
7
+ /**
8
+ * Prompt resolver for the <DataGridPremium /> component.
9
+ * @param {string} url The URL to send the request to.
10
+ * @param {string} query The query to be processed.
11
+ * @param {string} context The prompt context containing necessary information about the current columns definition.
12
+ * Either use the `context` parameter of the `onPrompt` callback or the return value of the `unstable_getPromptContext()` API method.
13
+ * @param {string} conversationId The id of the conversation the prompt is part of. If not passed, prompt response will return a new conversation id that can be used to continue the newly started conversation.
14
+ * @param {string} additionalContext Optional, additional context to make the processing results more accurate.
15
+ * @returns {Promise<PromptResponse>} The grid state updates to be applied.
16
+ */
17
+ function gridDefaultPromptResolver(url, query, context, conversationId, additionalContext = '') {
18
+ return fetch(url, {
19
+ mode: 'cors',
20
+ method: 'POST',
21
+ headers: {
22
+ 'content-type': 'application/json'
23
+ },
24
+ credentials: 'include',
25
+ body: JSON.stringify({
26
+ context,
27
+ query,
28
+ additionalContext,
29
+ conversationId
30
+ })
31
+ }).then(result => result.json()).then(result => {
32
+ if (result.ok === false) {
33
+ return Promise.reject(new Error(result.message));
34
+ }
35
+ return result.data;
36
+ });
37
+ }
@@ -0,0 +1,82 @@
1
+ export type Prompt = {
2
+ value: string;
3
+ createdAt: Date;
4
+ response?: PromptResponse;
5
+ variant?: 'success' | 'error' | 'processing';
6
+ helperText?: string;
7
+ };
8
+ export type PromptSuggestion = {
9
+ value: string;
10
+ };
11
+ export type Conversation = {
12
+ id?: string;
13
+ title?: string;
14
+ prompts: Prompt[];
15
+ };
16
+ export type GridAiAssistantState = {
17
+ activeConversationIndex: number;
18
+ conversations: Conversation[];
19
+ };
20
+ export type GridAiAssistantInitialState = Partial<GridAiAssistantState>;
21
+ type ColumnSort = {
22
+ column: string;
23
+ direction: 'asc' | 'desc';
24
+ };
25
+ type ColumnFilter = {
26
+ operator: string;
27
+ value: string | number | boolean | string[] | number[];
28
+ column: string;
29
+ };
30
+ type Grouping = {
31
+ column: string;
32
+ };
33
+ type AggregationFunction = 'avg' | 'sum' | 'min' | 'max' | 'size';
34
+ type Aggregation = {
35
+ [column: string]: AggregationFunction;
36
+ };
37
+ type Pivoting = {
38
+ columns: ColumnSort[];
39
+ rows: string[];
40
+ values: Aggregation[];
41
+ } | {};
42
+ export type PromptResponse = {
43
+ conversationId: string;
44
+ select: number;
45
+ filters: ColumnFilter[];
46
+ filterOperator?: 'and' | 'or';
47
+ aggregation: Aggregation;
48
+ sorting: ColumnSort[];
49
+ grouping: Grouping[];
50
+ pivoting: Pivoting;
51
+ };
52
+ /**
53
+ * The prompt API interface that is available in the grid [[apiRef]].
54
+ */
55
+ export interface GridAiAssistantApi {
56
+ /**
57
+ * The AI assistant API.
58
+ */
59
+ aiAssistant: {
60
+ /**
61
+ * Calls the `onPrompt()` callback to evaluate the prompt and get the necessary updates to the grid state.
62
+ * Adds the prompt to the current conversation.
63
+ * Updates the grid state based on the prompt response.
64
+ * @param {string} value The prompt to process
65
+ * @returns {Promise<PromptResponse | Error>} The grid state updates or a processing error
66
+ */
67
+ processPrompt: (value: string) => Promise<PromptResponse | Error>;
68
+ /**
69
+ * Sets the conversations.
70
+ * @param {Conversation[] | ((prevConversations: Conversation[]) => Conversation[])} conversations The new conversations.
71
+ */
72
+ setConversations: (conversations: Conversation[] | ((prevConversations: Conversation[]) => Conversation[])) => void;
73
+ /**
74
+ * Sets the active conversation index.
75
+ * @param {number} index The index of the conversation that should become active.
76
+ * @returns {Conversation} The active conversation.
77
+ * @throws {Error} If the conversation index does not exist.
78
+ */
79
+ setActiveConversationIndex: (index: number) => Conversation;
80
+ };
81
+ }
82
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { GridStatePremium } from '../../../models/gridStatePremium';
2
+ import { Conversation } from "./gridAiAssistantInterfaces.js";
3
+ export declare const gridAiAssistantActiveConversationIndexSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAiAssistantInterfaces").GridAiAssistantState, number>;
4
+ export declare const gridAiAssistantConversationsSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, import("./gridAiAssistantInterfaces").GridAiAssistantState, Conversation[]>;
5
+ export declare const gridAiAssistantActiveConversationSelector: import("@mui/x-data-grid").OutputSelector<GridStatePremium, number, Conversation | undefined>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gridAiAssistantConversationsSelector = exports.gridAiAssistantActiveConversationSelector = exports.gridAiAssistantActiveConversationIndexSelector = void 0;
7
+ var _internals = require("@mui/x-data-grid-pro/internals");
8
+ const gridAiAssistantStateSelector = (0, _internals.createRootSelector)(state => state.aiAssistant);
9
+ const gridAiAssistantActiveConversationIndexSelector = exports.gridAiAssistantActiveConversationIndexSelector = (0, _internals.createSelector)(gridAiAssistantStateSelector, aiAssistant => aiAssistant?.activeConversationIndex);
10
+ const gridAiAssistantConversationsSelector = exports.gridAiAssistantConversationsSelector = (0, _internals.createSelector)(gridAiAssistantStateSelector, aiAssistant => aiAssistant?.conversations);
11
+ const gridAiAssistantActiveConversationSelector = exports.gridAiAssistantActiveConversationSelector = (0, _internals.createSelectorMemoized)(gridAiAssistantConversationsSelector, gridAiAssistantActiveConversationIndexSelector, (conversations, index) => conversations[index]);
@@ -0,0 +1,2 @@
1
+ export { gridDefaultPromptResolver as unstable_gridDefaultPromptResolver } from "./api.js";
2
+ export type { PromptResponse, Conversation, PromptSuggestion } from './gridAiAssistantInterfaces';
@@ -0,0 +1,6 @@
1
+ import { RefObject } from '@mui/x-internals/types';
2
+ import { GridStateInitializer } from '@mui/x-data-grid-pro/internals';
3
+ import { GridPrivateApiPremium } from "../../../models/gridApiPremium.js";
4
+ import { DataGridPremiumProcessedProps } from "../../../models/dataGridPremiumProps.js";
5
+ export declare const aiAssistantStateInitializer: GridStateInitializer<Pick<DataGridPremiumProcessedProps, 'initialState' | 'aiAssistantConversations' | 'aiAssistant'>>;
6
+ export declare const useGridAiAssistant: (apiRef: RefObject<GridPrivateApiPremium>, props: Pick<DataGridPremiumProcessedProps, "aiAssistant" | "aiAssistantConversations" | "aiAssistantActiveConversationIndex" | "allowAiAssistantDataSampling" | "onAiAssistantConversationsChange" | "onAiAssistantActiveConversationIndexChange" | "onPrompt" | "slots" | "disableColumnFilter" | "disableRowGrouping" | "disableAggregation" | "disableColumnSorting" | "disablePivoting">) => void;