@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.
- package/CHANGELOG.md +159 -0
- package/DataGrid/DataGrid.js +1 -0
- package/DataGrid/useDataGridProps.js +21 -20
- package/components/base/GridOverlays.js +1 -1
- package/components/containers/GridRoot.js +4 -16
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +4 -1
- package/components/panel/filterPanel/GridFilterForm.js +1 -12
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/components/virtualization/GridMainContainer.js +11 -3
- package/components/virtualization/GridVirtualScroller.js +3 -1
- package/components/virtualization/GridVirtualScrollerFiller.d.ts +5 -1
- package/components/virtualization/GridVirtualScrollerFiller.js +9 -6
- package/hooks/core/useGridApiInitialization.js +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +1 -0
- package/hooks/features/editing/gridEditingSelectors.d.ts +3 -0
- package/hooks/features/editing/gridEditingSelectors.js +3 -1
- package/hooks/features/editing/index.d.ts +1 -0
- package/hooks/features/editing/index.js +1 -0
- package/hooks/features/filter/gridFilterSelector.d.ts +11 -0
- package/hooks/features/filter/gridFilterSelector.js +13 -0
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
- package/hooks/utils/useGridApiEventHandler.d.ts +1 -1
- package/index.js +1 -1
- package/locales/esES.js +1 -2
- package/locales/ruRU.js +4 -5
- package/models/api/gridCoreApi.d.ts +1 -1
- package/models/api/gridRowSelectionApi.d.ts +2 -2
- package/models/colDef/gridColDef.d.ts +4 -4
- package/models/gridRowSelectionModel.d.ts +2 -2
- package/models/props/DataGridProps.d.ts +5 -4
- package/modern/DataGrid/DataGrid.js +1 -0
- package/modern/DataGrid/useDataGridProps.js +21 -20
- package/modern/components/base/GridOverlays.js +1 -1
- package/modern/components/containers/GridRoot.js +4 -16
- package/modern/components/panel/GridPanel.js +4 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +1 -12
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/modern/components/virtualization/GridMainContainer.js +11 -3
- package/modern/components/virtualization/GridVirtualScroller.js +3 -1
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +9 -6
- package/modern/hooks/core/useGridApiInitialization.js +1 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +1 -0
- package/modern/hooks/features/editing/gridEditingSelectors.js +3 -1
- package/modern/hooks/features/editing/index.js +1 -0
- package/modern/hooks/features/filter/gridFilterSelector.js +13 -0
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
- package/modern/index.js +1 -1
- package/modern/locales/esES.js +1 -2
- package/modern/locales/ruRU.js +4 -5
- package/modern/utils/createSelector.js +2 -2
- package/node/DataGrid/DataGrid.js +1 -0
- package/node/DataGrid/useDataGridProps.js +21 -20
- package/node/components/base/GridOverlays.js +1 -1
- package/node/components/containers/GridRoot.js +3 -15
- package/node/components/panel/GridPanel.js +4 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +1 -12
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/node/components/virtualization/GridMainContainer.js +10 -2
- package/node/components/virtualization/GridVirtualScroller.js +3 -1
- package/node/components/virtualization/GridVirtualScrollerFiller.js +9 -6
- package/node/hooks/core/useGridApiInitialization.js +1 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +1 -0
- package/node/hooks/features/editing/gridEditingSelectors.js +3 -1
- package/node/hooks/features/editing/index.js +16 -0
- package/node/hooks/features/filter/gridFilterSelector.js +14 -1
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -11
- package/node/index.js +1 -1
- package/node/locales/esES.js +1 -2
- package/node/locales/ruRU.js +4 -5
- package/node/utils/createSelector.js +2 -2
- package/package.json +5 -5
- package/utils/createSelector.d.ts +1 -1
- package/utils/createSelector.js +2 -2
- package/modern/utils/EventManager.js +0 -69
- package/node/utils/EventManager.js +0 -76
- package/utils/EventManager.d.ts +0 -29
- 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
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
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
*/
|
|
@@ -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
|
-
|
|
30
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
-
|
|
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.
|
|
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 = ["
|
|
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
|
|
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__*/
|
|
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:
|
|
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
|
-
|
|
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__*/
|
|
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:
|
|
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
|
-
})),
|
|
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(--
|
|
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(--
|
|
24
|
+
borderRight: '1px solid var(--rowBorderColor)'
|
|
25
25
|
});
|
|
26
26
|
const PinnedRight = styled(Pinned)({
|
|
27
27
|
right: 0,
|
|
28
|
-
borderLeft: '1px solid var(--
|
|
28
|
+
borderLeft: '1px solid var(--rowBorderColor)'
|
|
29
29
|
});
|
|
30
30
|
const Main = styled('div')({
|
|
31
31
|
flexGrow: 1,
|
|
32
|
-
borderTop: '1px solid var(--
|
|
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
|
}
|
|
@@ -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.
|
|
@@ -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
|
-
|
|
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
package/modern/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
|
-
|
|
37
|
-
|
|
36
|
+
columnsManagementReset: 'Restablecer',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Agregar filtro',
|
|
40
39
|
filterPanelRemoveAll: 'Remover todos',
|
package/modern/locales/ruRU.js
CHANGED
|
@@ -45,11 +45,10 @@ const ruRUGrid = {
|
|
|
45
45
|
toolbarExportPrint: 'Печать',
|
|
46
46
|
toolbarExportExcel: 'Скачать в формате Excel',
|
|
47
47
|
// Columns management text
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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, ...
|
|
12
|
-
if (
|
|
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;
|
|
@@ -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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
|
|
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.
|
|
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
|
}
|