@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,121 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
- import composeClasses from '@mui/utils/composeClasses';
5
- import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid';
6
- import { createSelector } from '@mui/x-data-grid/internals';
7
- import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
8
- import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
9
- import { gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector } from "../hooks/features/detailPanel/gridDetailPanelSelector.js";
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- const useUtilityClasses = ownerState => {
12
- const {
13
- classes,
14
- isExpanded
15
- } = ownerState;
16
- const slots = {
17
- root: ['detailPanelToggleCell', isExpanded && 'detailPanelToggleCell--expanded']
18
- };
19
- return composeClasses(slots, getDataGridUtilityClass, classes);
20
- };
21
- const isExpandedSelector = createSelector(gridDetailPanelExpandedRowIdsSelector, (expandedRowIds, rowId) => {
22
- return expandedRowIds.has(rowId);
23
- });
24
- function GridDetailPanelToggleCell(props) {
25
- const {
26
- id,
27
- row,
28
- api
29
- } = props;
30
- const rowId = api.getRowId(row);
31
- const isExpanded = useGridSelector({
32
- current: api
33
- }, isExpandedSelector, rowId);
34
- const rootProps = useGridRootProps();
35
- const apiRef = useGridApiContext();
36
- const ownerState = {
37
- classes: rootProps.classes,
38
- isExpanded
39
- };
40
- const classes = useUtilityClasses(ownerState);
41
- const contentCache = useGridSelector(apiRef, gridDetailPanelExpandedRowsContentCacheSelector);
42
- const hasContent = /*#__PURE__*/React.isValidElement(contentCache[id]);
43
- const Icon = isExpanded ? rootProps.slots.detailPanelCollapseIcon : rootProps.slots.detailPanelExpandIcon;
44
- return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
45
- size: "small",
46
- tabIndex: -1,
47
- disabled: !hasContent,
48
- className: classes.root,
49
- "aria-label": isExpanded ? apiRef.current.getLocaleText('collapseDetailPanel') : apiRef.current.getLocaleText('expandDetailPanel')
50
- }, rootProps.slotProps?.baseIconButton, {
51
- children: /*#__PURE__*/_jsx(Icon, {
52
- fontSize: "inherit"
53
- })
54
- }));
55
- }
56
- process.env.NODE_ENV !== "production" ? GridDetailPanelToggleCell.propTypes = {
57
- // ----------------------------- Warning --------------------------------
58
- // | These PropTypes are generated from the TypeScript type definitions |
59
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
60
- // ----------------------------------------------------------------------
61
- /**
62
- * GridApi that let you manipulate the grid.
63
- */
64
- api: PropTypes.object.isRequired,
65
- /**
66
- * The mode of the cell.
67
- */
68
- cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
69
- /**
70
- * The column of the row that the current cell belongs to.
71
- */
72
- colDef: PropTypes.object.isRequired,
73
- /**
74
- * The column field of the cell that triggered the event.
75
- */
76
- field: PropTypes.string.isRequired,
77
- /**
78
- * A ref allowing to set imperative focus.
79
- * It can be passed to the element that should receive focus.
80
- * @ignore - do not document.
81
- */
82
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
83
- current: PropTypes.shape({
84
- focus: PropTypes.func.isRequired
85
- })
86
- })]),
87
- /**
88
- * The cell value formatted with the column valueFormatter.
89
- */
90
- formattedValue: PropTypes.any,
91
- /**
92
- * If true, the cell is the active element.
93
- */
94
- hasFocus: PropTypes.bool.isRequired,
95
- /**
96
- * The grid row id.
97
- */
98
- id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
99
- /**
100
- * If true, the cell is editable.
101
- */
102
- isEditable: PropTypes.bool,
103
- /**
104
- * The row model of the row that the current cell belongs to.
105
- */
106
- row: PropTypes.any.isRequired,
107
- /**
108
- * The node of the row that the current cell belongs to.
109
- */
110
- rowNode: PropTypes.object.isRequired,
111
- /**
112
- * the tabIndex value.
113
- */
114
- tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
115
- /**
116
- * The cell value.
117
- * If the column has `valueGetter`, use `params.row` to directly access the fields.
118
- */
119
- value: PropTypes.any
120
- } : void 0;
121
- export { GridDetailPanelToggleCell };
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import { GridDetailPanelsProps } from '@mui/x-data-grid/internals';
3
- export declare function GridDetailPanels(props: GridDetailPanelsProps): React.FunctionComponentElement<GridDetailPanelsProps> | null;
@@ -1,67 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import composeClasses from '@mui/utils/composeClasses';
5
- import { getDataGridUtilityClass, useGridSelector } from '@mui/x-data-grid';
6
- import { EMPTY_DETAIL_PANELS } from '@mui/x-data-grid/internals';
7
- import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
8
- import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
9
- import { gridDetailPanelExpandedRowsContentCacheSelector, gridDetailPanelExpandedRowIdsSelector } from "../hooks/features/detailPanel/index.js";
10
- import { GridDetailPanel } from "./GridDetailPanel.js";
11
- import { gridDetailPanelRawHeightCacheSelector } from "../hooks/features/detailPanel/gridDetailPanelSelector.js";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- const useUtilityClasses = () => {
14
- const slots = {
15
- detailPanel: ['detailPanel']
16
- };
17
- return composeClasses(slots, getDataGridUtilityClass, {});
18
- };
19
- export function GridDetailPanels(props) {
20
- const rootProps = useGridRootProps();
21
- if (!rootProps.getDetailPanelContent) {
22
- return null;
23
- }
24
- return /*#__PURE__*/React.createElement(GridDetailPanelsImpl, props);
25
- }
26
- function GridDetailPanelsImpl({
27
- virtualScroller
28
- }) {
29
- const apiRef = useGridPrivateApiContext();
30
- const classes = useUtilityClasses();
31
- const {
32
- setPanels
33
- } = virtualScroller;
34
- const expandedRowIds = useGridSelector(apiRef, gridDetailPanelExpandedRowIdsSelector);
35
- const detailPanelsContent = useGridSelector(apiRef, gridDetailPanelExpandedRowsContentCacheSelector);
36
- const detailPanelsHeights = useGridSelector(apiRef, gridDetailPanelRawHeightCacheSelector);
37
- const getDetailPanel = React.useCallback(rowId => {
38
- const content = detailPanelsContent[rowId];
39
-
40
- // Check if the id exists in the current page
41
- const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);
42
- const exists = rowIndex !== undefined;
43
- if (! /*#__PURE__*/React.isValidElement(content) || !exists) {
44
- return null;
45
- }
46
- const heightCache = detailPanelsHeights[rowId];
47
- const height = heightCache.autoHeight ? 'auto' : heightCache.height;
48
- return /*#__PURE__*/_jsx(GridDetailPanel, {
49
- rowId: rowId,
50
- height: height,
51
- className: classes.detailPanel,
52
- children: content
53
- }, `panel-${rowId}`);
54
- }, [apiRef, classes.detailPanel, detailPanelsHeights, detailPanelsContent]);
55
- React.useEffect(() => {
56
- if (expandedRowIds.size === 0) {
57
- setPanels(EMPTY_DETAIL_PANELS);
58
- } else {
59
- const map = new Map();
60
- for (const rowId of expandedRowIds) {
61
- map.set(rowId, getDetailPanel(rowId));
62
- }
63
- setPanels(map);
64
- }
65
- }, [expandedRowIds, setPanels, getDetailPanel]);
66
- return null;
67
- }
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { GridPinnedRowsProps } from '@mui/x-data-grid/internals';
3
- export declare function GridPinnedRows({
4
- position,
5
- virtualScroller
6
- }: GridPinnedRowsProps): React.JSX.Element | null;
@@ -1,40 +0,0 @@
1
- import * as React from 'react';
2
- import clsx from 'clsx';
3
- import composeClasses from '@mui/utils/composeClasses';
4
- import { getDataGridUtilityClass, gridClasses, useGridSelector } from '@mui/x-data-grid';
5
- import { gridPinnedRowsSelector, useGridPrivateApiContext } from '@mui/x-data-grid/internals';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- const useUtilityClasses = () => {
8
- const slots = {
9
- root: ['pinnedRows']
10
- };
11
- return composeClasses(slots, getDataGridUtilityClass, {});
12
- };
13
- export function GridPinnedRows({
14
- position,
15
- virtualScroller
16
- }) {
17
- const classes = useUtilityClasses();
18
- const apiRef = useGridPrivateApiContext();
19
- const pinnedRowsData = useGridSelector(apiRef, gridPinnedRowsSelector);
20
- const rows = pinnedRowsData[position];
21
- const pinnedRenderContext = React.useMemo(() => ({
22
- firstRowIndex: 0,
23
- lastRowIndex: rows.length,
24
- firstColumnIndex: -1,
25
- lastColumnIndex: -1
26
- }), [rows]);
27
- if (rows.length === 0) {
28
- return null;
29
- }
30
- const pinnedRows = virtualScroller.getRows({
31
- position,
32
- rows,
33
- renderContext: pinnedRenderContext
34
- });
35
- return /*#__PURE__*/_jsx("div", {
36
- className: clsx(classes.root, gridClasses[`pinnedRows--${position}`]),
37
- role: "presentation",
38
- children: pinnedRows
39
- });
40
- }
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
- import { GridColumnMenuProps } from '@mui/x-data-grid';
3
- import { GridColumnMenuPinningItem } from "./GridColumnMenuPinningItem.js";
4
- export declare const GRID_COLUMN_MENU_SLOTS_PRO: {
5
- columnMenuPinningItem: typeof GridColumnMenuPinningItem;
6
- columnMenuSortItem: typeof import("@mui/x-data-grid").GridColumnMenuSortItem;
7
- columnMenuFilterItem: typeof import("@mui/x-data-grid").GridColumnMenuFilterItem;
8
- columnMenuColumnsItem: typeof import("@mui/x-data-grid").GridColumnMenuColumnsItem;
9
- };
10
- export declare const GRID_COLUMN_MENU_SLOT_PROPS_PRO: {
11
- columnMenuPinningItem: {
12
- displayOrder: number;
13
- };
14
- columnMenuSortItem: {
15
- displayOrder: number;
16
- };
17
- columnMenuFilterItem: {
18
- displayOrder: number;
19
- };
20
- columnMenuColumnsItem: {
21
- displayOrder: number;
22
- };
23
- };
24
- export declare const GridProColumnMenu: React.ForwardRefExoticComponent<GridColumnMenuProps> | React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
@@ -1,21 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import { GridGenericColumnMenu, GRID_COLUMN_MENU_SLOTS, GRID_COLUMN_MENU_SLOT_PROPS } from '@mui/x-data-grid';
4
- import { forwardRef } from '@mui/x-internals/forwardRef';
5
- import { GridColumnMenuPinningItem } from "./GridColumnMenuPinningItem.js";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- export const GRID_COLUMN_MENU_SLOTS_PRO = _extends({}, GRID_COLUMN_MENU_SLOTS, {
8
- columnMenuPinningItem: GridColumnMenuPinningItem
9
- });
10
- export const GRID_COLUMN_MENU_SLOT_PROPS_PRO = _extends({}, GRID_COLUMN_MENU_SLOT_PROPS, {
11
- columnMenuPinningItem: {
12
- displayOrder: 15
13
- }
14
- });
15
- export const GridProColumnMenu = forwardRef(function GridProColumnMenu(props, ref) {
16
- return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {
17
- defaultSlots: GRID_COLUMN_MENU_SLOTS_PRO,
18
- defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS_PRO,
19
- ref: ref
20
- }));
21
- });
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { GridRenderCellParams } from '@mui/x-data-grid';
3
- declare function GridRowReorderCell(params: GridRenderCellParams): React.JSX.Element | null;
4
- declare namespace GridRowReorderCell {
5
- var propTypes: any;
6
- }
7
- export { GridRowReorderCell };
8
- export declare const renderRowReorderCell: (params: GridRenderCellParams) => React.JSX.Element | null;
@@ -1,140 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
- import composeClasses from '@mui/utils/composeClasses';
5
- import { gridRowMaximumTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
6
- import { gridEditRowsStateSelector, isEventTargetInPortal } from '@mui/x-data-grid/internals';
7
- import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- const useUtilityClasses = ownerState => {
10
- const {
11
- isDraggable,
12
- classes
13
- } = ownerState;
14
- const slots = {
15
- root: ['rowReorderCell', isDraggable && 'rowReorderCell--draggable'],
16
- placeholder: ['rowReorderCellPlaceholder']
17
- };
18
- return composeClasses(slots, getDataGridUtilityClass, classes);
19
- };
20
- function GridRowReorderCell(params) {
21
- const apiRef = useGridApiContext();
22
- const rootProps = useGridRootProps();
23
- const sortModel = useGridSelector(apiRef, gridSortModelSelector);
24
- const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
25
- const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);
26
- // eslint-disable-next-line no-underscore-dangle
27
- const cellValue = params.row.__reorder__ || params.id;
28
-
29
- // TODO: remove sortModel and treeDepth checks once row reorder is compatible
30
- const isDraggable = React.useMemo(() => !!rootProps.rowReordering && !sortModel.length && treeDepth === 1 && Object.keys(editRowsState).length === 0, [rootProps.rowReordering, sortModel, treeDepth, editRowsState]);
31
- const ownerState = {
32
- isDraggable,
33
- classes: rootProps.classes
34
- };
35
- const classes = useUtilityClasses(ownerState);
36
- const publish = React.useCallback((eventName, propHandler) => event => {
37
- // Ignore portal
38
- if (isEventTargetInPortal(event)) {
39
- return;
40
- }
41
-
42
- // The row might have been deleted
43
- if (!apiRef.current.getRow(params.id)) {
44
- return;
45
- }
46
- apiRef.current.publishEvent(eventName, apiRef.current.getRowParams(params.id), event);
47
- if (propHandler) {
48
- propHandler(event);
49
- }
50
- }, [apiRef, params.id]);
51
- const draggableEventHandlers = isDraggable ? {
52
- onDragStart: publish('rowDragStart'),
53
- onDragOver: publish('rowDragOver'),
54
- onDragEnd: publish('rowDragEnd')
55
- } : null;
56
- if (params.rowNode.type === 'footer') {
57
- return null;
58
- }
59
- return /*#__PURE__*/_jsxs("div", _extends({
60
- className: classes.root,
61
- draggable: isDraggable
62
- }, draggableEventHandlers, {
63
- children: [/*#__PURE__*/_jsx(rootProps.slots.rowReorderIcon, {}), /*#__PURE__*/_jsx("div", {
64
- className: classes.placeholder,
65
- children: cellValue
66
- })]
67
- }));
68
- }
69
- process.env.NODE_ENV !== "production" ? GridRowReorderCell.propTypes = {
70
- // ----------------------------- Warning --------------------------------
71
- // | These PropTypes are generated from the TypeScript type definitions |
72
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
73
- // ----------------------------------------------------------------------
74
- /**
75
- * GridApi that let you manipulate the grid.
76
- */
77
- api: PropTypes.object.isRequired,
78
- /**
79
- * The mode of the cell.
80
- */
81
- cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
82
- /**
83
- * The column of the row that the current cell belongs to.
84
- */
85
- colDef: PropTypes.object.isRequired,
86
- /**
87
- * The column field of the cell that triggered the event.
88
- */
89
- field: PropTypes.string.isRequired,
90
- /**
91
- * A ref allowing to set imperative focus.
92
- * It can be passed to the element that should receive focus.
93
- * @ignore - do not document.
94
- */
95
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
96
- current: PropTypes.shape({
97
- focus: PropTypes.func.isRequired
98
- })
99
- })]),
100
- /**
101
- * The cell value formatted with the column valueFormatter.
102
- */
103
- formattedValue: PropTypes.any,
104
- /**
105
- * If true, the cell is the active element.
106
- */
107
- hasFocus: PropTypes.bool.isRequired,
108
- /**
109
- * The grid row id.
110
- */
111
- id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
112
- /**
113
- * If true, the cell is editable.
114
- */
115
- isEditable: PropTypes.bool,
116
- /**
117
- * The row model of the row that the current cell belongs to.
118
- */
119
- row: PropTypes.any.isRequired,
120
- /**
121
- * The node of the row that the current cell belongs to.
122
- */
123
- rowNode: PropTypes.object.isRequired,
124
- /**
125
- * the tabIndex value.
126
- */
127
- tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
128
- /**
129
- * The cell value.
130
- * If the column has `valueGetter`, use `params.row` to directly access the fields.
131
- */
132
- value: PropTypes.any
133
- } : void 0;
134
- export { GridRowReorderCell };
135
- export const renderRowReorderCell = params => {
136
- if (params.rowNode.type === 'footer' || params.rowNode.type === 'pinnedRow') {
137
- return null;
138
- }
139
- return /*#__PURE__*/_jsx(GridRowReorderCell, _extends({}, params));
140
- };
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import { GridRenderCellParams, GridGroupNode } from '@mui/x-data-grid';
3
- interface GridTreeDataGroupingCellProps extends GridRenderCellParams<any, any, any, GridGroupNode> {
4
- hideDescendantCount?: boolean;
5
- /**
6
- * The cell offset multiplier used for calculating cell offset (`rowNode.depth * offsetMultiplier` px).
7
- * @default 2
8
- */
9
- offsetMultiplier?: number;
10
- }
11
- declare function GridTreeDataGroupingCell(props: GridTreeDataGroupingCellProps): React.JSX.Element;
12
- declare namespace GridTreeDataGroupingCell {
13
- var propTypes: any;
14
- }
15
- export { GridTreeDataGroupingCell };
@@ -1,133 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
- import composeClasses from '@mui/utils/composeClasses';
5
- import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
6
- import { vars } from '@mui/x-data-grid/internals';
7
- import { useGridRootProps } from "../hooks/utils/useGridRootProps.js";
8
- import { useGridApiContext } from "../hooks/utils/useGridApiContext.js";
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- const useUtilityClasses = ownerState => {
11
- const {
12
- classes
13
- } = ownerState;
14
- const slots = {
15
- root: ['treeDataGroupingCell'],
16
- toggle: ['treeDataGroupingCellToggle']
17
- };
18
- return composeClasses(slots, getDataGridUtilityClass, classes);
19
- };
20
- function GridTreeDataGroupingCell(props) {
21
- const {
22
- id,
23
- field,
24
- formattedValue,
25
- rowNode,
26
- hideDescendantCount,
27
- offsetMultiplier = 2
28
- } = props;
29
- const rootProps = useGridRootProps();
30
- const apiRef = useGridApiContext();
31
- const classes = useUtilityClasses(rootProps);
32
- const filteredDescendantCountLookup = useGridSelector(apiRef, gridFilteredDescendantCountLookupSelector);
33
- const filteredDescendantCount = filteredDescendantCountLookup[rowNode.id] ?? 0;
34
- const Icon = rowNode.childrenExpanded ? rootProps.slots.treeDataCollapseIcon : rootProps.slots.treeDataExpandIcon;
35
- const handleClick = event => {
36
- apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded);
37
- apiRef.current.setCellFocus(id, field);
38
- event.stopPropagation(); // TODO remove event.stopPropagation
39
- };
40
- return /*#__PURE__*/_jsxs("div", {
41
- className: classes.root,
42
- style: {
43
- marginLeft: vars.spacing(rowNode.depth * offsetMultiplier)
44
- },
45
- children: [/*#__PURE__*/_jsx("div", {
46
- className: classes.toggle,
47
- children: filteredDescendantCount > 0 && /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
48
- size: "small",
49
- onClick: handleClick,
50
- tabIndex: -1,
51
- "aria-label": rowNode.childrenExpanded ? apiRef.current.getLocaleText('treeDataCollapse') : apiRef.current.getLocaleText('treeDataExpand')
52
- }, rootProps?.slotProps?.baseIconButton, {
53
- children: /*#__PURE__*/_jsx(Icon, {
54
- fontSize: "inherit"
55
- })
56
- }))
57
- }), /*#__PURE__*/_jsxs("span", {
58
- children: [formattedValue === undefined ? rowNode.groupingKey : formattedValue, !hideDescendantCount && filteredDescendantCount > 0 ? ` (${filteredDescendantCount})` : '']
59
- })]
60
- });
61
- }
62
- process.env.NODE_ENV !== "production" ? GridTreeDataGroupingCell.propTypes = {
63
- // ----------------------------- Warning --------------------------------
64
- // | These PropTypes are generated from the TypeScript type definitions |
65
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
66
- // ----------------------------------------------------------------------
67
- /**
68
- * GridApi that let you manipulate the grid.
69
- */
70
- api: PropTypes.object.isRequired,
71
- /**
72
- * The mode of the cell.
73
- */
74
- cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
75
- /**
76
- * The column of the row that the current cell belongs to.
77
- */
78
- colDef: PropTypes.object.isRequired,
79
- /**
80
- * The column field of the cell that triggered the event.
81
- */
82
- field: PropTypes.string.isRequired,
83
- /**
84
- * A ref allowing to set imperative focus.
85
- * It can be passed to the element that should receive focus.
86
- * @ignore - do not document.
87
- */
88
- focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
89
- current: PropTypes.shape({
90
- focus: PropTypes.func.isRequired
91
- })
92
- })]),
93
- /**
94
- * The cell value formatted with the column valueFormatter.
95
- */
96
- formattedValue: PropTypes.any,
97
- /**
98
- * If true, the cell is the active element.
99
- */
100
- hasFocus: PropTypes.bool.isRequired,
101
- hideDescendantCount: PropTypes.bool,
102
- /**
103
- * The grid row id.
104
- */
105
- id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
106
- /**
107
- * If true, the cell is editable.
108
- */
109
- isEditable: PropTypes.bool,
110
- /**
111
- * The cell offset multiplier used for calculating cell offset (`rowNode.depth * offsetMultiplier` px).
112
- * @default 2
113
- */
114
- offsetMultiplier: PropTypes.number,
115
- /**
116
- * The row model of the row that the current cell belongs to.
117
- */
118
- row: PropTypes.any.isRequired,
119
- /**
120
- * The node of the row that the current cell belongs to.
121
- */
122
- rowNode: PropTypes.object.isRequired,
123
- /**
124
- * the tabIndex value.
125
- */
126
- tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
127
- /**
128
- * The cell value.
129
- * If the column has `valueGetter`, use `params.row` to directly access the fields.
130
- */
131
- value: PropTypes.any
132
- } : void 0;
133
- export { GridTreeDataGroupingCell };
@@ -1,26 +0,0 @@
1
- import * as React from 'react';
2
- import { GridFilterItem, GridFilterOperator, GridColDef } from '@mui/x-data-grid';
3
- import { PinnedColumnPosition, GridStateColDef } from '@mui/x-data-grid/internals';
4
- export interface GridRenderHeaderFilterProps extends GridHeaderFilterCellProps {
5
- inputRef: React.RefObject<unknown>;
6
- }
7
- export interface GridHeaderFilterCellProps extends Pick<GridStateColDef, 'headerClassName'> {
8
- colIndex: number;
9
- height: number;
10
- sortIndex?: number;
11
- hasFocus?: boolean;
12
- tabIndex: 0 | -1;
13
- width: number;
14
- colDef: GridColDef;
15
- headerFilterMenuRef: React.RefObject<HTMLButtonElement | null>;
16
- item: GridFilterItem;
17
- showClearIcon?: boolean;
18
- InputComponentProps: GridFilterOperator['InputComponentProps'];
19
- pinnedPosition?: PinnedColumnPosition;
20
- pinnedOffset?: number;
21
- style?: React.CSSProperties;
22
- showLeftBorder: boolean;
23
- showRightBorder: boolean;
24
- }
25
- declare const Memoized: React.ForwardRefExoticComponent<GridHeaderFilterCellProps> | React.ForwardRefExoticComponent<GridHeaderFilterCellProps & React.RefAttributes<HTMLDivElement>>;
26
- export { Memoized as GridHeaderFilterCell };