@mui/x-data-grid 7.9.0 → 7.10.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 (44) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/DataGrid/DataGrid.js +1 -0
  3. package/DataGrid/useDataGridProps.js +21 -20
  4. package/components/base/GridOverlays.js +1 -1
  5. package/components/containers/GridRoot.js +4 -16
  6. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  7. package/components/virtualization/GridMainContainer.js +11 -3
  8. package/components/virtualization/GridVirtualScroller.js +3 -1
  9. package/components/virtualization/GridVirtualScrollerFiller.d.ts +5 -1
  10. package/components/virtualization/GridVirtualScrollerFiller.js +9 -6
  11. package/hooks/features/filter/gridFilterSelector.d.ts +11 -0
  12. package/hooks/features/filter/gridFilterSelector.js +13 -0
  13. package/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
  14. package/index.js +1 -1
  15. package/locales/esES.js +1 -2
  16. package/models/api/gridRowSelectionApi.d.ts +2 -2
  17. package/models/colDef/gridColDef.d.ts +4 -4
  18. package/models/gridRowSelectionModel.d.ts +2 -2
  19. package/models/props/DataGridProps.d.ts +5 -4
  20. package/modern/DataGrid/DataGrid.js +1 -0
  21. package/modern/DataGrid/useDataGridProps.js +21 -20
  22. package/modern/components/base/GridOverlays.js +1 -1
  23. package/modern/components/containers/GridRoot.js +4 -16
  24. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  25. package/modern/components/virtualization/GridMainContainer.js +11 -3
  26. package/modern/components/virtualization/GridVirtualScroller.js +3 -1
  27. package/modern/components/virtualization/GridVirtualScrollerFiller.js +9 -6
  28. package/modern/hooks/features/filter/gridFilterSelector.js +13 -0
  29. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
  30. package/modern/index.js +1 -1
  31. package/modern/locales/esES.js +1 -2
  32. package/node/DataGrid/DataGrid.js +1 -0
  33. package/node/DataGrid/useDataGridProps.js +21 -20
  34. package/node/components/base/GridOverlays.js +1 -1
  35. package/node/components/containers/GridRoot.js +3 -15
  36. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
  37. package/node/components/virtualization/GridMainContainer.js +10 -2
  38. package/node/components/virtualization/GridVirtualScroller.js +3 -1
  39. package/node/components/virtualization/GridVirtualScrollerFiller.js +9 -6
  40. package/node/hooks/features/filter/gridFilterSelector.js +14 -1
  41. package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
  42. package/node/index.js +1 -1
  43. package/node/locales/esES.js +1 -2
  44. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,80 @@
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.10.0
7
+
8
+ _Jul 11, 2024_
9
+
10
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Add selectors to support showing child row count in footer in the Data Grid
13
+ - ✨ New APIs for retrieving current item tree and item's children IDs in the Tree View
14
+ - 🌍 Improve Spanish (es-ES) locale on the Data Grid
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@7.10.0`
23
+
24
+ - [DataGrid] Add selectors to support showing child row count in footer (#13725) @KenanYusuf
25
+ - [DataGrid] Fix incorrect panels position when using a toolbar (#13474) @oukunan
26
+ - [DataGrid] Set default variant to `'standard'` in `GridFilterInputMultipleValue` (#13129) @tarunrajput
27
+ - [DataGrid] Use `readonly` on more array props (#13331) @pcorpet
28
+ - [l10n] Improve Spanish (es-ES) locale (#13772) @joserealdev
29
+
30
+ #### `@mui/x-data-grid-pro@7.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
31
+
32
+ Same changes as in `@mui/x-data-grid@7.10.0`, plus:
33
+
34
+ - [DataGridPro] Keep bottom pinned row at the bottom (#13313) @romgrk
35
+
36
+ #### `@mui/x-data-grid-premium@7.10.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
37
+
38
+ Same changes as in `@mui/x-data-grid-pro@7.10.0`.
39
+
40
+ ### Date and Time Pickers
41
+
42
+ #### `@mui/x-date-pickers@7.10.0`
43
+
44
+ - [fields] Prevent infinite recursion when ensuring selection (#13779) @LukasTy
45
+ - [fields] Unify fields behavior regardless of the `readOnly` flag (#13688) @LukasTy
46
+
47
+ #### `@mui/x-date-pickers-pro@7.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
48
+
49
+ Same changes as in `@mui/x-date-pickers@7.10.0`, plus:
50
+
51
+ - [DateRangePicker] Fix `calendarHeader` slot props propagation (#13780) @LukasTy
52
+ - [DateTimeRangePicker] Resolve `format` from given `views` (#13743) @LukasTy
53
+
54
+ ### Charts
55
+
56
+ #### `@mui/x-charts@7.10.0`
57
+
58
+ - [charts] Fix displaying area of a `LineChart` when using the `log` scale (#13791) @alexfauquette
59
+ - [charts] Use correct click handler prop on pie chart `OnSeriesItemClick` documentation (#13761) @tonyhallett
60
+
61
+ ### Tree View
62
+
63
+ #### `@mui/x-tree-view@7.10.0`
64
+
65
+ - [TreeView] Add `getItemTree` and `getItemOrderedChildrenIds` methods to the public API (#13804) @flaviendelangle
66
+ - [TreeView] Add utility function to check if an optional plugin is present (#13788) @flaviendelangle
67
+
68
+ ### Docs
69
+
70
+ - [docs] Add missing default `loading` prop value (#13604) @oliviertassinari
71
+ - [docs] Add the `DateTimeRangePicker` to the "Commonly used components" demo (#13775) @flaviendelangle
72
+ - [docs] Fix Pickers customization playground overflow (#13742) @LukasTy
73
+ - [docs] Move Pickers dialog guidelines to accessibility page (#13778) @arthurbalduini
74
+
75
+ ### Core
76
+
77
+ - [core] Sort `DATA_GRID_PROPS_DEFAULT_VALUES` alphabetically (#13783) @oliviertassinari
78
+ - [test] Fix split infinitive use in tests @oliviertassinari
79
+
6
80
  ## 7.9.0
7
81
 
8
82
  _Jul 5, 2024_
@@ -333,6 +333,7 @@ DataGridRaw.propTypes = {
333
333
  keepNonExistentRowsSelected: PropTypes.bool,
334
334
  /**
335
335
  * If `true`, a loading overlay is displayed.
336
+ * @default false
336
337
  */
337
338
  loading: PropTypes.bool,
338
339
  /**
@@ -23,54 +23,55 @@ const DATA_GRID_FORCED_PROPS = {
23
23
  export const DATA_GRID_PROPS_DEFAULT_VALUES = {
24
24
  autoHeight: false,
25
25
  autoPageSize: false,
26
+ autosizeOnMount: false,
26
27
  checkboxSelection: false,
27
28
  checkboxSelectionVisibleOnly: false,
29
+ clipboardCopyCellDelimiter: '\t',
28
30
  columnBufferPx: 150,
29
- rowBufferPx: 150,
30
- rows: [],
31
- rowSelection: true,
31
+ columnHeaderHeight: 56,
32
+ disableAutosize: false,
32
33
  disableColumnFilter: false,
33
34
  disableColumnMenu: false,
35
+ disableColumnReorder: false,
36
+ disableColumnResize: false,
34
37
  disableColumnSelector: false,
38
+ disableColumnSorting: false,
35
39
  disableDensitySelector: false,
36
40
  disableEval: false,
37
41
  disableMultipleColumnsFiltering: false,
38
- disableMultipleRowSelection: false,
39
- disableColumnSorting: false,
40
42
  disableMultipleColumnsSorting: false,
43
+ disableMultipleRowSelection: false,
41
44
  disableRowSelectionOnClick: false,
42
45
  disableVirtualization: false,
43
46
  editMode: GridEditModes.Cell,
44
- filterMode: 'client',
45
47
  filterDebounceMs: 150,
46
- columnHeaderHeight: 56,
48
+ filterMode: 'client',
47
49
  hideFooter: false,
48
50
  hideFooterPagination: false,
49
51
  hideFooterRowCount: false,
50
52
  hideFooterSelectedRowCount: false,
51
53
  ignoreDiacritics: false,
54
+ ignoreValueFormatterDuringExport: false,
55
+ keepColumnPositionIfDraggedOutside: false,
56
+ keepNonExistentRowsSelected: false,
57
+ loading: false,
52
58
  logger: console,
53
59
  logLevel: process.env.NODE_ENV === 'production' ? 'error' : 'warn',
60
+ pageSizeOptions: [25, 50, 100],
54
61
  pagination: false,
55
62
  paginationMode: 'client',
56
- rowHeight: 52,
57
63
  resizeThrottleMs: 60,
58
- pageSizeOptions: [25, 50, 100],
64
+ rowBufferPx: 150,
65
+ rowHeight: 52,
66
+ rowPositionsDebounceMs: 166,
67
+ rows: [],
68
+ rowSelection: true,
59
69
  rowSpacingType: 'margin',
60
70
  showCellVerticalBorder: false,
61
71
  showColumnVerticalBorder: false,
62
- sortingOrder: ['asc', 'desc', null],
63
72
  sortingMode: 'client',
64
- throttleRowsMs: 0,
65
- disableColumnReorder: false,
66
- disableColumnResize: false,
67
- keepNonExistentRowsSelected: false,
68
- keepColumnPositionIfDraggedOutside: false,
69
- ignoreValueFormatterDuringExport: false,
70
- clipboardCopyCellDelimiter: '\t',
71
- rowPositionsDebounceMs: 166,
72
- autosizeOnMount: false,
73
- disableAutosize: false
73
+ sortingOrder: ['asc', 'desc', null],
74
+ throttleRowsMs: 0
74
75
  };
75
76
  const defaultSlots = DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
76
77
  export const useDataGridProps = inProps => {
@@ -55,7 +55,7 @@ function GridOverlayWrapper(props) {
55
55
  const rootProps = useGridRootProps();
56
56
  const currentPage = useGridVisibleRows(apiRef, rootProps);
57
57
  const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
58
- let height = dimensions.viewportOuterSize.height - dimensions.headersTotalHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
58
+ let height = dimensions.viewportOuterSize.height - dimensions.topContainerHeight - dimensions.bottomContainerHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
59
59
  if (rootProps.autoHeight && currentPage.rows.length === 0 || height === 0) {
60
60
  height = getMinimalContentHeight(apiRef);
61
61
  }
@@ -1,18 +1,17 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["children", "className"];
3
+ const _excluded = ["className"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';
8
- import { styled } from '@mui/system';
9
8
  import { GridRootStyles } from './GridRootStyles';
10
9
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
11
10
  import { useGridPrivateApiContext } from '../../hooks/utils/useGridPrivateApiContext';
12
11
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
13
12
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
14
13
  import { gridDensitySelector } from '../../hooks/features/density/densitySelector';
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
16
15
  const useUtilityClasses = ownerState => {
17
16
  const {
18
17
  autoHeight,
@@ -25,15 +24,9 @@ const useUtilityClasses = ownerState => {
25
24
  };
26
25
  return composeClasses(slots, getDataGridUtilityClass, classes);
27
26
  };
28
- const GridPanelAnchor = styled('div')({
29
- position: 'absolute',
30
- top: `var(--DataGrid-headersTotalHeight)`,
31
- left: 0
32
- });
33
27
  const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
34
28
  const rootProps = useGridRootProps();
35
29
  const {
36
- children,
37
30
  className
38
31
  } = props,
39
32
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -54,16 +47,11 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
54
47
  if (!mountedState) {
55
48
  return null;
56
49
  }
57
- return /*#__PURE__*/_jsxs(GridRootStyles, _extends({
50
+ return /*#__PURE__*/_jsx(GridRootStyles, _extends({
58
51
  ref: handleRef,
59
52
  className: clsx(className, classes.root),
60
53
  ownerState: ownerState
61
- }, other, {
62
- children: [/*#__PURE__*/_jsx(GridPanelAnchor, {
63
- role: "presentation",
64
- "data-id": "gridPanelAnchor"
65
- }), children]
66
- }));
54
+ }, other));
67
55
  });
68
56
  process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
69
57
  // ----------------------------- Warning --------------------------------
@@ -18,7 +18,7 @@ function GridFilterInputMultipleValue(props) {
18
18
  error,
19
19
  helperText,
20
20
  size,
21
- variant
21
+ variant = 'standard'
22
22
  } = props,
23
23
  other = _objectWithoutPropertiesLoose(props, _excluded);
24
24
  const TextFieldProps = {
@@ -3,7 +3,12 @@ import * as React from 'react';
3
3
  import { styled } from '@mui/system';
4
4
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
5
5
  import { useGridAriaAttributes } from '../../hooks/utils/useGridAriaAttributes';
6
- import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const GridPanelAnchor = styled('div')({
8
+ position: 'absolute',
9
+ top: `var(--DataGrid-headersTotalHeight)`,
10
+ left: 0
11
+ });
7
12
  const Element = styled('div', {
8
13
  name: 'MuiDataGrid',
9
14
  slot: 'Main',
@@ -16,12 +21,15 @@ const Element = styled('div', {
16
21
  export const GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
17
22
  const ariaAttributes = useGridAriaAttributes();
18
23
  const rootProps = useGridRootProps();
19
- return /*#__PURE__*/_jsx(Element, _extends({
24
+ return /*#__PURE__*/_jsxs(Element, _extends({
20
25
  ref: ref,
21
26
  ownerState: rootProps,
22
27
  className: props.className,
23
28
  tabIndex: -1
24
29
  }, ariaAttributes, {
25
- children: props.children
30
+ children: [/*#__PURE__*/_jsx(GridPanelAnchor, {
31
+ role: "presentation",
32
+ "data-id": "gridPanelAnchor"
33
+ }), props.children]
26
34
  }));
27
35
  });
@@ -87,7 +87,9 @@ function GridVirtualScroller(props) {
87
87
  virtualScroller: virtualScroller
88
88
  })]
89
89
  }))
90
- })), rows.length > 0 && /*#__PURE__*/_jsx(SpaceFiller, {}), /*#__PURE__*/_jsx(BottomContainer, {
90
+ })), /*#__PURE__*/_jsx(SpaceFiller, {
91
+ rowsLength: rows.length
92
+ }), /*#__PURE__*/_jsx(BottomContainer, {
91
93
  children: /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {
92
94
  position: "bottom",
93
95
  virtualScroller: virtualScroller
@@ -1,4 +1,8 @@
1
1
  import * as React from 'react';
2
- declare function GridVirtualScrollerFiller(): React.JSX.Element | null;
2
+ type Props = {
3
+ /** The number of rows */
4
+ rowsLength: number;
5
+ };
6
+ declare function GridVirtualScrollerFiller({ rowsLength }: Props): React.JSX.Element | null;
3
7
  declare const Memoized: typeof GridVirtualScrollerFiller;
4
8
  export { Memoized as GridVirtualScrollerFiller };
@@ -16,22 +16,24 @@ const Pinned = styled('div')({
16
16
  position: 'sticky',
17
17
  height: '100%',
18
18
  boxSizing: 'border-box',
19
- borderTop: '1px solid var(--DataGrid-rowBorderColor)',
19
+ borderTop: '1px solid var(--rowBorderColor)',
20
20
  backgroundColor: 'var(--DataGrid-pinnedBackground)'
21
21
  });
22
22
  const PinnedLeft = styled(Pinned)({
23
23
  left: 0,
24
- borderRight: '1px solid var(--DataGrid-rowBorderColor)'
24
+ borderRight: '1px solid var(--rowBorderColor)'
25
25
  });
26
26
  const PinnedRight = styled(Pinned)({
27
27
  right: 0,
28
- borderLeft: '1px solid var(--DataGrid-rowBorderColor)'
28
+ borderLeft: '1px solid var(--rowBorderColor)'
29
29
  });
30
30
  const Main = styled('div')({
31
31
  flexGrow: 1,
32
- borderTop: '1px solid var(--DataGrid-rowBorderColor)'
32
+ borderTop: '1px solid var(--rowBorderColor)'
33
33
  });
34
- function GridVirtualScrollerFiller() {
34
+ function GridVirtualScrollerFiller({
35
+ rowsLength
36
+ }) {
35
37
  const apiRef = useGridApiContext();
36
38
  const {
37
39
  viewportOuterSize,
@@ -52,7 +54,8 @@ function GridVirtualScrollerFiller() {
52
54
  className: gridClasses.filler,
53
55
  role: "presentation",
54
56
  style: {
55
- height
57
+ height,
58
+ '--rowBorderColor': rowsLength === 0 ? 'transparent' : 'var(--DataGrid-rowBorderColor)'
56
59
  },
57
60
  children: [leftPinnedWidth > 0 && /*#__PURE__*/_jsx(PinnedLeft, {
58
61
  className: gridClasses['filler--pinnedLeft'],
@@ -64,6 +64,17 @@ export declare const gridExpandedRowCountSelector: import("../../../utils/create
64
64
  * @category Filtering
65
65
  */
66
66
  export declare const gridFilteredTopLevelRowCountSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
67
+ /**
68
+ * Get the amount of rows accessible after the filtering process.
69
+ * Includes top level and descendant rows.
70
+ * @category Filtering
71
+ */
72
+ export declare const gridFilteredRowCountSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
73
+ /**
74
+ * Get the amount of descendant rows accessible after the filtering process.
75
+ * @category Filtering
76
+ */
77
+ export declare const gridFilteredDescendantRowCountSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, number>;
67
78
  /**
68
79
  * @category Filtering
69
80
  * @ignore - do not document.
@@ -89,6 +89,19 @@ export const gridExpandedRowCountSelector = createSelector(gridExpandedSortedRow
89
89
  */
90
90
  export const gridFilteredTopLevelRowCountSelector = createSelector(gridFilteredSortedTopLevelRowEntriesSelector, visibleSortedTopLevelRows => visibleSortedTopLevelRows.length);
91
91
 
92
+ /**
93
+ * Get the amount of rows accessible after the filtering process.
94
+ * Includes top level and descendant rows.
95
+ * @category Filtering
96
+ */
97
+ export const gridFilteredRowCountSelector = createSelector(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.length);
98
+
99
+ /**
100
+ * Get the amount of descendant rows accessible after the filtering process.
101
+ * @category Filtering
102
+ */
103
+ export const gridFilteredDescendantRowCountSelector = createSelector(gridFilteredRowCountSelector, gridFilteredTopLevelRowCountSelector, (totalRowCount, topLevelRowCount) => totalRowCount - topLevelRowCount);
104
+
92
105
  /**
93
106
  * @category Filtering
94
107
  * @ignore - do not document.
@@ -361,20 +361,12 @@ export const useGridVirtualScroller = () => {
361
361
  overflowY: rootProps.autoHeight ? 'hidden' : undefined
362
362
  }), [needsHorizontalScrollbar, rootProps.autoHeight]);
363
363
  const contentSize = React.useMemo(() => {
364
- // In cases where the columns exceed the available width,
365
- // the horizontal scrollbar should be shown even when there're no rows.
366
- // Keeping 1px as minimum height ensures that the scrollbar will visible if necessary.
367
- const height = Math.max(contentHeight, 1);
368
364
  const size = {
369
365
  width: needsHorizontalScrollbar ? columnsTotalWidth : 'auto',
370
- height
366
+ height: contentHeight
371
367
  };
372
- if (rootProps.autoHeight) {
373
- if (currentPage.rows.length === 0) {
374
- size.height = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.
375
- } else {
376
- size.height = contentHeight;
377
- }
368
+ if (rootProps.autoHeight && currentPage.rows.length === 0) {
369
+ size.height = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.
378
370
  }
379
371
  return size;
380
372
  }, [apiRef, columnsTotalWidth, contentHeight, needsHorizontalScrollbar, rootProps.autoHeight, currentPage.rows.length]);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.9.0
2
+ * @mui/x-data-grid v7.10.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/locales/esES.js CHANGED
@@ -33,8 +33,7 @@ const esESGrid = {
33
33
  columnsManagementSearchTitle: 'Buscar',
34
34
  columnsManagementNoColumns: 'Sin columnas',
35
35
  columnsManagementShowHideAllText: 'Mostrar/Ocultar todas',
36
- // columnsManagementReset: 'Reset',
37
-
36
+ columnsManagementReset: 'Restablecer',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'Agregar filtro',
40
39
  filterPanelRemoveAll: 'Remover todos',
@@ -30,9 +30,9 @@ export interface GridRowSelectionApi {
30
30
  /**
31
31
  * Updates the selected rows to be those passed to the `rowIds` argument.
32
32
  * Any row already selected will be unselected.
33
- * @param {GridRowId[]} rowIds The row ids to select.
33
+ * @param {readonly GridRowId[]} rowIds The row ids to select.
34
34
  */
35
- setRowSelectionModel: (rowIds: GridRowId[]) => void;
35
+ setRowSelectionModel: (rowIds: readonly GridRowId[]) => void;
36
36
  }
37
37
  export interface GridRowMultiSelectionApi {
38
38
  /**
@@ -79,7 +79,7 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
79
79
  /**
80
80
  * The order of the sorting sequence.
81
81
  */
82
- sortingOrder?: GridSortDirection[];
82
+ sortingOrder?: readonly GridSortDirection[];
83
83
  /**
84
84
  * If `true`, the column is resizable.
85
85
  * @default true
@@ -207,7 +207,7 @@ export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel,
207
207
  /**
208
208
  * Allows setting the filter operators for this column.
209
209
  */
210
- filterOperators?: GridFilterOperator<R, V, F>[];
210
+ filterOperators?: readonly GridFilterOperator<R, V, F>[];
211
211
  /**
212
212
  * The callback that generates a filtering function for a given quick filter value.
213
213
  * This function can return `null` to skip filtering for this value and column.
@@ -247,9 +247,9 @@ export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F
247
247
  /**
248
248
  * Function that returns the actions to be shown.
249
249
  * @param {GridRowParams} params The params for each row.
250
- * @returns {React.ReactElement<GridActionsCellItemProps>[]} An array of [[GridActionsCell]] elements.
250
+ * @returns {readonly React.ReactElement<GridActionsCellItemProps>[]} An array of [[GridActionsCell]] elements.
251
251
  */
252
- getActions: (params: GridRowParams<R>) => React.ReactElement<GridActionsCellItemProps>[];
252
+ getActions: (params: GridRowParams<R>) => readonly React.ReactElement<GridActionsCellItemProps>[];
253
253
  }
254
254
  /**
255
255
  * Column Definition interface used for columns with the `singleSelect` type.
@@ -1,3 +1,3 @@
1
1
  import { GridRowId } from './gridRows';
2
- export type GridInputRowSelectionModel = GridRowId[] | GridRowId;
3
- export type GridRowSelectionModel = GridRowId[];
2
+ export type GridInputRowSelectionModel = readonly GridRowId[] | GridRowId;
3
+ export type GridRowSelectionModel = readonly GridRowId[];
@@ -234,6 +234,11 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
234
234
  * @default "error" ("warn" in dev mode)
235
235
  */
236
236
  logLevel: keyof Logger | false;
237
+ /**
238
+ * If `true`, a loading overlay is displayed.
239
+ * @default false
240
+ */
241
+ loading: boolean;
237
242
  /**
238
243
  * If `true`, pagination is enabled.
239
244
  * @default false
@@ -698,10 +703,6 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
698
703
  * Return the id of a given [[GridRowModel]].
699
704
  */
700
705
  getRowId?: GridRowIdGetter<R>;
701
- /**
702
- * If `true`, a loading overlay is displayed.
703
- */
704
- loading?: boolean;
705
706
  /**
706
707
  * Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
707
708
  */
@@ -333,6 +333,7 @@ DataGridRaw.propTypes = {
333
333
  keepNonExistentRowsSelected: PropTypes.bool,
334
334
  /**
335
335
  * If `true`, a loading overlay is displayed.
336
+ * @default false
336
337
  */
337
338
  loading: PropTypes.bool,
338
339
  /**
@@ -23,54 +23,55 @@ const DATA_GRID_FORCED_PROPS = {
23
23
  export const DATA_GRID_PROPS_DEFAULT_VALUES = {
24
24
  autoHeight: false,
25
25
  autoPageSize: false,
26
+ autosizeOnMount: false,
26
27
  checkboxSelection: false,
27
28
  checkboxSelectionVisibleOnly: false,
29
+ clipboardCopyCellDelimiter: '\t',
28
30
  columnBufferPx: 150,
29
- rowBufferPx: 150,
30
- rows: [],
31
- rowSelection: true,
31
+ columnHeaderHeight: 56,
32
+ disableAutosize: false,
32
33
  disableColumnFilter: false,
33
34
  disableColumnMenu: false,
35
+ disableColumnReorder: false,
36
+ disableColumnResize: false,
34
37
  disableColumnSelector: false,
38
+ disableColumnSorting: false,
35
39
  disableDensitySelector: false,
36
40
  disableEval: false,
37
41
  disableMultipleColumnsFiltering: false,
38
- disableMultipleRowSelection: false,
39
- disableColumnSorting: false,
40
42
  disableMultipleColumnsSorting: false,
43
+ disableMultipleRowSelection: false,
41
44
  disableRowSelectionOnClick: false,
42
45
  disableVirtualization: false,
43
46
  editMode: GridEditModes.Cell,
44
- filterMode: 'client',
45
47
  filterDebounceMs: 150,
46
- columnHeaderHeight: 56,
48
+ filterMode: 'client',
47
49
  hideFooter: false,
48
50
  hideFooterPagination: false,
49
51
  hideFooterRowCount: false,
50
52
  hideFooterSelectedRowCount: false,
51
53
  ignoreDiacritics: false,
54
+ ignoreValueFormatterDuringExport: false,
55
+ keepColumnPositionIfDraggedOutside: false,
56
+ keepNonExistentRowsSelected: false,
57
+ loading: false,
52
58
  logger: console,
53
59
  logLevel: process.env.NODE_ENV === 'production' ? 'error' : 'warn',
60
+ pageSizeOptions: [25, 50, 100],
54
61
  pagination: false,
55
62
  paginationMode: 'client',
56
- rowHeight: 52,
57
63
  resizeThrottleMs: 60,
58
- pageSizeOptions: [25, 50, 100],
64
+ rowBufferPx: 150,
65
+ rowHeight: 52,
66
+ rowPositionsDebounceMs: 166,
67
+ rows: [],
68
+ rowSelection: true,
59
69
  rowSpacingType: 'margin',
60
70
  showCellVerticalBorder: false,
61
71
  showColumnVerticalBorder: false,
62
- sortingOrder: ['asc', 'desc', null],
63
72
  sortingMode: 'client',
64
- throttleRowsMs: 0,
65
- disableColumnReorder: false,
66
- disableColumnResize: false,
67
- keepNonExistentRowsSelected: false,
68
- keepColumnPositionIfDraggedOutside: false,
69
- ignoreValueFormatterDuringExport: false,
70
- clipboardCopyCellDelimiter: '\t',
71
- rowPositionsDebounceMs: 166,
72
- autosizeOnMount: false,
73
- disableAutosize: false
73
+ sortingOrder: ['asc', 'desc', null],
74
+ throttleRowsMs: 0
74
75
  };
75
76
  const defaultSlots = DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
76
77
  export const useDataGridProps = inProps => {
@@ -55,7 +55,7 @@ function GridOverlayWrapper(props) {
55
55
  const rootProps = useGridRootProps();
56
56
  const currentPage = useGridVisibleRows(apiRef, rootProps);
57
57
  const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
58
- let height = dimensions.viewportOuterSize.height - dimensions.headersTotalHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
58
+ let height = dimensions.viewportOuterSize.height - dimensions.topContainerHeight - dimensions.bottomContainerHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
59
59
  if (rootProps.autoHeight && currentPage.rows.length === 0 || height === 0) {
60
60
  height = getMinimalContentHeight(apiRef);
61
61
  }
@@ -1,18 +1,17 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["children", "className"];
3
+ const _excluded = ["className"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';
8
- import { styled } from '@mui/system';
9
8
  import { GridRootStyles } from './GridRootStyles';
10
9
  import { useGridSelector } from '../../hooks/utils/useGridSelector';
11
10
  import { useGridPrivateApiContext } from '../../hooks/utils/useGridPrivateApiContext';
12
11
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
13
12
  import { getDataGridUtilityClass } from '../../constants/gridClasses';
14
13
  import { gridDensitySelector } from '../../hooks/features/density/densitySelector';
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
16
15
  const useUtilityClasses = ownerState => {
17
16
  const {
18
17
  autoHeight,
@@ -25,15 +24,9 @@ const useUtilityClasses = ownerState => {
25
24
  };
26
25
  return composeClasses(slots, getDataGridUtilityClass, classes);
27
26
  };
28
- const GridPanelAnchor = styled('div')({
29
- position: 'absolute',
30
- top: `var(--DataGrid-headersTotalHeight)`,
31
- left: 0
32
- });
33
27
  const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
34
28
  const rootProps = useGridRootProps();
35
29
  const {
36
- children,
37
30
  className
38
31
  } = props,
39
32
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -54,16 +47,11 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
54
47
  if (!mountedState) {
55
48
  return null;
56
49
  }
57
- return /*#__PURE__*/_jsxs(GridRootStyles, _extends({
50
+ return /*#__PURE__*/_jsx(GridRootStyles, _extends({
58
51
  ref: handleRef,
59
52
  className: clsx(className, classes.root),
60
53
  ownerState: ownerState
61
- }, other, {
62
- children: [/*#__PURE__*/_jsx(GridPanelAnchor, {
63
- role: "presentation",
64
- "data-id": "gridPanelAnchor"
65
- }), children]
66
- }));
54
+ }, other));
67
55
  });
68
56
  process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
69
57
  // ----------------------------- Warning --------------------------------
@@ -18,7 +18,7 @@ function GridFilterInputMultipleValue(props) {
18
18
  error,
19
19
  helperText,
20
20
  size,
21
- variant
21
+ variant = 'standard'
22
22
  } = props,
23
23
  other = _objectWithoutPropertiesLoose(props, _excluded);
24
24
  const TextFieldProps = {
@@ -3,7 +3,12 @@ import * as React from 'react';
3
3
  import { styled } from '@mui/system';
4
4
  import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
5
5
  import { useGridAriaAttributes } from '../../hooks/utils/useGridAriaAttributes';
6
- import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const GridPanelAnchor = styled('div')({
8
+ position: 'absolute',
9
+ top: `var(--DataGrid-headersTotalHeight)`,
10
+ left: 0
11
+ });
7
12
  const Element = styled('div', {
8
13
  name: 'MuiDataGrid',
9
14
  slot: 'Main',
@@ -16,12 +21,15 @@ const Element = styled('div', {
16
21
  export const GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
17
22
  const ariaAttributes = useGridAriaAttributes();
18
23
  const rootProps = useGridRootProps();
19
- return /*#__PURE__*/_jsx(Element, _extends({
24
+ return /*#__PURE__*/_jsxs(Element, _extends({
20
25
  ref: ref,
21
26
  ownerState: rootProps,
22
27
  className: props.className,
23
28
  tabIndex: -1
24
29
  }, ariaAttributes, {
25
- children: props.children
30
+ children: [/*#__PURE__*/_jsx(GridPanelAnchor, {
31
+ role: "presentation",
32
+ "data-id": "gridPanelAnchor"
33
+ }), props.children]
26
34
  }));
27
35
  });
@@ -87,7 +87,9 @@ function GridVirtualScroller(props) {
87
87
  virtualScroller: virtualScroller
88
88
  })]
89
89
  }))
90
- })), rows.length > 0 && /*#__PURE__*/_jsx(SpaceFiller, {}), /*#__PURE__*/_jsx(BottomContainer, {
90
+ })), /*#__PURE__*/_jsx(SpaceFiller, {
91
+ rowsLength: rows.length
92
+ }), /*#__PURE__*/_jsx(BottomContainer, {
91
93
  children: /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {
92
94
  position: "bottom",
93
95
  virtualScroller: virtualScroller
@@ -16,22 +16,24 @@ const Pinned = styled('div')({
16
16
  position: 'sticky',
17
17
  height: '100%',
18
18
  boxSizing: 'border-box',
19
- borderTop: '1px solid var(--DataGrid-rowBorderColor)',
19
+ borderTop: '1px solid var(--rowBorderColor)',
20
20
  backgroundColor: 'var(--DataGrid-pinnedBackground)'
21
21
  });
22
22
  const PinnedLeft = styled(Pinned)({
23
23
  left: 0,
24
- borderRight: '1px solid var(--DataGrid-rowBorderColor)'
24
+ borderRight: '1px solid var(--rowBorderColor)'
25
25
  });
26
26
  const PinnedRight = styled(Pinned)({
27
27
  right: 0,
28
- borderLeft: '1px solid var(--DataGrid-rowBorderColor)'
28
+ borderLeft: '1px solid var(--rowBorderColor)'
29
29
  });
30
30
  const Main = styled('div')({
31
31
  flexGrow: 1,
32
- borderTop: '1px solid var(--DataGrid-rowBorderColor)'
32
+ borderTop: '1px solid var(--rowBorderColor)'
33
33
  });
34
- function GridVirtualScrollerFiller() {
34
+ function GridVirtualScrollerFiller({
35
+ rowsLength
36
+ }) {
35
37
  const apiRef = useGridApiContext();
36
38
  const {
37
39
  viewportOuterSize,
@@ -52,7 +54,8 @@ function GridVirtualScrollerFiller() {
52
54
  className: gridClasses.filler,
53
55
  role: "presentation",
54
56
  style: {
55
- height
57
+ height,
58
+ '--rowBorderColor': rowsLength === 0 ? 'transparent' : 'var(--DataGrid-rowBorderColor)'
56
59
  },
57
60
  children: [leftPinnedWidth > 0 && /*#__PURE__*/_jsx(PinnedLeft, {
58
61
  className: gridClasses['filler--pinnedLeft'],
@@ -89,6 +89,19 @@ export const gridExpandedRowCountSelector = createSelector(gridExpandedSortedRow
89
89
  */
90
90
  export const gridFilteredTopLevelRowCountSelector = createSelector(gridFilteredSortedTopLevelRowEntriesSelector, visibleSortedTopLevelRows => visibleSortedTopLevelRows.length);
91
91
 
92
+ /**
93
+ * Get the amount of rows accessible after the filtering process.
94
+ * Includes top level and descendant rows.
95
+ * @category Filtering
96
+ */
97
+ export const gridFilteredRowCountSelector = createSelector(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.length);
98
+
99
+ /**
100
+ * Get the amount of descendant rows accessible after the filtering process.
101
+ * @category Filtering
102
+ */
103
+ export const gridFilteredDescendantRowCountSelector = createSelector(gridFilteredRowCountSelector, gridFilteredTopLevelRowCountSelector, (totalRowCount, topLevelRowCount) => totalRowCount - topLevelRowCount);
104
+
92
105
  /**
93
106
  * @category Filtering
94
107
  * @ignore - do not document.
@@ -361,20 +361,12 @@ export const useGridVirtualScroller = () => {
361
361
  overflowY: rootProps.autoHeight ? 'hidden' : undefined
362
362
  }), [needsHorizontalScrollbar, rootProps.autoHeight]);
363
363
  const contentSize = React.useMemo(() => {
364
- // In cases where the columns exceed the available width,
365
- // the horizontal scrollbar should be shown even when there're no rows.
366
- // Keeping 1px as minimum height ensures that the scrollbar will visible if necessary.
367
- const height = Math.max(contentHeight, 1);
368
364
  const size = {
369
365
  width: needsHorizontalScrollbar ? columnsTotalWidth : 'auto',
370
- height
366
+ height: contentHeight
371
367
  };
372
- if (rootProps.autoHeight) {
373
- if (currentPage.rows.length === 0) {
374
- size.height = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.
375
- } else {
376
- size.height = contentHeight;
377
- }
368
+ if (rootProps.autoHeight && currentPage.rows.length === 0) {
369
+ size.height = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.
378
370
  }
379
371
  return size;
380
372
  }, [apiRef, columnsTotalWidth, contentHeight, needsHorizontalScrollbar, rootProps.autoHeight, currentPage.rows.length]);
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.9.0
2
+ * @mui/x-data-grid v7.10.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -33,8 +33,7 @@ const esESGrid = {
33
33
  columnsManagementSearchTitle: 'Buscar',
34
34
  columnsManagementNoColumns: 'Sin columnas',
35
35
  columnsManagementShowHideAllText: 'Mostrar/Ocultar todas',
36
- // columnsManagementReset: 'Reset',
37
-
36
+ columnsManagementReset: 'Restablecer',
38
37
  // Filter panel text
39
38
  filterPanelAddFilter: 'Agregar filtro',
40
39
  filterPanelRemoveAll: 'Remover todos',
@@ -341,6 +341,7 @@ DataGridRaw.propTypes = {
341
341
  keepNonExistentRowsSelected: _propTypes.default.bool,
342
342
  /**
343
343
  * If `true`, a loading overlay is displayed.
344
+ * @default false
344
345
  */
345
346
  loading: _propTypes.default.bool,
346
347
  /**
@@ -32,54 +32,55 @@ const DATA_GRID_FORCED_PROPS = {
32
32
  const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES = {
33
33
  autoHeight: false,
34
34
  autoPageSize: false,
35
+ autosizeOnMount: false,
35
36
  checkboxSelection: false,
36
37
  checkboxSelectionVisibleOnly: false,
38
+ clipboardCopyCellDelimiter: '\t',
37
39
  columnBufferPx: 150,
38
- rowBufferPx: 150,
39
- rows: [],
40
- rowSelection: true,
40
+ columnHeaderHeight: 56,
41
+ disableAutosize: false,
41
42
  disableColumnFilter: false,
42
43
  disableColumnMenu: false,
44
+ disableColumnReorder: false,
45
+ disableColumnResize: false,
43
46
  disableColumnSelector: false,
47
+ disableColumnSorting: false,
44
48
  disableDensitySelector: false,
45
49
  disableEval: false,
46
50
  disableMultipleColumnsFiltering: false,
47
- disableMultipleRowSelection: false,
48
- disableColumnSorting: false,
49
51
  disableMultipleColumnsSorting: false,
52
+ disableMultipleRowSelection: false,
50
53
  disableRowSelectionOnClick: false,
51
54
  disableVirtualization: false,
52
55
  editMode: _models.GridEditModes.Cell,
53
- filterMode: 'client',
54
56
  filterDebounceMs: 150,
55
- columnHeaderHeight: 56,
57
+ filterMode: 'client',
56
58
  hideFooter: false,
57
59
  hideFooterPagination: false,
58
60
  hideFooterRowCount: false,
59
61
  hideFooterSelectedRowCount: false,
60
62
  ignoreDiacritics: false,
63
+ ignoreValueFormatterDuringExport: false,
64
+ keepColumnPositionIfDraggedOutside: false,
65
+ keepNonExistentRowsSelected: false,
66
+ loading: false,
61
67
  logger: console,
62
68
  logLevel: process.env.NODE_ENV === 'production' ? 'error' : 'warn',
69
+ pageSizeOptions: [25, 50, 100],
63
70
  pagination: false,
64
71
  paginationMode: 'client',
65
- rowHeight: 52,
66
72
  resizeThrottleMs: 60,
67
- pageSizeOptions: [25, 50, 100],
73
+ rowBufferPx: 150,
74
+ rowHeight: 52,
75
+ rowPositionsDebounceMs: 166,
76
+ rows: [],
77
+ rowSelection: true,
68
78
  rowSpacingType: 'margin',
69
79
  showCellVerticalBorder: false,
70
80
  showColumnVerticalBorder: false,
71
- sortingOrder: ['asc', 'desc', null],
72
81
  sortingMode: 'client',
73
- throttleRowsMs: 0,
74
- disableColumnReorder: false,
75
- disableColumnResize: false,
76
- keepNonExistentRowsSelected: false,
77
- keepColumnPositionIfDraggedOutside: false,
78
- ignoreValueFormatterDuringExport: false,
79
- clipboardCopyCellDelimiter: '\t',
80
- rowPositionsDebounceMs: 166,
81
- autosizeOnMount: false,
82
- disableAutosize: false
82
+ sortingOrder: ['asc', 'desc', null],
83
+ throttleRowsMs: 0
83
84
  };
84
85
  const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
85
86
  const useDataGridProps = inProps => {
@@ -64,7 +64,7 @@ function GridOverlayWrapper(props) {
64
64
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
65
65
  const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, rootProps);
66
66
  const dimensions = (0, _useGridSelector.useGridSelector)(apiRef, _dimensions.gridDimensionsSelector);
67
- let height = dimensions.viewportOuterSize.height - dimensions.headersTotalHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
67
+ let height = dimensions.viewportOuterSize.height - dimensions.topContainerHeight - dimensions.bottomContainerHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
68
68
  if (rootProps.autoHeight && currentPage.rows.length === 0 || height === 0) {
69
69
  height = (0, _gridRowsUtils.getMinimalContentHeight)(apiRef);
70
70
  }
@@ -11,7 +11,6 @@ var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _clsx = _interopRequireDefault(require("clsx"));
13
13
  var _utils = require("@mui/utils");
14
- var _system = require("@mui/system");
15
14
  var _GridRootStyles = require("./GridRootStyles");
16
15
  var _useGridSelector = require("../../hooks/utils/useGridSelector");
17
16
  var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
@@ -19,7 +18,7 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
19
18
  var _gridClasses = require("../../constants/gridClasses");
20
19
  var _densitySelector = require("../../hooks/features/density/densitySelector");
21
20
  var _jsxRuntime = require("react/jsx-runtime");
22
- const _excluded = ["children", "className"];
21
+ const _excluded = ["className"];
23
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
24
  const useUtilityClasses = ownerState => {
@@ -34,15 +33,9 @@ const useUtilityClasses = ownerState => {
34
33
  };
35
34
  return (0, _utils.unstable_composeClasses)(slots, _gridClasses.getDataGridUtilityClass, classes);
36
35
  };
37
- const GridPanelAnchor = (0, _system.styled)('div')({
38
- position: 'absolute',
39
- top: `var(--DataGrid-headersTotalHeight)`,
40
- left: 0
41
- });
42
36
  const GridRoot = exports.GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
43
37
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
44
38
  const {
45
- children,
46
39
  className
47
40
  } = props,
48
41
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
@@ -63,16 +56,11 @@ const GridRoot = exports.GridRoot = /*#__PURE__*/React.forwardRef(function GridR
63
56
  if (!mountedState) {
64
57
  return null;
65
58
  }
66
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridRootStyles.GridRootStyles, (0, _extends2.default)({
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridRootStyles.GridRootStyles, (0, _extends2.default)({
67
60
  ref: handleRef,
68
61
  className: (0, _clsx.default)(className, classes.root),
69
62
  ownerState: ownerState
70
- }, other, {
71
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(GridPanelAnchor, {
72
- role: "presentation",
73
- "data-id": "gridPanelAnchor"
74
- }), children]
75
- }));
63
+ }, other));
76
64
  });
77
65
  process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
78
66
  // ----------------------------- Warning --------------------------------
@@ -27,7 +27,7 @@ function GridFilterInputMultipleValue(props) {
27
27
  error,
28
28
  helperText,
29
29
  size,
30
- variant
30
+ variant = 'standard'
31
31
  } = props,
32
32
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
33
33
  const TextFieldProps = {
@@ -13,6 +13,11 @@ var _useGridAriaAttributes = require("../../hooks/utils/useGridAriaAttributes");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ const GridPanelAnchor = (0, _system.styled)('div')({
17
+ position: 'absolute',
18
+ top: `var(--DataGrid-headersTotalHeight)`,
19
+ left: 0
20
+ });
16
21
  const Element = (0, _system.styled)('div', {
17
22
  name: 'MuiDataGrid',
18
23
  slot: 'Main',
@@ -25,12 +30,15 @@ const Element = (0, _system.styled)('div', {
25
30
  const GridMainContainer = exports.GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
26
31
  const ariaAttributes = (0, _useGridAriaAttributes.useGridAriaAttributes)();
27
32
  const rootProps = (0, _useGridRootProps.useGridRootProps)();
28
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Element, (0, _extends2.default)({
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Element, (0, _extends2.default)({
29
34
  ref: ref,
30
35
  ownerState: rootProps,
31
36
  className: props.className,
32
37
  tabIndex: -1
33
38
  }, ariaAttributes, {
34
- children: props.children
39
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(GridPanelAnchor, {
40
+ role: "presentation",
41
+ "data-id": "gridPanelAnchor"
42
+ }), props.children]
35
43
  }));
36
44
  });
@@ -96,7 +96,9 @@ function GridVirtualScroller(props) {
96
96
  virtualScroller: virtualScroller
97
97
  })]
98
98
  }))
99
- })), rows.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridVirtualScrollerFiller.GridVirtualScrollerFiller, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridBottomContainer.GridBottomContainer, {
99
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridVirtualScrollerFiller.GridVirtualScrollerFiller, {
100
+ rowsLength: rows.length
101
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridBottomContainer.GridBottomContainer, {
100
102
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.pinnedRows, {
101
103
  position: "bottom",
102
104
  virtualScroller: virtualScroller
@@ -24,22 +24,24 @@ const Pinned = (0, _system.styled)('div')({
24
24
  position: 'sticky',
25
25
  height: '100%',
26
26
  boxSizing: 'border-box',
27
- borderTop: '1px solid var(--DataGrid-rowBorderColor)',
27
+ borderTop: '1px solid var(--rowBorderColor)',
28
28
  backgroundColor: 'var(--DataGrid-pinnedBackground)'
29
29
  });
30
30
  const PinnedLeft = (0, _system.styled)(Pinned)({
31
31
  left: 0,
32
- borderRight: '1px solid var(--DataGrid-rowBorderColor)'
32
+ borderRight: '1px solid var(--rowBorderColor)'
33
33
  });
34
34
  const PinnedRight = (0, _system.styled)(Pinned)({
35
35
  right: 0,
36
- borderLeft: '1px solid var(--DataGrid-rowBorderColor)'
36
+ borderLeft: '1px solid var(--rowBorderColor)'
37
37
  });
38
38
  const Main = (0, _system.styled)('div')({
39
39
  flexGrow: 1,
40
- borderTop: '1px solid var(--DataGrid-rowBorderColor)'
40
+ borderTop: '1px solid var(--rowBorderColor)'
41
41
  });
42
- function GridVirtualScrollerFiller() {
42
+ function GridVirtualScrollerFiller({
43
+ rowsLength
44
+ }) {
43
45
  const apiRef = (0, _useGridApiContext.useGridApiContext)();
44
46
  const {
45
47
  viewportOuterSize,
@@ -60,7 +62,8 @@ function GridVirtualScrollerFiller() {
60
62
  className: _constants.gridClasses.filler,
61
63
  role: "presentation",
62
64
  style: {
63
- height
65
+ height,
66
+ '--rowBorderColor': rowsLength === 0 ? 'transparent' : 'var(--DataGrid-rowBorderColor)'
64
67
  },
65
68
  children: [leftPinnedWidth > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(PinnedLeft, {
66
69
  className: _constants.gridClasses['filler--pinnedLeft'],
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.gridVisibleRowsLookupSelector = exports.gridQuickFilterValuesSelector = exports.gridFilteredTopLevelRowCountSelector = exports.gridFilteredSortedTopLevelRowEntriesSelector = exports.gridFilteredSortedRowIdsSelector = exports.gridFilteredSortedRowEntriesSelector = exports.gridFilteredRowsLookupSelector = exports.gridFilteredDescendantCountLookupSelector = exports.gridFilterModelSelector = exports.gridFilterActiveItemsSelector = exports.gridFilterActiveItemsLookupSelector = exports.gridExpandedSortedRowIdsSelector = exports.gridExpandedSortedRowEntriesSelector = exports.gridExpandedRowCountSelector = void 0;
6
+ exports.gridVisibleRowsLookupSelector = exports.gridQuickFilterValuesSelector = exports.gridFilteredTopLevelRowCountSelector = exports.gridFilteredSortedTopLevelRowEntriesSelector = exports.gridFilteredSortedRowIdsSelector = exports.gridFilteredSortedRowEntriesSelector = exports.gridFilteredRowsLookupSelector = exports.gridFilteredRowCountSelector = exports.gridFilteredDescendantRowCountSelector = exports.gridFilteredDescendantCountLookupSelector = exports.gridFilterModelSelector = exports.gridFilterActiveItemsSelector = exports.gridFilterActiveItemsLookupSelector = exports.gridExpandedSortedRowIdsSelector = exports.gridExpandedSortedRowEntriesSelector = exports.gridExpandedRowCountSelector = void 0;
7
7
  var _createSelector = require("../../../utils/createSelector");
8
8
  var _gridSortingSelector = require("../sorting/gridSortingSelector");
9
9
  var _gridColumnsSelector = require("../columns/gridColumnsSelector");
@@ -95,6 +95,19 @@ const gridExpandedRowCountSelector = exports.gridExpandedRowCountSelector = (0,
95
95
  */
96
96
  const gridFilteredTopLevelRowCountSelector = exports.gridFilteredTopLevelRowCountSelector = (0, _createSelector.createSelector)(gridFilteredSortedTopLevelRowEntriesSelector, visibleSortedTopLevelRows => visibleSortedTopLevelRows.length);
97
97
 
98
+ /**
99
+ * Get the amount of rows accessible after the filtering process.
100
+ * Includes top level and descendant rows.
101
+ * @category Filtering
102
+ */
103
+ const gridFilteredRowCountSelector = exports.gridFilteredRowCountSelector = (0, _createSelector.createSelector)(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.length);
104
+
105
+ /**
106
+ * Get the amount of descendant rows accessible after the filtering process.
107
+ * @category Filtering
108
+ */
109
+ const gridFilteredDescendantRowCountSelector = exports.gridFilteredDescendantRowCountSelector = (0, _createSelector.createSelector)(gridFilteredRowCountSelector, gridFilteredTopLevelRowCountSelector, (totalRowCount, topLevelRowCount) => totalRowCount - topLevelRowCount);
110
+
98
111
  /**
99
112
  * @category Filtering
100
113
  * @ignore - do not document.
@@ -373,20 +373,12 @@ const useGridVirtualScroller = () => {
373
373
  overflowY: rootProps.autoHeight ? 'hidden' : undefined
374
374
  }), [needsHorizontalScrollbar, rootProps.autoHeight]);
375
375
  const contentSize = React.useMemo(() => {
376
- // In cases where the columns exceed the available width,
377
- // the horizontal scrollbar should be shown even when there're no rows.
378
- // Keeping 1px as minimum height ensures that the scrollbar will visible if necessary.
379
- const height = Math.max(contentHeight, 1);
380
376
  const size = {
381
377
  width: needsHorizontalScrollbar ? columnsTotalWidth : 'auto',
382
- height
378
+ height: contentHeight
383
379
  };
384
- if (rootProps.autoHeight) {
385
- if (currentPage.rows.length === 0) {
386
- size.height = (0, _gridRowsUtils.getMinimalContentHeight)(apiRef); // Give room to show the overlay when there no rows.
387
- } else {
388
- size.height = contentHeight;
389
- }
380
+ if (rootProps.autoHeight && currentPage.rows.length === 0) {
381
+ size.height = (0, _gridRowsUtils.getMinimalContentHeight)(apiRef); // Give room to show the overlay when there no rows.
390
382
  }
391
383
  return size;
392
384
  }, [apiRef, columnsTotalWidth, contentHeight, needsHorizontalScrollbar, rootProps.autoHeight, currentPage.rows.length]);
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.9.0
2
+ * @mui/x-data-grid v7.10.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -39,8 +39,7 @@ const esESGrid = {
39
39
  columnsManagementSearchTitle: 'Buscar',
40
40
  columnsManagementNoColumns: 'Sin columnas',
41
41
  columnsManagementShowHideAllText: 'Mostrar/Ocultar todas',
42
- // columnsManagementReset: 'Reset',
43
-
42
+ columnsManagementReset: 'Restablecer',
44
43
  // Filter panel text
45
44
  filterPanelAddFilter: 'Agregar filtro',
46
45
  filterPanelRemoveAll: 'Remover todos',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid",
3
- "version": "7.9.0",
3
+ "version": "7.10.0",
4
4
  "description": "The Community plan edition of the Data Grid components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -43,7 +43,7 @@
43
43
  "clsx": "^2.1.1",
44
44
  "prop-types": "^15.8.1",
45
45
  "reselect": "^4.1.8",
46
- "@mui/x-internals": "7.9.0"
46
+ "@mui/x-internals": "7.10.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@mui/material": "^5.15.14",