@mui/x-data-grid 7.9.0 → 7.11.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 (83) hide show
  1. package/CHANGELOG.md +159 -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/GridPanel.d.ts +1 -1
  7. package/components/panel/GridPanel.js +4 -1
  8. package/components/panel/filterPanel/GridFilterForm.js +1 -12
  9. package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +1 -1
  10. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
  11. package/components/virtualization/GridMainContainer.js +11 -3
  12. package/components/virtualization/GridVirtualScroller.js +3 -1
  13. package/components/virtualization/GridVirtualScrollerFiller.d.ts +5 -1
  14. package/components/virtualization/GridVirtualScrollerFiller.js +9 -6
  15. package/hooks/core/useGridApiInitialization.js +1 -1
  16. package/hooks/features/columnResize/useGridColumnResize.js +1 -0
  17. package/hooks/features/editing/gridEditingSelectors.d.ts +3 -0
  18. package/hooks/features/editing/gridEditingSelectors.js +3 -1
  19. package/hooks/features/editing/index.d.ts +1 -0
  20. package/hooks/features/editing/index.js +1 -0
  21. package/hooks/features/filter/gridFilterSelector.d.ts +11 -0
  22. package/hooks/features/filter/gridFilterSelector.js +13 -0
  23. package/hooks/features/index.d.ts +1 -0
  24. package/hooks/features/index.js +1 -0
  25. package/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
  26. package/hooks/utils/useGridApiEventHandler.d.ts +1 -1
  27. package/index.js +1 -1
  28. package/locales/esES.js +1 -2
  29. package/locales/ruRU.js +4 -5
  30. package/models/api/gridCoreApi.d.ts +1 -1
  31. package/models/api/gridRowSelectionApi.d.ts +2 -2
  32. package/models/colDef/gridColDef.d.ts +4 -4
  33. package/models/gridRowSelectionModel.d.ts +2 -2
  34. package/models/props/DataGridProps.d.ts +5 -4
  35. package/modern/DataGrid/DataGrid.js +1 -0
  36. package/modern/DataGrid/useDataGridProps.js +21 -20
  37. package/modern/components/base/GridOverlays.js +1 -1
  38. package/modern/components/containers/GridRoot.js +4 -16
  39. package/modern/components/panel/GridPanel.js +4 -1
  40. package/modern/components/panel/filterPanel/GridFilterForm.js +1 -12
  41. package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
  42. package/modern/components/virtualization/GridMainContainer.js +11 -3
  43. package/modern/components/virtualization/GridVirtualScroller.js +3 -1
  44. package/modern/components/virtualization/GridVirtualScrollerFiller.js +9 -6
  45. package/modern/hooks/core/useGridApiInitialization.js +1 -1
  46. package/modern/hooks/features/columnResize/useGridColumnResize.js +1 -0
  47. package/modern/hooks/features/editing/gridEditingSelectors.js +3 -1
  48. package/modern/hooks/features/editing/index.js +1 -0
  49. package/modern/hooks/features/filter/gridFilterSelector.js +13 -0
  50. package/modern/hooks/features/index.js +1 -0
  51. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
  52. package/modern/index.js +1 -1
  53. package/modern/locales/esES.js +1 -2
  54. package/modern/locales/ruRU.js +4 -5
  55. package/modern/utils/createSelector.js +2 -2
  56. package/node/DataGrid/DataGrid.js +1 -0
  57. package/node/DataGrid/useDataGridProps.js +21 -20
  58. package/node/components/base/GridOverlays.js +1 -1
  59. package/node/components/containers/GridRoot.js +3 -15
  60. package/node/components/panel/GridPanel.js +4 -1
  61. package/node/components/panel/filterPanel/GridFilterForm.js +1 -12
  62. package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
  63. package/node/components/virtualization/GridMainContainer.js +10 -2
  64. package/node/components/virtualization/GridVirtualScroller.js +3 -1
  65. package/node/components/virtualization/GridVirtualScrollerFiller.js +9 -6
  66. package/node/hooks/core/useGridApiInitialization.js +1 -1
  67. package/node/hooks/features/columnResize/useGridColumnResize.js +1 -0
  68. package/node/hooks/features/editing/gridEditingSelectors.js +3 -1
  69. package/node/hooks/features/editing/index.js +16 -0
  70. package/node/hooks/features/filter/gridFilterSelector.js +14 -1
  71. package/node/hooks/features/index.js +11 -0
  72. package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
  73. package/node/index.js +1 -1
  74. package/node/locales/esES.js +1 -2
  75. package/node/locales/ruRU.js +4 -5
  76. package/node/utils/createSelector.js +2 -2
  77. package/package.json +5 -5
  78. package/utils/createSelector.d.ts +1 -1
  79. package/utils/createSelector.js +2 -2
  80. package/modern/utils/EventManager.js +0 -69
  81. package/node/utils/EventManager.js +0 -76
  82. package/utils/EventManager.d.ts +0 -29
  83. package/utils/EventManager.js +0 -69
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { EventListenerOptions } from '@mui/x-internals/EventManager';
2
3
  import { GridEventListener, GridEvents } from '../../models/events';
3
4
  import { CleanupTracking } from '../../utils/cleanupTracking/CleanupTracking';
4
- import { EventListenerOptions } from '../../utils/EventManager';
5
5
  import type { GridApiCommon } from '../../models';
6
6
  /**
7
7
  * Signal to the underlying logic what version of the public component API
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.9.0
2
+ * @mui/x-data-grid v7.11.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',
package/locales/ruRU.js CHANGED
@@ -45,11 +45,10 @@ const ruRUGrid = {
45
45
  toolbarExportPrint: 'Печать',
46
46
  toolbarExportExcel: 'Скачать в формате Excel',
47
47
  // Columns management text
48
- // columnsManagementSearchTitle: 'Search',
49
- // columnsManagementNoColumns: 'No columns',
50
- // columnsManagementShowHideAllText: 'Show/Hide All',
51
- // columnsManagementReset: 'Reset',
52
-
48
+ columnsManagementSearchTitle: 'Поиск',
49
+ columnsManagementNoColumns: 'Нет столбцов',
50
+ columnsManagementShowHideAllText: 'Показать/Скрыть Всё',
51
+ columnsManagementReset: 'Сбросить',
53
52
  // Filter panel text
54
53
  filterPanelAddFilter: 'Добавить фильтр',
55
54
  filterPanelRemoveAll: 'Очистить фильтр',
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { EventManager, EventListenerOptions } from '@mui/x-internals/EventManager';
2
3
  import { GridEventPublisher, GridEventListener, GridEvents } from '../events';
3
4
  import { Store } from '../../utils/Store';
4
- import { EventManager, EventListenerOptions } from '../../utils/EventManager';
5
5
  import { GridApiCaches } from '../gridApiCaches';
6
6
  import type { GridApiCommon, GridPrivateApiCommon } from './gridApiCommon';
7
7
  import type { DataGridProcessedProps } from '../props/DataGridProps';
@@ -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 --------------------------------
@@ -57,7 +57,10 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
57
57
  }, [apiRef]);
58
58
  const modifiers = React.useMemo(() => [{
59
59
  name: 'flip',
60
- enabled: false
60
+ enabled: true,
61
+ options: {
62
+ rootBoundary: 'document'
63
+ }
61
64
  }, {
62
65
  name: 'isPlaced',
63
66
  enabled: true,
@@ -243,18 +243,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
243
243
  applyMultiFilterOperatorChanges(logicOperator);
244
244
  }, [applyMultiFilterOperatorChanges]);
245
245
  const handleDeleteFilter = () => {
246
- if (rootProps.disableMultipleColumnsFiltering) {
247
- if (item.value === undefined) {
248
- deleteFilter(item);
249
- } else {
250
- // TODO v6: simplify the behavior by always remove the filter form
251
- applyFilterChanges(_extends({}, item, {
252
- value: undefined
253
- }));
254
- }
255
- } else {
256
- deleteFilter(item);
257
- }
246
+ deleteFilter(item);
258
247
  };
259
248
  React.useImperativeHandle(focusElementRef, () => ({
260
249
  focus: () => {
@@ -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 = {
@@ -88,6 +88,6 @@ process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes =
88
88
  operator: PropTypes.string.isRequired,
89
89
  value: PropTypes.any
90
90
  }).isRequired,
91
- type: PropTypes.oneOf(['number', 'text'])
91
+ type: PropTypes.oneOf(['date', 'datetime-local', 'number', 'text'])
92
92
  } : void 0;
93
93
  export { GridFilterInputMultipleValue };
@@ -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'],
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
+ import { EventManager } from '@mui/x-internals/EventManager';
2
3
  import { Store } from '../../utils/Store';
3
4
  import { useGridApiMethod } from '../utils/useGridApiMethod';
4
5
  import { GridSignature } from '../utils/useGridApiEventHandler';
5
- import { EventManager } from '../../utils/EventManager';
6
6
  const SYMBOL_API_PRIVATE = Symbol('mui.api_private');
7
7
  const isSyntheticEvent = event => {
8
8
  return event.isPropagationStopped !== undefined;
@@ -267,6 +267,7 @@ export const useGridColumnResize = (apiRef, props) => {
267
267
  // Check if the current event is part of a double-click
268
268
  if (nativeEvent.timeStamp - prevTimeStamp < 300 && nativeEvent.clientX === prevClientX && nativeEvent.clientY === prevClientY) {
269
269
  refs.previousMouseClickEvent = undefined;
270
+ apiRef.current.publishEvent('columnResizeStop', null, nativeEvent);
270
271
  return;
271
272
  }
272
273
  }
@@ -1,2 +1,4 @@
1
- // TODO v6: rename to gridEditingStateSelector
1
+ /**
2
+ * Select the row editing state.
3
+ */
2
4
  export const gridEditRowsStateSelector = state => state.editRows;
@@ -0,0 +1 @@
1
+ export * from './gridEditingSelectors';
@@ -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.
@@ -4,6 +4,7 @@ export * from './columns';
4
4
  export * from './columnGrouping';
5
5
  export * from './columnResize';
6
6
  export * from './density';
7
+ export * from './editing';
7
8
  export * from './filter';
8
9
  export * from './focus';
9
10
  export * from './pagination';
@@ -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.11.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',
@@ -45,11 +45,10 @@ const ruRUGrid = {
45
45
  toolbarExportPrint: 'Печать',
46
46
  toolbarExportExcel: 'Скачать в формате Excel',
47
47
  // Columns management text
48
- // columnsManagementSearchTitle: 'Search',
49
- // columnsManagementNoColumns: 'No columns',
50
- // columnsManagementShowHideAllText: 'Show/Hide All',
51
- // columnsManagementReset: 'Reset',
52
-
48
+ columnsManagementSearchTitle: 'Поиск',
49
+ columnsManagementNoColumns: 'Нет столбцов',
50
+ columnsManagementShowHideAllText: 'Показать/Скрыть Всё',
51
+ columnsManagementReset: 'Сбросить',
53
52
  // Filter panel text
54
53
  filterPanelAddFilter: 'Добавить фильтр',
55
54
  filterPanelRemoveAll: 'Очистить фильтр',
@@ -8,8 +8,8 @@ function checkIsAPIRef(value) {
8
8
  const DEFAULT_INSTANCE_ID = {
9
9
  id: 'default'
10
10
  };
11
- export const createSelector = (a, b, c, d, e, f, ...rest) => {
12
- if (rest.length > 0) {
11
+ export const createSelector = (a, b, c, d, e, f, ...other) => {
12
+ if (other.length > 0) {
13
13
  throw new Error('Unsupported number of selectors');
14
14
  }
15
15
  let selector;
@@ -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
  }