@mui/x-data-grid 6.18.1 → 7.0.0-alpha.1
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 +558 -1
- package/DataGrid/DataGrid.js +0 -10
- package/DataGrid/useDataGridProps.js +9 -14
- package/colDef/gridActionsColDef.js +1 -2
- package/colDef/gridBooleanColDef.js +0 -1
- package/colDef/gridBooleanOperators.js +3 -4
- package/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/colDef/gridDateOperators.js +10 -11
- package/colDef/gridNumericColDef.js +1 -3
- package/colDef/gridNumericOperators.d.ts +2 -2
- package/colDef/gridNumericOperators.js +13 -14
- package/colDef/gridSingleSelectOperators.js +5 -6
- package/colDef/gridStringColDef.js +1 -3
- package/colDef/gridStringOperators.d.ts +2 -2
- package/colDef/gridStringOperators.js +11 -12
- package/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/constants/defaultGridSlotsComponents.js +17 -17
- package/hooks/features/export/useGridPrintExport.js +7 -10
- package/hooks/features/filter/gridFilterUtils.js +14 -68
- package/hooks/features/rows/useGridRows.js +4 -1
- package/index.js +1 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -1
- package/internals/utils/computeSlots.d.ts +4 -6
- package/internals/utils/computeSlots.js +2 -8
- package/internals/utils/index.d.ts +0 -1
- package/internals/utils/index.js +0 -1
- package/internals/utils/useProps.d.ts +1 -8
- package/internals/utils/useProps.js +5 -8
- package/joy/icons.d.ts +1 -2
- package/joy/joySlots.d.ts +1 -2
- package/legacy/DataGrid/DataGrid.js +0 -10
- package/legacy/DataGrid/useDataGridProps.js +10 -18
- package/legacy/colDef/gridActionsColDef.js +1 -2
- package/legacy/colDef/gridBooleanColDef.js +0 -1
- package/legacy/colDef/gridBooleanOperators.js +3 -4
- package/legacy/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/legacy/colDef/gridDateOperators.js +10 -11
- package/legacy/colDef/gridNumericColDef.js +1 -3
- package/legacy/colDef/gridNumericOperators.js +13 -14
- package/legacy/colDef/gridSingleSelectOperators.js +5 -6
- package/legacy/colDef/gridStringColDef.js +1 -3
- package/legacy/colDef/gridStringOperators.js +11 -12
- package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/legacy/constants/defaultGridSlotsComponents.js +17 -17
- package/legacy/hooks/features/export/useGridPrintExport.js +7 -10
- package/legacy/hooks/features/filter/gridFilterUtils.js +14 -68
- package/legacy/hooks/features/rows/useGridRows.js +2 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +0 -1
- package/legacy/internals/utils/computeSlots.js +2 -8
- package/legacy/internals/utils/index.js +0 -1
- package/legacy/internals/utils/useProps.js +5 -6
- package/legacy/locales/csCZ.js +2 -2
- package/legacy/material/index.js +48 -48
- package/locales/csCZ.js +2 -2
- package/material/index.js +48 -48
- package/models/colDef/gridColDef.d.ts +4 -14
- package/models/colDef/index.d.ts +1 -1
- package/models/gridFilterOperator.d.ts +4 -16
- package/models/gridIconSlotsComponent.d.ts +35 -36
- package/models/gridSlotsComponent.d.ts +31 -34
- package/models/index.d.ts +1 -1
- package/models/props/DataGridProps.d.ts +3 -14
- package/modern/DataGrid/DataGrid.js +0 -10
- package/modern/DataGrid/useDataGridProps.js +7 -9
- package/modern/colDef/gridActionsColDef.js +1 -2
- package/modern/colDef/gridBooleanColDef.js +0 -1
- package/modern/colDef/gridBooleanOperators.js +3 -4
- package/modern/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/modern/colDef/gridDateOperators.js +10 -11
- package/modern/colDef/gridNumericColDef.js +1 -3
- package/modern/colDef/gridNumericOperators.js +13 -14
- package/modern/colDef/gridSingleSelectOperators.js +5 -6
- package/modern/colDef/gridStringColDef.js +1 -3
- package/modern/colDef/gridStringOperators.js +11 -12
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/modern/constants/defaultGridSlotsComponents.js +17 -17
- package/modern/hooks/features/export/useGridPrintExport.js +6 -10
- package/modern/hooks/features/filter/gridFilterUtils.js +14 -67
- package/modern/hooks/features/rows/useGridRows.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +0 -1
- package/modern/internals/utils/computeSlots.js +2 -8
- package/modern/internals/utils/index.js +0 -1
- package/modern/internals/utils/useProps.js +5 -8
- package/modern/locales/csCZ.js +2 -2
- package/modern/material/index.js +48 -48
- package/node/DataGrid/DataGrid.js +0 -10
- package/node/DataGrid/useDataGridProps.js +6 -8
- package/node/colDef/gridActionsColDef.js +1 -2
- package/node/colDef/gridBooleanColDef.js +0 -1
- package/node/colDef/gridBooleanOperators.js +3 -4
- package/node/colDef/gridCheckboxSelectionColDef.js +0 -1
- package/node/colDef/gridDateOperators.js +10 -11
- package/node/colDef/gridNumericColDef.js +1 -3
- package/node/colDef/gridNumericOperators.js +14 -14
- package/node/colDef/gridSingleSelectOperators.js +5 -6
- package/node/colDef/gridStringColDef.js +1 -3
- package/node/colDef/gridStringOperators.js +12 -12
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/node/constants/defaultGridSlotsComponents.js +17 -17
- package/node/hooks/features/export/useGridPrintExport.js +5 -9
- package/node/hooks/features/filter/gridFilterUtils.js +14 -67
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +1 -13
- package/node/internals/utils/computeSlots.js +2 -7
- package/node/internals/utils/index.js +0 -11
- package/node/internals/utils/useProps.js +4 -8
- package/node/locales/csCZ.js +2 -2
- package/node/material/index.js +48 -48
- package/package.json +1 -1
- package/colDef/utils.d.ts +0 -21
- package/colDef/utils.js +0 -51
- package/internals/utils/slotsMigration.d.ts +0 -4
- package/internals/utils/slotsMigration.js +0 -13
- package/legacy/colDef/utils.js +0 -51
- package/legacy/internals/utils/slotsMigration.js +0 -14
- package/modern/colDef/utils.js +0 -51
- package/modern/internals/utils/slotsMigration.js +0 -13
- package/node/colDef/utils.js +0 -63
- package/node/internals/utils/slotsMigration.js +0 -21
|
@@ -3,7 +3,6 @@ import { gridNumberComparator } from '../hooks/features/sorting/gridSortingUtils
|
|
|
3
3
|
import { isNumber } from '../utils/utils';
|
|
4
4
|
import { getGridNumericOperators, getGridNumericQuickFilterFn } from './gridNumericOperators';
|
|
5
5
|
import { GRID_STRING_COL_DEF } from './gridStringColDef';
|
|
6
|
-
import { convertQuickFilterV7ToLegacy } from './utils';
|
|
7
6
|
export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
8
7
|
type: 'number',
|
|
9
8
|
align: 'right',
|
|
@@ -14,6 +13,5 @@ export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
14
13
|
value
|
|
15
14
|
}) => isNumber(value) ? value.toLocaleString() : value || '',
|
|
16
15
|
filterOperators: getGridNumericOperators(),
|
|
17
|
-
getApplyQuickFilterFn:
|
|
18
|
-
getApplyQuickFilterFnV7: getGridNumericQuickFilterFn
|
|
16
|
+
getApplyQuickFilterFn: getGridNumericQuickFilterFn
|
|
19
17
|
});
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilterInputValue';
|
|
2
2
|
import { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';
|
|
3
|
-
import { convertLegacyOperators, tagInternalFilter } from './utils';
|
|
4
3
|
const parseNumericValue = value => {
|
|
5
4
|
if (value == null) {
|
|
6
5
|
return null;
|
|
7
6
|
}
|
|
8
7
|
return Number(value);
|
|
9
8
|
};
|
|
10
|
-
export const getGridNumericQuickFilterFn =
|
|
9
|
+
export const getGridNumericQuickFilterFn = value => {
|
|
11
10
|
if (value == null || Number.isNaN(value) || value === '') {
|
|
12
11
|
return null;
|
|
13
12
|
}
|
|
14
13
|
return columnValue => {
|
|
15
14
|
return parseNumericValue(columnValue) === parseNumericValue(value);
|
|
16
15
|
};
|
|
17
|
-
}
|
|
18
|
-
export const getGridNumericOperators = () =>
|
|
16
|
+
};
|
|
17
|
+
export const getGridNumericOperators = () => [{
|
|
19
18
|
value: '=',
|
|
20
|
-
|
|
19
|
+
getApplyFilterFn: filterItem => {
|
|
21
20
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
22
21
|
return null;
|
|
23
22
|
}
|
|
@@ -31,7 +30,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
31
30
|
}
|
|
32
31
|
}, {
|
|
33
32
|
value: '!=',
|
|
34
|
-
|
|
33
|
+
getApplyFilterFn: filterItem => {
|
|
35
34
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
36
35
|
return null;
|
|
37
36
|
}
|
|
@@ -45,7 +44,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
45
44
|
}
|
|
46
45
|
}, {
|
|
47
46
|
value: '>',
|
|
48
|
-
|
|
47
|
+
getApplyFilterFn: filterItem => {
|
|
49
48
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
50
49
|
return null;
|
|
51
50
|
}
|
|
@@ -62,7 +61,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
62
61
|
}
|
|
63
62
|
}, {
|
|
64
63
|
value: '>=',
|
|
65
|
-
|
|
64
|
+
getApplyFilterFn: filterItem => {
|
|
66
65
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
67
66
|
return null;
|
|
68
67
|
}
|
|
@@ -79,7 +78,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
79
78
|
}
|
|
80
79
|
}, {
|
|
81
80
|
value: '<',
|
|
82
|
-
|
|
81
|
+
getApplyFilterFn: filterItem => {
|
|
83
82
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
84
83
|
return null;
|
|
85
84
|
}
|
|
@@ -96,7 +95,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
96
95
|
}
|
|
97
96
|
}, {
|
|
98
97
|
value: '<=',
|
|
99
|
-
|
|
98
|
+
getApplyFilterFn: filterItem => {
|
|
100
99
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
101
100
|
return null;
|
|
102
101
|
}
|
|
@@ -113,7 +112,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
113
112
|
}
|
|
114
113
|
}, {
|
|
115
114
|
value: 'isEmpty',
|
|
116
|
-
|
|
115
|
+
getApplyFilterFn: () => {
|
|
117
116
|
return value => {
|
|
118
117
|
return value == null;
|
|
119
118
|
};
|
|
@@ -121,7 +120,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
121
120
|
requiresFilterValue: false
|
|
122
121
|
}, {
|
|
123
122
|
value: 'isNotEmpty',
|
|
124
|
-
|
|
123
|
+
getApplyFilterFn: () => {
|
|
125
124
|
return value => {
|
|
126
125
|
return value != null;
|
|
127
126
|
};
|
|
@@ -129,7 +128,7 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
129
128
|
requiresFilterValue: false
|
|
130
129
|
}, {
|
|
131
130
|
value: 'isAnyOf',
|
|
132
|
-
|
|
131
|
+
getApplyFilterFn: filterItem => {
|
|
133
132
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
134
133
|
return null;
|
|
135
134
|
}
|
|
@@ -141,4 +140,4 @@ export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
|
141
140
|
InputComponentProps: {
|
|
142
141
|
type: 'number'
|
|
143
142
|
}
|
|
144
|
-
}]
|
|
143
|
+
}];
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { GridFilterInputSingleSelect } from '../components/panel/filterPanel/GridFilterInputSingleSelect';
|
|
2
2
|
import { GridFilterInputMultipleSingleSelect } from '../components/panel/filterPanel/GridFilterInputMultipleSingleSelect';
|
|
3
3
|
import { isObject } from '../utils/utils';
|
|
4
|
-
import { convertLegacyOperators } from './utils';
|
|
5
4
|
const parseObjectValue = value => {
|
|
6
5
|
if (value == null || !isObject(value)) {
|
|
7
6
|
return value;
|
|
8
7
|
}
|
|
9
8
|
return value.value;
|
|
10
9
|
};
|
|
11
|
-
export const getGridSingleSelectOperators = () =>
|
|
10
|
+
export const getGridSingleSelectOperators = () => [{
|
|
12
11
|
value: 'is',
|
|
13
|
-
|
|
12
|
+
getApplyFilterFn: filterItem => {
|
|
14
13
|
if (filterItem.value == null || filterItem.value === '') {
|
|
15
14
|
return null;
|
|
16
15
|
}
|
|
@@ -19,7 +18,7 @@ export const getGridSingleSelectOperators = () => convertLegacyOperators([{
|
|
|
19
18
|
InputComponent: GridFilterInputSingleSelect
|
|
20
19
|
}, {
|
|
21
20
|
value: 'not',
|
|
22
|
-
|
|
21
|
+
getApplyFilterFn: filterItem => {
|
|
23
22
|
if (filterItem.value == null || filterItem.value === '') {
|
|
24
23
|
return null;
|
|
25
24
|
}
|
|
@@ -28,7 +27,7 @@ export const getGridSingleSelectOperators = () => convertLegacyOperators([{
|
|
|
28
27
|
InputComponent: GridFilterInputSingleSelect
|
|
29
28
|
}, {
|
|
30
29
|
value: 'isAnyOf',
|
|
31
|
-
|
|
30
|
+
getApplyFilterFn: filterItem => {
|
|
32
31
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
33
32
|
return null;
|
|
34
33
|
}
|
|
@@ -36,4 +35,4 @@ export const getGridSingleSelectOperators = () => convertLegacyOperators([{
|
|
|
36
35
|
return value => filterItemValues.includes(parseObjectValue(value));
|
|
37
36
|
},
|
|
38
37
|
InputComponent: GridFilterInputMultipleSingleSelect
|
|
39
|
-
}]
|
|
38
|
+
}];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { renderEditInputCell } from '../components/cell/GridEditInputCell';
|
|
2
2
|
import { gridStringOrNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
|
|
3
3
|
import { getGridStringOperators, getGridStringQuickFilterFn } from './gridStringOperators';
|
|
4
|
-
import { convertQuickFilterV7ToLegacy } from './utils';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* TODO: Move pro and premium properties outside of this Community file
|
|
@@ -24,6 +23,5 @@ export const GRID_STRING_COL_DEF = {
|
|
|
24
23
|
align: 'left',
|
|
25
24
|
filterOperators: getGridStringOperators(),
|
|
26
25
|
renderEditCell: renderEditInputCell,
|
|
27
|
-
getApplyQuickFilterFn:
|
|
28
|
-
getApplyQuickFilterFnV7: getGridStringQuickFilterFn
|
|
26
|
+
getApplyQuickFilterFn: getGridStringQuickFilterFn
|
|
29
27
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilterInputValue';
|
|
2
2
|
import { escapeRegExp } from '../utils/utils';
|
|
3
3
|
import { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';
|
|
4
|
-
import { convertLegacyOperators, tagInternalFilter } from './utils';
|
|
5
4
|
import { removeDiacritics } from '../hooks/features/filter/gridFilterUtils';
|
|
6
|
-
export const getGridStringQuickFilterFn =
|
|
5
|
+
export const getGridStringQuickFilterFn = value => {
|
|
7
6
|
if (!value) {
|
|
8
7
|
return null;
|
|
9
8
|
}
|
|
@@ -15,10 +14,10 @@ export const getGridStringQuickFilterFn = tagInternalFilter(value => {
|
|
|
15
14
|
}
|
|
16
15
|
return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
|
|
17
16
|
};
|
|
18
|
-
}
|
|
19
|
-
export const getGridStringOperators = (disableTrim = false) =>
|
|
17
|
+
};
|
|
18
|
+
export const getGridStringOperators = (disableTrim = false) => [{
|
|
20
19
|
value: 'contains',
|
|
21
|
-
|
|
20
|
+
getApplyFilterFn: filterItem => {
|
|
22
21
|
if (!filterItem.value) {
|
|
23
22
|
return null;
|
|
24
23
|
}
|
|
@@ -31,7 +30,7 @@ export const getGridStringOperators = (disableTrim = false) => convertLegacyOper
|
|
|
31
30
|
InputComponent: GridFilterInputValue
|
|
32
31
|
}, {
|
|
33
32
|
value: 'equals',
|
|
34
|
-
|
|
33
|
+
getApplyFilterFn: filterItem => {
|
|
35
34
|
if (!filterItem.value) {
|
|
36
35
|
return null;
|
|
37
36
|
}
|
|
@@ -47,7 +46,7 @@ export const getGridStringOperators = (disableTrim = false) => convertLegacyOper
|
|
|
47
46
|
InputComponent: GridFilterInputValue
|
|
48
47
|
}, {
|
|
49
48
|
value: 'startsWith',
|
|
50
|
-
|
|
49
|
+
getApplyFilterFn: filterItem => {
|
|
51
50
|
if (!filterItem.value) {
|
|
52
51
|
return null;
|
|
53
52
|
}
|
|
@@ -60,7 +59,7 @@ export const getGridStringOperators = (disableTrim = false) => convertLegacyOper
|
|
|
60
59
|
InputComponent: GridFilterInputValue
|
|
61
60
|
}, {
|
|
62
61
|
value: 'endsWith',
|
|
63
|
-
|
|
62
|
+
getApplyFilterFn: filterItem => {
|
|
64
63
|
if (!filterItem.value) {
|
|
65
64
|
return null;
|
|
66
65
|
}
|
|
@@ -73,7 +72,7 @@ export const getGridStringOperators = (disableTrim = false) => convertLegacyOper
|
|
|
73
72
|
InputComponent: GridFilterInputValue
|
|
74
73
|
}, {
|
|
75
74
|
value: 'isEmpty',
|
|
76
|
-
|
|
75
|
+
getApplyFilterFn: () => {
|
|
77
76
|
return value => {
|
|
78
77
|
return value === '' || value == null;
|
|
79
78
|
};
|
|
@@ -81,7 +80,7 @@ export const getGridStringOperators = (disableTrim = false) => convertLegacyOper
|
|
|
81
80
|
requiresFilterValue: false
|
|
82
81
|
}, {
|
|
83
82
|
value: 'isNotEmpty',
|
|
84
|
-
|
|
83
|
+
getApplyFilterFn: () => {
|
|
85
84
|
return value => {
|
|
86
85
|
return value !== '' && value != null;
|
|
87
86
|
};
|
|
@@ -89,7 +88,7 @@ export const getGridStringOperators = (disableTrim = false) => convertLegacyOper
|
|
|
89
88
|
requiresFilterValue: false
|
|
90
89
|
}, {
|
|
91
90
|
value: 'isAnyOf',
|
|
92
|
-
|
|
91
|
+
getApplyFilterFn: filterItem => {
|
|
93
92
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
94
93
|
return null;
|
|
95
94
|
}
|
|
@@ -103,4 +102,4 @@ export const getGridStringOperators = (disableTrim = false) => convertLegacyOper
|
|
|
103
102
|
}) : false;
|
|
104
103
|
},
|
|
105
104
|
InputComponent: GridFilterInputMultipleValue
|
|
106
|
-
}]
|
|
105
|
+
}];
|
|
@@ -128,6 +128,8 @@ process.env.NODE_ENV !== "production" ? GridToolbarFilterButton.propTypes = {
|
|
|
128
128
|
* The props used for each slot inside.
|
|
129
129
|
* @default {}
|
|
130
130
|
*/
|
|
131
|
-
componentsProps: PropTypes.
|
|
131
|
+
componentsProps: PropTypes.shape({
|
|
132
|
+
button: PropTypes.object
|
|
133
|
+
})
|
|
132
134
|
} : void 0;
|
|
133
135
|
export { GridToolbarFilterButton };
|
|
@@ -9,21 +9,21 @@ import materialSlots from '../material';
|
|
|
9
9
|
// TODO: camelCase these key. It's a private helper now.
|
|
10
10
|
// Remove then need to call `uncapitalizeObjectKeys`.
|
|
11
11
|
export const DATA_GRID_DEFAULT_SLOTS_COMPONENTS = _extends({}, materialSlots, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
cell: GridCellV7,
|
|
13
|
+
skeletonCell: GridSkeletonCell,
|
|
14
|
+
columnHeaderFilterIconButton: GridColumnHeaderFilterIconButton,
|
|
15
|
+
columnMenu: GridColumnMenu,
|
|
16
|
+
columnHeaders: GridColumnHeaders,
|
|
17
|
+
footer: GridFooter,
|
|
18
|
+
footerRowCount: GridRowCount,
|
|
19
|
+
toolbar: null,
|
|
20
|
+
preferencesPanel: GridPreferencesPanel,
|
|
21
|
+
loadingOverlay: GridLoadingOverlay,
|
|
22
|
+
noResultsOverlay: GridNoResultsOverlay,
|
|
23
|
+
noRowsOverlay: GridNoRowsOverlay,
|
|
24
|
+
pagination: GridPagination,
|
|
25
|
+
filterPanel: GridFilterPanel,
|
|
26
|
+
columnsPanel: GridColumnsPanel,
|
|
27
|
+
panel: GridPanel,
|
|
28
|
+
row: GridRow
|
|
29
29
|
});
|
|
@@ -7,7 +7,7 @@ import { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from
|
|
|
7
7
|
import { gridClasses } from '../../../constants/gridClasses';
|
|
8
8
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
9
9
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
10
|
-
import { getColumnsToExport } from './utils';
|
|
10
|
+
import { defaultGetRowsToExport, getColumnsToExport } from './utils';
|
|
11
11
|
import { mergeStateWithPaginationModel } from '../pagination/useGridPagination';
|
|
12
12
|
import { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';
|
|
13
13
|
import { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';
|
|
@@ -118,12 +118,10 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
118
118
|
// the footer is always being placed at the bottom of the page as if all rows are exported
|
|
119
119
|
// so if getRowsToExport is being used to only export a subset of rows then we need to
|
|
120
120
|
// adjust the footer position to be correctly placed at the bottom of the grid
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
|
|
126
|
-
}
|
|
121
|
+
const gridFooterElement = gridClone.querySelector(`.${gridClasses.footerContainer}`);
|
|
122
|
+
gridFooterElement.style.position = 'absolute';
|
|
123
|
+
gridFooterElement.style.width = '100%';
|
|
124
|
+
gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
|
|
127
125
|
|
|
128
126
|
// printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
|
|
129
127
|
// prevents us to do it
|
|
@@ -226,9 +224,7 @@ export const useGridPrintExport = (apiRef, props) => {
|
|
|
226
224
|
apiRef.current.forceUpdate();
|
|
227
225
|
}
|
|
228
226
|
await updateGridColumnsForPrint(options?.fields, options?.allColumns, options?.includeCheckboxes);
|
|
229
|
-
|
|
230
|
-
updateGridRowsForPrint(options.getRowsToExport);
|
|
231
|
-
}
|
|
227
|
+
updateGridRowsForPrint(options?.getRowsToExport ?? defaultGetRowsToExport);
|
|
232
228
|
apiRef.current.unstable_setVirtualization(false);
|
|
233
229
|
await raf(); // wait for the state changes to take action
|
|
234
230
|
const printWindow = buildPrintWindow(options?.fileName);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { GridLogicOperator } from '../../../models';
|
|
3
|
-
import { GLOBAL_API_REF, isInternalFilter } from '../../../colDef/utils';
|
|
4
3
|
import { getDefaultGridFilterModel } from './gridFilterState';
|
|
5
4
|
import { buildWarning } from '../../../utils/warning';
|
|
6
5
|
import { getPublicApiRef } from '../../../utils/getPublicApiRef';
|
|
@@ -108,42 +107,19 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
|
|
|
108
107
|
if (!filterOperator) {
|
|
109
108
|
throw new Error(`MUI: No filter operator found for column '${column.field}' and operator value '${newFilterItem.operator}'.`);
|
|
110
109
|
}
|
|
111
|
-
const hasUserFunctionLegacy = !isInternalFilter(filterOperator.getApplyFilterFn);
|
|
112
|
-
const hasUserFunctionV7 = !isInternalFilter(filterOperator.getApplyFilterFnV7);
|
|
113
110
|
const publicApiRef = getPublicApiRef(apiRef);
|
|
114
|
-
if (filterOperator.getApplyFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
115
|
-
const applyFilterOnRow = filterOperator.getApplyFilterFnV7(newFilterItem, column);
|
|
116
|
-
if (typeof applyFilterOnRow !== 'function') {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
v7: true,
|
|
121
|
-
item: newFilterItem,
|
|
122
|
-
fn: row => {
|
|
123
|
-
let value = apiRef.current.getRowValue(row, column);
|
|
124
|
-
if (ignoreDiacritics) {
|
|
125
|
-
value = removeDiacritics(value);
|
|
126
|
-
}
|
|
127
|
-
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
111
|
const applyFilterOnRow = filterOperator.getApplyFilterFn(newFilterItem, column);
|
|
132
112
|
if (typeof applyFilterOnRow !== 'function') {
|
|
133
113
|
return null;
|
|
134
114
|
}
|
|
135
115
|
return {
|
|
136
|
-
v7: false,
|
|
137
116
|
item: newFilterItem,
|
|
138
|
-
fn:
|
|
139
|
-
|
|
140
|
-
GLOBAL_API_REF.current = publicApiRef;
|
|
117
|
+
fn: row => {
|
|
118
|
+
let value = apiRef.current.getRowValue(row, column);
|
|
141
119
|
if (ignoreDiacritics) {
|
|
142
|
-
|
|
120
|
+
value = removeDiacritics(value);
|
|
143
121
|
}
|
|
144
|
-
|
|
145
|
-
GLOBAL_API_REF.current = null;
|
|
146
|
-
return result;
|
|
122
|
+
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
147
123
|
}
|
|
148
124
|
};
|
|
149
125
|
};
|
|
@@ -170,7 +146,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
170
146
|
for (let i = 0; i < appliers.length; i += 1) {
|
|
171
147
|
const applier = appliers[i];
|
|
172
148
|
if (!shouldApplyFilter || shouldApplyFilter(applier.item.field)) {
|
|
173
|
-
resultPerItemId[applier.item.id] = applier.
|
|
149
|
+
resultPerItemId[applier.item.id] = applier.fn(row);
|
|
174
150
|
}
|
|
175
151
|
}
|
|
176
152
|
return resultPerItemId;
|
|
@@ -186,7 +162,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
186
162
|
${appliers.map((applier, i) => `${JSON.stringify(String(applier.item.id))}:
|
|
187
163
|
!shouldApply${i} ?
|
|
188
164
|
false :
|
|
189
|
-
|
|
165
|
+
appliers[${i}].fn(row),
|
|
190
166
|
`).join('\n')}};
|
|
191
167
|
|
|
192
168
|
return result$$;
|
|
@@ -220,27 +196,12 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
220
196
|
columnFields.forEach(field => {
|
|
221
197
|
const column = apiRef.current.getColumn(field);
|
|
222
198
|
const getApplyQuickFilterFn = column?.getApplyQuickFilterFn;
|
|
223
|
-
|
|
224
|
-
const hasUserFunctionLegacy = !isInternalFilter(getApplyQuickFilterFn);
|
|
225
|
-
const hasUserFunctionV7 = !isInternalFilter(getApplyQuickFilterFnV7);
|
|
226
|
-
if (getApplyQuickFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
199
|
+
if (getApplyQuickFilterFn) {
|
|
227
200
|
appliersPerField.push({
|
|
228
201
|
column,
|
|
229
202
|
appliers: quickFilterValues.map(quickFilterValue => {
|
|
230
203
|
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
231
204
|
return {
|
|
232
|
-
v7: true,
|
|
233
|
-
fn: getApplyQuickFilterFnV7(value, column, publicApiRef)
|
|
234
|
-
};
|
|
235
|
-
})
|
|
236
|
-
});
|
|
237
|
-
} else if (getApplyQuickFilterFn) {
|
|
238
|
-
appliersPerField.push({
|
|
239
|
-
column,
|
|
240
|
-
appliers: quickFilterValues.map(quickFilterValue => {
|
|
241
|
-
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
242
|
-
return {
|
|
243
|
-
v7: false,
|
|
244
205
|
fn: getApplyQuickFilterFn(value, column, publicApiRef)
|
|
245
206
|
};
|
|
246
207
|
})
|
|
@@ -249,7 +210,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
249
210
|
});
|
|
250
211
|
return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
|
|
251
212
|
const result = {};
|
|
252
|
-
const usedCellParams = {};
|
|
253
213
|
|
|
254
214
|
/* eslint-disable no-restricted-syntax, no-labels */
|
|
255
215
|
outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
|
|
@@ -270,26 +230,13 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
270
230
|
if (applier.fn === null) {
|
|
271
231
|
continue;
|
|
272
232
|
}
|
|
273
|
-
if (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
continue outer;
|
|
281
|
-
}
|
|
282
|
-
} else {
|
|
283
|
-
const cellParams = usedCellParams[field] ?? apiRef.current.getCellParams(apiRef.current.getRowId(row), field);
|
|
284
|
-
if (ignoreDiacritics) {
|
|
285
|
-
cellParams.value = removeDiacritics(cellParams.value);
|
|
286
|
-
}
|
|
287
|
-
usedCellParams[field] = cellParams;
|
|
288
|
-
const isMatching = applier.fn(cellParams);
|
|
289
|
-
if (isMatching) {
|
|
290
|
-
result[filterValue] = true;
|
|
291
|
-
continue outer;
|
|
292
|
-
}
|
|
233
|
+
if (ignoreDiacritics) {
|
|
234
|
+
value = removeDiacritics(value);
|
|
235
|
+
}
|
|
236
|
+
const isMatching = applier.fn(value, row, column, publicApiRef);
|
|
237
|
+
if (isMatching) {
|
|
238
|
+
result[filterValue] = true;
|
|
239
|
+
continue outer;
|
|
293
240
|
}
|
|
294
241
|
}
|
|
295
242
|
result[filterValue] = false;
|
|
@@ -283,7 +283,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
283
283
|
});
|
|
284
284
|
|
|
285
285
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
286
|
-
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]
|
|
286
|
+
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
|
|
287
287
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
288
288
|
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
|
289
289
|
apiRef.current.setState(state => _extends({}, state, {
|
package/modern/index.js
CHANGED
|
@@ -63,5 +63,4 @@ export * from '../utils/getPublicApiRef';
|
|
|
63
63
|
export { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
|
|
64
64
|
export * from '../hooks/utils/useOnMount';
|
|
65
65
|
export { serializeCellValue } from '../hooks/features/export/serializers/csvSerializer';
|
|
66
|
-
export * from '../colDef/utils';
|
|
67
66
|
export * from './utils';
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { uncapitalizeObjectKeys } from './slotsMigration';
|
|
3
|
-
|
|
4
|
-
// TODO v7: Remove `components` and usages of `UncapitalizeObjectKeys` type
|
|
5
|
-
// after converting keys in Grid(Pro|Premium)SlotsComponent to camelCase.
|
|
6
|
-
// https://github.com/mui/mui-x/issues/7940
|
|
7
2
|
export function computeSlots({
|
|
8
3
|
defaultSlots,
|
|
9
|
-
slots
|
|
10
|
-
components
|
|
4
|
+
slots
|
|
11
5
|
}) {
|
|
12
|
-
const overrides = slots
|
|
6
|
+
const overrides = slots;
|
|
13
7
|
if (!overrides || Object.keys(overrides).length === 0) {
|
|
14
8
|
return defaultSlots;
|
|
15
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
|
|
4
5
|
/** Gathers props for the root element into a single `.forwardedProps` field */
|
|
5
6
|
function groupForwardedProps(props) {
|
|
6
7
|
const keys = Object.keys(props);
|
|
@@ -22,11 +23,7 @@ function groupForwardedProps(props) {
|
|
|
22
23
|
}
|
|
23
24
|
export function useProps(allProps) {
|
|
24
25
|
return React.useMemo(() => {
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
componentsProps
|
|
28
|
-
} = allProps,
|
|
29
|
-
themedProps = _objectWithoutPropertiesLoose(allProps, _excluded);
|
|
30
|
-
return [components, componentsProps, groupForwardedProps(themedProps)];
|
|
26
|
+
const themedProps = _extends({}, (_objectDestructuringEmpty(allProps), allProps));
|
|
27
|
+
return groupForwardedProps(themedProps);
|
|
31
28
|
}, [allProps]);
|
|
32
29
|
}
|
package/modern/locales/csCZ.js
CHANGED
|
@@ -150,8 +150,8 @@ const csCZGrid = {
|
|
|
150
150
|
// Actions cell more text
|
|
151
151
|
actionsCellMore: 'více',
|
|
152
152
|
// Column pinning text
|
|
153
|
-
pinToLeft: 'Připnout
|
|
154
|
-
pinToRight: 'Připnout
|
|
153
|
+
pinToLeft: 'Připnout vlevo',
|
|
154
|
+
pinToRight: 'Připnout vpravo',
|
|
155
155
|
unpin: 'Odepnout',
|
|
156
156
|
// Tree Data
|
|
157
157
|
treeDataGroupingHeaderName: 'Skupina',
|