@mui/x-data-grid 7.18.0 → 7.19.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 (143) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/DataGrid/DataGrid.js +5 -0
  3. package/components/cell/GridCell.js +7 -8
  4. package/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
  5. package/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
  6. package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
  7. package/components/containers/GridRoot.js +1 -1
  8. package/components/containers/GridRootStyles.js +32 -23
  9. package/components/containers/GridToolbarContainer.js +1 -1
  10. package/components/menu/GridMenu.js +1 -1
  11. package/components/panel/GridPanel.d.ts +1 -1
  12. package/components/panel/GridPanel.js +1 -1
  13. package/components/panel/GridPanelContent.js +1 -1
  14. package/components/panel/GridPanelFooter.js +1 -1
  15. package/components/panel/GridPanelHeader.js +1 -1
  16. package/components/panel/GridPanelWrapper.js +1 -1
  17. package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
  18. package/components/toolbar/GridToolbarQuickFilter.js +1 -1
  19. package/components/virtualization/GridBottomContainer.d.ts +1 -1
  20. package/components/virtualization/GridBottomContainer.js +18 -1
  21. package/components/virtualization/GridMainContainer.js +3 -1
  22. package/components/virtualization/GridTopContainer.d.ts +1 -1
  23. package/components/virtualization/GridTopContainer.js +1 -1
  24. package/components/virtualization/GridVirtualScrollbar.js +1 -7
  25. package/components/virtualization/GridVirtualScroller.js +1 -0
  26. package/components/virtualization/GridVirtualScrollerFiller.js +3 -4
  27. package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
  28. package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
  29. package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
  30. package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
  31. package/hooks/features/columns/gridColumnsUtils.js +3 -2
  32. package/hooks/features/density/densitySelector.d.ts +1 -1
  33. package/hooks/features/editing/useGridCellEditing.js +1 -1
  34. package/hooks/features/editing/useGridRowEditing.js +1 -1
  35. package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
  36. package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
  37. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
  38. package/hooks/features/keyboardNavigation/utils.d.ts +1 -1
  39. package/hooks/features/pagination/gridPaginationSelector.d.ts +9 -9
  40. package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
  41. package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
  42. package/hooks/features/rowSelection/useGridRowSelection.js +105 -29
  43. package/hooks/features/rowSelection/utils.d.ts +10 -0
  44. package/hooks/features/rowSelection/utils.js +156 -1
  45. package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
  46. package/hooks/features/rows/gridRowsSelector.d.ts +14 -14
  47. package/hooks/features/rows/useGridRows.d.ts +1 -1
  48. package/hooks/features/rows/useGridRows.js +7 -1
  49. package/hooks/features/scroll/useGridScroll.js +19 -19
  50. package/hooks/features/sorting/gridSortingSelector.d.ts +4 -4
  51. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
  52. package/hooks/utils/useGridVisibleRows.d.ts +2 -2
  53. package/index.js +1 -1
  54. package/internals/index.d.ts +1 -0
  55. package/internals/index.js +1 -0
  56. package/locales/bgBG.js +8 -9
  57. package/locales/deDE.js +4 -4
  58. package/locales/frFR.js +4 -4
  59. package/locales/hrHR.d.ts +1 -1
  60. package/locales/hrHR.js +69 -46
  61. package/locales/jaJP.js +1 -2
  62. package/locales/ptPT.d.ts +1 -1
  63. package/locales/ptPT.js +4 -4
  64. package/locales/viVN.js +20 -20
  65. package/locales/zhHK.d.ts +1 -1
  66. package/models/gridRowSelectionModel.d.ts +4 -0
  67. package/models/props/DataGridProps.d.ts +20 -1
  68. package/modern/DataGrid/DataGrid.js +5 -0
  69. package/modern/components/cell/GridCell.js +7 -8
  70. package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
  71. package/modern/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
  72. package/modern/components/containers/GridRoot.js +1 -1
  73. package/modern/components/containers/GridRootStyles.js +32 -23
  74. package/modern/components/containers/GridToolbarContainer.js +1 -1
  75. package/modern/components/menu/GridMenu.js +1 -1
  76. package/modern/components/panel/GridPanel.js +1 -1
  77. package/modern/components/panel/GridPanelContent.js +1 -1
  78. package/modern/components/panel/GridPanelFooter.js +1 -1
  79. package/modern/components/panel/GridPanelHeader.js +1 -1
  80. package/modern/components/panel/GridPanelWrapper.js +1 -1
  81. package/modern/components/toolbar/GridToolbarQuickFilter.js +1 -1
  82. package/modern/components/virtualization/GridBottomContainer.js +18 -1
  83. package/modern/components/virtualization/GridMainContainer.js +3 -1
  84. package/modern/components/virtualization/GridTopContainer.js +1 -1
  85. package/modern/components/virtualization/GridVirtualScrollbar.js +1 -7
  86. package/modern/components/virtualization/GridVirtualScroller.js +1 -0
  87. package/modern/components/virtualization/GridVirtualScrollerFiller.js +3 -4
  88. package/modern/hooks/features/columns/gridColumnsUtils.js +3 -2
  89. package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
  90. package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
  91. package/modern/hooks/features/rowSelection/useGridRowSelection.js +105 -29
  92. package/modern/hooks/features/rowSelection/utils.js +156 -1
  93. package/modern/hooks/features/rows/useGridRows.js +7 -1
  94. package/modern/hooks/features/scroll/useGridScroll.js +19 -19
  95. package/modern/index.js +1 -1
  96. package/modern/internals/index.js +1 -0
  97. package/modern/locales/bgBG.js +8 -9
  98. package/modern/locales/deDE.js +4 -4
  99. package/modern/locales/frFR.js +4 -4
  100. package/modern/locales/hrHR.js +69 -46
  101. package/modern/locales/jaJP.js +1 -2
  102. package/modern/locales/ptPT.js +4 -4
  103. package/modern/locales/viVN.js +20 -20
  104. package/modern/utils/createSelector.js +6 -0
  105. package/node/DataGrid/DataGrid.js +5 -0
  106. package/node/components/cell/GridCell.js +7 -8
  107. package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
  108. package/node/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
  109. package/node/components/containers/GridRoot.js +1 -1
  110. package/node/components/containers/GridRootStyles.js +32 -23
  111. package/node/components/containers/GridToolbarContainer.js +1 -1
  112. package/node/components/menu/GridMenu.js +1 -1
  113. package/node/components/panel/GridPanel.js +1 -1
  114. package/node/components/panel/GridPanelContent.js +1 -1
  115. package/node/components/panel/GridPanelFooter.js +1 -1
  116. package/node/components/panel/GridPanelHeader.js +1 -1
  117. package/node/components/panel/GridPanelWrapper.js +1 -1
  118. package/node/components/toolbar/GridToolbarQuickFilter.js +1 -1
  119. package/node/components/virtualization/GridBottomContainer.js +18 -1
  120. package/node/components/virtualization/GridMainContainer.js +3 -1
  121. package/node/components/virtualization/GridTopContainer.js +1 -1
  122. package/node/components/virtualization/GridVirtualScrollbar.js +1 -7
  123. package/node/components/virtualization/GridVirtualScroller.js +1 -0
  124. package/node/components/virtualization/GridVirtualScrollerFiller.js +3 -4
  125. package/node/hooks/features/columns/gridColumnsUtils.js +3 -2
  126. package/node/hooks/features/editing/useGridCellEditing.js +1 -1
  127. package/node/hooks/features/editing/useGridRowEditing.js +1 -1
  128. package/node/hooks/features/rowSelection/useGridRowSelection.js +102 -26
  129. package/node/hooks/features/rowSelection/utils.js +160 -1
  130. package/node/hooks/features/rows/useGridRows.js +7 -1
  131. package/node/hooks/features/scroll/useGridScroll.js +19 -19
  132. package/node/index.js +1 -1
  133. package/node/internals/index.js +23 -15
  134. package/node/locales/bgBG.js +8 -9
  135. package/node/locales/deDE.js +4 -4
  136. package/node/locales/frFR.js +4 -4
  137. package/node/locales/hrHR.js +69 -46
  138. package/node/locales/jaJP.js +1 -2
  139. package/node/locales/ptPT.js +4 -4
  140. package/node/locales/viVN.js +20 -20
  141. package/node/utils/createSelector.js +6 -0
  142. package/package.json +1 -1
  143. package/utils/createSelector.js +6 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,116 @@
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
+ ## 7.19.0
7
+
8
+ _Oct 4, 2024_
9
+
10
+ We'd like to offer a big thanks to the 26 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🔁 Automatic parents and children selection for Data Grid ["tree data"](https://mui.com/x/react-data-grid/tree-data/) and ["row grouping"](https://mui.com/x/react-data-grid/row-grouping/) features
13
+ - 💫 Support `minHeight` and `maxHeight` on flex parent container for the Data Grid component
14
+ - 🎁 Export `publicAPI` from the `useTreeItem2Utils` hook for the Tree View
15
+ - 🌍 Improve Bulgarian (bg-BG), Croatian (hr-HR), French (fr-FR), German (de-DE), Japanese (ja-JP) and Vietnamese (vi-VN) locales and add Portuguese (pt-PT) locale on the Data Grid component
16
+ - 🌏 Improve Czech (cs-CZ) and Portuguese (pt-BR) locales and add Bulgarian (bg-BG), Croatian (hr-HR) and Portuguese (pt-PT) locales on the Pickers components
17
+ - 🐞 Bugfixes
18
+ - 📚 Documentation improvements
19
+
20
+ Special thanks goes out to our community contributors who have helped make this release possible:
21
+ @AWAIS97, @chucamphong, @GMchris, @JakubSveda, @k-rajat19, @k725, @lhilgert9, @ruiaraujo012, @Sanderand, @thomasmoon, @vallereaugabriel.
22
+ Following are all team members who have contributed to this release:
23
+ @alexfauquette, @arminmeh, @arthurbalduini, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @MBilalShafi, @michelengelen, @noraleonte, @oliviertassinari, @romgrk, @sai6855, @samuelsycamore.
24
+
25
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
26
+
27
+ ### Data Grid
28
+
29
+ #### `@mui/x-data-grid@7.19.0`
30
+
31
+ - [DataGrid] Fix column definition `undefined` value (#14456) @sai6855
32
+ - [DataGrid] Fix `checkboxSelectionVisibleOnly` reset the selection on filtering (#14677) @MBilalShafi
33
+ - [DataGrid] Fix background colors when `CSSVarsProvider` is used (#12901) @cherniavskii
34
+ - [DataGrid] Fix error when initializing aggregation with row spanning (#14710) @MBilalShafi
35
+ - [DataGrid] Fix scroll to cell logic for keyboard navigating cells and drag selection with pinned columns (#14550) @KenanYusuf
36
+ - [DataGrid] Support `minHeight` and `maxHeight` on flex parent container (#14614) @cherniavskii
37
+ - [l10n] Add missing Portuguese (pt-PT) translations (#14707) @ruiaraujo012
38
+ - [l10n] Improve Bulgarian (bg-BG) locale (#14451) @GMchris
39
+ - [l10n] Improve Croatian (hr-HR) locale (#14794) @arminmeh
40
+ - [l10n] Improve French (fr-FR) locale (#14750) @vallereaugabriel
41
+ - [l10n] Improve German (de-DE) locale (#14755) @lhilgert9
42
+ - [l10n] Improve Japanese (ja-JP) locale (#14381) @k725
43
+ - [l10n] Improve Vietnamese (vi-VN) locale (#14769) @chucamphong
44
+
45
+ #### `@mui/x-data-grid-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
46
+
47
+ Same changes as in `@mui/x-data-grid@7.19.0`, plus:
48
+
49
+ - [DataGridPro] Fix dragging styles removal in column reorder (#14680) @k-rajat19
50
+ - [DataGridPro] Fix row pre-processing running with a stale data source (#14810) @MBilalShafi
51
+ - [DataGridPro] Fix `onRowsScrollEnd` not firing on very fast scrolling (#14171) @arminmeh
52
+
53
+ #### `@mui/x-data-grid-premium@7.19.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
54
+
55
+ Same changes as in `@mui/x-data-grid-pro@7.19.0`, plus:
56
+
57
+ - [DataGridPremium] Automatic parents and children selection (#13757) @MBilalShafi
58
+
59
+ ### Date and Time Pickers
60
+
61
+ #### `@mui/x-date-pickers@7.19.0`
62
+
63
+ - [pickers] Fix left-right keyboard nav with `yearsOrder="desc"` and `direction="rtl"` (#14682) @thomasmoon
64
+ - [pickers] Improve `PickerValidDate` type (#14771) @flaviendelangle
65
+ - [pickers] Improve typing of the range pickers (#14716) @flaviendelangle
66
+ - [l10n] Add Bulgarian (bg-BG) locale (#14469) @GMchris
67
+ - [l10n] Add Croatian (hr-HR) locale (#14795) @arminmeh
68
+ - [l10n] Add Portuguese (pt-PT) locale (#14722) @ruiaraujo012
69
+ - [l10n] Improve Czech (cs-CZ) locale (#14732) @JakubSveda
70
+ - [l10n] Improve Portuguese (pt-BR) locale (#14725) @arthurbalduini
71
+
72
+ #### `@mui/x-date-pickers-pro@7.19.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
+
74
+ Same changes as in `@mui/x-date-pickers@7.19.0`.
75
+
76
+ ### Charts
77
+
78
+ #### `@mui/x-charts@7.19.0`
79
+
80
+ - [charts] Fix `LineChart` area animation being stuck when resizing container (#14711) @alexfauquette
81
+ - [charts] Improve types and start using `warnOnce` (#14792) @JCQuintas
82
+
83
+ #### `@mui/x-charts-pro@7.0.0-beta.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
84
+
85
+ Same changes as in `@mui/x-charts@7.19.0`.
86
+
87
+ ### Tree View
88
+
89
+ #### `@mui/x-tree-view@7.19.0`
90
+
91
+ - [TreeView] Apply experimental features in `getDefaultizedParams` instead of in the plugin render (#14661) @flaviendelangle
92
+ - [TreeView] Export `publicAPI` form `useTreeItem2Utils` (#14729) @noraleonte
93
+ - [TreeView] Fix cursor navigation interfering with browser shortcut keys (#14798) @sai6855
94
+ - [TreeView] Fix invalid test for items reordering (#14665) @flaviendelangle
95
+ - [TreeView] Remove `instance.getTreeItemIdAttribute` (#14667) @flaviendelangle
96
+
97
+ ### Docs
98
+
99
+ - [docs] Added warning callout for Firefox reordering bug (#14516) @michelengelen
100
+ - [docs] Copyedit `pages.ts` navigation (#14782) @samuelsycamore
101
+ - [docs] Fix typo in row spanning doc (#14770) @flaviendelangle
102
+ - [docs] Fix typo in the Tree View migration guide to v7 (#14727) @Sanderand
103
+ - [docs] Fix typo in usage of Moment guide for UTC and timezones (#14780) @AWAIS97
104
+ - [docs] Fix what's new link to use absolute URL (#14543) @oliviertassinari
105
+
106
+ ### Core
107
+
108
+ - [core] Fix class name composition order (#14775) @oliviertassinari
109
+ - [core] Replace minWidth, maxWidth with width (#14776) @oliviertassinari
110
+ - [code-infra] Remove custom playwright installation steps (#14728) @Janpot
111
+ - [code-infra] Replace or remove all instances of `e` identifier (#14724) @samuelsycamore
112
+ - [infra] Adds community contribution section to the changelog script (#14799) @michelengelen
113
+ - [infra] Fix line break in Stack Overflow message @oliviertassinari
114
+ - [test] Fix `Escape` event firing event (#14797) @oliviertassinari
115
+
6
116
  ## 7.18.0
7
117
 
8
118
  _Sep 20, 2024_
@@ -73,6 +73,11 @@ DataGridRaw.propTypes = {
73
73
  /**
74
74
  * If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
75
75
  * @default false
76
+ * @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
77
+ * @example
78
+ * <div style={{ display: 'flex', flexDirection: 'column' }}>
79
+ * <DataGrid />
80
+ * </div>
76
81
  */
77
82
  autoHeight: PropTypes.bool,
78
83
  /**
@@ -118,11 +118,11 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
118
118
  const result = apiRef.current.getCellParams(rowId, field);
119
119
  result.api = apiRef.current;
120
120
  return result;
121
- } catch (e) {
122
- if (e instanceof MissingRowIdError) {
121
+ } catch (error) {
122
+ if (error instanceof MissingRowIdError) {
123
123
  return EMPTY_CELL_PARAMS;
124
124
  }
125
- throw e;
125
+ throw error;
126
126
  }
127
127
  }, objectShallowCompare);
128
128
  const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
@@ -255,10 +255,9 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
255
255
  return /*#__PURE__*/_jsx("div", {
256
256
  "data-colindex": colIndex,
257
257
  role: "presentation",
258
- style: _extends({}, style, {
259
- minWidth: 'var(--width)',
260
- maxWidth: 'var(--width)'
261
- })
258
+ style: _extends({
259
+ width: 'var(--width)'
260
+ }, style)
262
261
  });
263
262
  }
264
263
  if (cellParams === EMPTY_CELL_PARAMS) {
@@ -315,7 +314,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
315
314
  };
316
315
  return /*#__PURE__*/_jsx("div", _extends({
317
316
  ref: handleRef,
318
- className: clsx(className, classNames, classes.root),
317
+ className: clsx(classes.root, classNames, className),
319
318
  role: "gridcell",
320
319
  "data-field": field,
321
320
  "data-colindex": colIndex,
@@ -36,7 +36,7 @@ export const GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function Grid
36
36
  const classes = useUtilityClasses(rootProps);
37
37
  return /*#__PURE__*/_jsx(GridColumnHeadersRoot, _extends({
38
38
  ref: ref,
39
- className: clsx(className, classes.root),
39
+ className: clsx(classes.root, className),
40
40
  ownerState: rootProps
41
41
  }, other, {
42
42
  role: "presentation"
@@ -1,12 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["field", "id", "value", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "api"];
3
+ const _excluded = ["field", "id", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "api"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef } from '@mui/utils';
7
7
  import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
8
8
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
9
9
  import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
10
+ import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
11
+ import { getCheckboxPropsSelector } from "../../hooks/features/rowSelection/utils.js";
10
12
  import { jsx as _jsx } from "react/jsx-runtime";
11
13
  const useUtilityClasses = ownerState => {
12
14
  const {
@@ -21,7 +23,6 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
21
23
  const {
22
24
  field,
23
25
  id,
24
- value: isChecked,
25
26
  rowNode,
26
27
  hasFocus,
27
28
  tabIndex
@@ -69,21 +70,28 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
69
70
  event.stopPropagation();
70
71
  }
71
72
  }, []);
73
+ const isSelectable = apiRef.current.isRowSelectable(id);
74
+ const checkboxPropsSelector = getCheckboxPropsSelector(id, rootProps.rowSelectionPropagation?.parents ?? false);
75
+ const {
76
+ isIndeterminate,
77
+ isChecked
78
+ } = useGridSelector(apiRef, checkboxPropsSelector);
72
79
  if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
73
80
  return null;
74
81
  }
75
- const isSelectable = apiRef.current.isRowSelectable(id);
76
82
  const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
83
+ const checked = rootProps.indeterminateCheckboxAction === 'select' ? isChecked && !isIndeterminate : isChecked;
77
84
  return /*#__PURE__*/_jsx(rootProps.slots.baseCheckbox, _extends({
78
85
  ref: handleRef,
79
86
  tabIndex: tabIndex,
80
- checked: isChecked,
87
+ checked: checked,
81
88
  onChange: handleChange,
82
89
  className: classes.root,
83
90
  inputProps: {
84
91
  'aria-label': label
85
92
  },
86
93
  onKeyDown: handleKeyDown,
94
+ indeterminate: isIndeterminate,
87
95
  disabled: !isSelectable,
88
96
  touchRippleRef: rippleRef /* FIXME: typing error */
89
97
  }, rootProps.slotProps?.baseCheckbox, other));
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import type { GridColumnHeaderParams } from '../../models/params/gridColumnHeaderParams';
3
- declare const GridHeaderCheckbox: React.ForwardRefExoticComponent<GridColumnHeaderParams<import("../../models/gridRows").GridValidRowModel, any, any> & React.RefAttributes<HTMLButtonElement>>;
3
+ declare const GridHeaderCheckbox: React.ForwardRefExoticComponent<GridColumnHeaderParams<import("../..").GridValidRowModel, any, any> & React.RefAttributes<HTMLButtonElement>>;
4
4
  export { GridHeaderCheckbox };
@@ -46,7 +46,7 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
46
46
  }
47
47
  return /*#__PURE__*/_jsx(GridRootStyles, _extends({
48
48
  ref: handleRef,
49
- className: clsx(className, classes.root),
49
+ className: clsx(classes.root, className),
50
50
  ownerState: ownerState
51
51
  }, other));
52
52
  });
@@ -170,14 +170,28 @@ export const GridRootStyles = styled('div', {
170
170
  const hoverOpacity = (t.vars || t).palette.action.hoverOpacity;
171
171
  const hoverColor = (t.vars || t).palette.action.hover;
172
172
  const selectedOpacity = (t.vars || t).palette.action.selectedOpacity;
173
+ const selectedHoverOpacity = t.vars ? `calc(${hoverOpacity} + ${selectedOpacity})` // TODO: Improve type
174
+ : hoverOpacity + selectedOpacity;
173
175
  const selectedBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedOpacity})` : alpha(t.palette.primary.main, selectedOpacity);
174
- const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / calc(
175
- ${t.vars.palette.action.selectedOpacity} +
176
- ${t.vars.palette.action.hoverOpacity}
177
- ))` : alpha(t.palette.primary.main, t.palette.action.selectedOpacity + t.palette.action.hoverOpacity);
178
- const pinnedHoverBackground = t.vars ? hoverColor : blend(pinnedBackground, hoverColor, hoverOpacity);
179
- const pinnedSelectedBackground = t.vars ? selectedBackground : blend(pinnedBackground, selectedBackground, selectedOpacity);
180
- const pinnedSelectedHoverBackground = t.vars ? hoverColor : blend(pinnedSelectedBackground, hoverColor, hoverOpacity);
176
+ const selectedHoverBackground = t.vars ? `rgba(${t.vars.palette.primary.mainChannel} / ${selectedHoverOpacity})` : alpha(t.palette.primary.main, selectedHoverOpacity);
177
+ const blendFn = t.vars ? blendCssVars : blend;
178
+ const getPinnedBackgroundStyles = backgroundColor => ({
179
+ [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
180
+ backgroundColor,
181
+ '&.Mui-selected': {
182
+ backgroundColor: blendFn(backgroundColor, selectedBackground, selectedOpacity),
183
+ '&:hover': {
184
+ backgroundColor: blendFn(backgroundColor, selectedBackground, selectedHoverOpacity)
185
+ }
186
+ }
187
+ }
188
+ });
189
+ const pinnedBackgroundColor = blendFn(pinnedBackground, hoverColor, hoverOpacity);
190
+ const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedBackgroundColor);
191
+ const pinnedSelectedBackgroundColor = blendFn(pinnedBackground, selectedBackground, selectedOpacity);
192
+ const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackgroundColor);
193
+ const pinnedSelectedHoverBackgroundColor = blendFn(pinnedBackground, selectedHoverBackground, selectedHoverOpacity);
194
+ const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackgroundColor);
181
195
  const selectedStyles = {
182
196
  backgroundColor: selectedBackground,
183
197
  '&:hover': {
@@ -617,24 +631,15 @@ export const GridRootStyles = styled('div', {
617
631
  [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
618
632
  position: 'sticky',
619
633
  zIndex: 3,
620
- background: 'var(--DataGrid-pinnedBackground)'
634
+ background: 'var(--DataGrid-pinnedBackground)',
635
+ '&.Mui-selected': {
636
+ backgroundColor: pinnedSelectedBackgroundColor
637
+ }
621
638
  },
622
639
  [`& .${c.virtualScrollerContent} .${c.row}`]: {
623
- '&:hover': {
624
- [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
625
- backgroundColor: pinnedHoverBackground
626
- }
627
- },
628
- [`&.Mui-selected`]: {
629
- [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
630
- backgroundColor: pinnedSelectedBackground
631
- },
632
- '&:hover': {
633
- [`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
634
- backgroundColor: pinnedSelectedHoverBackground
635
- }
636
- }
637
- }
640
+ '&:hover': pinnedHoverStyles,
641
+ '&.Mui-selected': pinnedSelectedStyles,
642
+ '&.Mui-selected:hover': pinnedSelectedHoverStyles
638
643
  },
639
644
  [`& .${c.cellOffsetLeft}`]: {
640
645
  flex: '0 0 auto',
@@ -747,4 +752,8 @@ function blend(background, overlay, opacity, gamma = 1) {
747
752
  type: 'rgb',
748
753
  values: rgb
749
754
  });
755
+ }
756
+ const removeOpacity = color => `rgb(from ${color} r g b / 1)`;
757
+ function blendCssVars(background, overlay, opacity) {
758
+ return `color-mix(in srgb,${background}, ${removeOpacity(overlay)} calc(${opacity} * 100%))`;
750
759
  }
@@ -44,7 +44,7 @@ const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarC
44
44
  }
45
45
  return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({
46
46
  ref: ref,
47
- className: clsx(className, classes.root),
47
+ className: clsx(classes.root, className),
48
48
  ownerState: rootProps
49
49
  }, other, {
50
50
  children: children
@@ -85,7 +85,7 @@ function GridMenu(props) {
85
85
  };
86
86
  return /*#__PURE__*/_jsx(GridMenuRoot, _extends({
87
87
  as: rootProps.slots.basePopper,
88
- className: clsx(className, classes.root),
88
+ className: clsx(classes.root, className),
89
89
  ownerState: rootProps,
90
90
  open: open,
91
91
  anchorEl: target,
@@ -16,7 +16,7 @@ export interface GridPanelProps extends Partial<React.ComponentProps<typeof Grid
16
16
  open: boolean;
17
17
  }
18
18
  export declare const gridPanelClasses: Record<keyof GridPanelClasses, string>;
19
- declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material/Popper").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
19
+ declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
20
20
  ownerState: OwnerState;
21
21
  }, {}, {}>;
22
22
  declare const GridPanel: React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -84,7 +84,7 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
84
84
  return /*#__PURE__*/_jsx(GridPanelRoot, _extends({
85
85
  ref: ref,
86
86
  placement: "bottom-start",
87
- className: clsx(className, classes.panel),
87
+ className: clsx(classes.panel, className),
88
88
  ownerState: rootProps,
89
89
  anchorEl: anchorEl,
90
90
  modifiers: modifiers
@@ -37,7 +37,7 @@ function GridPanelContent(props) {
37
37
  const rootProps = useGridRootProps();
38
38
  const classes = useUtilityClasses(rootProps);
39
39
  return /*#__PURE__*/_jsx(GridPanelContentRoot, _extends({
40
- className: clsx(className, classes.root),
40
+ className: clsx(classes.root, className),
41
41
  ownerState: rootProps
42
42
  }, other));
43
43
  }
@@ -37,7 +37,7 @@ function GridPanelFooter(props) {
37
37
  const rootProps = useGridRootProps();
38
38
  const classes = useUtilityClasses(rootProps);
39
39
  return /*#__PURE__*/_jsx(GridPanelFooterRoot, _extends({
40
- className: clsx(className, classes.root),
40
+ className: clsx(classes.root, className),
41
41
  ownerState: rootProps
42
42
  }, other));
43
43
  }
@@ -35,7 +35,7 @@ function GridPanelHeader(props) {
35
35
  const rootProps = useGridRootProps();
36
36
  const classes = useUtilityClasses(rootProps);
37
37
  return /*#__PURE__*/_jsx(GridPanelHeaderRoot, _extends({
38
- className: clsx(className, classes.root),
38
+ className: clsx(classes.root, className),
39
39
  ownerState: rootProps
40
40
  }, other));
41
41
  }
@@ -48,7 +48,7 @@ const GridPanelWrapper = /*#__PURE__*/React.forwardRef(function GridPanelWrapper
48
48
  children: /*#__PURE__*/_jsx(GridPanelWrapperRoot, _extends({
49
49
  ref: ref,
50
50
  tabIndex: -1,
51
- className: clsx(className, classes.root),
51
+ className: clsx(classes.root, className),
52
52
  ownerState: rootProps
53
53
  }, other))
54
54
  }));
@@ -1,5 +1,5 @@
1
1
  import type { GridColDef, GridSingleSelectColDef } from '../../../models/colDef/gridColDef';
2
2
  import type { GridValueOptionsParams } from '../../../models/params/gridValueOptionsParams';
3
3
  export declare function isSingleSelectColDef(colDef: GridColDef | null): colDef is GridSingleSelectColDef;
4
- export declare function getValueOptions(column: GridSingleSelectColDef, additionalParams?: Omit<GridValueOptionsParams, 'field'>): import("../../../models/colDef/gridColDef").ValueOptions[] | undefined;
4
+ export declare function getValueOptions(column: GridSingleSelectColDef, additionalParams?: Omit<GridValueOptionsParams, 'field'>): import("../../..").ValueOptions[] | undefined;
5
5
  export declare function getValueFromValueOptions(value: string, valueOptions: any[] | undefined, getOptionValue: NonNullable<GridSingleSelectColDef['getOptionValue']>): any;
@@ -93,7 +93,7 @@ function GridToolbarQuickFilter(props) {
93
93
  variant: "standard",
94
94
  value: searchValue,
95
95
  onChange: handleSearchValueChange,
96
- className: clsx(className, classes.root),
96
+ className: clsx(classes.root, className),
97
97
  placeholder: apiRef.current.getLocaleText('toolbarQuickFilterPlaceholder'),
98
98
  "aria-label": apiRef.current.getLocaleText('toolbarQuickFilterLabel'),
99
99
  type: "search"
@@ -1,2 +1,2 @@
1
1
  import * as React from 'react';
2
- export declare function GridBottomContainer(props: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
2
+ export declare function GridBottomContainer(props: React.PropsWithChildren): React.JSX.Element;
@@ -4,6 +4,9 @@ import clsx from 'clsx';
4
4
  import { styled } from '@mui/system';
5
5
  import composeClasses from '@mui/utils/composeClasses';
6
6
  import { gridClasses, getDataGridUtilityClass } from "../../constants/gridClasses.js";
7
+ import { gridDimensionsSelector } from "../../hooks/features/dimensions/gridDimensionsSelectors.js";
8
+ import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
9
+ import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
8
11
  const useUtilityClasses = () => {
9
12
  const slots = {
@@ -18,8 +21,22 @@ const Element = styled('div')({
18
21
  });
19
22
  export function GridBottomContainer(props) {
20
23
  const classes = useUtilityClasses();
24
+ const apiRef = useGridApiContext();
25
+ const {
26
+ viewportOuterSize,
27
+ minimumSize,
28
+ hasScrollX,
29
+ scrollbarSize
30
+ } = useGridSelector(apiRef, gridDimensionsSelector);
31
+ const scrollHeight = hasScrollX ? scrollbarSize : 0;
32
+ const offset = Math.max(viewportOuterSize.height - minimumSize.height -
33
+ // Subtract scroll height twice to account for GridVirtualScrollerFiller and horizontal scrollbar
34
+ 2 * scrollHeight, 0);
21
35
  return /*#__PURE__*/_jsx(Element, _extends({}, props, {
22
- className: clsx(classes.root, props.className, gridClasses['container--bottom']),
36
+ className: clsx(classes.root, gridClasses['container--bottom']),
37
+ style: {
38
+ transform: `translateY(${offset}px)`
39
+ },
23
40
  role: "presentation"
24
41
  }));
25
42
  }
@@ -16,7 +16,9 @@ const Element = styled('div', {
16
16
  })({
17
17
  flexGrow: 1,
18
18
  position: 'relative',
19
- overflow: 'hidden'
19
+ overflow: 'hidden',
20
+ display: 'flex',
21
+ flexDirection: 'column'
20
22
  });
21
23
  export const GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
22
24
  const rootProps = useGridRootProps();
@@ -1,2 +1,2 @@
1
1
  import * as React from 'react';
2
- export declare function GridTopContainer(props: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
2
+ export declare function GridTopContainer(props: React.PropsWithChildren): React.JSX.Element;
@@ -19,7 +19,7 @@ const Element = styled('div')({
19
19
  export function GridTopContainer(props) {
20
20
  const classes = useUtilityClasses();
21
21
  return /*#__PURE__*/_jsx(Element, _extends({}, props, {
22
- className: clsx(classes.root, props.className, gridClasses['container--top']),
22
+ className: clsx(classes.root, gridClasses['container--top']),
23
23
  role: "presentation"
24
24
  }));
25
25
  }
@@ -21,9 +21,6 @@ const Scrollbar = styled('div')({
21
21
  position: 'absolute',
22
22
  display: 'inline-block',
23
23
  zIndex: 6,
24
- '& > div': {
25
- display: 'inline-block'
26
- },
27
24
  // In macOS Safari and Gnome Web, scrollbars are overlaid and don't affect the layout. So we consider
28
25
  // their size to be 0px throughout all the calculations, but the floating scrollbar container does need
29
26
  // to appear and have a real size. We set it to 14px because it seems like an acceptable value and we
@@ -55,9 +52,6 @@ const ScrollbarHorizontal = styled(Scrollbar)({
55
52
  },
56
53
  bottom: '0px'
57
54
  });
58
- const Content = styled('div')({
59
- display: 'inline-block'
60
- });
61
55
  const GridVirtualScrollbar = /*#__PURE__*/React.forwardRef(function GridVirtualScrollbar(props, ref) {
62
56
  const apiRef = useGridPrivateApiContext();
63
57
  const rootProps = useGridRootProps();
@@ -127,7 +121,7 @@ const GridVirtualScrollbar = /*#__PURE__*/React.forwardRef(function GridVirtualS
127
121
  className: classes.root,
128
122
  tabIndex: -1,
129
123
  "aria-hidden": "true",
130
- children: /*#__PURE__*/_jsx(Content, {
124
+ children: /*#__PURE__*/_jsx("div", {
131
125
  ref: contentRef,
132
126
  className: classes.content
133
127
  })
@@ -37,6 +37,7 @@ const Scroller = styled('div', {
37
37
  })({
38
38
  position: 'relative',
39
39
  height: '100%',
40
+ flexGrow: 1,
40
41
  overflow: 'scroll',
41
42
  scrollbarWidth: 'none' /* Firefox */,
42
43
  '&::-webkit-scrollbar': {
@@ -44,10 +44,9 @@ function GridVirtualScrollerFiller({
44
44
  leftPinnedWidth,
45
45
  rightPinnedWidth
46
46
  } = useGridSelector(apiRef, gridDimensionsSelector);
47
- const scrollbarHeight = hasScrollX ? scrollbarSize : 0;
48
- const expandedHeight = viewportOuterSize.height - minimumSize.height - scrollbarHeight;
49
- const height = Math.max(scrollbarHeight, expandedHeight);
50
- if (height === 0) {
47
+ const height = hasScrollX ? scrollbarSize : 0;
48
+ const needsLastRowBorder = viewportOuterSize.height - minimumSize.height > 0;
49
+ if (height === 0 && !needsLastRowBorder) {
51
50
  return null;
52
51
  }
53
52
  return /*#__PURE__*/_jsxs(Filler, {
@@ -4,9 +4,9 @@ import { GridStateCommunity } from '../../../models/gridStateCommunity';
4
4
  * @ignore - do not document.
5
5
  */
6
6
  export declare const gridColumnGroupingSelector: (state: GridStateCommunity) => import("./gridColumnGroupsInterfaces").GridColumnsGroupingState;
7
- export declare const gridColumnGroupsUnwrappedModelSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, {
7
+ export declare const gridColumnGroupsUnwrappedModelSelector: import("../../..").OutputSelector<GridStateCommunity, {
8
8
  [columnField: string]: string[];
9
9
  }>;
10
- export declare const gridColumnGroupsLookupSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridColumnGroupsInterfaces").GridColumnGroupLookup>;
11
- export declare const gridColumnGroupsHeaderStructureSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, import("./gridColumnGroupsInterfaces").GridGroupingStructure[][]>;
12
- export declare const gridColumnGroupsHeaderMaxDepthSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
10
+ export declare const gridColumnGroupsLookupSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridColumnGroupsInterfaces").GridColumnGroupLookup>;
11
+ export declare const gridColumnGroupsHeaderStructureSelector: import("../../..").OutputSelector<GridStateCommunity, import("./gridColumnGroupsInterfaces").GridGroupingStructure[][]>;
12
+ export declare const gridColumnGroupsHeaderMaxDepthSelector: import("../../..").OutputSelector<GridStateCommunity, number>;
@@ -28,7 +28,7 @@ export interface GetHeadersParams {
28
28
  maxLastColumn?: number;
29
29
  }
30
30
  type OwnerState = DataGridProcessedProps;
31
- export declare const GridColumnHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
31
+ export declare const GridColumnHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
32
32
  ownerState: OwnerState;
33
33
  }, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
34
34
  export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
@@ -1,3 +1,3 @@
1
1
  import { GridStateCommunity } from '../../../models/gridStateCommunity';
2
2
  export declare const gridColumnResizeSelector: (state: GridStateCommunity) => import("./columnResizeState").GridColumnResizeState;
3
- export declare const gridResizingColumnFieldSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, string>;
3
+ export declare const gridResizingColumnFieldSelector: import("../../..").OutputSelector<GridStateCommunity, string>;