@mui/x-data-grid 5.6.0 → 5.6.1

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 (230) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/DataGrid/DataGrid.js +18 -3
  3. package/DataGrid/useDataGridComponent.js +19 -15
  4. package/DataGrid/useDataGridProps.js +3 -2
  5. package/colDef/gridNumericOperators.d.ts +1 -1
  6. package/colDef/gridNumericOperators.js +1 -1
  7. package/components/ErrorBoundary.d.ts +2 -2
  8. package/components/GridRow.js +29 -3
  9. package/components/base/GridErrorHandler.d.ts +8 -2
  10. package/components/base/GridErrorHandler.js +13 -2
  11. package/components/cell/GridBooleanCell.d.ts +2 -1
  12. package/components/cell/GridCell.js +4 -2
  13. package/components/cell/GridEditBooleanCell.d.ts +2 -1
  14. package/components/cell/GridEditDateCell.d.ts +2 -1
  15. package/components/cell/GridEditInputCell.d.ts +2 -1
  16. package/components/cell/GridEditSingleSelectCell.d.ts +2 -1
  17. package/components/cell/GridEditSingleSelectCell.js +2 -1
  18. package/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  19. package/components/containers/GridRootStyles.js +1 -1
  20. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -1
  21. package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +27 -23
  22. package/components/panel/filterPanel/filterPanelUtils.d.ts +2 -2
  23. package/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
  24. package/constants/gridClasses.d.ts +5 -1
  25. package/constants/gridClasses.js +1 -1
  26. package/context/GridContextProvider.d.ts +9 -6
  27. package/hooks/features/columnMenu/useGridColumnMenu.d.ts +2 -0
  28. package/hooks/features/columnMenu/useGridColumnMenu.js +6 -7
  29. package/hooks/features/columns/gridColumnsSelector.d.ts +8 -8
  30. package/hooks/features/columns/gridColumnsSelector.js +11 -10
  31. package/hooks/features/columns/gridColumnsUtils.js +7 -5
  32. package/hooks/features/density/useGridDensity.d.ts +2 -0
  33. package/hooks/features/density/useGridDensity.js +3 -4
  34. package/hooks/features/dimensions/useGridDimensions.js +2 -2
  35. package/hooks/features/editRows/useGridEditing.d.ts +2 -0
  36. package/hooks/features/editRows/useGridEditing.js +3 -4
  37. package/hooks/features/export/serializers/csvSerializer.js +4 -4
  38. package/hooks/features/filter/gridFilterSelector.d.ts +1 -0
  39. package/hooks/features/filter/gridFilterSelector.js +1 -0
  40. package/hooks/features/focus/useGridFocus.d.ts +2 -0
  41. package/hooks/features/focus/useGridFocus.js +10 -11
  42. package/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
  43. package/hooks/features/pagination/useGridPage.d.ts +1 -2
  44. package/hooks/features/pagination/useGridPage.js +5 -17
  45. package/hooks/features/pagination/useGridPageSize.d.ts +1 -2
  46. package/hooks/features/pagination/useGridPageSize.js +5 -26
  47. package/hooks/features/pagination/useGridPagination.d.ts +2 -0
  48. package/hooks/features/pagination/useGridPagination.js +25 -2
  49. package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +3 -1
  50. package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +10 -11
  51. package/hooks/features/rows/useGridParamsApi.js +3 -10
  52. package/hooks/features/rows/useGridRows.js +14 -6
  53. package/hooks/features/rows/useGridRowsMeta.d.ts +3 -1
  54. package/hooks/features/rows/useGridRowsMeta.js +42 -24
  55. package/hooks/features/selection/gridSelectionSelector.d.ts +1 -1
  56. package/hooks/features/selection/useGridSelection.d.ts +2 -0
  57. package/hooks/features/selection/useGridSelection.js +28 -16
  58. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +8 -3
  59. package/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  60. package/hooks/utils/useGridApi.js +10 -1
  61. package/hooks/utils/useGridInitializeState.d.ts +2 -1
  62. package/hooks/utils/useGridSelector.js +4 -4
  63. package/hooks/utils/useGridState.js +10 -1
  64. package/hooks/utils/{useCurrentPageRows.d.ts → useGridVisibleRows.d.ts} +7 -6
  65. package/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +8 -7
  66. package/index.js +1 -1
  67. package/internals/index.d.ts +9 -12
  68. package/internals/index.js +9 -12
  69. package/legacy/DataGrid/DataGrid.js +18 -3
  70. package/legacy/DataGrid/useDataGridComponent.js +19 -15
  71. package/legacy/DataGrid/useDataGridProps.js +8 -2
  72. package/legacy/colDef/gridNumericOperators.js +1 -1
  73. package/legacy/components/GridRow.js +30 -3
  74. package/legacy/components/base/GridErrorHandler.js +13 -2
  75. package/legacy/components/cell/GridCell.js +4 -2
  76. package/legacy/components/cell/GridEditSingleSelectCell.js +10 -9
  77. package/legacy/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  78. package/legacy/components/containers/GridRootStyles.js +1 -1
  79. package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +29 -26
  80. package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
  81. package/legacy/constants/gridClasses.js +1 -1
  82. package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +8 -9
  83. package/legacy/hooks/features/columns/gridColumnsSelector.js +13 -12
  84. package/legacy/hooks/features/columns/gridColumnsUtils.js +7 -5
  85. package/legacy/hooks/features/density/useGridDensity.js +5 -6
  86. package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
  87. package/legacy/hooks/features/editRows/useGridEditing.js +5 -6
  88. package/legacy/hooks/features/export/serializers/csvSerializer.js +4 -4
  89. package/legacy/hooks/features/filter/gridFilterSelector.js +1 -0
  90. package/legacy/hooks/features/focus/useGridFocus.js +12 -13
  91. package/legacy/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
  92. package/legacy/hooks/features/pagination/useGridPage.js +5 -17
  93. package/legacy/hooks/features/pagination/useGridPageSize.js +5 -26
  94. package/legacy/hooks/features/pagination/useGridPagination.js +25 -2
  95. package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +10 -11
  96. package/legacy/hooks/features/rows/useGridParamsApi.js +3 -10
  97. package/legacy/hooks/features/rows/useGridRows.js +17 -6
  98. package/legacy/hooks/features/rows/useGridRowsMeta.js +44 -26
  99. package/legacy/hooks/features/selection/useGridSelection.js +29 -19
  100. package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  101. package/legacy/hooks/utils/useGridApi.js +7 -0
  102. package/legacy/hooks/utils/useGridSelector.js +4 -4
  103. package/legacy/hooks/utils/useGridState.js +7 -0
  104. package/legacy/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +8 -7
  105. package/legacy/index.js +1 -1
  106. package/legacy/internals/index.js +9 -12
  107. package/legacy/models/colDef/gridDefaultColumnTypes.js +4 -4
  108. package/legacy/utils/createSelector.js +4 -4
  109. package/legacy/utils/getGridLocalization.js +2 -2
  110. package/lib/lodash/_baseGetAllKeys.d.ts +1 -1
  111. package/lib/lodash/_baseIsEqual.d.ts +1 -1
  112. package/lib/lodash/_baseIsEqualDeep.d.ts +1 -1
  113. package/lib/lodash/_baseKeys.d.ts +1 -1
  114. package/lib/lodash/_cacheHas.d.ts +1 -1
  115. package/lib/lodash/_equalArrays.d.ts +1 -1
  116. package/lib/lodash/_equalByTag.d.ts +1 -1
  117. package/lib/lodash/_equalObjects.d.ts +1 -1
  118. package/lib/lodash/_getAllKeys.d.ts +1 -1
  119. package/lib/lodash/_getMapData.d.ts +1 -1
  120. package/lib/lodash/_getNative.d.ts +1 -1
  121. package/lib/lodash/_getValue.d.ts +1 -1
  122. package/lib/lodash/_hashSet.d.ts +1 -1
  123. package/lib/lodash/_listCacheSet.d.ts +1 -1
  124. package/lib/lodash/_mapCacheSet.d.ts +1 -1
  125. package/lib/lodash/_mapToArray.d.ts +1 -1
  126. package/lib/lodash/_setCacheAdd.d.ts +1 -1
  127. package/lib/lodash/_setToArray.d.ts +1 -1
  128. package/lib/lodash/_stackSet.d.ts +1 -1
  129. package/lib/lodash/keys.d.ts +1 -1
  130. package/models/api/gridRowApi.d.ts +6 -0
  131. package/models/api/gridRowsMetaApi.d.ts +7 -0
  132. package/models/api/gridSortApi.d.ts +1 -0
  133. package/models/colDef/gridColDef.d.ts +1 -2
  134. package/models/colDef/gridDefaultColumnTypes.js +2 -2
  135. package/models/gridRows.d.ts +8 -2
  136. package/models/params/gridRowParams.d.ts +29 -1
  137. package/models/props/DataGridProps.d.ts +20 -4
  138. package/modern/DataGrid/DataGrid.js +18 -3
  139. package/modern/DataGrid/useDataGridComponent.js +19 -15
  140. package/modern/DataGrid/useDataGridProps.js +3 -2
  141. package/modern/colDef/gridNumericOperators.js +1 -1
  142. package/modern/components/GridRow.js +29 -3
  143. package/modern/components/base/GridErrorHandler.js +13 -2
  144. package/modern/components/cell/GridCell.js +2 -2
  145. package/modern/components/cell/GridEditSingleSelectCell.js +2 -1
  146. package/modern/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  147. package/modern/components/containers/GridRootStyles.js +1 -1
  148. package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +27 -23
  149. package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
  150. package/modern/constants/gridClasses.js +1 -1
  151. package/modern/hooks/features/columnMenu/useGridColumnMenu.js +6 -7
  152. package/modern/hooks/features/columns/gridColumnsSelector.js +11 -10
  153. package/modern/hooks/features/columns/gridColumnsUtils.js +7 -5
  154. package/modern/hooks/features/density/useGridDensity.js +3 -4
  155. package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
  156. package/modern/hooks/features/editRows/useGridEditing.js +3 -4
  157. package/modern/hooks/features/export/serializers/csvSerializer.js +4 -4
  158. package/modern/hooks/features/filter/gridFilterSelector.js +1 -0
  159. package/modern/hooks/features/focus/useGridFocus.js +10 -11
  160. package/modern/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
  161. package/modern/hooks/features/pagination/useGridPage.js +1 -9
  162. package/modern/hooks/features/pagination/useGridPageSize.js +1 -20
  163. package/modern/hooks/features/pagination/useGridPagination.js +23 -2
  164. package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +6 -7
  165. package/modern/hooks/features/rows/useGridParamsApi.js +3 -10
  166. package/modern/hooks/features/rows/useGridRows.js +14 -6
  167. package/modern/hooks/features/rows/useGridRowsMeta.js +36 -24
  168. package/modern/hooks/features/selection/useGridSelection.js +24 -16
  169. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  170. package/modern/hooks/utils/useGridApi.js +10 -1
  171. package/modern/hooks/utils/useGridSelector.js +4 -4
  172. package/modern/hooks/utils/useGridState.js +10 -1
  173. package/modern/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +8 -7
  174. package/modern/index.js +1 -1
  175. package/modern/internals/index.js +9 -12
  176. package/modern/models/colDef/gridDefaultColumnTypes.js +2 -2
  177. package/modern/utils/createSelector.js +4 -4
  178. package/modern/utils/getGridLocalization.js +1 -1
  179. package/node/DataGrid/DataGrid.js +18 -3
  180. package/node/DataGrid/useDataGridComponent.js +11 -9
  181. package/node/DataGrid/useDataGridProps.js +3 -2
  182. package/node/colDef/gridNumericOperators.js +1 -1
  183. package/node/components/GridRow.js +28 -3
  184. package/node/components/base/GridErrorHandler.js +11 -1
  185. package/node/components/cell/GridCell.js +4 -2
  186. package/node/components/cell/GridEditSingleSelectCell.js +2 -1
  187. package/node/components/columnHeaders/GridColumnHeaderItem.js +5 -3
  188. package/node/components/containers/GridRootStyles.js +1 -1
  189. package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +27 -23
  190. package/node/components/virtualization/GridVirtualScrollerRenderZone.js +4 -1
  191. package/node/constants/gridClasses.js +1 -1
  192. package/node/hooks/features/columnMenu/useGridColumnMenu.js +10 -8
  193. package/node/hooks/features/columns/gridColumnsSelector.js +11 -9
  194. package/node/hooks/features/columns/gridColumnsUtils.js +7 -5
  195. package/node/hooks/features/density/useGridDensity.js +7 -6
  196. package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
  197. package/node/hooks/features/editRows/useGridEditing.js +8 -5
  198. package/node/hooks/features/export/serializers/csvSerializer.js +5 -4
  199. package/node/hooks/features/filter/gridFilterSelector.js +1 -0
  200. package/node/hooks/features/focus/useGridFocus.js +15 -13
  201. package/node/hooks/features/keyboard/useGridKeyboardNavigation.js +2 -2
  202. package/node/hooks/features/pagination/useGridPage.js +7 -20
  203. package/node/hooks/features/pagination/useGridPageSize.js +6 -26
  204. package/node/hooks/features/pagination/useGridPagination.js +31 -1
  205. package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +15 -13
  206. package/node/hooks/features/rows/useGridParamsApi.js +4 -10
  207. package/node/hooks/features/rows/useGridRows.js +15 -6
  208. package/node/hooks/features/rows/useGridRowsMeta.js +47 -26
  209. package/node/hooks/features/selection/useGridSelection.js +32 -18
  210. package/node/hooks/features/virtualization/useGridVirtualScroller.js +4 -4
  211. package/node/hooks/utils/useGridApi.js +11 -1
  212. package/node/hooks/utils/useGridSelector.js +6 -4
  213. package/node/hooks/utils/useGridState.js +11 -1
  214. package/node/hooks/utils/{useCurrentPageRows.js → useGridVisibleRows.js} +11 -10
  215. package/node/index.js +1 -1
  216. package/node/internals/index.js +45 -21
  217. package/node/models/colDef/gridDefaultColumnTypes.js +2 -2
  218. package/node/utils/createSelector.js +5 -4
  219. package/node/utils/getGridLocalization.js +2 -2
  220. package/package.json +2 -2
  221. package/utils/createSelector.js +4 -4
  222. package/utils/getGridLocalization.d.ts +2 -1
  223. package/utils/getGridLocalization.js +2 -2
  224. package/utils/keyboardUtils.d.ts +1 -1
  225. package/utils/warning.d.ts +1 -1
  226. package/hooks/utils/useGridStateInit.d.ts +0 -7
  227. package/hooks/utils/useGridStateInit.js +0 -9
  228. package/legacy/hooks/utils/useGridStateInit.js +0 -9
  229. package/modern/hooks/utils/useGridStateInit.js +0 -9
  230. package/node/hooks/utils/useGridStateInit.js +0 -23
package/CHANGELOG.md CHANGED
@@ -3,6 +3,49 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 5.6.1
7
+
8
+ _Mar 10, 2022_
9
+
10
+ We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - [DataGrid] Allow to add margins or borders between rows (#3848) @m4theushw
13
+
14
+ ```tsx
15
+ <DataGrid getRowSpacing={() => ({ top: 10, bottom: 10 })} />
16
+ ```
17
+
18
+ Check the [documentation](https://mui.com/components/data-grid/rows/#row-spacing) for more information.
19
+
20
+ ### `@mui/x-data-grid@v5.6.1` / `@mui/x-data-grid-pro@v5.6.1`
21
+
22
+ #### Changes
23
+
24
+ - [DataGrid] Display column's filter icon if a filter is applied (#4120) @DanailH
25
+ - [DataGrid] Do not loop through rows to compute top level rows count when the tree is flat (#4081) @flaviendelangle
26
+ - [DataGrid] Rename API method (#4148) @m4theushw
27
+ - [DataGrid] Support extending built-in column types (#4114) @cherniavskii
28
+ - [DataGridPro] Re-export the components removed by mistake during bundle split (#4134) @flaviendelangle
29
+
30
+ ### Docs
31
+
32
+ - [docs] Fix links to prevent duplicate search result (#4130) @siriwatknp
33
+ - [docs] Fix outdated links to `localeTextConstants.ts` (#4080) @patilvishal755
34
+ - [docs] Neglect e2e tests related to search (#4118) @siriwatknp
35
+ - [docs] Use regex instead of specific url in e2e-website-tests (#4121) @siriwatknp
36
+
37
+ ### Core
38
+
39
+ - [core] Enforce `noImplicitAny` (#4084) @cherniavskii
40
+ - [core] Improve the Pro support issue template (#4082) @oliviertassinari
41
+ - [core] Initialize remaining states before feature hooks (#4036) @m4theushw
42
+ - [core] Merge `page` and `pageSize` state initializer into a single `pagination` state initializer (#4087) @flaviendelangle
43
+ - [core] Prepare `yarn docs:api:build` scripts for multi packages support (#4111) @flaviendelangle
44
+ - [core] Upgrade `@mui/monorepo` (#4149) @cherniavskii
45
+ - [core] Use `buildWarning` and `wrapWithWarningOnCall` for deprecated methods and wrong usages (#4056) @flaviendelangle
46
+ - [test] Make focus state out-of-sync warning opt-in (#4129) @m4theushw
47
+ - [test] Only test custom input keyboard event in edit mode (#4075) @alexfauquette
48
+
6
49
  ## 5.6.0
7
50
 
8
51
  _Mar 4, 2022_
@@ -79,6 +79,7 @@ DataGridRaw.propTypes = {
79
79
  * Set of columns of type [[GridColumns]].
80
80
  */
81
81
  columns: chainPropTypes(PropTypes.array.isRequired, props => {
82
+ // @ts-ignore because otherwise `build:api` doesn't work
82
83
  if (props.columns && props.columns.some(column => column.resizable)) {
83
84
  return new Error([`MUI: \`column.resizable = true\` is not a valid prop.`, 'Column resizing is not available in the MIT version.', '', 'You need to upgrade to the DataGridPro component to unlock this feature.'].join('\n'));
84
85
  }
@@ -182,7 +183,8 @@ DataGridRaw.propTypes = {
182
183
  * For each feature, if the flag is not explicitly set to `true`, the feature will be fully disabled and any property / method call will not have any effect.
183
184
  */
184
185
  experimentalFeatures: PropTypes.shape({
185
- preventCommitWhileValidating: PropTypes.bool
186
+ preventCommitWhileValidating: PropTypes.bool,
187
+ warnIfFocusStateIsNotSynced: PropTypes.bool
186
188
  }),
187
189
 
188
190
  /**
@@ -221,7 +223,7 @@ DataGridRaw.propTypes = {
221
223
 
222
224
  /**
223
225
  * Function that applies CSS classes dynamically on rows.
224
- * @param {GridRowParams} params With all properties from [[GridRowParams]].
226
+ * @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
225
227
  * @returns {string} The CSS class to apply to the row.
226
228
  */
227
229
  getRowClassName: PropTypes.func,
@@ -238,6 +240,13 @@ DataGridRaw.propTypes = {
238
240
  */
239
241
  getRowId: PropTypes.func,
240
242
 
243
+ /**
244
+ * Function that allows to specify the spacing between rows.
245
+ * @param {GridRowSpacingParams} params With all properties from [[GridRowSpacingParams]].
246
+ * @returns {GridRowSpacing} The row spacing values.
247
+ */
248
+ getRowSpacing: PropTypes.func,
249
+
241
250
  /**
242
251
  * Set the height in pixel of the column headers in the grid.
243
252
  * @default 56
@@ -290,7 +299,7 @@ DataGridRaw.propTypes = {
290
299
 
291
300
  /**
292
301
  * Set the locale text of the grid.
293
- * You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/grid/x-data-grid/src/internals/constants/localeTextConstants.ts) in the GitHub repository.
302
+ * You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/grid/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
294
303
  */
295
304
  localeText: PropTypes.object,
296
305
 
@@ -614,6 +623,12 @@ DataGridRaw.propTypes = {
614
623
  */
615
624
  rows: PropTypes.arrayOf(PropTypes.object).isRequired,
616
625
 
626
+ /**
627
+ * Sets the type of space between rows added by `getRowSpacing`.
628
+ * @default "margin"
629
+ */
630
+ rowSpacingType: PropTypes.oneOf(['border', 'margin']),
631
+
617
632
  /**
618
633
  * Select the pageSize dynamically using the component UI.
619
634
  * @default [25, 50, 100]
@@ -1,29 +1,27 @@
1
1
  import { useGridInitialization } from '../hooks/core/useGridInitialization';
2
2
  import { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
3
3
  import { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
4
- import { useGridColumnMenu } from '../hooks/features/columnMenu/useGridColumnMenu';
4
+ import { columnMenuStateInitializer, useGridColumnMenu } from '../hooks/features/columnMenu/useGridColumnMenu';
5
5
  import { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
6
- import { useGridDensity } from '../hooks/features/density/useGridDensity';
6
+ import { densityStateInitializer, useGridDensity } from '../hooks/features/density/useGridDensity';
7
7
  import { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';
8
8
  import { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';
9
9
  import { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';
10
- import { useGridFocus } from '../hooks/features/focus/useGridFocus';
10
+ import { focusStateInitializer, useGridFocus } from '../hooks/features/focus/useGridFocus';
11
11
  import { useGridKeyboard } from '../hooks/features/keyboard/useGridKeyboard';
12
12
  import { useGridKeyboardNavigation } from '../hooks/features/keyboard/useGridKeyboardNavigation';
13
- import { useGridPagination } from '../hooks/features/pagination/useGridPagination';
14
- import { pageStateInitializer } from '../hooks/features/pagination/useGridPage';
15
- import { pageSizeStateInitializer } from '../hooks/features/pagination/useGridPageSize';
16
- import { useGridPreferencesPanel } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
17
- import { useGridEditing } from '../hooks/features/editRows/useGridEditing';
13
+ import { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';
14
+ import { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';
15
+ import { useGridEditing, editingStateInitializer } from '../hooks/features/editRows/useGridEditing';
18
16
  import { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGridRows';
19
17
  import { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';
20
- import { useGridSelection } from '../hooks/features/selection/useGridSelection';
18
+ import { selectionStateInitializer, useGridSelection } from '../hooks/features/selection/useGridSelection';
21
19
  import { useGridSelectionPreProcessors } from '../hooks/features/selection/useGridSelectionPreProcessors';
22
20
  import { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
23
21
  import { useGridScroll } from '../hooks/features/scroll/useGridScroll';
24
22
  import { useGridEvents } from '../hooks/features/events/useGridEvents';
25
23
  import { useGridDimensions } from '../hooks/features/dimensions/useGridDimensions';
26
- import { useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';
24
+ import { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';
27
25
  import { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
28
26
  export const useDataGridComponent = props => {
29
27
  const apiRef = useGridInitialization(undefined, props);
@@ -36,12 +34,18 @@ export const useDataGridComponent = props => {
36
34
  * Register all state initializers here.
37
35
  */
38
36
 
39
- useGridInitializeState(filterStateInitializer, apiRef, props);
40
- useGridInitializeState(pageSizeStateInitializer, apiRef, props);
41
- useGridInitializeState(pageStateInitializer, apiRef, props);
37
+ useGridInitializeState(selectionStateInitializer, apiRef, props);
38
+ useGridInitializeState(columnsStateInitializer, apiRef, props);
42
39
  useGridInitializeState(rowsStateInitializer, apiRef, props);
40
+ useGridInitializeState(editingStateInitializer, apiRef, props);
41
+ useGridInitializeState(focusStateInitializer, apiRef, props);
43
42
  useGridInitializeState(sortingStateInitializer, apiRef, props);
44
- useGridInitializeState(columnsStateInitializer, apiRef, props);
43
+ useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
44
+ useGridInitializeState(filterStateInitializer, apiRef, props);
45
+ useGridInitializeState(densityStateInitializer, apiRef, props);
46
+ useGridInitializeState(paginationStateInitializer, apiRef, props);
47
+ useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
48
+ useGridInitializeState(columnMenuStateInitializer, apiRef, props);
45
49
  useGridSelection(apiRef, props);
46
50
  useGridColumns(apiRef, props);
47
51
  useGridRows(apiRef, props);
@@ -49,7 +53,7 @@ export const useDataGridComponent = props => {
49
53
  useGridEditing(apiRef, props);
50
54
  useGridFocus(apiRef, props);
51
55
  useGridSorting(apiRef, props);
52
- useGridPreferencesPanel(apiRef, props);
56
+ useGridPreferencesPanel(apiRef);
53
57
  useGridFilter(apiRef, props);
54
58
  useGridDensity(apiRef, props);
55
59
  useGridPagination(apiRef, props);
@@ -54,6 +54,7 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
54
54
  paginationMode: GridFeatureModeConstant.client,
55
55
  rowHeight: 52,
56
56
  rowsPerPageOptions: [25, 50, 100],
57
+ rowSpacingType: 'margin',
57
58
  showCellRightBorder: false,
58
59
  showColumnRightBorder: false,
59
60
  sortingOrder: ['asc', 'desc', null],
@@ -80,8 +81,8 @@ export const useDataGridProps = inProps => {
80
81
  }
81
82
 
82
83
  const mergedComponents = {};
83
- Object.keys(DATA_GRID_DEFAULT_SLOTS_COMPONENTS).forEach(key => {
84
- mergedComponents[key] = overrides[key] === undefined ? DATA_GRID_DEFAULT_SLOTS_COMPONENTS[key] : overrides[key];
84
+ Object.entries(DATA_GRID_DEFAULT_SLOTS_COMPONENTS).forEach(([key, defaultComponent]) => {
85
+ mergedComponents[key] = overrides[key] === undefined ? defaultComponent : overrides[key];
85
86
  });
86
87
  return mergedComponents;
87
88
  }, [themedProps.components]);
@@ -3,4 +3,4 @@ export declare const getGridNumericOperators: () => GridFilterOperator[];
3
3
  /**
4
4
  * @deprecated Use `getGridNumericOperators` instead.
5
5
  */
6
- export declare const getGridNumericColumnOperators: () => GridFilterOperator[];
6
+ export declare const getGridNumericColumnOperators: (() => GridFilterOperator[]) | ((...args: any[]) => any);
@@ -174,4 +174,4 @@ export const getGridNumericOperators = () => [{
174
174
  * @deprecated Use `getGridNumericOperators` instead.
175
175
  */
176
176
 
177
- export const getGridNumericColumnOperators = wrapWithWarningOnCall(getGridNumericOperators, 'MUI: Using getGridNumericColumnOperators is deprecated, use getGridNumericOperators instead.');
177
+ export const getGridNumericColumnOperators = wrapWithWarningOnCall(getGridNumericOperators, ['MUI: The method getGridNumericColumnOperators is deprecated and will be removed in the next major version.', 'Use getGridNumericOperators instead.']);
@@ -10,9 +10,9 @@ export interface ErrorBoundaryProps {
10
10
  componentProps?: any[];
11
11
  }
12
12
  export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, any> {
13
- static getDerivedStateFromError(error: any): {
13
+ static getDerivedStateFromError(error: Error): {
14
14
  hasError: boolean;
15
- error: any;
15
+ error: Error;
16
16
  };
17
17
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
18
18
  logError(error: Error, errorInfo?: ErrorInfo): void;
@@ -16,6 +16,7 @@ import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
16
16
  import { useGridRootProps } from '../hooks/utils/useGridRootProps';
17
17
  import { gridColumnsTotalWidthSelector } from '../hooks/features/columns/gridColumnsSelector';
18
18
  import { useGridSelector } from '../hooks/utils/useGridSelector';
19
+ import { useGridVisibleRows } from '../hooks/utils/useGridVisibleRows';
19
20
  import { findParentElementFromClassName } from '../utils/domUtils';
20
21
  import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelectionColDef';
21
22
  import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef';
@@ -83,6 +84,7 @@ function GridRow(props) {
83
84
 
84
85
  const apiRef = useGridApiContext();
85
86
  const rootProps = useGridRootProps();
87
+ const currentPage = useGridVisibleRows(apiRef, rootProps);
86
88
  const columnsTotalWidth = useGridSelector(apiRef, gridColumnsTotalWidthSelector);
87
89
  const {
88
90
  hasScrollX,
@@ -150,12 +152,36 @@ function GridRow(props) {
150
152
  publish(GridEvents.rowClick, onClick)(event);
151
153
  }, [apiRef, onClick, publish, rowId]);
152
154
 
153
- const style = _extends({
155
+ const style = _extends({}, styleProp, {
154
156
  maxHeight: rowHeight,
155
157
  minHeight: rowHeight
156
- }, styleProp);
158
+ });
159
+
160
+ const sizes = apiRef.current.unstable_getRowInternalSizes(rowId);
161
+
162
+ if (sizes != null && sizes.spacingTop) {
163
+ const property = rootProps.rowSpacingType === 'border' ? 'borderTopWidth' : 'marginTop';
164
+ style[property] = sizes.spacingTop;
165
+ }
166
+
167
+ if (sizes != null && sizes.spacingBottom) {
168
+ const property = rootProps.rowSpacingType === 'border' ? 'borderBottomWidth' : 'marginBottom';
169
+ style[property] = sizes.spacingBottom;
170
+ }
171
+
172
+ let rowClassName = null;
173
+
174
+ if (typeof rootProps.getRowClassName === 'function') {
175
+ const indexRelativeToCurrentPage = index - currentPage.range.firstRowIndex;
176
+
177
+ const rowParams = _extends({}, apiRef.current.getRowParams(rowId), {
178
+ isFirstVisible: indexRelativeToCurrentPage === 0,
179
+ isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1
180
+ });
181
+
182
+ rowClassName = rootProps.getRowClassName(rowParams);
183
+ }
157
184
 
158
- const rowClassName = typeof rootProps.getRowClassName === 'function' && rootProps.getRowClassName(apiRef.current.getRowParams(rowId));
159
185
  const cells = [];
160
186
 
161
187
  for (let i = 0; i < renderedColumns.length; i += 1) {
@@ -1,2 +1,8 @@
1
- /// <reference types="react" />
2
- export declare function GridErrorHandler(props: any): JSX.Element;
1
+ import * as React from 'react';
2
+ declare function GridErrorHandler(props: {
3
+ children: React.ReactNode;
4
+ }): JSX.Element;
5
+ declare namespace GridErrorHandler {
6
+ var propTypes: any;
7
+ }
8
+ export { GridErrorHandler };
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import PropTypes from 'prop-types';
3
4
  import { styled } from '@mui/material/styles';
4
5
  import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
5
6
  import { useGridLogger } from '../../hooks/utils/useGridLogger';
@@ -15,7 +16,8 @@ const ErrorOverlayWrapper = styled('div')({
15
16
  width: '100%',
16
17
  height: '100%'
17
18
  });
18
- export function GridErrorHandler(props) {
19
+
20
+ function GridErrorHandler(props) {
19
21
  const {
20
22
  children
21
23
  } = props;
@@ -47,4 +49,13 @@ export function GridErrorHandler(props) {
47
49
  }),
48
50
  children: children
49
51
  });
50
- }
52
+ }
53
+
54
+ process.env.NODE_ENV !== "production" ? GridErrorHandler.propTypes = {
55
+ // ----------------------------- Warning --------------------------------
56
+ // | These PropTypes are generated from the TypeScript type definitions |
57
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
58
+ // ----------------------------------------------------------------------
59
+ children: PropTypes.node
60
+ } : void 0;
61
+ export { GridErrorHandler };
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { SvgIconProps } from '@mui/material/SvgIcon';
3
3
  import { GridRenderCellParams } from '../../models/params/gridCellParams';
4
+ import { GridColDef } from '../../models/colDef/gridColDef';
4
5
  interface GridBooleanCellProps extends GridRenderCellParams, Omit<SvgIconProps, 'tabIndex' | 'id'> {
5
6
  }
6
7
  export declare const GridBooleanCell: React.MemoExoticComponent<(props: GridBooleanCellProps) => JSX.Element>;
7
- export declare const renderBooleanCell: (params: GridBooleanCellProps) => "" | JSX.Element;
8
+ export declare const renderBooleanCell: GridColDef['renderCell'];
8
9
  export {};
@@ -48,6 +48,8 @@ const useUtilityClasses = ownerState => {
48
48
  let warnedOnce = false;
49
49
 
50
50
  function GridCell(props) {
51
+ var _rootProps$experiment;
52
+
51
53
  const {
52
54
  align,
53
55
  children,
@@ -141,7 +143,7 @@ function GridCell(props) {
141
143
  }, [hasFocus, cellMode, apiRef]);
142
144
  let handleFocus = other.onFocus;
143
145
 
144
- if (process.env.NODE_ENV === 'test') {
146
+ if (process.env.NODE_ENV === 'test' && (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.warnIfFocusStateIsNotSynced) {
145
147
  handleFocus = event => {
146
148
  const focusedCell = gridFocusCellSelector(apiRef);
147
149
 
@@ -154,7 +156,7 @@ function GridCell(props) {
154
156
  }
155
157
 
156
158
  if (!warnedOnce) {
157
- console.error([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : focusedCell.field}.`, 'In the next render, the focus will be changed to match the state.', 'Call `fireEvent.mouseUp` and `fireEvent.click` before to sync the focus with the state.'].join('\n'));
159
+ console.warn([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : focusedCell.field}.`, "Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\n'));
158
160
  warnedOnce = true;
159
161
  }
160
162
  };
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { GridRenderEditCellParams } from '../../models/params/gridCellParams';
3
+ import { GridColDef } from '../../models/colDef/gridColDef';
3
4
  export declare function GridEditBooleanCell(props: GridRenderEditCellParams & Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, 'id'>): JSX.Element;
4
- export declare const renderEditBooleanCell: (params: any) => JSX.Element;
5
+ export declare const renderEditBooleanCell: GridColDef['renderEditCell'];
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { InputBaseProps } from '@mui/material/InputBase';
3
3
  import { GridRenderEditCellParams } from '../../models/params/gridCellParams';
4
+ import { GridColDef } from '../../models/colDef/gridColDef';
4
5
  export declare function GridEditDateCell(props: GridRenderEditCellParams & Omit<InputBaseProps, 'id'>): JSX.Element;
5
- export declare const renderEditDateCell: (params: any) => JSX.Element;
6
+ export declare const renderEditDateCell: GridColDef['renderEditCell'];
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { InputBaseProps } from '@mui/material/InputBase';
3
3
  import { GridRenderEditCellParams } from '../../models/params/gridCellParams';
4
+ import { GridColDef } from '../../models/colDef/gridColDef';
4
5
  interface GridEditInputCellProps {
5
6
  debounceMs?: number;
6
7
  }
@@ -9,4 +10,4 @@ declare namespace GridEditInputCell {
9
10
  var propTypes: any;
10
11
  }
11
12
  export { GridEditInputCell };
12
- export declare const renderEditInputCell: (params: any) => JSX.Element;
13
+ export declare const renderEditInputCell: GridColDef['renderEditCell'];
@@ -1,9 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectProps } from '@mui/material/Select';
3
3
  import { GridRenderEditCellParams } from '../../models/params/gridCellParams';
4
+ import { GridColDef } from '../../models/colDef/gridColDef';
4
5
  declare function GridEditSingleSelectCell(props: GridRenderEditCellParams & Omit<SelectProps, 'id'>): JSX.Element;
5
6
  declare namespace GridEditSingleSelectCell {
6
7
  var propTypes: any;
7
8
  }
8
9
  export { GridEditSingleSelectCell };
9
- export declare const renderEditSingleSelectCell: (params: any) => JSX.Element;
10
+ export declare const renderEditSingleSelectCell: GridColDef['renderEditCell'];
@@ -70,10 +70,11 @@ function GridEditSingleSelectCell(props) {
70
70
 
71
71
  const handleChange = async event => {
72
72
  setOpen(false);
73
+ const target = event.target;
73
74
  const isValid = await api.setEditCellValue({
74
75
  id,
75
76
  field,
76
- value: event.target.value
77
+ value: target.value
77
78
  }, event); // We use isValid === false because the default return is undefined which evaluates to true with !isValid
78
79
 
79
80
  if (rootProps.editMode === GridEditModes.Row || isValid === false) {
@@ -23,13 +23,15 @@ const useUtilityClasses = ownerState => {
23
23
  classes,
24
24
  isDragging,
25
25
  sortDirection,
26
- showRightBorder
26
+ showRightBorder,
27
+ filterItemsCounter
27
28
  } = ownerState;
28
- const isColumnSorted = sortDirection != null; // todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work
29
+ const isColumnSorted = sortDirection != null;
30
+ const isColumnFiltered = filterItemsCounter != null && filterItemsCounter > 0; // todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work
29
31
 
30
32
  const isColumnNumeric = column.type === 'number';
31
33
  const slots = {
32
- root: ['columnHeader', column.headerAlign === 'left' && 'columnHeader--alignLeft', column.headerAlign === 'center' && 'columnHeader--alignCenter', column.headerAlign === 'right' && 'columnHeader--alignRight', column.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnNumeric && 'columnHeader--numeric', showRightBorder && 'withBorder'],
34
+ root: ['columnHeader', column.headerAlign === 'left' && 'columnHeader--alignLeft', column.headerAlign === 'center' && 'columnHeader--alignCenter', column.headerAlign === 'right' && 'columnHeader--alignRight', column.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', showRightBorder && 'withBorder'],
33
35
  draggableContainer: ['columnHeaderDraggableContainer'],
34
36
  titleContainer: ['columnHeaderTitleContainer'],
35
37
  titleContainerContent: ['columnHeaderTitleContainerContent']
@@ -138,7 +138,7 @@ export const GridRootStyles = styled('div', {
138
138
  display: 'flex',
139
139
  alignItems: 'center'
140
140
  },
141
- [`& .${gridClasses['columnHeader--sorted']} .${gridClasses.iconButtonContainer}`]: {
141
+ [`& .${gridClasses['columnHeader--sorted']} .${gridClasses.iconButtonContainer}, & .${gridClasses['columnHeader--filtered']} .${gridClasses.iconButtonContainer}`]: {
142
142
  visibility: 'visible',
143
143
  width: 'auto'
144
144
  },
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { AutocompleteProps } from '@mui/material/Autocomplete';
3
3
  import { GridFilterItem } from '../../../models/gridFilterItem';
4
+ import type { GridApiCommon } from '../../../models/api/gridApiCommon';
4
5
  export declare type GridFilterInputMultipleSingleSelectProps = {
5
6
  item: GridFilterItem;
6
7
  applyValue: (value: GridFilterItem) => void;
7
- apiRef: any;
8
+ apiRef: React.MutableRefObject<GridApiCommon>;
8
9
  focusElementRef?: React.Ref<any>;
9
10
  type?: 'singleSelect';
10
11
  } & Omit<AutocompleteProps<any[], true, false, true>, 'options' | 'renderInput'>;
@@ -10,21 +10,6 @@ import { unstable_useId as useId } from '@mui/material/utils';
10
10
  import { getValueFromOption } from './filterPanelUtils';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
 
13
- const getSingleSelectOptionFormatter = ({
14
- valueFormatter,
15
- field
16
- }, api) => option => {
17
- if (typeof option === 'object') {
18
- return option.label;
19
- }
20
-
21
- return valueFormatter && option !== '' ? valueFormatter({
22
- value: option,
23
- field,
24
- api
25
- }) : option;
26
- };
27
-
28
13
  const isOptionEqualToValue = (option, value) => getValueFromOption(option) === getValueFromOption(value);
29
14
 
30
15
  const filter = createFilterOptions();
@@ -41,15 +26,31 @@ function GridFilterInputMultipleSingleSelect(props) {
41
26
  const id = useId();
42
27
  const resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;
43
28
  const resolvedValueOptions = React.useMemo(() => {
44
- return typeof resolvedColumn.valueOptions === 'function' ? resolvedColumn.valueOptions({
29
+ return typeof (resolvedColumn == null ? void 0 : resolvedColumn.valueOptions) === 'function' ? resolvedColumn.valueOptions({
45
30
  field: resolvedColumn.field
46
- }) : resolvedColumn.valueOptions;
31
+ }) : resolvedColumn == null ? void 0 : resolvedColumn.valueOptions;
47
32
  }, [resolvedColumn]);
48
33
  const resolvedFormattedValueOptions = React.useMemo(() => {
49
- return resolvedValueOptions.map(getValueFromOption);
34
+ return resolvedValueOptions == null ? void 0 : resolvedValueOptions.map(getValueFromOption);
50
35
  }, [resolvedValueOptions]);
51
- const filterValueOptionFormatter = getSingleSelectOptionFormatter(apiRef.current.getColumn(item.columnField), apiRef.current); // The value is computed from the item.value and used directly
52
- // If it was done by a useEffect/useSate, the Autocomplete could receive incoherent value and options
36
+ const {
37
+ valueFormatter,
38
+ field
39
+ } = apiRef.current.getColumn(item.columnField);
40
+
41
+ const filterValueOptionFormatter = option => {
42
+ if (typeof option === 'object') {
43
+ return option.label;
44
+ }
45
+
46
+ return valueFormatter && option !== '' ? valueFormatter({
47
+ value: option,
48
+ field,
49
+ api: apiRef.current
50
+ }) : option;
51
+ }; // The value is computed from the item.value and used directly
52
+ // If it was done by a useEffect/useState, the Autocomplete could receive incoherent value and options
53
+
53
54
 
54
55
  const filterValues = React.useMemo(() => {
55
56
  if (!Array.isArray(item.value)) {
@@ -60,7 +61,7 @@ function GridFilterInputMultipleSingleSelect(props) {
60
61
  const itemValueIndexes = item.value.map(element => {
61
62
  // get the index matching between values and valueoptions
62
63
  const formattedElement = getValueFromOption(element);
63
- const index = resolvedFormattedValueOptions.findIndex(formatedOption => formatedOption === formattedElement);
64
+ const index = (resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(formatedOption => formatedOption === formattedElement)) || 0;
64
65
  return index;
65
66
  });
66
67
  return itemValueIndexes.filter(index => index >= 0).map(index => resolvedValueOptions[index]);
@@ -85,7 +86,8 @@ function GridFilterInputMultipleSingleSelect(props) {
85
86
  multiple: true,
86
87
  freeSolo: false,
87
88
  limitTags: 1,
88
- options: resolvedValueOptions,
89
+ options: resolvedValueOptions // TODO: avoid `any`?
90
+ ,
89
91
  isOptionEqualToValue: isOptionEqualToValue,
90
92
  filterOptions: filter,
91
93
  id: id,
@@ -116,7 +118,9 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleSingleSelect.prop
116
118
  // | These PropTypes are generated from the TypeScript type definitions |
117
119
  // | To update them edit the TypeScript types and run "yarn proptypes" |
118
120
  // ----------------------------------------------------------------------
119
- apiRef: PropTypes.any.isRequired,
121
+ apiRef: PropTypes.shape({
122
+ current: PropTypes.object.isRequired
123
+ }).isRequired,
120
124
  applyValue: PropTypes.func.isRequired,
121
125
  focusElementRef: PropTypes
122
126
  /* @typescript-to-proptypes-ignore */
@@ -1,2 +1,2 @@
1
- export declare function getValueFromOption(option: any): any;
2
- export declare function getValueFromValueOptions(value: any, valueOptions: any): any;
1
+ export declare function getValueFromOption(option: any | undefined): any;
2
+ export declare function getValueFromValueOptions(value: string, valueOptions: any[]): any;
@@ -24,7 +24,10 @@ const VirtualScrollerRenderZoneRoot = styled('div', {
24
24
  slot: 'VirtualScrollerRenderZone',
25
25
  overridesResolver: (props, styles) => styles.virtualScrollerRenderZone
26
26
  })({
27
- position: 'absolute'
27
+ position: 'absolute',
28
+ display: 'flex',
29
+ // Prevents margin collapsing when using `getRowSpacing`
30
+ flexDirection: 'column'
28
31
  });
29
32
  const GridVirtualScrollerRenderZone = /*#__PURE__*/React.forwardRef(function GridVirtualScrollerRenderZone(props, ref) {
30
33
  const {
@@ -79,6 +79,10 @@ export interface GridClasses {
79
79
  * Styles applied to the column header if the column is sorted.
80
80
  */
81
81
  'columnHeader--sorted': string;
82
+ /**
83
+ * Styles applied to the column header if the column has a filter applied to it.
84
+ */
85
+ 'columnHeader--filtered': string;
82
86
  /**
83
87
  * Styles applied to the column header element.
84
88
  */
@@ -371,4 +375,4 @@ export interface GridClasses {
371
375
  }
372
376
  export declare type GridClassKey = keyof GridClasses;
373
377
  export declare function getDataGridUtilityClass(slot: string): string;
374
- export declare const gridClasses: Record<"overlay" | "cell" | "row" | "menu" | "main" | "root" | "paper" | "autoHeight" | "booleanCell" | "cell--editable" | "cell--editing" | "cell--textCenter" | "cell--textLeft" | "cell--textRight" | "cell--withRenderer" | "cellContent" | "cellCheckbox" | "checkboxInput" | "columnHeader--alignCenter" | "columnHeader--alignLeft" | "columnHeader--alignRight" | "columnHeader--dragging" | "columnHeader--moving" | "columnHeader--numeric" | "columnHeader--sortable" | "columnHeader--sorted" | "columnHeader" | "columnHeaderCheckbox" | "columnHeaderDraggableContainer" | "columnHeaderDropZone" | "columnHeaderTitle" | "columnHeaderTitleContainer" | "columnHeaderTitleContainerContent" | "columnHeaders" | "columnHeadersInner" | "columnHeadersInner--scrollable" | "columnSeparator--resizable" | "columnSeparator--resizing" | "columnSeparator--sideLeft" | "columnSeparator--sideRight" | "columnSeparator" | "columnsPanel" | "columnsPanelRow" | "detailPanel" | "detailPanels" | "detailPanelToggleCell" | "detailPanelToggleCell--expanded" | "panel" | "panelHeader" | "panelWrapper" | "panelContent" | "panelFooter" | "editBooleanCell" | "filterForm" | "filterFormDeleteIcon" | "filterFormLinkOperatorInput" | "filterFormColumnInput" | "filterFormOperatorInput" | "filterFormValueInput" | "editInputCell" | "filterIcon" | "footerContainer" | "iconButtonContainer" | "iconSeparator" | "menuIcon" | "menuIconButton" | "menuOpen" | "menuList" | "virtualScroller" | "virtualScrollerContent" | "virtualScrollerContent--overflowed" | "virtualScrollerRenderZone" | "pinnedColumns" | "pinnedColumns--left" | "pinnedColumns--right" | "pinnedColumnHeaders" | "pinnedColumnHeaders--left" | "pinnedColumnHeaders--right" | "row--editable" | "row--editing" | "row--lastVisible" | "rowCount" | "scrollArea" | "scrollArea--left" | "scrollArea--right" | "selectedRowCount" | "sortIcon" | "toolbarContainer" | "toolbarFilterList" | "withBorder" | "treeDataGroupingCell" | "treeDataGroupingCellToggle" | "actionsCell" | "groupingCriteriaCell" | "groupingCriteriaCellToggle", string>;
378
+ export declare const gridClasses: Record<"overlay" | "cell" | "row" | "menu" | "main" | "root" | "paper" | "autoHeight" | "booleanCell" | "cell--editable" | "cell--editing" | "cell--textCenter" | "cell--textLeft" | "cell--textRight" | "cell--withRenderer" | "cellContent" | "cellCheckbox" | "checkboxInput" | "columnHeader--alignCenter" | "columnHeader--alignLeft" | "columnHeader--alignRight" | "columnHeader--dragging" | "columnHeader--moving" | "columnHeader--numeric" | "columnHeader--sortable" | "columnHeader--sorted" | "columnHeader--filtered" | "columnHeader" | "columnHeaderCheckbox" | "columnHeaderDraggableContainer" | "columnHeaderDropZone" | "columnHeaderTitle" | "columnHeaderTitleContainer" | "columnHeaderTitleContainerContent" | "columnHeaders" | "columnHeadersInner" | "columnHeadersInner--scrollable" | "columnSeparator--resizable" | "columnSeparator--resizing" | "columnSeparator--sideLeft" | "columnSeparator--sideRight" | "columnSeparator" | "columnsPanel" | "columnsPanelRow" | "detailPanel" | "detailPanels" | "detailPanelToggleCell" | "detailPanelToggleCell--expanded" | "panel" | "panelHeader" | "panelWrapper" | "panelContent" | "panelFooter" | "editBooleanCell" | "filterForm" | "filterFormDeleteIcon" | "filterFormLinkOperatorInput" | "filterFormColumnInput" | "filterFormOperatorInput" | "filterFormValueInput" | "editInputCell" | "filterIcon" | "footerContainer" | "iconButtonContainer" | "iconSeparator" | "menuIcon" | "menuIconButton" | "menuOpen" | "menuList" | "virtualScroller" | "virtualScrollerContent" | "virtualScrollerContent--overflowed" | "virtualScrollerRenderZone" | "pinnedColumns" | "pinnedColumns--left" | "pinnedColumns--right" | "pinnedColumnHeaders" | "pinnedColumnHeaders--left" | "pinnedColumnHeaders--right" | "row--editable" | "row--editing" | "row--lastVisible" | "rowCount" | "scrollArea" | "scrollArea--left" | "scrollArea--right" | "selectedRowCount" | "sortIcon" | "toolbarContainer" | "toolbarFilterList" | "withBorder" | "treeDataGroupingCell" | "treeDataGroupingCellToggle" | "actionsCell" | "groupingCriteriaCell" | "groupingCriteriaCellToggle", string>;
@@ -2,4 +2,4 @@ import { generateUtilityClasses, generateUtilityClass } from '@mui/material';
2
2
  export function getDataGridUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiDataGrid', slot);
4
4
  }
5
- export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'row--editable', 'row--editing', 'row', 'row--lastVisible', 'rowCount', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);
5
+ export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'row--editable', 'row--editing', 'row', 'row--lastVisible', 'rowCount', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);