@mui/x-data-grid 7.0.0-alpha.3 → 7.0.0-alpha.5
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 +245 -0
- package/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/colDef/gridDefaultColumnTypes.d.ts +2 -2
- package/colDef/gridDefaultColumnTypes.js +2 -2
- package/components/GridRow.js +7 -2
- package/components/base/GridOverlays.js +0 -2
- package/components/cell/GridActionsCell.js +0 -1
- package/components/cell/GridCell.js +0 -2
- package/components/virtualization/GridVirtualScroller.js +0 -1
- package/hooks/features/editing/useGridCellEditing.js +0 -2
- package/hooks/features/editing/useGridRowEditing.js +0 -1
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
- package/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
- package/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/legacy/colDef/gridDefaultColumnTypes.js +2 -2
- package/legacy/components/GridRow.js +7 -2
- package/legacy/components/base/GridOverlays.js +0 -2
- package/legacy/components/cell/GridActionsCell.js +0 -1
- package/legacy/components/cell/GridCell.js +0 -2
- package/legacy/components/virtualization/GridVirtualScroller.js +0 -1
- package/legacy/hooks/features/editing/useGridCellEditing.js +0 -2
- package/legacy/hooks/features/editing/useGridRowEditing.js +0 -1
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
- package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/locales/coreLocales.js +1 -0
- package/legacy/locales/daDK.js +37 -39
- package/legacy/locales/plPL.js +0 -1
- package/legacy/locales/svSE.js +31 -33
- package/legacy/locales/urPK.js +26 -28
- package/legacy/utils/utils.js +0 -1
- package/locales/coreLocales.js +1 -0
- package/locales/daDK.js +37 -39
- package/locales/plPL.js +0 -1
- package/locales/svSE.js +31 -33
- package/locales/urPK.js +26 -28
- package/models/colDef/gridColType.d.ts +2 -4
- package/models/controlStateItem.d.ts +1 -4
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/modern/colDef/gridDefaultColumnTypes.js +2 -2
- package/modern/components/GridRow.js +7 -2
- package/modern/components/base/GridOverlays.js +0 -2
- package/modern/components/cell/GridActionsCell.js +0 -1
- package/modern/components/cell/GridCell.js +0 -2
- package/modern/components/virtualization/GridVirtualScroller.js +0 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +0 -2
- package/modern/hooks/features/editing/useGridRowEditing.js +0 -1
- package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -4
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +7 -5
- package/modern/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/coreLocales.js +1 -0
- package/modern/locales/daDK.js +37 -39
- package/modern/locales/plPL.js +0 -1
- package/modern/locales/svSE.js +31 -33
- package/modern/locales/urPK.js +26 -28
- package/modern/utils/utils.js +0 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -1
- package/node/colDef/gridDefaultColumnTypes.js +2 -2
- package/node/components/GridRow.js +7 -2
- package/node/components/base/GridOverlays.js +0 -2
- package/node/components/cell/GridActionsCell.js +0 -1
- package/node/components/cell/GridCell.js +0 -2
- package/node/components/virtualization/GridVirtualScroller.js +0 -1
- package/node/hooks/features/editing/useGridCellEditing.js +0 -2
- package/node/hooks/features/editing/useGridRowEditing.js +0 -1
- package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -7
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +6 -4
- package/node/hooks/features/rows/useGridRowsMeta.js +0 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +0 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +14 -14
- package/node/locales/daDK.js +37 -39
- package/node/locales/plPL.js +0 -1
- package/node/locales/svSE.js +31 -33
- package/node/locales/urPK.js +26 -28
- package/node/utils/utils.js +0 -1
- package/package.json +4 -4
- package/utils/createSelector.d.ts +1 -1
- package/utils/utils.js +0 -1
package/locales/svSE.js
CHANGED
|
@@ -9,7 +9,7 @@ const svSEGrid = {
|
|
|
9
9
|
toolbarDensityLabel: 'Densitet',
|
|
10
10
|
toolbarDensityCompact: 'Kompakt',
|
|
11
11
|
toolbarDensityStandard: 'Standard',
|
|
12
|
-
toolbarDensityComfortable: '
|
|
12
|
+
toolbarDensityComfortable: 'Luftig',
|
|
13
13
|
// Columns selector toolbar button text
|
|
14
14
|
toolbarColumns: 'Kolumner',
|
|
15
15
|
toolbarColumnsLabel: 'Välj kolumner',
|
|
@@ -39,8 +39,8 @@ const svSEGrid = {
|
|
|
39
39
|
filterPanelAddFilter: 'Lägg till filter',
|
|
40
40
|
filterPanelRemoveAll: 'Ta bort alla',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Ta bort',
|
|
42
|
-
filterPanelLogicOperator: 'Logisk
|
|
43
|
-
filterPanelOperator: '
|
|
42
|
+
filterPanelLogicOperator: 'Logisk operator',
|
|
43
|
+
filterPanelOperator: 'Operator',
|
|
44
44
|
filterPanelOperatorAnd: 'Och',
|
|
45
45
|
filterPanelOperatorOr: 'Eller',
|
|
46
46
|
filterPanelColumns: 'Kolumner',
|
|
@@ -48,7 +48,7 @@ const svSEGrid = {
|
|
|
48
48
|
filterPanelInputPlaceholder: 'Filtervärde',
|
|
49
49
|
// Filter operators text
|
|
50
50
|
filterOperatorContains: 'innehåller',
|
|
51
|
-
filterOperatorEquals: '
|
|
51
|
+
filterOperatorEquals: 'lika med',
|
|
52
52
|
filterOperatorStartsWith: 'börjar med',
|
|
53
53
|
filterOperatorEndsWith: 'slutar med',
|
|
54
54
|
filterOperatorIs: 'är',
|
|
@@ -60,34 +60,32 @@ const svSEGrid = {
|
|
|
60
60
|
filterOperatorIsEmpty: 'är tom',
|
|
61
61
|
filterOperatorIsNotEmpty: 'är inte tom',
|
|
62
62
|
filterOperatorIsAnyOf: 'är någon av',
|
|
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: 'Innehåller',
|
|
71
|
+
headerFilterOperatorEquals: 'Lika med',
|
|
72
|
+
headerFilterOperatorStartsWith: 'Börjar med',
|
|
73
|
+
headerFilterOperatorEndsWith: 'Slutar med',
|
|
74
|
+
headerFilterOperatorIs: 'Är',
|
|
75
|
+
headerFilterOperatorNot: 'Är inte',
|
|
76
|
+
headerFilterOperatorAfter: 'Är efter',
|
|
77
|
+
headerFilterOperatorOnOrAfter: 'Är på eller efter',
|
|
78
|
+
headerFilterOperatorBefore: 'Är innan',
|
|
79
|
+
headerFilterOperatorOnOrBefore: 'Är på eller innan',
|
|
80
|
+
headerFilterOperatorIsEmpty: 'Är tom',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: 'Är inte tom',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'Innehåller någon av',
|
|
83
|
+
'headerFilterOperator=': 'Lika med',
|
|
84
|
+
'headerFilterOperator!=': 'Inte lika med',
|
|
85
|
+
'headerFilterOperator>': 'Större än',
|
|
86
|
+
'headerFilterOperator>=': 'Större eller lika med',
|
|
87
|
+
'headerFilterOperator<': 'Mindre än',
|
|
88
|
+
'headerFilterOperator<=': 'Mindre eller lika med',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'något',
|
|
93
91
|
filterValueTrue: 'sant',
|
|
@@ -98,7 +96,7 @@ const svSEGrid = {
|
|
|
98
96
|
columnMenuManageColumns: 'Hantera kolumner',
|
|
99
97
|
columnMenuFilter: 'Filtrera',
|
|
100
98
|
columnMenuHideColumn: 'Dölj',
|
|
101
|
-
columnMenuUnsort: '
|
|
99
|
+
columnMenuUnsort: 'Ta bort sortering',
|
|
102
100
|
columnMenuSortAsc: 'Sortera stigande',
|
|
103
101
|
columnMenuSortDesc: 'Sortera fallande',
|
|
104
102
|
// Column header text
|
|
@@ -142,7 +140,7 @@ const svSEGrid = {
|
|
|
142
140
|
rowReorderingHeaderName: 'Ordna om rader',
|
|
143
141
|
// Aggregation
|
|
144
142
|
aggregationMenuItemHeader: 'Aggregering',
|
|
145
|
-
aggregationFunctionLabelSum: '
|
|
143
|
+
aggregationFunctionLabelSum: 'summa',
|
|
146
144
|
aggregationFunctionLabelAvg: 'medel',
|
|
147
145
|
aggregationFunctionLabelMin: 'min',
|
|
148
146
|
aggregationFunctionLabelMax: 'max',
|
package/locales/urPK.js
CHANGED
|
@@ -37,7 +37,7 @@ const urPKGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'سارے چھپائیں',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'نیا فلٹر',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'سارے ختم کریں',
|
|
41
41
|
filterPanelDeleteIconLabel: 'ختم کریں',
|
|
42
42
|
filterPanelLogicOperator: 'لاجک آپریٹر',
|
|
43
43
|
filterPanelOperator: 'آپریٹر',
|
|
@@ -60,34 +60,32 @@ const urPKGrid = {
|
|
|
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: 'صحیح',
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
type
|
|
2
|
-
export type
|
|
3
|
-
export type GridColType = LiteralUnion<GridNativeColTypes, string>;
|
|
4
|
-
export {};
|
|
1
|
+
export type GridNativeColTypes = 'string' | 'number' | 'date' | 'dateTime' | 'boolean' | 'singleSelect' | 'actions' | 'custom';
|
|
2
|
+
export type GridColType = GridNativeColTypes;
|
|
@@ -5,10 +5,7 @@ import { GridStateCommunity } from './gridStateCommunity';
|
|
|
5
5
|
export interface GridControlStateItem<State extends GridStateCommunity, E extends keyof GridControlledStateEventLookup> {
|
|
6
6
|
stateId: string;
|
|
7
7
|
propModel?: GridEventLookup[E]['params'];
|
|
8
|
-
stateSelector: OutputSelector<
|
|
9
|
-
state: State;
|
|
10
|
-
instanceId: string;
|
|
11
|
-
}, GridControlledStateEventLookup[E]['params']> | ((state: State) => GridControlledStateEventLookup[E]['params']);
|
|
8
|
+
stateSelector: OutputSelector<State, GridControlledStateEventLookup[E]['params']> | ((state: State) => GridControlledStateEventLookup[E]['params']);
|
|
12
9
|
propOnChange?: (model: GridControlledStateEventLookup[E]['params'], details: GridCallbackDetails) => void;
|
|
13
10
|
changeEvent: E;
|
|
14
11
|
}
|
|
@@ -7,8 +7,8 @@ import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
|
|
9
9
|
export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {
|
|
10
|
+
type: 'custom',
|
|
10
11
|
field: GRID_CHECKBOX_SELECTION_FIELD,
|
|
11
|
-
type: 'checkboxSelection',
|
|
12
12
|
width: 50,
|
|
13
13
|
resizable: false,
|
|
14
14
|
sortable: false,
|
|
@@ -4,7 +4,7 @@ import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from './gridDateColDef';
|
|
|
4
4
|
import { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';
|
|
5
5
|
import { GRID_SINGLE_SELECT_COL_DEF } from './gridSingleSelectColDef';
|
|
6
6
|
import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from './gridActionsColDef';
|
|
7
|
-
export const DEFAULT_GRID_COL_TYPE_KEY = '
|
|
7
|
+
export const DEFAULT_GRID_COL_TYPE_KEY = 'string';
|
|
8
8
|
export const getGridDefaultColumnTypes = () => {
|
|
9
9
|
const nativeColumnTypes = {
|
|
10
10
|
string: GRID_STRING_COL_DEF,
|
|
@@ -14,7 +14,7 @@ export const getGridDefaultColumnTypes = () => {
|
|
|
14
14
|
boolean: GRID_BOOLEAN_COL_DEF,
|
|
15
15
|
singleSelect: GRID_SINGLE_SELECT_COL_DEF,
|
|
16
16
|
[GRID_ACTIONS_COLUMN_TYPE]: GRID_ACTIONS_COL_DEF,
|
|
17
|
-
|
|
17
|
+
custom: GRID_STRING_COL_DEF
|
|
18
18
|
};
|
|
19
19
|
return nativeColumnTypes;
|
|
20
20
|
};
|
|
@@ -53,7 +53,6 @@ function EmptyCell({
|
|
|
53
53
|
style: style
|
|
54
54
|
}); // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
|
|
55
55
|
}
|
|
56
|
-
|
|
57
56
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
58
57
|
const {
|
|
59
58
|
selected,
|
|
@@ -193,7 +192,13 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
193
192
|
const CellComponent = slots.cell === GridCellV7 ? GridCellV7 : GridCellWrapper;
|
|
194
193
|
const rowReordering = rootProps.rowReordering;
|
|
195
194
|
const getCell = (column, cellProps) => {
|
|
196
|
-
|
|
195
|
+
// when the cell is a reorder cell we are not allowing to reorder the col
|
|
196
|
+
// fixes https://github.com/mui/mui-x/issues/11126
|
|
197
|
+
const isReorderCell = column.field === '__reorder__';
|
|
198
|
+
const isEditingRows = Object.keys(editRowsState).length > 0;
|
|
199
|
+
const canReorderColumn = !(disableColumnReorder || column.disableReorder);
|
|
200
|
+
const canReorderRow = rowReordering && !sortModel.length && treeDepth <= 1 && !isEditingRows;
|
|
201
|
+
const disableDragEvents = !(canReorderColumn || isReorderCell && canReorderRow);
|
|
197
202
|
const editCellState = editRowsState[rowId]?.[column.field] ?? null;
|
|
198
203
|
let cellIsNotVisible = false;
|
|
199
204
|
if (focusedCellColumnIndexNotInRange !== undefined && visibleColumns[focusedCellColumnIndexNotInRange].field === column.field) {
|
|
@@ -31,7 +31,6 @@ const GridOverlayWrapperRoot = styled('div', {
|
|
|
31
31
|
zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel
|
|
32
32
|
: 4 // Should be above pinned columns and detail panel
|
|
33
33
|
}));
|
|
34
|
-
|
|
35
34
|
const GridOverlayWrapperInner = styled('div', {
|
|
36
35
|
name: 'MuiDataGrid',
|
|
37
36
|
slot: 'OverlayWrapperInner',
|
|
@@ -62,7 +61,6 @@ function GridOverlayWrapper(props) {
|
|
|
62
61
|
if (rootProps.autoHeight && height === 0) {
|
|
63
62
|
height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
|
|
64
63
|
}
|
|
65
|
-
|
|
66
64
|
const classes = useUtilityClasses(_extends({}, props, {
|
|
67
65
|
classes: rootProps.classes
|
|
68
66
|
}));
|
|
@@ -126,7 +126,6 @@ function GridActionsCell(props) {
|
|
|
126
126
|
if (newIndex < 0 || newIndex >= numberOfButtons) {
|
|
127
127
|
return; // We're already in the first or last item = do nothing and let the grid listen the event
|
|
128
128
|
}
|
|
129
|
-
|
|
130
129
|
if (newIndex !== focusedButtonIndex) {
|
|
131
130
|
event.preventDefault(); // Prevent scrolling
|
|
132
131
|
event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp
|
|
@@ -242,7 +242,6 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
242
242
|
minHeight: height,
|
|
243
243
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
244
244
|
};
|
|
245
|
-
|
|
246
245
|
return cellStyle;
|
|
247
246
|
}, [width, height, isNotVisible]);
|
|
248
247
|
React.useEffect(() => {
|
|
@@ -510,7 +509,6 @@ const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
510
509
|
minHeight: height,
|
|
511
510
|
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
512
511
|
};
|
|
513
|
-
|
|
514
512
|
return cellStyle;
|
|
515
513
|
}, [width, height, isNotVisible]);
|
|
516
514
|
React.useEffect(() => {
|
|
@@ -29,7 +29,6 @@ const VirtualScrollerRoot = styled('div', {
|
|
|
29
29
|
},
|
|
30
30
|
zIndex: 0 // See https://github.com/mui/mui-x/issues/10547
|
|
31
31
|
});
|
|
32
|
-
|
|
33
32
|
const GridVirtualScroller = /*#__PURE__*/React.forwardRef(function GridVirtualScroller(props, ref) {
|
|
34
33
|
const rootProps = useGridRootProps();
|
|
35
34
|
const classes = useUtilityClasses(rootProps);
|
|
@@ -81,7 +81,6 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
81
81
|
reason = event.shiftKey ? GridCellEditStopReasons.shiftTabKeyDown : GridCellEditStopReasons.tabKeyDown;
|
|
82
82
|
event.preventDefault(); // Prevent going to the next element in the tab sequence
|
|
83
83
|
}
|
|
84
|
-
|
|
85
84
|
if (reason) {
|
|
86
85
|
const newParams = _extends({}, params, {
|
|
87
86
|
reason
|
|
@@ -175,7 +174,6 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
175
174
|
if (props.cellModesModel && isNewModelDifferentFromProp) {
|
|
176
175
|
return; // The prop always win
|
|
177
176
|
}
|
|
178
|
-
|
|
179
177
|
setCellModesModel(newModel);
|
|
180
178
|
cellModesModelRef.current = newModel;
|
|
181
179
|
apiRef.current.publishEvent('cellModesModelChange', newModel);
|
|
@@ -239,7 +239,6 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
239
239
|
if (props.rowModesModel && isNewModelDifferentFromProp) {
|
|
240
240
|
return; // The prop always win
|
|
241
241
|
}
|
|
242
|
-
|
|
243
242
|
setRowModesModel(newModel);
|
|
244
243
|
rowModesModelRef.current = newModel;
|
|
245
244
|
apiRef.current.publishEvent('rowModesModelChange', newModel);
|
|
@@ -2,18 +2,14 @@ import { createSelector } from '../../../utils/createSelector';
|
|
|
2
2
|
export const gridFocusStateSelector = state => state.focus;
|
|
3
3
|
export const gridFocusCellSelector = createSelector(gridFocusStateSelector, focusState => focusState.cell);
|
|
4
4
|
export const gridFocusColumnHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeader);
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
-
export const unstable_gridFocusColumnHeaderFilterSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeaderFilter);
|
|
5
|
+
export const gridFocusColumnHeaderFilterSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeaderFilter);
|
|
8
6
|
|
|
9
7
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10
8
|
export const unstable_gridFocusColumnGroupHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnGroupHeader);
|
|
11
9
|
export const gridTabIndexStateSelector = state => state.tabIndex;
|
|
12
10
|
export const gridTabIndexCellSelector = createSelector(gridTabIndexStateSelector, state => state.cell);
|
|
13
11
|
export const gridTabIndexColumnHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeader);
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
-
export const unstable_gridTabIndexColumnHeaderFilterSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeaderFilter);
|
|
12
|
+
export const gridTabIndexColumnHeaderFilterSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeaderFilter);
|
|
17
13
|
|
|
18
14
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
15
|
export const unstable_gridTabIndexColumnGroupHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnGroupHeader);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
1
|
import { createSelector } from '../../../utils/createSelector';
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
2
|
+
export const gridHeaderFilteringStateSelector = state => state.headerFiltering;
|
|
3
|
+
export const gridHeaderFilteringEditFieldSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);
|
|
4
|
+
export const gridHeaderFilteringMenuSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);
|
|
@@ -13,7 +13,7 @@ import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPan
|
|
|
13
13
|
import { gridPinnedRowsSelector } from '../rows/gridRowsSelector';
|
|
14
14
|
import { unstable_gridFocusColumnGroupHeaderSelector } from '../focus';
|
|
15
15
|
import { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';
|
|
16
|
-
import {
|
|
16
|
+
import { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';
|
|
17
17
|
import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
18
18
|
import { isEventTargetInPortal } from '../../../utils/domUtils';
|
|
19
19
|
function enrichPageRowsWithPinnedRows(apiRef, rows) {
|
|
@@ -71,7 +71,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
71
71
|
const currentPageRows = React.useMemo(() => enrichPageRowsWithPinnedRows(apiRef, initialCurrentPageRows), [apiRef, initialCurrentPageRows]);
|
|
72
72
|
const headerFilteringEnabled =
|
|
73
73
|
// @ts-expect-error // TODO move relevant code to the `DataGridPro`
|
|
74
|
-
props.signature !== 'DataGrid' && props.
|
|
74
|
+
props.signature !== 'DataGrid' && props.headerFilters;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* @param {number} colIndex Index of the column to focus
|
|
@@ -237,8 +237,8 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
237
237
|
if (!dimensions) {
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
const isEditing =
|
|
241
|
-
const isHeaderMenuOpen =
|
|
240
|
+
const isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
|
|
241
|
+
const isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
|
|
242
242
|
if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
@@ -506,7 +506,9 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
506
506
|
break;
|
|
507
507
|
}
|
|
508
508
|
const colDef = params.colDef;
|
|
509
|
-
if (colDef &&
|
|
509
|
+
if (colDef &&
|
|
510
|
+
// `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package
|
|
511
|
+
colDef.field === '__tree_data_group__') {
|
|
510
512
|
break;
|
|
511
513
|
}
|
|
512
514
|
if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {
|
|
@@ -550,7 +550,6 @@ export const useGridVirtualScroller = props => {
|
|
|
550
550
|
if (rootProps.autoHeight && currentPage.rows.length === 0) {
|
|
551
551
|
size.height = getMinimalContentHeight(apiRef, rootProps.rowHeight); // Give room to show the overlay when there no rows.
|
|
552
552
|
}
|
|
553
|
-
|
|
554
553
|
return size;
|
|
555
554
|
}, [apiRef, rootRef, columnsTotalWidth, rowsMeta.currentPageTotalHeight, needsHorizontalScrollbar, rootProps.autoHeight, rootProps.rowHeight, currentPage.rows.length]);
|
|
556
555
|
React.useEffect(() => {
|
package/modern/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { useGridInitialization } from '../hooks/core/useGridInitialization';
|
|
|
11
11
|
export { unwrapPrivateAPI } from '../hooks/core/useGridApiInitialization';
|
|
12
12
|
export { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';
|
|
13
13
|
export { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
14
|
-
export {
|
|
14
|
+
export { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../hooks/features/headerFiltering/gridHeaderFilteringSelectors';
|
|
15
15
|
export { useGridColumnMenu, columnMenuStateInitializer } from '../hooks/features/columnMenu/useGridColumnMenu';
|
|
16
16
|
export { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';
|
|
17
17
|
export { getTotalHeaderHeight } from '../hooks/features/columns/gridColumnsUtils';
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// This allows not to bump the minimal version of `@mui/material` in peerDependencies which results
|
|
4
4
|
// in broader compatibility between the packages.
|
|
5
5
|
// See https://github.com/mui/mui-x/pull/7646#issuecomment-1404605556 for additional context.
|
|
6
|
+
|
|
6
7
|
export const beBYCore = {
|
|
7
8
|
components: {
|
|
8
9
|
MuiTablePagination: {
|
package/modern/locales/daDK.js
CHANGED
|
@@ -47,47 +47,45 @@ const daDKGrid = {
|
|
|
47
47
|
filterPanelInputLabel: 'Værdi',
|
|
48
48
|
filterPanelInputPlaceholder: 'Filter værdi',
|
|
49
49
|
// Filter operators text
|
|
50
|
-
filterOperatorContains: '
|
|
51
|
-
filterOperatorEquals: '
|
|
52
|
-
filterOperatorStartsWith: '
|
|
53
|
-
filterOperatorEndsWith: '
|
|
54
|
-
filterOperatorIs: '
|
|
55
|
-
filterOperatorNot: '
|
|
56
|
-
filterOperatorAfter: '
|
|
57
|
-
filterOperatorOnOrAfter: '
|
|
58
|
-
filterOperatorBefore: '
|
|
59
|
-
filterOperatorOnOrBefore: '
|
|
60
|
-
filterOperatorIsEmpty: '
|
|
61
|
-
filterOperatorIsNotEmpty: '
|
|
50
|
+
filterOperatorContains: 'indeholder',
|
|
51
|
+
filterOperatorEquals: 'lig med',
|
|
52
|
+
filterOperatorStartsWith: 'begynder med',
|
|
53
|
+
filterOperatorEndsWith: 'ender med',
|
|
54
|
+
filterOperatorIs: 'er lig med',
|
|
55
|
+
filterOperatorNot: 'er ikke lig med',
|
|
56
|
+
filterOperatorAfter: 'efter',
|
|
57
|
+
filterOperatorOnOrAfter: 'på eller efter',
|
|
58
|
+
filterOperatorBefore: 'før',
|
|
59
|
+
filterOperatorOnOrBefore: 'på eller før',
|
|
60
|
+
filterOperatorIsEmpty: 'indeholder ikke data',
|
|
61
|
+
filterOperatorIsNotEmpty: 'indeholder data',
|
|
62
62
|
filterOperatorIsAnyOf: 'indeholder en af',
|
|
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: 'Indeholder',
|
|
71
|
+
headerFilterOperatorEquals: 'Lig med',
|
|
72
|
+
headerFilterOperatorStartsWith: 'Begynder med',
|
|
73
|
+
headerFilterOperatorEndsWith: 'Ender med',
|
|
74
|
+
headerFilterOperatorIs: 'Er lig med',
|
|
75
|
+
headerFilterOperatorNot: 'Er ikke lig med',
|
|
76
|
+
headerFilterOperatorAfter: 'Efter',
|
|
77
|
+
headerFilterOperatorOnOrAfter: 'På eller efter',
|
|
78
|
+
headerFilterOperatorBefore: 'Før',
|
|
79
|
+
headerFilterOperatorOnOrBefore: 'På eller før',
|
|
80
|
+
headerFilterOperatorIsEmpty: 'Indeholder ikke data',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: 'Indeholder data',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'Indeholder en af',
|
|
83
|
+
'headerFilterOperator=': 'Lig med',
|
|
84
|
+
'headerFilterOperator!=': 'Ikke lig med',
|
|
85
|
+
'headerFilterOperator>': 'Større end',
|
|
86
|
+
'headerFilterOperator>=': 'Større end eller lig med',
|
|
87
|
+
'headerFilterOperator<': 'Mindre end',
|
|
88
|
+
'headerFilterOperator<=': 'Mindre end eller lig med',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'hvilken som helst',
|
|
93
91
|
filterValueTrue: 'positiv',
|