@mui/x-data-grid-pro 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 (269) hide show
  1. package/CHANGELOG.md +388 -96
  2. package/DataGridPro/DataGridPro.js +8 -7
  3. package/DataGridPro/useDataGridProComponent.d.ts +2 -2
  4. package/DataGridPro/useDataGridProComponent.js +2 -3
  5. package/components/GridDetailPanel.js +1 -2
  6. package/components/headerFiltering/GridHeaderFilterMenu.js +2 -2
  7. package/esm/DataGridPro/DataGridPro.js +9 -8
  8. package/esm/DataGridPro/useDataGridProComponent.d.ts +2 -2
  9. package/esm/DataGridPro/useDataGridProComponent.js +2 -3
  10. package/esm/components/GridDetailPanel.js +1 -2
  11. package/esm/components/headerFiltering/GridHeaderFilterMenu.js +2 -2
  12. package/esm/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +3 -6
  13. package/esm/hooks/features/dataSource/useGridDataSourceBasePro.js +36 -8
  14. package/esm/hooks/features/dataSource/utils.d.ts +3 -2
  15. package/esm/hooks/features/dataSource/utils.js +13 -1
  16. package/esm/hooks/features/detailPanel/useGridDetailPanel.js +4 -3
  17. package/esm/hooks/features/lazyLoader/useGridLazyLoader.d.ts +1 -1
  18. package/esm/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +1 -1
  19. package/esm/hooks/features/rowPinning/useGridRowPinning.d.ts +1 -1
  20. package/esm/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +38 -1
  21. package/esm/index.js +1 -1
  22. package/esm/internals/index.d.ts +1 -0
  23. package/esm/internals/index.js +1 -0
  24. package/esm/material/icons.d.ts +3 -6
  25. package/esm/material/icons.js +1 -1
  26. package/esm/material/index.d.ts +2 -2
  27. package/esm/models/dataGridProProps.d.ts +3 -3
  28. package/esm/models/gridProIconSlotsComponent.d.ts +6 -3
  29. package/esm/package.json +1 -1
  30. package/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +3 -6
  31. package/hooks/features/dataSource/useGridDataSourceBasePro.js +34 -6
  32. package/hooks/features/dataSource/utils.d.ts +3 -2
  33. package/hooks/features/dataSource/utils.js +15 -2
  34. package/hooks/features/detailPanel/useGridDetailPanel.js +4 -3
  35. package/hooks/features/lazyLoader/useGridLazyLoader.d.ts +1 -1
  36. package/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +1 -1
  37. package/hooks/features/rowPinning/useGridRowPinning.d.ts +1 -1
  38. package/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +37 -0
  39. package/index.js +1 -1
  40. package/internals/index.d.ts +1 -0
  41. package/internals/index.js +15 -7
  42. package/material/icons.d.ts +3 -6
  43. package/material/icons.js +3 -3
  44. package/material/index.d.ts +2 -2
  45. package/models/dataGridProProps.d.ts +3 -3
  46. package/models/gridProIconSlotsComponent.d.ts +6 -3
  47. package/package.json +8 -14
  48. package/esm/utils/releaseInfo.d.ts +0 -1
  49. package/esm/utils/releaseInfo.js +0 -13
  50. package/modern/DataGridPro/DataGrid.d.ts +0 -8
  51. package/modern/DataGridPro/DataGrid.js +0 -19
  52. package/modern/DataGridPro/DataGridPro.d.ts +0 -16
  53. package/modern/DataGridPro/DataGridPro.js +0 -1020
  54. package/modern/DataGridPro/index.d.ts +0 -3
  55. package/modern/DataGridPro/index.js +0 -3
  56. package/modern/DataGridPro/useDataGridProComponent.d.ts +0 -4
  57. package/modern/DataGridPro/useDataGridProComponent.js +0 -105
  58. package/modern/DataGridPro/useDataGridProProps.d.ts +0 -7
  59. package/modern/DataGridPro/useDataGridProProps.js +0 -54
  60. package/modern/components/GridColumnHeaders.d.ts +0 -5
  61. package/modern/components/GridColumnHeaders.js +0 -92
  62. package/modern/components/GridColumnMenuPinningItem.d.ts +0 -7
  63. package/modern/components/GridColumnMenuPinningItem.js +0 -77
  64. package/modern/components/GridDataSourceTreeDataGroupingCell.d.ts +0 -12
  65. package/modern/components/GridDataSourceTreeDataGroupingCell.js +0 -107
  66. package/modern/components/GridDetailPanel.d.ts +0 -14
  67. package/modern/components/GridDetailPanel.js +0 -53
  68. package/modern/components/GridDetailPanelToggleCell.d.ts +0 -7
  69. package/modern/components/GridDetailPanelToggleCell.js +0 -121
  70. package/modern/components/GridDetailPanels.d.ts +0 -3
  71. package/modern/components/GridDetailPanels.js +0 -67
  72. package/modern/components/GridPinnedRows.d.ts +0 -6
  73. package/modern/components/GridPinnedRows.js +0 -40
  74. package/modern/components/GridProColumnMenu.d.ts +0 -24
  75. package/modern/components/GridProColumnMenu.js +0 -21
  76. package/modern/components/GridRowReorderCell.d.ts +0 -8
  77. package/modern/components/GridRowReorderCell.js +0 -140
  78. package/modern/components/GridTreeDataGroupingCell.d.ts +0 -15
  79. package/modern/components/GridTreeDataGroupingCell.js +0 -133
  80. package/modern/components/headerFiltering/GridHeaderFilterCell.d.ts +0 -26
  81. package/modern/components/headerFiltering/GridHeaderFilterCell.js +0 -362
  82. package/modern/components/headerFiltering/GridHeaderFilterClearButton.d.ts +0 -6
  83. package/modern/components/headerFiltering/GridHeaderFilterClearButton.js +0 -17
  84. package/modern/components/headerFiltering/GridHeaderFilterMenu.d.ts +0 -30
  85. package/modern/components/headerFiltering/GridHeaderFilterMenu.js +0 -137
  86. package/modern/components/headerFiltering/GridHeaderFilterMenuContainer.d.ts +0 -17
  87. package/modern/components/headerFiltering/GridHeaderFilterMenuContainer.js +0 -138
  88. package/modern/components/headerFiltering/index.d.ts +0 -3
  89. package/modern/components/headerFiltering/index.js +0 -3
  90. package/modern/components/index.d.ts +0 -6
  91. package/modern/components/index.js +0 -7
  92. package/modern/components/reexports.d.ts +0 -1
  93. package/modern/components/reexports.js +0 -1
  94. package/modern/constants/dataGridProDefaultSlotsComponents.d.ts +0 -2
  95. package/modern/constants/dataGridProDefaultSlotsComponents.js +0 -17
  96. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +0 -12
  97. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -143
  98. package/modern/hooks/features/columnPinning/gridColumnPinningInterface.d.ts +0 -40
  99. package/modern/hooks/features/columnPinning/gridColumnPinningInterface.js +0 -1
  100. package/modern/hooks/features/columnPinning/index.d.ts +0 -1
  101. package/modern/hooks/features/columnPinning/index.js +0 -1
  102. package/modern/hooks/features/columnPinning/useGridColumnPinning.d.ts +0 -6
  103. package/modern/hooks/features/columnPinning/useGridColumnPinning.js +0 -228
  104. package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.d.ts +0 -4
  105. package/modern/hooks/features/columnPinning/useGridColumnPinningPreProcessors.js +0 -105
  106. package/modern/hooks/features/columnReorder/columnReorderInterfaces.d.ts +0 -6
  107. package/modern/hooks/features/columnReorder/columnReorderInterfaces.js +0 -1
  108. package/modern/hooks/features/columnReorder/columnReorderSelector.d.ts +0 -3
  109. package/modern/hooks/features/columnReorder/columnReorderSelector.js +0 -3
  110. package/modern/hooks/features/columnReorder/index.d.ts +0 -2
  111. package/modern/hooks/features/columnReorder/index.js +0 -2
  112. package/modern/hooks/features/columnReorder/useGridColumnReorder.d.ts +0 -9
  113. package/modern/hooks/features/columnReorder/useGridColumnReorder.js +0 -242
  114. package/modern/hooks/features/dataSource/gridDataSourceSelector.d.ts +0 -7
  115. package/modern/hooks/features/dataSource/gridDataSourceSelector.js +0 -6
  116. package/modern/hooks/features/dataSource/models.d.ts +0 -75
  117. package/modern/hooks/features/dataSource/models.js +0 -1
  118. package/modern/hooks/features/dataSource/useGridDataSourceBasePro.d.ts +0 -33
  119. package/modern/hooks/features/dataSource/useGridDataSourceBasePro.js +0 -179
  120. package/modern/hooks/features/dataSource/useGridDataSourcePro.d.ts +0 -6
  121. package/modern/hooks/features/dataSource/useGridDataSourcePro.js +0 -35
  122. package/modern/hooks/features/dataSource/utils.d.ts +0 -29
  123. package/modern/hooks/features/dataSource/utils.js +0 -82
  124. package/modern/hooks/features/detailPanel/gridDetailPanelInterface.d.ts +0 -41
  125. package/modern/hooks/features/detailPanel/gridDetailPanelInterface.js +0 -1
  126. package/modern/hooks/features/detailPanel/gridDetailPanelSelector.d.ts +0 -14
  127. package/modern/hooks/features/detailPanel/gridDetailPanelSelector.js +0 -5
  128. package/modern/hooks/features/detailPanel/gridDetailPanelToggleColDef.d.ts +0 -4
  129. package/modern/hooks/features/detailPanel/gridDetailPanelToggleColDef.js +0 -34
  130. package/modern/hooks/features/detailPanel/index.d.ts +0 -3
  131. package/modern/hooks/features/detailPanel/index.js +0 -3
  132. package/modern/hooks/features/detailPanel/useGridDetailPanel.d.ts +0 -6
  133. package/modern/hooks/features/detailPanel/useGridDetailPanel.js +0 -191
  134. package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.d.ts +0 -4
  135. package/modern/hooks/features/detailPanel/useGridDetailPanelPreProcessors.js +0 -43
  136. package/modern/hooks/features/index.d.ts +0 -7
  137. package/modern/hooks/features/index.js +0 -8
  138. package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +0 -9
  139. package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +0 -104
  140. package/modern/hooks/features/lazyLoader/useGridLazyLoader.d.ts +0 -10
  141. package/modern/hooks/features/lazyLoader/useGridLazyLoader.js +0 -90
  142. package/modern/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.d.ts +0 -5
  143. package/modern/hooks/features/lazyLoader/useGridLazyLoaderPreProcessors.js +0 -34
  144. package/modern/hooks/features/lazyLoader/utils.d.ts +0 -18
  145. package/modern/hooks/features/lazyLoader/utils.js +0 -34
  146. package/modern/hooks/features/rowPinning/gridRowPinningInterface.d.ts +0 -17
  147. package/modern/hooks/features/rowPinning/gridRowPinningInterface.js +0 -1
  148. package/modern/hooks/features/rowPinning/gridRowPinningSelector.d.ts +0 -1
  149. package/modern/hooks/features/rowPinning/gridRowPinningSelector.js +0 -1
  150. package/modern/hooks/features/rowPinning/index.d.ts +0 -1
  151. package/modern/hooks/features/rowPinning/index.js +0 -1
  152. package/modern/hooks/features/rowPinning/useGridRowPinning.d.ts +0 -6
  153. package/modern/hooks/features/rowPinning/useGridRowPinning.js +0 -52
  154. package/modern/hooks/features/rowPinning/useGridRowPinningPreProcessors.d.ts +0 -38
  155. package/modern/hooks/features/rowPinning/useGridRowPinningPreProcessors.js +0 -119
  156. package/modern/hooks/features/rowReorder/gridRowReorderColDef.d.ts +0 -2
  157. package/modern/hooks/features/rowReorder/gridRowReorderColDef.js +0 -20
  158. package/modern/hooks/features/rowReorder/index.d.ts +0 -1
  159. package/modern/hooks/features/rowReorder/index.js +0 -1
  160. package/modern/hooks/features/rowReorder/useGridRowReorder.d.ts +0 -8
  161. package/modern/hooks/features/rowReorder/useGridRowReorder.js +0 -141
  162. package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +0 -4
  163. package/modern/hooks/features/rowReorder/useGridRowReorderPreProcessors.js +0 -46
  164. package/modern/hooks/features/rows/index.d.ts +0 -1
  165. package/modern/hooks/features/rows/index.js +0 -1
  166. package/modern/hooks/features/rows/useGridRowAriaAttributes.d.ts +0 -3
  167. package/modern/hooks/features/rows/useGridRowAriaAttributes.js +0 -37
  168. package/modern/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.d.ts +0 -10
  169. package/modern/hooks/features/serverSideLazyLoader/useGridDataSourceLazyLoader.js +0 -325
  170. package/modern/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.d.ts +0 -4
  171. package/modern/hooks/features/serverSideTreeData/useGridDataSourceTreeDataPreProcessors.js +0 -148
  172. package/modern/hooks/features/serverSideTreeData/utils.d.ts +0 -7
  173. package/modern/hooks/features/serverSideTreeData/utils.js +0 -18
  174. package/modern/hooks/features/treeData/gridTreeDataGroupColDef.d.ts +0 -8
  175. package/modern/hooks/features/treeData/gridTreeDataGroupColDef.js +0 -27
  176. package/modern/hooks/features/treeData/gridTreeDataUtils.d.ts +0 -22
  177. package/modern/hooks/features/treeData/gridTreeDataUtils.js +0 -95
  178. package/modern/hooks/features/treeData/index.d.ts +0 -1
  179. package/modern/hooks/features/treeData/index.js +0 -1
  180. package/modern/hooks/features/treeData/useGridTreeData.d.ts +0 -4
  181. package/modern/hooks/features/treeData/useGridTreeData.js +0 -22
  182. package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.d.ts +0 -4
  183. package/modern/hooks/features/treeData/useGridTreeDataPreProcessors.js +0 -148
  184. package/modern/hooks/index.d.ts +0 -1
  185. package/modern/hooks/index.js +0 -1
  186. package/modern/hooks/utils/useGridApiContext.d.ts +0 -4
  187. package/modern/hooks/utils/useGridApiContext.js +0 -2
  188. package/modern/hooks/utils/useGridApiRef.d.ts +0 -4
  189. package/modern/hooks/utils/useGridApiRef.js +0 -2
  190. package/modern/hooks/utils/useGridAriaAttributes.d.ts +0 -2
  191. package/modern/hooks/utils/useGridAriaAttributes.js +0 -11
  192. package/modern/hooks/utils/useGridPrivateApiContext.d.ts +0 -2
  193. package/modern/hooks/utils/useGridPrivateApiContext.js +0 -2
  194. package/modern/hooks/utils/useGridRootProps.d.ts +0 -2
  195. package/modern/hooks/utils/useGridRootProps.js +0 -2
  196. package/modern/index.d.ts +0 -22
  197. package/modern/index.js +0 -25
  198. package/modern/internals/index.d.ts +0 -33
  199. package/modern/internals/index.js +0 -38
  200. package/modern/internals/propValidation.d.ts +0 -3
  201. package/modern/internals/propValidation.js +0 -2
  202. package/modern/locales.d.ts +0 -1
  203. package/modern/locales.js +0 -1
  204. package/modern/material/icons.d.ts +0 -6
  205. package/modern/material/icons.js +0 -17
  206. package/modern/material/index.d.ts +0 -5
  207. package/modern/material/index.js +0 -8
  208. package/modern/models/dataGridProProps.d.ts +0 -222
  209. package/modern/models/dataGridProProps.js +0 -1
  210. package/modern/models/gridApiPro.d.ts +0 -11
  211. package/modern/models/gridApiPro.js +0 -1
  212. package/modern/models/gridFetchRowsParams.d.ts +0 -22
  213. package/modern/models/gridFetchRowsParams.js +0 -1
  214. package/modern/models/gridGroupingColDefOverride.d.ts +0 -30
  215. package/modern/models/gridGroupingColDefOverride.js +0 -1
  216. package/modern/models/gridProIconSlotsComponent.d.ts +0 -13
  217. package/modern/models/gridProIconSlotsComponent.js +0 -1
  218. package/modern/models/gridProSlotProps.d.ts +0 -8
  219. package/modern/models/gridProSlotProps.js +0 -1
  220. package/modern/models/gridProSlotsComponent.d.ts +0 -18
  221. package/modern/models/gridProSlotsComponent.js +0 -1
  222. package/modern/models/gridRowOrderChangeParams.d.ts +0 -18
  223. package/modern/models/gridRowOrderChangeParams.js +0 -1
  224. package/modern/models/gridRowScrollEndParams.d.ts +0 -18
  225. package/modern/models/gridRowScrollEndParams.js +0 -1
  226. package/modern/models/gridStatePro.d.ts +0 -19
  227. package/modern/models/gridStatePro.js +0 -1
  228. package/modern/models/index.d.ts +0 -7
  229. package/modern/models/index.js +0 -7
  230. package/modern/package.json +0 -1
  231. package/modern/themeAugmentation/index.d.ts +0 -2
  232. package/modern/themeAugmentation/index.js +0 -4
  233. package/modern/themeAugmentation/overrides.d.ts +0 -7
  234. package/modern/themeAugmentation/overrides.js +0 -1
  235. package/modern/themeAugmentation/props.d.ts +0 -15
  236. package/modern/themeAugmentation/props.js +0 -1
  237. package/modern/typeOverloads/index.d.ts +0 -1
  238. package/modern/typeOverloads/index.js +0 -1
  239. package/modern/typeOverloads/modules.d.ts +0 -70
  240. package/modern/typeOverloads/modules.js +0 -1
  241. package/modern/typeOverloads/reexports.d.ts +0 -17
  242. package/modern/typeOverloads/reexports.js +0 -15
  243. package/modern/utils/index.d.ts +0 -1
  244. package/modern/utils/index.js +0 -1
  245. package/modern/utils/releaseInfo.d.ts +0 -1
  246. package/modern/utils/releaseInfo.js +0 -13
  247. package/modern/utils/tree/createRowTree.d.ts +0 -17
  248. package/modern/utils/tree/createRowTree.js +0 -37
  249. package/modern/utils/tree/index.d.ts +0 -1
  250. package/modern/utils/tree/index.js +0 -1
  251. package/modern/utils/tree/insertDataRowInTree.d.ts +0 -69
  252. package/modern/utils/tree/insertDataRowInTree.js +0 -141
  253. package/modern/utils/tree/models.d.ts +0 -14
  254. package/modern/utils/tree/models.js +0 -1
  255. package/modern/utils/tree/removeDataRowFromTree.d.ts +0 -45
  256. package/modern/utils/tree/removeDataRowFromTree.js +0 -94
  257. package/modern/utils/tree/sortRowTree.d.ts +0 -15
  258. package/modern/utils/tree/sortRowTree.js +0 -114
  259. package/modern/utils/tree/updateRowTree.d.ts +0 -20
  260. package/modern/utils/tree/updateRowTree.js +0 -88
  261. package/modern/utils/tree/utils.d.ts +0 -54
  262. package/modern/utils/tree/utils.js +0 -197
  263. package/tsconfig.build.tsbuildinfo +0 -1
  264. package/utils/releaseInfo.d.ts +0 -1
  265. package/utils/releaseInfo.js +0 -20
  266. /package/esm/{locales.d.ts → locales/index.d.ts} +0 -0
  267. /package/esm/{locales.js → locales/index.js} +0 -0
  268. /package/{locales.d.ts → locales/index.d.ts} +0 -0
  269. /package/{locales.js → locales/index.js} +0 -0
@@ -1,70 +0,0 @@
1
- import { GridRowId, GridPinnedColumnFields } from '@mui/x-data-grid';
2
- import type { GridRowScrollEndParams, GridRowOrderChangeParams, GridFetchRowsParams } from '../models';
3
- import type { GridRenderHeaderFilterProps } from '../components/headerFiltering/GridHeaderFilterCell';
4
- import type { GridColumnPinningInternalCache } from '../hooks/features/columnPinning/gridColumnPinningInterface';
5
- import type { GridCanBeReorderedPreProcessingContext } from '../hooks/features/columnReorder/columnReorderInterfaces';
6
- import { GridRowPinningInternalCache } from "../hooks/features/rowPinning/gridRowPinningInterface.js";
7
- export interface GridColDefPro {
8
- /**
9
- * Allows to render a component in the column header filter cell.
10
- * @param {GridRenderHeaderFilterProps} params Object containing parameters for the renderer and `inputRef`.
11
- * @returns {React.ReactNode} The element to be rendered.
12
- */
13
- renderHeaderFilter?: (params: GridRenderHeaderFilterProps) => React.ReactNode;
14
- }
15
- export interface GridControlledStateEventLookupPro {
16
- /**
17
- * Fired when the open detail panels are changed.
18
- * @ignore - do not document.
19
- */
20
- detailPanelsExpandedRowIdsChange: {
21
- params: Set<GridRowId>;
22
- };
23
- /**
24
- * Fired when the pinned columns is changed.
25
- * @ignore - do not document.
26
- */
27
- pinnedColumnsChange: {
28
- params: GridPinnedColumnFields;
29
- };
30
- }
31
- export interface GridEventLookupPro {
32
- /**
33
- * Fired when scrolling to the bottom of the grid viewport.
34
- */
35
- rowsScrollEnd: {
36
- params: GridRowScrollEndParams;
37
- };
38
- /**
39
- * Fired when the user ends reordering a row.
40
- */
41
- rowOrderChange: {
42
- params: GridRowOrderChangeParams;
43
- };
44
- /**
45
- * Fired when a new batch of rows is requested to be loaded. Called with a [[GridFetchRowsParams]] object.
46
- * Used to trigger `onFetchRows`.
47
- */
48
- fetchRows: {
49
- params: GridFetchRowsParams;
50
- };
51
- }
52
- export interface GridPipeProcessingLookupPro {
53
- canBeReordered: {
54
- value: boolean;
55
- context: GridCanBeReorderedPreProcessingContext;
56
- };
57
- }
58
- export interface GridApiCachesPro {
59
- columnPinning: GridColumnPinningInternalCache;
60
- pinnedRows: GridRowPinningInternalCache;
61
- }
62
- declare module '@mui/x-data-grid' {
63
- interface GridEventLookup extends GridEventLookupPro {}
64
- interface GridControlledStateEventLookup extends GridControlledStateEventLookupPro {}
65
- interface GridPipeProcessingLookup extends GridPipeProcessingLookupPro {}
66
- }
67
- declare module '@mui/x-data-grid/internals' {
68
- interface GridApiCaches extends GridApiCachesPro {}
69
- interface GridBaseColDef extends GridColDefPro {}
70
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- import type { GridApiPro } from '../models/gridApiPro';
2
- import type { GridInitialStatePro, GridStatePro } from '../models/gridStatePro';
3
- export { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
4
- export { useGridApiRef } from "../hooks/utils/useGridApiRef.js";
5
- export { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
6
- /**
7
- * The full grid API.
8
- */
9
- export type GridApi = GridApiPro;
10
- /**
11
- * The state of Data Grid Pro.
12
- */
13
- export type GridState = GridStatePro;
14
- /**
15
- * The initial state of Data Grid Pro.
16
- */
17
- export type GridInitialState = GridInitialStatePro;
@@ -1,15 +0,0 @@
1
- export { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
2
- export { useGridApiRef } from "../hooks/utils/useGridApiRef.js";
3
- export { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
4
-
5
- /**
6
- * The full grid API.
7
- */
8
-
9
- /**
10
- * The state of Data Grid Pro.
11
- */
12
-
13
- /**
14
- * The initial state of Data Grid Pro.
15
- */
@@ -1 +0,0 @@
1
- export * from "./tree/index.js";
@@ -1 +0,0 @@
1
- export * from "./tree/index.js";
@@ -1 +0,0 @@
1
- export declare const getReleaseInfo: () => any;
@@ -1,13 +0,0 @@
1
- import { ponyfillGlobal } from '@mui/utils';
2
- export const getReleaseInfo = () => {
3
- const releaseInfo = "MTc0MzYzMTIwMDAwMA==";
4
- if (process.env.NODE_ENV !== 'production') {
5
- // A simple hack to set the value in the test environment (has no build step).
6
- // eslint-disable-next-line no-useless-concat
7
- if (releaseInfo === '__RELEASE' + '_INFO__') {
8
- // eslint-disable-next-line no-underscore-dangle
9
- return ponyfillGlobal.__MUI_RELEASE_INFO__;
10
- }
11
- }
12
- return releaseInfo;
13
- };
@@ -1,17 +0,0 @@
1
- import { GridRowTreeConfig } from '@mui/x-data-grid';
2
- import { GridRowTreeCreationValue } from '@mui/x-data-grid/internals';
3
- import { RowTreeBuilderNode, GridTreePathDuplicateHandler } from "./models.js";
4
- import { DataGridProProps } from "../../models/dataGridProProps.js";
5
- interface CreateRowTreeParams {
6
- previousTree: GridRowTreeConfig | null;
7
- nodes: RowTreeBuilderNode[];
8
- defaultGroupingExpansionDepth: number;
9
- isGroupExpandedByDefault?: DataGridProProps['isGroupExpandedByDefault'];
10
- groupingName: string;
11
- onDuplicatePath?: GridTreePathDuplicateHandler;
12
- }
13
- /**
14
- * Transform a list of rows into a tree structure where each row references its parent and children.
15
- */
16
- export declare const createRowTree: (params: CreateRowTreeParams) => GridRowTreeCreationValue;
17
- export {};
@@ -1,37 +0,0 @@
1
- import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid';
2
- import { buildRootGroup } from '@mui/x-data-grid/internals';
3
- import { insertDataRowInTree } from "./insertDataRowInTree.js";
4
- /**
5
- * Transform a list of rows into a tree structure where each row references its parent and children.
6
- */
7
- export const createRowTree = params => {
8
- const dataRowIds = [];
9
- const tree = {
10
- [GRID_ROOT_GROUP_ID]: buildRootGroup()
11
- };
12
- const treeDepths = {};
13
- const groupsToFetch = new Set();
14
- for (let i = 0; i < params.nodes.length; i += 1) {
15
- const node = params.nodes[i];
16
- dataRowIds.push(node.id);
17
- insertDataRowInTree({
18
- tree,
19
- previousTree: params.previousTree,
20
- id: node.id,
21
- path: node.path,
22
- serverChildrenCount: node.serverChildrenCount,
23
- onDuplicatePath: params.onDuplicatePath,
24
- treeDepths,
25
- isGroupExpandedByDefault: params.isGroupExpandedByDefault,
26
- defaultGroupingExpansionDepth: params.defaultGroupingExpansionDepth,
27
- groupsToFetch
28
- });
29
- }
30
- return {
31
- tree,
32
- treeDepths,
33
- groupingName: params.groupingName,
34
- dataRowIds,
35
- groupsToFetch: Array.from(groupsToFetch)
36
- };
37
- };
@@ -1 +0,0 @@
1
- export { getGroupRowIdFromPath } from "./utils.js";
@@ -1 +0,0 @@
1
- export { getGroupRowIdFromPath } from "./utils.js";
@@ -1,69 +0,0 @@
1
- import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
2
- import { GridTreeDepths, GridRowTreeUpdatedGroupsManager } from '@mui/x-data-grid/internals';
3
- import { GridTreePathDuplicateHandler, RowTreeBuilderGroupingCriterion } from "./models.js";
4
- import { DataGridProProps } from "../../models/dataGridProProps.js";
5
- interface InsertDataRowInTreeParams {
6
- /**
7
- * ID of the data row to insert in the tree.
8
- */
9
- id: GridRowId;
10
- /**
11
- * Path of the data row to insert in the tree.
12
- */
13
- path: RowTreeBuilderGroupingCriterion[];
14
- /**
15
- * Tree in which to insert the data row.
16
- * This tree can be mutated but it's children should not.
17
- * For instance:
18
- *
19
- * - `tree[nodeId] = newNode` => valid
20
- * - `tree[nodeId].children.push(newNodeId)` => invalid
21
- */
22
- tree: GridRowTreeConfig;
23
- /**
24
- * Previous tree instance for comparison.
25
- */
26
- previousTree: GridRowTreeConfig | null;
27
- /**
28
- * Amount of nodes at each depth of the tree.
29
- * This object can be mutated.
30
- * For instance:
31
- *
32
- * - `treeDepths[nodeDepth] = treeDepth[nodeDepth] + 1` => valid
33
- */
34
- treeDepths: GridTreeDepths;
35
- /**
36
- * Object tracking the action performed on each group.
37
- * Used to decide which groups to refresh on sorting, filtering, aggregation, ...
38
- * If not defined, then the tracking will be skipped.
39
- */
40
- updatedGroupsManager?: GridRowTreeUpdatedGroupsManager;
41
- /**
42
- * Callback fired when trying to insert a data row for a path already populated by another data row.
43
- */
44
- onDuplicatePath?: GridTreePathDuplicateHandler;
45
- isGroupExpandedByDefault?: DataGridProProps['isGroupExpandedByDefault'];
46
- defaultGroupingExpansionDepth: number;
47
- serverChildrenCount?: number;
48
- groupsToFetch?: Set<GridRowId>;
49
- }
50
- /**
51
- * Inserts a data row in a tree.
52
- * For each steps of its path:
53
- * - if a node exists with the same partial path, it will register this node as the ancestor of the data row.
54
- * - if not, it will create an auto-generated node and register it as ancestor of the data row.
55
- */
56
- export declare const insertDataRowInTree: ({
57
- id,
58
- path,
59
- updatedGroupsManager,
60
- previousTree,
61
- tree,
62
- treeDepths,
63
- onDuplicatePath,
64
- isGroupExpandedByDefault,
65
- defaultGroupingExpansionDepth,
66
- serverChildrenCount,
67
- groupsToFetch
68
- }: InsertDataRowInTreeParams) => void;
69
- export {};
@@ -1,141 +0,0 @@
1
- import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid';
2
- import { updateGroupDefaultExpansion, checkGroupChildrenExpansion, getGroupRowIdFromPath, insertNodeInTree, updateGroupNodeIdAndAutoGenerated } from "./utils.js";
3
- /**
4
- * Inserts a data row in a tree.
5
- * For each steps of its path:
6
- * - if a node exists with the same partial path, it will register this node as the ancestor of the data row.
7
- * - if not, it will create an auto-generated node and register it as ancestor of the data row.
8
- */
9
- export const insertDataRowInTree = ({
10
- id,
11
- path,
12
- updatedGroupsManager,
13
- previousTree,
14
- tree,
15
- treeDepths,
16
- onDuplicatePath,
17
- isGroupExpandedByDefault,
18
- defaultGroupingExpansionDepth,
19
- serverChildrenCount,
20
- groupsToFetch
21
- }) => {
22
- let parentNodeId = GRID_ROOT_GROUP_ID;
23
- for (let depth = 0; depth < path.length; depth += 1) {
24
- const {
25
- key,
26
- field
27
- } = path[depth];
28
- const fieldWithDefaultValue = field ?? '__no_field__';
29
- const keyWithDefaultValue = key ?? '__no_key__';
30
- const existingNodeIdWithPartialPath = tree[parentNodeId].childrenFromPath?.[fieldWithDefaultValue]?.[keyWithDefaultValue.toString()];
31
-
32
- // When we reach the last step of the path,
33
- // We need to create a node for the row passed to `insertNodeInTree`
34
- if (depth === path.length - 1) {
35
- // If no node matches the full path,
36
- // We create a leaf node for the data row.
37
- if (existingNodeIdWithPartialPath == null) {
38
- let node;
39
- if (serverChildrenCount !== undefined && serverChildrenCount !== 0) {
40
- node = {
41
- type: 'group',
42
- id,
43
- parent: parentNodeId,
44
- path: path.map(step => step.key),
45
- depth,
46
- isAutoGenerated: false,
47
- groupingKey: key,
48
- groupingField: field,
49
- children: [],
50
- childrenFromPath: {},
51
- childrenExpanded: false,
52
- serverChildrenCount
53
- };
54
- const shouldFetchChildren = checkGroupChildrenExpansion(node, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
55
- if (shouldFetchChildren) {
56
- groupsToFetch?.add(id);
57
- }
58
- } else {
59
- node = {
60
- type: 'leaf',
61
- id,
62
- depth,
63
- parent: parentNodeId,
64
- groupingKey: key
65
- };
66
- }
67
- updatedGroupsManager?.addAction(parentNodeId, 'insertChildren');
68
- insertNodeInTree(node, tree, treeDepths, previousTree);
69
- } else {
70
- const existingNodeWithPartialPath = tree[existingNodeIdWithPartialPath];
71
-
72
- // If we already have an auto-generated group matching the partial path,
73
- // We replace it with the node from of data row passed to `insertNodeInTree`
74
- if (existingNodeWithPartialPath.type === 'group' && existingNodeWithPartialPath.isAutoGenerated) {
75
- updatedGroupsManager?.addAction(parentNodeId, 'removeChildren');
76
- updatedGroupsManager?.addAction(parentNodeId, 'insertChildren');
77
- updateGroupNodeIdAndAutoGenerated({
78
- tree,
79
- previousTree,
80
- treeDepths,
81
- node: existingNodeWithPartialPath,
82
- updatedNode: {
83
- id,
84
- isAutoGenerated: false
85
- }
86
- });
87
- } else {
88
- // If we have another row matching the partial path, then there is a duplicate in the dataset.
89
- // We warn the user and skip the current row.
90
- onDuplicatePath?.(existingNodeIdWithPartialPath, id, path);
91
- }
92
- }
93
- }
94
- // For the intermediary steps of the path,
95
- // We need to make sure that there is a node matching the partial path.
96
- //
97
- // If no node matches the partial path,
98
- // We create an auto-generated group node.
99
- else if (existingNodeIdWithPartialPath == null) {
100
- const nodeId = getGroupRowIdFromPath(path.slice(0, depth + 1));
101
- const autoGeneratedGroupNode = {
102
- type: 'group',
103
- id: nodeId,
104
- parent: parentNodeId,
105
- depth,
106
- isAutoGenerated: true,
107
- groupingKey: key,
108
- groupingField: field,
109
- children: [],
110
- childrenFromPath: {},
111
- childrenExpanded: false
112
- };
113
- updatedGroupsManager?.addAction(parentNodeId, 'insertChildren');
114
- insertNodeInTree(updateGroupDefaultExpansion(autoGeneratedGroupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault), tree, treeDepths, previousTree);
115
- parentNodeId = nodeId;
116
- }
117
- // For the intermediary steps of the path
118
- // If a node matches the partial path, we use it as parent for the next step
119
- else {
120
- const currentGroupNode = tree[existingNodeIdWithPartialPath];
121
-
122
- // If the node matching the partial path is not a group, we turn it into a group
123
- if (currentGroupNode.type !== 'group') {
124
- const groupNode = {
125
- type: 'group',
126
- id: currentGroupNode.id,
127
- parent: currentGroupNode.parent,
128
- depth: currentGroupNode.depth,
129
- isAutoGenerated: false,
130
- groupingKey: key,
131
- groupingField: field,
132
- children: [],
133
- childrenFromPath: {},
134
- childrenExpanded: false
135
- };
136
- tree[existingNodeIdWithPartialPath] = updateGroupDefaultExpansion(groupNode, defaultGroupingExpansionDepth, isGroupExpandedByDefault);
137
- }
138
- parentNodeId = currentGroupNode.id;
139
- }
140
- }
141
- };
@@ -1,14 +0,0 @@
1
- import { GridKeyValue, GridRowId } from '@mui/x-data-grid';
2
- export interface RowTreeBuilderGroupingCriterion {
3
- field: string | null;
4
- key: GridKeyValue | null;
5
- }
6
- export interface RowTreeBuilderNode {
7
- id: GridRowId;
8
- path: RowTreeBuilderGroupingCriterion[];
9
- serverChildrenCount?: number;
10
- }
11
- /**
12
- * Callback called when trying to insert a data row in the tree in place of an already existing data row.
13
- */
14
- export type GridTreePathDuplicateHandler = (firstId: GridRowId, secondId: GridRowId, path: RowTreeBuilderGroupingCriterion[]) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
2
- import { GridTreeDepths, GridRowTreeUpdatedGroupsManager } from '@mui/x-data-grid/internals';
3
- interface RemoveDataRowFromTreeParams {
4
- /**
5
- * ID of the data row to remove from the tree.
6
- */
7
- id: GridRowId;
8
- /**
9
- * Tree from which to remove the data row.
10
- * This tree can be mutated but it's children should not.
11
- * For instance:
12
- *
13
- * - `tree[nodeId] = newNode` => valid
14
- * - `tree[nodeId].children.push(newNodeId)` => invalid
15
- */
16
- tree: GridRowTreeConfig;
17
- /**
18
- * Amount of nodes at each depth of the tree.
19
- * This object can be mutated.
20
- * For instance:
21
- *
22
- * - `treeDepths[nodeDepth] = treeDepth[nodeDepth] + 1` => valid
23
- */
24
- treeDepths: GridTreeDepths;
25
- /**
26
- * Object tracking the action performed on each group.
27
- * Used to decide which groups to refresh on sorting, filtering, aggregation, ...
28
- * If not defined, then the tracking will be skipped.
29
- */
30
- updatedGroupsManager?: GridRowTreeUpdatedGroupsManager;
31
- }
32
- /**
33
- * Removed a data row from the tree.
34
- * If the node is a non-empty group, replace it with an auto-generated group to be able to keep displaying its children.
35
- * If not, remove it and recursively clean its parent with the following rules:
36
- * - An empty auto-generated should be removed from the tree
37
- * - An empty non-auto-generated should be turned into a leaf
38
- */
39
- export declare const removeDataRowFromTree: ({
40
- id,
41
- tree,
42
- treeDepths,
43
- updatedGroupsManager
44
- }: RemoveDataRowFromTreeParams) => void;
45
- export {};
@@ -1,94 +0,0 @@
1
- import { GRID_ROOT_GROUP_ID } from '@mui/x-data-grid';
2
- import { getNodePathInTree, getGroupRowIdFromPath, removeNodeFromTree, updateGroupNodeIdAndAutoGenerated } from "./utils.js";
3
- const removeNodeAndCleanParent = ({
4
- node,
5
- tree,
6
- treeDepths,
7
- updatedGroupsManager
8
- }) => {
9
- removeNodeFromTree({
10
- node,
11
- tree,
12
- treeDepths
13
- });
14
- if (node.type === 'group' && node.footerId != null) {
15
- removeNodeFromTree({
16
- node: tree[node.footerId],
17
- tree,
18
- treeDepths
19
- });
20
- }
21
- const parentNode = tree[node.parent];
22
- updatedGroupsManager?.addAction(parentNode.id, 'removeChildren');
23
- const shouldDeleteGroup = parentNode.id !== GRID_ROOT_GROUP_ID && parentNode.children.length === 0;
24
- if (shouldDeleteGroup) {
25
- if (parentNode.isAutoGenerated) {
26
- removeNodeAndCleanParent({
27
- node: parentNode,
28
- tree,
29
- treeDepths
30
- });
31
- } else {
32
- tree[parentNode.id] = {
33
- type: 'leaf',
34
- id: parentNode.id,
35
- depth: parentNode.depth,
36
- parent: parentNode.parent,
37
- groupingKey: parentNode.groupingKey
38
- };
39
- }
40
- }
41
- };
42
- const replaceDataGroupWithAutoGeneratedGroup = ({
43
- node,
44
- tree,
45
- treeDepths,
46
- updatedGroupsManager
47
- }) => {
48
- updatedGroupsManager?.addAction(node.parent, 'removeChildren');
49
- updatedGroupsManager?.addAction(node.parent, 'insertChildren');
50
- updateGroupNodeIdAndAutoGenerated({
51
- previousTree: null,
52
- tree,
53
- treeDepths,
54
- node,
55
- updatedNode: {
56
- id: getGroupRowIdFromPath(getNodePathInTree({
57
- id: node.id,
58
- tree
59
- })),
60
- isAutoGenerated: true
61
- }
62
- });
63
- };
64
-
65
- /**
66
- * Removed a data row from the tree.
67
- * If the node is a non-empty group, replace it with an auto-generated group to be able to keep displaying its children.
68
- * If not, remove it and recursively clean its parent with the following rules:
69
- * - An empty auto-generated should be removed from the tree
70
- * - An empty non-auto-generated should be turned into a leaf
71
- */
72
- export const removeDataRowFromTree = ({
73
- id,
74
- tree,
75
- treeDepths,
76
- updatedGroupsManager
77
- }) => {
78
- const node = tree[id];
79
- if (node.type === 'group' && node.children.length > 0) {
80
- replaceDataGroupWithAutoGeneratedGroup({
81
- node,
82
- tree,
83
- treeDepths,
84
- updatedGroupsManager
85
- });
86
- } else {
87
- removeNodeAndCleanParent({
88
- node,
89
- tree,
90
- treeDepths,
91
- updatedGroupsManager
92
- });
93
- }
94
- };
@@ -1,15 +0,0 @@
1
- import { GridRowId, GridRowTreeConfig } from '@mui/x-data-grid';
2
- import { GridSortingModelApplier } from '@mui/x-data-grid/internals';
3
- interface SortRowTreeParams {
4
- rowTree: GridRowTreeConfig;
5
- disableChildrenSorting: boolean;
6
- sortRowList: GridSortingModelApplier | null;
7
- /**
8
- * Defines where the groups are placed relative to the leaves of same depth when no sorting rule is applied.
9
- * If `true` the groups will be rendered below the leaves.
10
- * If `false`, the groups will be rendered on their creation order.
11
- */
12
- shouldRenderGroupBelowLeaves: boolean;
13
- }
14
- export declare const sortRowTree: (params: SortRowTreeParams) => GridRowId[];
15
- export {};