@mui/x-data-grid 6.12.1 → 6.14.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 +212 -55
- package/README.md +3 -7
- package/components/GridColumnHeaders.js +2 -3
- package/components/GridFooter.js +4 -5
- package/components/GridPagination.d.ts +2 -44
- package/components/GridRowCount.d.ts +3 -0
- package/components/base/GridOverlays.js +22 -3
- package/components/cell/GridActionsCellItem.d.ts +4 -54
- package/components/containers/GridRootStyles.js +4 -1
- package/components/panel/GridPanelWrapper.js +2 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +2 -4
- package/constants/defaultGridSlotsComponents.js +2 -1
- package/hooks/features/columns/useGridColumns.js +11 -4
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.js +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -5
- package/index.js +1 -1
- package/legacy/components/GridColumnHeaders.js +2 -3
- package/legacy/components/GridFooter.js +4 -5
- package/legacy/components/base/GridOverlays.js +34 -10
- package/legacy/components/containers/GridRootStyles.js +1 -1
- package/legacy/components/panel/GridPanelWrapper.js +2 -2
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +2 -4
- package/legacy/constants/defaultGridSlotsComponents.js +2 -1
- package/legacy/hooks/features/columns/useGridColumns.js +9 -4
- package/legacy/hooks/features/rows/gridRowsUtils.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/locales/faIR.js +25 -27
- package/legacy/locales/jaJP.js +25 -27
- package/legacy/locales/skSK.js +27 -29
- package/legacy/locales/viVN.js +35 -39
- package/legacy/utils/createSelector.js +1 -1
- package/locales/faIR.js +25 -27
- package/locales/jaJP.js +25 -27
- package/locales/skSK.js +27 -29
- package/locales/viVN.js +35 -39
- package/models/colDef/gridColDef.d.ts +2 -4
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +4 -0
- package/modern/components/GridColumnHeaders.js +2 -3
- package/modern/components/GridFooter.js +2 -3
- package/modern/components/base/GridOverlays.js +22 -3
- package/modern/components/containers/GridRootStyles.js +4 -1
- package/modern/components/panel/GridPanelWrapper.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +2 -4
- package/modern/constants/defaultGridSlotsComponents.js +2 -1
- package/modern/hooks/features/columns/useGridColumns.js +10 -4
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -1
- package/modern/index.js +1 -1
- package/modern/locales/faIR.js +25 -27
- package/modern/locales/jaJP.js +25 -27
- package/modern/locales/skSK.js +27 -29
- package/modern/locales/viVN.js +35 -39
- package/modern/utils/createSelector.js +1 -1
- package/node/components/GridColumnHeaders.js +2 -3
- package/node/components/GridFooter.js +2 -3
- package/node/components/base/GridOverlays.js +22 -3
- package/node/components/containers/GridRootStyles.js +4 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -3
- package/node/constants/defaultGridSlotsComponents.js +1 -0
- package/node/hooks/features/columns/useGridColumns.js +10 -4
- package/node/hooks/features/rows/gridRowsUtils.js +1 -1
- package/node/index.js +1 -1
- package/node/locales/faIR.js +25 -27
- package/node/locales/jaJP.js +25 -27
- package/node/locales/skSK.js +27 -29
- package/node/locales/viVN.js +35 -39
- package/node/utils/createSelector.js +1 -1
- package/package.json +3 -3
- package/utils/createSelector.js +1 -1
package/locales/viVN.js
CHANGED
|
@@ -37,7 +37,7 @@ const viVNGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'Ẩn tất cả',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'Thêm bộ lọc',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Xóa tất cả',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Xóa',
|
|
42
42
|
filterPanelLogicOperator: 'Toán tử logic',
|
|
43
43
|
filterPanelOperator: 'Toán tử',
|
|
@@ -59,35 +59,33 @@ const viVNGrid = {
|
|
|
59
59
|
filterOperatorOnOrBefore: 'bằng hoặc trước',
|
|
60
60
|
filterOperatorIsEmpty: 'Rỗng',
|
|
61
61
|
filterOperatorIsNotEmpty: 'Khác rỗng',
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
filterOperatorIsAnyOf: 'Bất kỳ',
|
|
63
|
+
'filterOperator=': '=',
|
|
64
|
+
'filterOperator!=': '!=',
|
|
65
|
+
'filterOperator>': '>',
|
|
66
|
+
'filterOperator>=': '>=',
|
|
67
|
+
'filterOperator<': '<',
|
|
68
|
+
'filterOperator<=': '<=',
|
|
70
69
|
// Header filter operators text
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
headerFilterOperatorContains: 'Chứa',
|
|
71
|
+
headerFilterOperatorEquals: 'Bằng',
|
|
72
|
+
headerFilterOperatorStartsWith: 'Bắt đầu với',
|
|
73
|
+
headerFilterOperatorEndsWith: 'Kết thúc với',
|
|
74
|
+
headerFilterOperatorIs: 'là',
|
|
75
|
+
headerFilterOperatorNot: 'Không là',
|
|
76
|
+
headerFilterOperatorAfter: 'Sau',
|
|
77
|
+
headerFilterOperatorOnOrAfter: 'Đang hoặc sau',
|
|
78
|
+
headerFilterOperatorBefore: 'Trước',
|
|
79
|
+
headerFilterOperatorOnOrBefore: 'Đang hoặc trước',
|
|
80
|
+
headerFilterOperatorIsEmpty: 'Rỗng',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: 'Khác rỗng',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'Bất kỳ',
|
|
83
|
+
'headerFilterOperator=': 'Bằng',
|
|
84
|
+
'headerFilterOperator!=': 'Khác',
|
|
85
|
+
'headerFilterOperator>': 'Lớn hơn',
|
|
86
|
+
'headerFilterOperator>=': 'Lớn hơn hoặc bằng',
|
|
87
|
+
'headerFilterOperator<': 'Nhỏ hơn',
|
|
88
|
+
'headerFilterOperator<=': 'Nhỏ hơn hoặc bằng',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'bất kỳ giá trị nào',
|
|
93
91
|
filterValueTrue: 'Có',
|
|
@@ -95,7 +93,7 @@ const viVNGrid = {
|
|
|
95
93
|
// Column menu text
|
|
96
94
|
columnMenuLabel: 'Danh mục',
|
|
97
95
|
columnMenuShowColumns: 'Danh sách cột',
|
|
98
|
-
|
|
96
|
+
columnMenuManageColumns: 'Quản lý cột',
|
|
99
97
|
columnMenuFilter: 'Bộ lọc',
|
|
100
98
|
columnMenuHideColumn: 'Ẩn cột',
|
|
101
99
|
columnMenuUnsort: 'Bỏ sắp xếp',
|
|
@@ -139,15 +137,13 @@ const viVNGrid = {
|
|
|
139
137
|
expandDetailPanel: 'Mở rộng',
|
|
140
138
|
collapseDetailPanel: 'Thu nhỏ',
|
|
141
139
|
// Row reordering text
|
|
142
|
-
rowReorderingHeaderName: 'Sắp xếp hàng'
|
|
143
|
-
|
|
140
|
+
rowReorderingHeaderName: 'Sắp xếp hàng',
|
|
144
141
|
// Aggregation
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
aggregationMenuItemHeader: 'Tổng hợp',
|
|
143
|
+
aggregationFunctionLabelSum: 'Tổng',
|
|
144
|
+
aggregationFunctionLabelAvg: 'Trung bình',
|
|
145
|
+
aggregationFunctionLabelMin: 'Tối thiểu',
|
|
146
|
+
aggregationFunctionLabelMax: 'Tối đa',
|
|
147
|
+
aggregationFunctionLabelSize: 'Kích cỡ'
|
|
151
148
|
};
|
|
152
|
-
|
|
153
149
|
export const viVN = getGridLocalization(viVNGrid, viVNCore);
|
|
@@ -5,7 +5,7 @@ import type { GridFilterOperator } from '../gridFilterOperator';
|
|
|
5
5
|
import { GridCellParams, GridRenderCellParams, GridRenderEditCellParams, GridValueFormatterParams, GridValueGetterParams, GridValueSetterParams, GridPreProcessEditCellProps } from '../params/gridCellParams';
|
|
6
6
|
import { GridColumnHeaderParams } from '../params/gridColumnHeaderParams';
|
|
7
7
|
import { GridComparatorFn, GridSortDirection } from '../gridSortModel';
|
|
8
|
-
import { GridColType
|
|
8
|
+
import { GridColType } from './gridColType';
|
|
9
9
|
import { GridRowParams } from '../params/gridRowParams';
|
|
10
10
|
import { GridValueOptionsParams } from '../params/gridValueOptionsParams';
|
|
11
11
|
import { GridActionsCellItemProps } from '../../components/cell/GridActionsCellItem';
|
|
@@ -288,9 +288,7 @@ export interface GridSingleSelectColDef<R extends GridValidRowModel = any, V = a
|
|
|
288
288
|
* - [Column definition](/x/react-data-grid/column-definition/)
|
|
289
289
|
*/
|
|
290
290
|
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = GridBaseColDef<R, V, F> | GridActionsColDef<R, V, F> | GridSingleSelectColDef<R, V, F>;
|
|
291
|
-
export type GridColTypeDef<V = any, F = V> = Omit<GridBaseColDef<any, V, F>, 'field'
|
|
292
|
-
extendType?: GridNativeColTypes;
|
|
293
|
-
};
|
|
291
|
+
export type GridColTypeDef<V = any, F = V> = Omit<GridBaseColDef<any, V, F>, 'field'>;
|
|
294
292
|
export type GridStateColDef<R extends GridValidRowModel = any, V = any, F = V> = GridColDef<R, V, F> & {
|
|
295
293
|
computedWidth: number;
|
|
296
294
|
/**
|
|
@@ -107,6 +107,11 @@ export interface GridSlotsComponent extends GridBaseSlots, GridIconSlotsComponen
|
|
|
107
107
|
* @default GridFooter
|
|
108
108
|
*/
|
|
109
109
|
Footer: React.JSXElementConstructor<any>;
|
|
110
|
+
/**
|
|
111
|
+
* Row count component rendered in the footer
|
|
112
|
+
* @default GridRowCount
|
|
113
|
+
*/
|
|
114
|
+
FooterRowCount: React.JSXElementConstructor<any>;
|
|
110
115
|
/**
|
|
111
116
|
* Toolbar component rendered inside the Header component.
|
|
112
117
|
* @default null
|
|
@@ -21,6 +21,7 @@ import { GridOverlayProps } from '../components/containers/GridOverlay';
|
|
|
21
21
|
import { GridPanelProps } from '../components/panel/GridPanel';
|
|
22
22
|
import type { GridRowProps } from '../components/GridRow';
|
|
23
23
|
import type { GridCellProps } from '../components/cell/GridCell';
|
|
24
|
+
import type { GridRowCountProps } from '../components';
|
|
24
25
|
export interface BaseCheckboxPropsOverrides {
|
|
25
26
|
}
|
|
26
27
|
export interface BaseTextFieldPropsOverrides {
|
|
@@ -59,6 +60,8 @@ export interface FilterPanelPropsOverrides {
|
|
|
59
60
|
}
|
|
60
61
|
export interface FooterPropsOverrides {
|
|
61
62
|
}
|
|
63
|
+
export interface FooterRowCountOverrides {
|
|
64
|
+
}
|
|
62
65
|
export interface PaginationPropsOverrides {
|
|
63
66
|
}
|
|
64
67
|
export interface LoadingOverlayPropsOverrides {
|
|
@@ -100,6 +103,7 @@ export interface GridSlotsComponentsProps {
|
|
|
100
103
|
columnsPanel?: SlotProps<GridColumnsPanelProps, ColumnsPanelPropsOverrides>;
|
|
101
104
|
filterPanel?: SlotProps<GridFilterPanelProps, FilterPanelPropsOverrides>;
|
|
102
105
|
footer?: SlotProps<GridFooterContainerProps, FooterPropsOverrides>;
|
|
106
|
+
footerRowCount?: SlotProps<GridRowCountProps, FooterRowCountOverrides>;
|
|
103
107
|
loadingOverlay?: SlotProps<GridOverlayProps, LoadingOverlayPropsOverrides>;
|
|
104
108
|
noResultsOverlay?: SlotProps<GridOverlayProps, NoResultsOverlayPropsOverrides>;
|
|
105
109
|
noRowsOverlay?: SlotProps<GridOverlayProps, NoRowsOverlayPropsOverrides>;
|
|
@@ -3,6 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["innerRef", "className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnPositions", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "densityFactor", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import { refType } from '@mui/utils';
|
|
6
7
|
import { fastMemo } from '../utils/fastMemo';
|
|
7
8
|
import { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
8
9
|
import { GridBaseColumnHeaders } from './columnHeaders/GridBaseColumnHeaders';
|
|
@@ -94,9 +95,7 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
|
94
95
|
filterColumnLookup: PropTypes.object.isRequired,
|
|
95
96
|
hasOtherElementInTabSequence: PropTypes.bool.isRequired,
|
|
96
97
|
headerGroupingMaxDepth: PropTypes.number.isRequired,
|
|
97
|
-
innerRef:
|
|
98
|
-
current: PropTypes.object
|
|
99
|
-
})]),
|
|
98
|
+
innerRef: refType,
|
|
100
99
|
minColumnIndex: PropTypes.number,
|
|
101
100
|
sortColumnLookup: PropTypes.object.isRequired,
|
|
102
101
|
visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
@@ -6,7 +6,6 @@ import { gridTopLevelRowCountSelector } from '../hooks/features/rows/gridRowsSel
|
|
|
6
6
|
import { selectedGridRowsCountSelector } from '../hooks/features/rowSelection/gridRowSelectionSelector';
|
|
7
7
|
import { gridFilteredTopLevelRowCountSelector } from '../hooks/features/filter/gridFilterSelector';
|
|
8
8
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
9
|
-
import { GridRowCount } from './GridRowCount';
|
|
10
9
|
import { GridSelectedRowCount } from './GridSelectedRowCount';
|
|
11
10
|
import { GridFooterContainer } from './containers/GridFooterContainer';
|
|
12
11
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
@@ -21,10 +20,10 @@ const GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref)
|
|
|
21
20
|
const selectedRowCountElement = !rootProps.hideFooterSelectedRowCount && selectedRowCount > 0 ? /*#__PURE__*/_jsx(GridSelectedRowCount, {
|
|
22
21
|
selectedRowCount: selectedRowCount
|
|
23
22
|
}) : /*#__PURE__*/_jsx("div", {});
|
|
24
|
-
const rowCountElement = !rootProps.hideFooterRowCount && !rootProps.pagination ? /*#__PURE__*/_jsx(
|
|
23
|
+
const rowCountElement = !rootProps.hideFooterRowCount && !rootProps.pagination ? /*#__PURE__*/_jsx(rootProps.slots.footerRowCount, _extends({}, rootProps.slotProps?.footerRowCount, {
|
|
25
24
|
rowCount: totalTopLevelRowCount,
|
|
26
25
|
visibleRowCount: visibleTopLevelRowCount
|
|
27
|
-
}) : null;
|
|
26
|
+
})) : null;
|
|
28
27
|
const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.slots.pagination && /*#__PURE__*/_jsx(rootProps.slots.pagination, _extends({}, rootProps.slotProps?.pagination));
|
|
29
28
|
return /*#__PURE__*/_jsxs(GridFooterContainer, _extends({
|
|
30
29
|
ref: ref
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import { styled } from '@mui/system';
|
|
4
5
|
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
5
6
|
import clsx from 'clsx';
|
|
@@ -14,8 +15,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
15
|
const GridOverlayWrapperRoot = styled('div', {
|
|
15
16
|
name: 'MuiDataGrid',
|
|
16
17
|
slot: 'OverlayWrapper',
|
|
18
|
+
shouldForwardProp: prop => prop !== 'overlayType',
|
|
17
19
|
overridesResolver: (props, styles) => styles.overlayWrapper
|
|
18
|
-
})({
|
|
20
|
+
})(({
|
|
21
|
+
overlayType
|
|
22
|
+
}) => ({
|
|
19
23
|
position: 'sticky',
|
|
20
24
|
// To stay in place while scrolling
|
|
21
25
|
top: 0,
|
|
@@ -24,12 +28,14 @@ const GridOverlayWrapperRoot = styled('div', {
|
|
|
24
28
|
// To stay above the content instead of shifting it down
|
|
25
29
|
height: 0,
|
|
26
30
|
// To stay above the content instead of shifting it down
|
|
27
|
-
zIndex:
|
|
28
|
-
|
|
31
|
+
zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel
|
|
32
|
+
: 4 // Should be above pinned columns and detail panel
|
|
33
|
+
}));
|
|
29
34
|
|
|
30
35
|
const GridOverlayWrapperInner = styled('div', {
|
|
31
36
|
name: 'MuiDataGrid',
|
|
32
37
|
slot: 'OverlayWrapperInner',
|
|
38
|
+
shouldForwardProp: prop => prop !== 'overlayType',
|
|
33
39
|
overridesResolver: (props, styles) => styles.overlayWrapperInner
|
|
34
40
|
})({});
|
|
35
41
|
const useUtilityClasses = ownerState => {
|
|
@@ -65,6 +71,7 @@ function GridOverlayWrapper(props) {
|
|
|
65
71
|
}
|
|
66
72
|
return /*#__PURE__*/_jsx(GridOverlayWrapperRoot, {
|
|
67
73
|
className: clsx(classes.root),
|
|
74
|
+
overlayType: props.overlayType,
|
|
68
75
|
children: /*#__PURE__*/_jsx(GridOverlayWrapperInner, _extends({
|
|
69
76
|
className: clsx(classes.inner),
|
|
70
77
|
style: {
|
|
@@ -74,6 +81,13 @@ function GridOverlayWrapper(props) {
|
|
|
74
81
|
}, props))
|
|
75
82
|
});
|
|
76
83
|
}
|
|
84
|
+
process.env.NODE_ENV !== "production" ? GridOverlayWrapper.propTypes = {
|
|
85
|
+
// ----------------------------- Warning --------------------------------
|
|
86
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
87
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
88
|
+
// ----------------------------------------------------------------------
|
|
89
|
+
overlayType: PropTypes.string.isRequired
|
|
90
|
+
} : void 0;
|
|
77
91
|
export function GridOverlays() {
|
|
78
92
|
const apiRef = useGridApiContext();
|
|
79
93
|
const rootProps = useGridRootProps();
|
|
@@ -83,19 +97,24 @@ export function GridOverlays() {
|
|
|
83
97
|
const showNoRowsOverlay = !loading && totalRowCount === 0;
|
|
84
98
|
const showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;
|
|
85
99
|
let overlay = null;
|
|
100
|
+
let overlayType = '';
|
|
86
101
|
if (showNoRowsOverlay) {
|
|
87
102
|
overlay = /*#__PURE__*/_jsx(rootProps.slots.noRowsOverlay, _extends({}, rootProps.slotProps?.noRowsOverlay));
|
|
103
|
+
overlayType = 'noRowsOverlay';
|
|
88
104
|
}
|
|
89
105
|
if (showNoResultsOverlay) {
|
|
90
106
|
overlay = /*#__PURE__*/_jsx(rootProps.slots.noResultsOverlay, _extends({}, rootProps.slotProps?.noResultsOverlay));
|
|
107
|
+
overlayType = 'noResultsOverlay';
|
|
91
108
|
}
|
|
92
109
|
if (loading) {
|
|
93
110
|
overlay = /*#__PURE__*/_jsx(rootProps.slots.loadingOverlay, _extends({}, rootProps.slotProps?.loadingOverlay));
|
|
111
|
+
overlayType = 'loadingOverlay';
|
|
94
112
|
}
|
|
95
113
|
if (overlay === null) {
|
|
96
114
|
return null;
|
|
97
115
|
}
|
|
98
116
|
return /*#__PURE__*/_jsx(GridOverlayWrapper, {
|
|
117
|
+
overlayType: overlayType,
|
|
99
118
|
children: overlay
|
|
100
119
|
});
|
|
101
120
|
}
|
|
@@ -348,7 +348,10 @@ export const GridRootStyles = styled('div', {
|
|
|
348
348
|
'&.Mui-selected': {
|
|
349
349
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
|
|
350
350
|
'&:hover, &.Mui-hovered': {
|
|
351
|
-
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} /
|
|
351
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(
|
|
352
|
+
${theme.vars.palette.action.selectedOpacity} +
|
|
353
|
+
${theme.vars.palette.action.hoverOpacity}
|
|
354
|
+
))` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
|
|
352
355
|
// Reset on touch devices, it doesn't add specificity
|
|
353
356
|
'@media (hover: none)': {
|
|
354
357
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className", "slotProps"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import
|
|
7
|
+
import FocusTrap from '@mui/material/Unstable_TrapFocus';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
10
10
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
@@ -40,7 +40,7 @@ const GridPanelWrapper = /*#__PURE__*/React.forwardRef(function GridPanelWrapper
|
|
|
40
40
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
41
41
|
const rootProps = useGridRootProps();
|
|
42
42
|
const classes = useUtilityClasses(rootProps);
|
|
43
|
-
return /*#__PURE__*/_jsx(
|
|
43
|
+
return /*#__PURE__*/_jsx(FocusTrap, _extends({
|
|
44
44
|
open: true,
|
|
45
45
|
disableEnforceFocus: true,
|
|
46
46
|
isEnabled: isEnabled
|
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { unstable_useId as useId } from '@mui/utils';
|
|
6
|
+
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
7
7
|
import { styled } from '@mui/material/styles';
|
|
8
8
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -94,9 +94,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
|
|
|
94
94
|
}).isRequired,
|
|
95
95
|
applyValue: PropTypes.func.isRequired,
|
|
96
96
|
clearButton: PropTypes.node,
|
|
97
|
-
focusElementRef:
|
|
98
|
-
current: PropTypes.any.isRequired
|
|
99
|
-
})]),
|
|
97
|
+
focusElementRef: refType,
|
|
100
98
|
/**
|
|
101
99
|
* It is `true` if the filter either has a value or an operator with no value
|
|
102
100
|
* required is selected (e.g. `isEmpty`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridPreferencesPanel, GridRow, GridColumnHeaderFilterIconButton } from '../components';
|
|
2
|
+
import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridPreferencesPanel, GridRow, GridColumnHeaderFilterIconButton, GridRowCount } from '../components';
|
|
3
3
|
import { GridCellV7 } from '../components/cell/GridCell';
|
|
4
4
|
import { GridColumnHeaders } from '../components/GridColumnHeaders';
|
|
5
5
|
import { GridColumnMenu } from '../components/menu/columnMenu/GridColumnMenu';
|
|
@@ -15,6 +15,7 @@ export const DATA_GRID_DEFAULT_SLOTS_COMPONENTS = _extends({}, materialSlots, {
|
|
|
15
15
|
ColumnMenu: GridColumnMenu,
|
|
16
16
|
ColumnHeaders: GridColumnHeaders,
|
|
17
17
|
Footer: GridFooter,
|
|
18
|
+
FooterRowCount: GridRowCount,
|
|
18
19
|
Toolbar: null,
|
|
19
20
|
PreferencesPanel: GridPreferencesPanel,
|
|
20
21
|
LoadingOverlay: GridLoadingOverlay,
|
|
@@ -124,17 +124,23 @@ export function useGridColumns(apiRef, props) {
|
|
|
124
124
|
}, [apiRef, logger, setGridColumnsState, getColumnIndexRelativeToVisibleColumns]);
|
|
125
125
|
const setColumnWidth = React.useCallback((field, width) => {
|
|
126
126
|
logger.debug(`Updating column ${field} width to ${width}`);
|
|
127
|
-
const
|
|
127
|
+
const columnsState = gridColumnsStateSelector(apiRef.current.state);
|
|
128
|
+
const column = columnsState.lookup[field];
|
|
128
129
|
const newColumn = _extends({}, column, {
|
|
129
|
-
width
|
|
130
|
+
width,
|
|
131
|
+
hasBeenResized: true
|
|
130
132
|
});
|
|
131
|
-
|
|
133
|
+
setGridColumnsState(hydrateColumnsWidth(_extends({}, columnsState, {
|
|
134
|
+
lookup: _extends({}, columnsState.lookup, {
|
|
135
|
+
[field]: newColumn
|
|
136
|
+
})
|
|
137
|
+
}), apiRef.current.getRootDimensions()?.viewportInnerSize.width ?? 0));
|
|
132
138
|
apiRef.current.publishEvent('columnWidthChange', {
|
|
133
139
|
element: apiRef.current.getColumnHeaderElement(field),
|
|
134
140
|
colDef: newColumn,
|
|
135
141
|
width
|
|
136
142
|
});
|
|
137
|
-
}, [apiRef, logger]);
|
|
143
|
+
}, [apiRef, logger, setGridColumnsState]);
|
|
138
144
|
const columnApi = {
|
|
139
145
|
getColumn,
|
|
140
146
|
getAllColumns,
|
|
@@ -277,5 +277,5 @@ export function calculatePinnedRowsHeight(apiRef) {
|
|
|
277
277
|
}
|
|
278
278
|
export function getMinimalContentHeight(apiRef, rowHeight) {
|
|
279
279
|
const densityFactor = gridDensityFactorSelector(apiRef);
|
|
280
|
-
return 2 * Math.floor(rowHeight * densityFactor)
|
|
280
|
+
return `var(--DataGrid-overlayHeight, ${2 * Math.floor(rowHeight * densityFactor)}px)`;
|
|
281
281
|
}
|
package/modern/index.js
CHANGED
package/modern/locales/faIR.js
CHANGED
|
@@ -60,34 +60,32 @@ const faIRGrid = {
|
|
|
60
60
|
filterOperatorIsEmpty: 'خالی است',
|
|
61
61
|
filterOperatorIsNotEmpty: 'خالی نیست',
|
|
62
62
|
filterOperatorIsAnyOf: 'هر یک از',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
'filterOperator=': '=',
|
|
64
|
+
'filterOperator!=': '!=',
|
|
65
|
+
'filterOperator>': '>',
|
|
66
|
+
'filterOperator>=': '>=',
|
|
67
|
+
'filterOperator<': '<',
|
|
68
|
+
'filterOperator<=': '<=',
|
|
70
69
|
// Header filter operators text
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
headerFilterOperatorContains: 'شامل',
|
|
71
|
+
headerFilterOperatorEquals: 'مساوی',
|
|
72
|
+
headerFilterOperatorStartsWith: 'شروع با',
|
|
73
|
+
headerFilterOperatorEndsWith: 'پایان با',
|
|
74
|
+
headerFilterOperatorIs: 'هست',
|
|
75
|
+
headerFilterOperatorNot: 'نیست',
|
|
76
|
+
headerFilterOperatorAfter: 'بعد از',
|
|
77
|
+
headerFilterOperatorOnOrAfter: 'معادل یا بعد از',
|
|
78
|
+
headerFilterOperatorBefore: 'قبل از',
|
|
79
|
+
headerFilterOperatorOnOrBefore: 'معادل یا قبل از',
|
|
80
|
+
headerFilterOperatorIsEmpty: 'خالی است',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: 'خالی نیست',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'هر یک از',
|
|
83
|
+
'headerFilterOperator=': 'مساوی',
|
|
84
|
+
'headerFilterOperator!=': 'نامساوی',
|
|
85
|
+
'headerFilterOperator>': 'بزرگتر',
|
|
86
|
+
'headerFilterOperator>=': 'بزرگتر یا مساوی',
|
|
87
|
+
'headerFilterOperator<': 'کوچکتر',
|
|
88
|
+
'headerFilterOperator<=': 'کوچکتر یا مساوی',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'هرچیزی',
|
|
93
91
|
filterValueTrue: 'صحیح',
|
package/modern/locales/jaJP.js
CHANGED
|
@@ -60,34 +60,32 @@ const jaJPGrid = {
|
|
|
60
60
|
filterOperatorIsEmpty: '...空である',
|
|
61
61
|
filterOperatorIsNotEmpty: '...空でない',
|
|
62
62
|
filterOperatorIsAnyOf: '...のいずれか',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
'filterOperator=': '=',
|
|
64
|
+
'filterOperator!=': '!=',
|
|
65
|
+
'filterOperator>': '>',
|
|
66
|
+
'filterOperator>=': '>=',
|
|
67
|
+
'filterOperator<': '<',
|
|
68
|
+
'filterOperator<=': '<=',
|
|
70
69
|
// Header filter operators text
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
headerFilterOperatorContains: '含む',
|
|
71
|
+
headerFilterOperatorEquals: '等しい',
|
|
72
|
+
headerFilterOperatorStartsWith: 'で始まる',
|
|
73
|
+
headerFilterOperatorEndsWith: 'で終わる',
|
|
74
|
+
headerFilterOperatorIs: 'である',
|
|
75
|
+
headerFilterOperatorNot: 'ではない',
|
|
76
|
+
headerFilterOperatorAfter: '...より後ろ',
|
|
77
|
+
headerFilterOperatorOnOrAfter: '...以降',
|
|
78
|
+
headerFilterOperatorBefore: '...より前',
|
|
79
|
+
headerFilterOperatorOnOrBefore: '...以前',
|
|
80
|
+
headerFilterOperatorIsEmpty: '空白',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: '空白ではない',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'いずれか',
|
|
83
|
+
'headerFilterOperator=': '等しい',
|
|
84
|
+
'headerFilterOperator!=': '等しくない',
|
|
85
|
+
'headerFilterOperator>': 'より大きい',
|
|
86
|
+
'headerFilterOperator>=': '以上',
|
|
87
|
+
'headerFilterOperator<': '未満',
|
|
88
|
+
'headerFilterOperator<=': '以下',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'いずれか',
|
|
93
91
|
filterValueTrue: '真',
|
package/modern/locales/skSK.js
CHANGED
|
@@ -45,7 +45,7 @@ const skSKGrid = {
|
|
|
45
45
|
columnsPanelHideAllButton: 'Skryť všetko',
|
|
46
46
|
// Filter panel text
|
|
47
47
|
filterPanelAddFilter: 'Pridať filter',
|
|
48
|
-
|
|
48
|
+
filterPanelRemoveAll: 'Odstrániť všetky',
|
|
49
49
|
filterPanelDeleteIconLabel: 'Odstrániť',
|
|
50
50
|
filterPanelLogicOperator: 'Logický operátor',
|
|
51
51
|
filterPanelOperator: 'Operátory',
|
|
@@ -68,34 +68,32 @@ const skSKGrid = {
|
|
|
68
68
|
filterOperatorIsEmpty: 'je prázdny',
|
|
69
69
|
filterOperatorIsNotEmpty: 'nie je prázdny',
|
|
70
70
|
filterOperatorIsAnyOf: 'je jeden z',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
'filterOperator=': '=',
|
|
72
|
+
'filterOperator!=': '!=',
|
|
73
|
+
'filterOperator>': '>',
|
|
74
|
+
'filterOperator>=': '>=',
|
|
75
|
+
'filterOperator<': '<',
|
|
76
|
+
'filterOperator<=': '<=',
|
|
78
77
|
// Header filter operators text
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
78
|
+
headerFilterOperatorContains: 'Obsahuje',
|
|
79
|
+
headerFilterOperatorEquals: 'Rovná sa',
|
|
80
|
+
headerFilterOperatorStartsWith: 'Začína s',
|
|
81
|
+
headerFilterOperatorEndsWith: 'Končí na',
|
|
82
|
+
headerFilterOperatorIs: 'Je',
|
|
83
|
+
headerFilterOperatorNot: 'Nie je',
|
|
84
|
+
headerFilterOperatorAfter: 'Je po',
|
|
85
|
+
headerFilterOperatorOnOrAfter: 'Je na alebo po',
|
|
86
|
+
headerFilterOperatorBefore: 'Je pred',
|
|
87
|
+
headerFilterOperatorOnOrBefore: 'Je na alebo skôr',
|
|
88
|
+
headerFilterOperatorIsEmpty: 'Je prázdny',
|
|
89
|
+
headerFilterOperatorIsNotEmpty: 'Nie je prázdny',
|
|
90
|
+
headerFilterOperatorIsAnyOf: 'Je jeden z',
|
|
91
|
+
'headerFilterOperator=': 'Rovná sa',
|
|
92
|
+
'headerFilterOperator!=': 'Nerovná sa',
|
|
93
|
+
'headerFilterOperator>': 'Väčší ako',
|
|
94
|
+
'headerFilterOperator>=': 'Väčší ako alebo rovný',
|
|
95
|
+
'headerFilterOperator<': 'Menší ako',
|
|
96
|
+
'headerFilterOperator<=': 'Menší ako alebo rovný',
|
|
99
97
|
// Filter values text
|
|
100
98
|
filterValueAny: 'akýkoľvek',
|
|
101
99
|
filterValueTrue: 'áno',
|
|
@@ -103,7 +101,7 @@ const skSKGrid = {
|
|
|
103
101
|
// Column menu text
|
|
104
102
|
columnMenuLabel: 'Menu',
|
|
105
103
|
columnMenuShowColumns: 'Zobraziť stĺpce',
|
|
106
|
-
|
|
104
|
+
columnMenuManageColumns: 'Spravovať stĺpce',
|
|
107
105
|
columnMenuFilter: 'Filter',
|
|
108
106
|
columnMenuHideColumn: 'Skryť',
|
|
109
107
|
columnMenuUnsort: 'Zrušiť filtre',
|