@mui/x-data-grid 6.18.1 → 7.0.0-alpha.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 +149 -0
- 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/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/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/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/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
|
@@ -7,16 +7,15 @@ exports.getGridSingleSelectOperators = void 0;
|
|
|
7
7
|
var _GridFilterInputSingleSelect = require("../components/panel/filterPanel/GridFilterInputSingleSelect");
|
|
8
8
|
var _GridFilterInputMultipleSingleSelect = require("../components/panel/filterPanel/GridFilterInputMultipleSingleSelect");
|
|
9
9
|
var _utils = require("../utils/utils");
|
|
10
|
-
var _utils2 = require("./utils");
|
|
11
10
|
const parseObjectValue = value => {
|
|
12
11
|
if (value == null || !(0, _utils.isObject)(value)) {
|
|
13
12
|
return value;
|
|
14
13
|
}
|
|
15
14
|
return value.value;
|
|
16
15
|
};
|
|
17
|
-
const getGridSingleSelectOperators = () =>
|
|
16
|
+
const getGridSingleSelectOperators = () => [{
|
|
18
17
|
value: 'is',
|
|
19
|
-
|
|
18
|
+
getApplyFilterFn: filterItem => {
|
|
20
19
|
if (filterItem.value == null || filterItem.value === '') {
|
|
21
20
|
return null;
|
|
22
21
|
}
|
|
@@ -25,7 +24,7 @@ const getGridSingleSelectOperators = () => (0, _utils2.convertLegacyOperators)([
|
|
|
25
24
|
InputComponent: _GridFilterInputSingleSelect.GridFilterInputSingleSelect
|
|
26
25
|
}, {
|
|
27
26
|
value: 'not',
|
|
28
|
-
|
|
27
|
+
getApplyFilterFn: filterItem => {
|
|
29
28
|
if (filterItem.value == null || filterItem.value === '') {
|
|
30
29
|
return null;
|
|
31
30
|
}
|
|
@@ -34,7 +33,7 @@ const getGridSingleSelectOperators = () => (0, _utils2.convertLegacyOperators)([
|
|
|
34
33
|
InputComponent: _GridFilterInputSingleSelect.GridFilterInputSingleSelect
|
|
35
34
|
}, {
|
|
36
35
|
value: 'isAnyOf',
|
|
37
|
-
|
|
36
|
+
getApplyFilterFn: filterItem => {
|
|
38
37
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
@@ -42,5 +41,5 @@ const getGridSingleSelectOperators = () => (0, _utils2.convertLegacyOperators)([
|
|
|
42
41
|
return value => filterItemValues.includes(parseObjectValue(value));
|
|
43
42
|
},
|
|
44
43
|
InputComponent: _GridFilterInputMultipleSingleSelect.GridFilterInputMultipleSingleSelect
|
|
45
|
-
}]
|
|
44
|
+
}];
|
|
46
45
|
exports.getGridSingleSelectOperators = getGridSingleSelectOperators;
|
|
@@ -7,7 +7,6 @@ exports.GRID_STRING_COL_DEF = void 0;
|
|
|
7
7
|
var _GridEditInputCell = require("../components/cell/GridEditInputCell");
|
|
8
8
|
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
|
|
9
9
|
var _gridStringOperators = require("./gridStringOperators");
|
|
10
|
-
var _utils = require("./utils");
|
|
11
10
|
/**
|
|
12
11
|
* TODO: Move pro and premium properties outside of this Community file
|
|
13
12
|
*/
|
|
@@ -29,6 +28,5 @@ const GRID_STRING_COL_DEF = exports.GRID_STRING_COL_DEF = {
|
|
|
29
28
|
align: 'left',
|
|
30
29
|
filterOperators: (0, _gridStringOperators.getGridStringOperators)(),
|
|
31
30
|
renderEditCell: _GridEditInputCell.renderEditInputCell,
|
|
32
|
-
getApplyQuickFilterFn:
|
|
33
|
-
getApplyQuickFilterFnV7: _gridStringOperators.getGridStringQuickFilterFn
|
|
31
|
+
getApplyQuickFilterFn: _gridStringOperators.getGridStringQuickFilterFn
|
|
34
32
|
};
|
|
@@ -7,9 +7,8 @@ exports.getGridStringQuickFilterFn = exports.getGridStringOperators = void 0;
|
|
|
7
7
|
var _GridFilterInputValue = require("../components/panel/filterPanel/GridFilterInputValue");
|
|
8
8
|
var _utils = require("../utils/utils");
|
|
9
9
|
var _GridFilterInputMultipleValue = require("../components/panel/filterPanel/GridFilterInputMultipleValue");
|
|
10
|
-
var _utils2 = require("./utils");
|
|
11
10
|
var _gridFilterUtils = require("../hooks/features/filter/gridFilterUtils");
|
|
12
|
-
const getGridStringQuickFilterFn =
|
|
11
|
+
const getGridStringQuickFilterFn = value => {
|
|
13
12
|
if (!value) {
|
|
14
13
|
return null;
|
|
15
14
|
}
|
|
@@ -21,10 +20,11 @@ const getGridStringQuickFilterFn = exports.getGridStringQuickFilterFn = (0, _uti
|
|
|
21
20
|
}
|
|
22
21
|
return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
|
|
23
22
|
};
|
|
24
|
-
}
|
|
25
|
-
|
|
23
|
+
};
|
|
24
|
+
exports.getGridStringQuickFilterFn = getGridStringQuickFilterFn;
|
|
25
|
+
const getGridStringOperators = (disableTrim = false) => [{
|
|
26
26
|
value: 'contains',
|
|
27
|
-
|
|
27
|
+
getApplyFilterFn: filterItem => {
|
|
28
28
|
if (!filterItem.value) {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
@@ -37,7 +37,7 @@ const getGridStringOperators = (disableTrim = false) => (0, _utils2.convertLegac
|
|
|
37
37
|
InputComponent: _GridFilterInputValue.GridFilterInputValue
|
|
38
38
|
}, {
|
|
39
39
|
value: 'equals',
|
|
40
|
-
|
|
40
|
+
getApplyFilterFn: filterItem => {
|
|
41
41
|
if (!filterItem.value) {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
@@ -53,7 +53,7 @@ const getGridStringOperators = (disableTrim = false) => (0, _utils2.convertLegac
|
|
|
53
53
|
InputComponent: _GridFilterInputValue.GridFilterInputValue
|
|
54
54
|
}, {
|
|
55
55
|
value: 'startsWith',
|
|
56
|
-
|
|
56
|
+
getApplyFilterFn: filterItem => {
|
|
57
57
|
if (!filterItem.value) {
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
@@ -66,7 +66,7 @@ const getGridStringOperators = (disableTrim = false) => (0, _utils2.convertLegac
|
|
|
66
66
|
InputComponent: _GridFilterInputValue.GridFilterInputValue
|
|
67
67
|
}, {
|
|
68
68
|
value: 'endsWith',
|
|
69
|
-
|
|
69
|
+
getApplyFilterFn: filterItem => {
|
|
70
70
|
if (!filterItem.value) {
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
@@ -79,7 +79,7 @@ const getGridStringOperators = (disableTrim = false) => (0, _utils2.convertLegac
|
|
|
79
79
|
InputComponent: _GridFilterInputValue.GridFilterInputValue
|
|
80
80
|
}, {
|
|
81
81
|
value: 'isEmpty',
|
|
82
|
-
|
|
82
|
+
getApplyFilterFn: () => {
|
|
83
83
|
return value => {
|
|
84
84
|
return value === '' || value == null;
|
|
85
85
|
};
|
|
@@ -87,7 +87,7 @@ const getGridStringOperators = (disableTrim = false) => (0, _utils2.convertLegac
|
|
|
87
87
|
requiresFilterValue: false
|
|
88
88
|
}, {
|
|
89
89
|
value: 'isNotEmpty',
|
|
90
|
-
|
|
90
|
+
getApplyFilterFn: () => {
|
|
91
91
|
return value => {
|
|
92
92
|
return value !== '' && value != null;
|
|
93
93
|
};
|
|
@@ -95,7 +95,7 @@ const getGridStringOperators = (disableTrim = false) => (0, _utils2.convertLegac
|
|
|
95
95
|
requiresFilterValue: false
|
|
96
96
|
}, {
|
|
97
97
|
value: 'isAnyOf',
|
|
98
|
-
|
|
98
|
+
getApplyFilterFn: filterItem => {
|
|
99
99
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
100
100
|
return null;
|
|
101
101
|
}
|
|
@@ -109,5 +109,5 @@ const getGridStringOperators = (disableTrim = false) => (0, _utils2.convertLegac
|
|
|
109
109
|
}) : false;
|
|
110
110
|
},
|
|
111
111
|
InputComponent: _GridFilterInputMultipleValue.GridFilterInputMultipleValue
|
|
112
|
-
}]
|
|
112
|
+
}];
|
|
113
113
|
exports.getGridStringOperators = getGridStringOperators;
|
|
@@ -15,21 +15,21 @@ var _material = _interopRequireDefault(require("../material"));
|
|
|
15
15
|
// TODO: camelCase these key. It's a private helper now.
|
|
16
16
|
// Remove then need to call `uncapitalizeObjectKeys`.
|
|
17
17
|
const DATA_GRID_DEFAULT_SLOTS_COMPONENTS = exports.DATA_GRID_DEFAULT_SLOTS_COMPONENTS = (0, _extends2.default)({}, _material.default, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
cell: _GridCell.GridCellV7,
|
|
19
|
+
skeletonCell: _components.GridSkeletonCell,
|
|
20
|
+
columnHeaderFilterIconButton: _components.GridColumnHeaderFilterIconButton,
|
|
21
|
+
columnMenu: _GridColumnMenu.GridColumnMenu,
|
|
22
|
+
columnHeaders: _GridColumnHeaders.GridColumnHeaders,
|
|
23
|
+
footer: _components.GridFooter,
|
|
24
|
+
footerRowCount: _components.GridRowCount,
|
|
25
|
+
toolbar: null,
|
|
26
|
+
preferencesPanel: _components.GridPreferencesPanel,
|
|
27
|
+
loadingOverlay: _components.GridLoadingOverlay,
|
|
28
|
+
noResultsOverlay: _GridNoResultsOverlay.GridNoResultsOverlay,
|
|
29
|
+
noRowsOverlay: _components.GridNoRowsOverlay,
|
|
30
|
+
pagination: _components.GridPagination,
|
|
31
|
+
filterPanel: _components.GridFilterPanel,
|
|
32
|
+
columnsPanel: _components.GridColumnsPanel,
|
|
33
|
+
panel: _components.GridPanel,
|
|
34
|
+
row: _components.GridRow
|
|
35
35
|
});
|
|
@@ -127,12 +127,10 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
127
127
|
// the footer is always being placed at the bottom of the page as if all rows are exported
|
|
128
128
|
// so if getRowsToExport is being used to only export a subset of rows then we need to
|
|
129
129
|
// adjust the footer position to be correctly placed at the bottom of the grid
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
|
|
135
|
-
}
|
|
130
|
+
const gridFooterElement = gridClone.querySelector(`.${_gridClasses.gridClasses.footerContainer}`);
|
|
131
|
+
gridFooterElement.style.position = 'absolute';
|
|
132
|
+
gridFooterElement.style.width = '100%';
|
|
133
|
+
gridFooterElement.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
|
|
136
134
|
|
|
137
135
|
// printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
|
|
138
136
|
// prevents us to do it
|
|
@@ -235,9 +233,7 @@ const useGridPrintExport = (apiRef, props) => {
|
|
|
235
233
|
apiRef.current.forceUpdate();
|
|
236
234
|
}
|
|
237
235
|
await updateGridColumnsForPrint(options?.fields, options?.allColumns, options?.includeCheckboxes);
|
|
238
|
-
|
|
239
|
-
updateGridRowsForPrint(options.getRowsToExport);
|
|
240
|
-
}
|
|
236
|
+
updateGridRowsForPrint(options?.getRowsToExport ?? _utils2.defaultGetRowsToExport);
|
|
241
237
|
apiRef.current.unstable_setVirtualization(false);
|
|
242
238
|
await raf(); // wait for the state changes to take action
|
|
243
239
|
const printWindow = buildPrintWindow(options?.fileName);
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.sanitizeFilterModel = exports.removeDiacritics = exports.passFilterLogic = exports.mergeStateWithFilterModel = exports.cleanFilterItem = exports.buildAggregatedFilterApplier = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _models = require("../../../models");
|
|
10
|
-
var _utils = require("../../../colDef/utils");
|
|
11
10
|
var _gridFilterState = require("./gridFilterState");
|
|
12
11
|
var _warning = require("../../../utils/warning");
|
|
13
12
|
var _getPublicApiRef = require("../../../utils/getPublicApiRef");
|
|
@@ -118,42 +117,19 @@ const getFilterCallbackFromItem = (filterItem, apiRef) => {
|
|
|
118
117
|
if (!filterOperator) {
|
|
119
118
|
throw new Error(`MUI: No filter operator found for column '${column.field}' and operator value '${newFilterItem.operator}'.`);
|
|
120
119
|
}
|
|
121
|
-
const hasUserFunctionLegacy = !(0, _utils.isInternalFilter)(filterOperator.getApplyFilterFn);
|
|
122
|
-
const hasUserFunctionV7 = !(0, _utils.isInternalFilter)(filterOperator.getApplyFilterFnV7);
|
|
123
120
|
const publicApiRef = (0, _getPublicApiRef.getPublicApiRef)(apiRef);
|
|
124
|
-
if (filterOperator.getApplyFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
125
|
-
const applyFilterOnRow = filterOperator.getApplyFilterFnV7(newFilterItem, column);
|
|
126
|
-
if (typeof applyFilterOnRow !== 'function') {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
v7: true,
|
|
131
|
-
item: newFilterItem,
|
|
132
|
-
fn: row => {
|
|
133
|
-
let value = apiRef.current.getRowValue(row, column);
|
|
134
|
-
if (ignoreDiacritics) {
|
|
135
|
-
value = removeDiacritics(value);
|
|
136
|
-
}
|
|
137
|
-
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
121
|
const applyFilterOnRow = filterOperator.getApplyFilterFn(newFilterItem, column);
|
|
142
122
|
if (typeof applyFilterOnRow !== 'function') {
|
|
143
123
|
return null;
|
|
144
124
|
}
|
|
145
125
|
return {
|
|
146
|
-
v7: false,
|
|
147
126
|
item: newFilterItem,
|
|
148
|
-
fn:
|
|
149
|
-
|
|
150
|
-
_utils.GLOBAL_API_REF.current = publicApiRef;
|
|
127
|
+
fn: row => {
|
|
128
|
+
let value = apiRef.current.getRowValue(row, column);
|
|
151
129
|
if (ignoreDiacritics) {
|
|
152
|
-
|
|
130
|
+
value = removeDiacritics(value);
|
|
153
131
|
}
|
|
154
|
-
|
|
155
|
-
_utils.GLOBAL_API_REF.current = null;
|
|
156
|
-
return result;
|
|
132
|
+
return applyFilterOnRow(value, row, column, publicApiRef);
|
|
157
133
|
}
|
|
158
134
|
};
|
|
159
135
|
};
|
|
@@ -180,7 +156,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
180
156
|
for (let i = 0; i < appliers.length; i += 1) {
|
|
181
157
|
const applier = appliers[i];
|
|
182
158
|
if (!shouldApplyFilter || shouldApplyFilter(applier.item.field)) {
|
|
183
|
-
resultPerItemId[applier.item.id] = applier.
|
|
159
|
+
resultPerItemId[applier.item.id] = applier.fn(row);
|
|
184
160
|
}
|
|
185
161
|
}
|
|
186
162
|
return resultPerItemId;
|
|
@@ -196,7 +172,7 @@ const buildAggregatedFilterItemsApplier = (filterModel, apiRef, disableEval) =>
|
|
|
196
172
|
${appliers.map((applier, i) => `${JSON.stringify(String(applier.item.id))}:
|
|
197
173
|
!shouldApply${i} ?
|
|
198
174
|
false :
|
|
199
|
-
|
|
175
|
+
appliers[${i}].fn(row),
|
|
200
176
|
`).join('\n')}};
|
|
201
177
|
|
|
202
178
|
return result$$;
|
|
@@ -230,27 +206,12 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
230
206
|
columnFields.forEach(field => {
|
|
231
207
|
const column = apiRef.current.getColumn(field);
|
|
232
208
|
const getApplyQuickFilterFn = column?.getApplyQuickFilterFn;
|
|
233
|
-
|
|
234
|
-
const hasUserFunctionLegacy = !(0, _utils.isInternalFilter)(getApplyQuickFilterFn);
|
|
235
|
-
const hasUserFunctionV7 = !(0, _utils.isInternalFilter)(getApplyQuickFilterFnV7);
|
|
236
|
-
if (getApplyQuickFilterFnV7 && !(hasUserFunctionLegacy && !hasUserFunctionV7)) {
|
|
209
|
+
if (getApplyQuickFilterFn) {
|
|
237
210
|
appliersPerField.push({
|
|
238
211
|
column,
|
|
239
212
|
appliers: quickFilterValues.map(quickFilterValue => {
|
|
240
213
|
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
241
214
|
return {
|
|
242
|
-
v7: true,
|
|
243
|
-
fn: getApplyQuickFilterFnV7(value, column, publicApiRef)
|
|
244
|
-
};
|
|
245
|
-
})
|
|
246
|
-
});
|
|
247
|
-
} else if (getApplyQuickFilterFn) {
|
|
248
|
-
appliersPerField.push({
|
|
249
|
-
column,
|
|
250
|
-
appliers: quickFilterValues.map(quickFilterValue => {
|
|
251
|
-
const value = ignoreDiacritics ? removeDiacritics(quickFilterValue) : quickFilterValue;
|
|
252
|
-
return {
|
|
253
|
-
v7: false,
|
|
254
215
|
fn: getApplyQuickFilterFn(value, column, publicApiRef)
|
|
255
216
|
};
|
|
256
217
|
})
|
|
@@ -259,7 +220,6 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
259
220
|
});
|
|
260
221
|
return function isRowMatchingQuickFilter(row, shouldApplyFilter) {
|
|
261
222
|
const result = {};
|
|
262
|
-
const usedCellParams = {};
|
|
263
223
|
|
|
264
224
|
/* eslint-disable no-restricted-syntax, no-labels */
|
|
265
225
|
outer: for (let v = 0; v < quickFilterValues.length; v += 1) {
|
|
@@ -280,26 +240,13 @@ const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {
|
|
|
280
240
|
if (applier.fn === null) {
|
|
281
241
|
continue;
|
|
282
242
|
}
|
|
283
|
-
if (
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
continue outer;
|
|
291
|
-
}
|
|
292
|
-
} else {
|
|
293
|
-
const cellParams = usedCellParams[field] ?? apiRef.current.getCellParams(apiRef.current.getRowId(row), field);
|
|
294
|
-
if (ignoreDiacritics) {
|
|
295
|
-
cellParams.value = removeDiacritics(cellParams.value);
|
|
296
|
-
}
|
|
297
|
-
usedCellParams[field] = cellParams;
|
|
298
|
-
const isMatching = applier.fn(cellParams);
|
|
299
|
-
if (isMatching) {
|
|
300
|
-
result[filterValue] = true;
|
|
301
|
-
continue outer;
|
|
302
|
-
}
|
|
243
|
+
if (ignoreDiacritics) {
|
|
244
|
+
value = removeDiacritics(value);
|
|
245
|
+
}
|
|
246
|
+
const isMatching = applier.fn(value, row, column, publicApiRef);
|
|
247
|
+
if (isMatching) {
|
|
248
|
+
result[filterValue] = true;
|
|
249
|
+
continue outer;
|
|
303
250
|
}
|
|
304
251
|
}
|
|
305
252
|
result[filterValue] = false;
|
|
@@ -293,7 +293,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
293
293
|
});
|
|
294
294
|
|
|
295
295
|
// Removes potential remaining skeleton rows from the dataRowIds.
|
|
296
|
-
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]
|
|
296
|
+
const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');
|
|
297
297
|
apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;
|
|
298
298
|
apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;
|
|
299
299
|
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
package/node/index.js
CHANGED
package/node/internals/index.js
CHANGED
|
@@ -742,7 +742,7 @@ Object.keys(_useOnMount).forEach(function (key) {
|
|
|
742
742
|
});
|
|
743
743
|
});
|
|
744
744
|
var _csvSerializer = require("../hooks/features/export/serializers/csvSerializer");
|
|
745
|
-
var _utils3 = require("
|
|
745
|
+
var _utils3 = require("./utils");
|
|
746
746
|
Object.keys(_utils3).forEach(function (key) {
|
|
747
747
|
if (key === "default" || key === "__esModule") return;
|
|
748
748
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -753,16 +753,4 @@ Object.keys(_utils3).forEach(function (key) {
|
|
|
753
753
|
return _utils3[key];
|
|
754
754
|
}
|
|
755
755
|
});
|
|
756
|
-
});
|
|
757
|
-
var _utils4 = require("./utils");
|
|
758
|
-
Object.keys(_utils4).forEach(function (key) {
|
|
759
|
-
if (key === "default" || key === "__esModule") return;
|
|
760
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
761
|
-
if (key in exports && exports[key] === _utils4[key]) return;
|
|
762
|
-
Object.defineProperty(exports, key, {
|
|
763
|
-
enumerable: true,
|
|
764
|
-
get: function () {
|
|
765
|
-
return _utils4[key];
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
756
|
});
|
|
@@ -6,16 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.computeSlots = computeSlots;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _slotsMigration = require("./slotsMigration");
|
|
10
|
-
// TODO v7: Remove `components` and usages of `UncapitalizeObjectKeys` type
|
|
11
|
-
// after converting keys in Grid(Pro|Premium)SlotsComponent to camelCase.
|
|
12
|
-
// https://github.com/mui/mui-x/issues/7940
|
|
13
9
|
function computeSlots({
|
|
14
10
|
defaultSlots,
|
|
15
|
-
slots
|
|
16
|
-
components
|
|
11
|
+
slots
|
|
17
12
|
}) {
|
|
18
|
-
const overrides = slots
|
|
13
|
+
const overrides = slots;
|
|
19
14
|
if (!overrides || Object.keys(overrides).length === 0) {
|
|
20
15
|
return defaultSlots;
|
|
21
16
|
}
|
|
@@ -14,17 +14,6 @@ Object.keys(_computeSlots).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _slotsMigration = require("./slotsMigration");
|
|
18
|
-
Object.keys(_slotsMigration).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _slotsMigration[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _slotsMigration[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
17
|
var _useProps = require("./useProps");
|
|
29
18
|
Object.keys(_useProps).forEach(function (key) {
|
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useProps = useProps;
|
|
8
|
-
var
|
|
8
|
+
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
const _excluded = ["components", "componentsProps"];
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
/** Gathers props for the root element into a single `.forwardedProps` field */
|
|
@@ -31,11 +31,7 @@ function groupForwardedProps(props) {
|
|
|
31
31
|
}
|
|
32
32
|
function useProps(allProps) {
|
|
33
33
|
return React.useMemo(() => {
|
|
34
|
-
const {
|
|
35
|
-
|
|
36
|
-
componentsProps
|
|
37
|
-
} = allProps,
|
|
38
|
-
themedProps = (0, _objectWithoutPropertiesLoose2.default)(allProps, _excluded);
|
|
39
|
-
return [components, componentsProps, groupForwardedProps(themedProps)];
|
|
34
|
+
const themedProps = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(allProps), allProps));
|
|
35
|
+
return groupForwardedProps(themedProps);
|
|
40
36
|
}, [allProps]);
|
|
41
37
|
}
|
package/node/locales/csCZ.js
CHANGED
|
@@ -156,8 +156,8 @@ const csCZGrid = {
|
|
|
156
156
|
// Actions cell more text
|
|
157
157
|
actionsCellMore: 'více',
|
|
158
158
|
// Column pinning text
|
|
159
|
-
pinToLeft: 'Připnout
|
|
160
|
-
pinToRight: 'Připnout
|
|
159
|
+
pinToLeft: 'Připnout vlevo',
|
|
160
|
+
pinToRight: 'Připnout vpravo',
|
|
161
161
|
unpin: 'Odepnout',
|
|
162
162
|
// Tree Data
|
|
163
163
|
treeDataGroupingHeaderName: 'Skupina',
|
package/node/material/index.js
CHANGED
|
@@ -22,55 +22,55 @@ var _GridColumnUnsortedIcon = require("./icons/GridColumnUnsortedIcon");
|
|
|
22
22
|
var _icons = require("./icons");
|
|
23
23
|
var _MUISelectOption = _interopRequireDefault(require("./components/MUISelectOption"));
|
|
24
24
|
const iconSlots = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
25
|
+
booleanCellTrueIcon: _icons.GridCheckIcon,
|
|
26
|
+
booleanCellFalseIcon: _icons.GridCloseIcon,
|
|
27
|
+
columnMenuIcon: _icons.GridTripleDotsVerticalIcon,
|
|
28
|
+
openFilterButtonIcon: _icons.GridFilterListIcon,
|
|
29
|
+
filterPanelDeleteIcon: _icons.GridCloseIcon,
|
|
30
|
+
columnFilteredIcon: _icons.GridFilterAltIcon,
|
|
31
|
+
columnSelectorIcon: _icons.GridColumnIcon,
|
|
32
|
+
columnUnsortedIcon: _GridColumnUnsortedIcon.GridColumnUnsortedIcon,
|
|
33
|
+
columnSortedAscendingIcon: _icons.GridArrowUpwardIcon,
|
|
34
|
+
columnSortedDescendingIcon: _icons.GridArrowDownwardIcon,
|
|
35
|
+
columnResizeIcon: _icons.GridSeparatorIcon,
|
|
36
|
+
densityCompactIcon: _icons.GridViewHeadlineIcon,
|
|
37
|
+
densityStandardIcon: _icons.GridTableRowsIcon,
|
|
38
|
+
densityComfortableIcon: _icons.GridViewStreamIcon,
|
|
39
|
+
exportIcon: _icons.GridSaveAltIcon,
|
|
40
|
+
moreActionsIcon: _icons.GridMoreVertIcon,
|
|
41
|
+
treeDataCollapseIcon: _icons.GridExpandMoreIcon,
|
|
42
|
+
treeDataExpandIcon: _icons.GridKeyboardArrowRight,
|
|
43
|
+
groupingCriteriaCollapseIcon: _icons.GridExpandMoreIcon,
|
|
44
|
+
groupingCriteriaExpandIcon: _icons.GridKeyboardArrowRight,
|
|
45
|
+
detailPanelExpandIcon: _icons.GridAddIcon,
|
|
46
|
+
detailPanelCollapseIcon: _icons.GridRemoveIcon,
|
|
47
|
+
rowReorderIcon: _icons.GridDragIcon,
|
|
48
|
+
quickFilterIcon: _icons.GridSearchIcon,
|
|
49
|
+
quickFilterClearIcon: _icons.GridCloseIcon,
|
|
50
|
+
columnMenuHideIcon: _icons.GridVisibilityOffIcon,
|
|
51
|
+
columnMenuSortAscendingIcon: _icons.GridArrowUpwardIcon,
|
|
52
|
+
columnMenuSortDescendingIcon: _icons.GridArrowDownwardIcon,
|
|
53
|
+
columnMenuFilterIcon: _icons.GridFilterAltIcon,
|
|
54
|
+
columnMenuManageColumnsIcon: _icons.GridViewColumnIcon,
|
|
55
|
+
columnMenuClearIcon: _icons.GridClearIcon,
|
|
56
|
+
loadIcon: _icons.GridLoadIcon,
|
|
57
|
+
filterPanelAddIcon: _icons.GridAddIcon,
|
|
58
|
+
filterPanelRemoveAllIcon: _icons.GridDeleteForeverIcon,
|
|
59
|
+
columnReorderIcon: _icons.GridDragIcon
|
|
60
60
|
};
|
|
61
61
|
const materialSlots = (0, _extends2.default)({}, iconSlots, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
baseCheckbox: _Checkbox.default,
|
|
63
|
+
baseTextField: _TextField.default,
|
|
64
|
+
baseFormControl: _FormControl.default,
|
|
65
|
+
baseSelect: _Select.default,
|
|
66
|
+
baseSwitch: _Switch.default,
|
|
67
|
+
baseButton: _Button.default,
|
|
68
|
+
baseIconButton: _IconButton.default,
|
|
69
|
+
baseInputAdornment: _InputAdornment.default,
|
|
70
|
+
baseTooltip: _Tooltip.default,
|
|
71
|
+
basePopper: _Popper.default,
|
|
72
|
+
baseInputLabel: _InputLabel.default,
|
|
73
|
+
baseSelectOption: _MUISelectOption.default,
|
|
74
|
+
baseChip: _Chip.default
|
|
75
75
|
});
|
|
76
76
|
var _default = exports.default = materialSlots;
|
package/package.json
CHANGED
package/colDef/utils.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { GridApiCommunity } from '../models/api/gridApiCommunity';
|
|
3
|
-
import { GetApplyFilterFnV7, GetApplyFilterFnLegacy, GridFilterOperator } from '../models';
|
|
4
|
-
import { GetApplyQuickFilterFnV7, GetApplyQuickFilterFnLegacy } from '../models/colDef/gridColDef';
|
|
5
|
-
/**
|
|
6
|
-
* A global API ref, for v7-to-legacy converter
|
|
7
|
-
*/
|
|
8
|
-
export declare const GLOBAL_API_REF: {
|
|
9
|
-
current: React.MutableRefObject<GridApiCommunity> | null;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A tagger to determine if the filter is internal or custom user-supplied.
|
|
13
|
-
* To be a valid internal filter, the v7 function *must* be defined/redefined at
|
|
14
|
-
* the same time as the legacy one.
|
|
15
|
-
* https://github.com/mui/mui-x/pull/9254#discussion_r1231095551
|
|
16
|
-
*/
|
|
17
|
-
export declare function tagInternalFilter<T>(fn: T): T;
|
|
18
|
-
export declare function isInternalFilter(fn: Function | undefined): boolean;
|
|
19
|
-
export declare function convertFilterV7ToLegacy(fn: GetApplyFilterFnV7): GetApplyFilterFnLegacy;
|
|
20
|
-
export declare function convertLegacyOperators(ops: Omit<GridFilterOperator, 'getApplyFilterFn'>[]): GridFilterOperator[];
|
|
21
|
-
export declare function convertQuickFilterV7ToLegacy(fn: GetApplyQuickFilterFnV7): GetApplyQuickFilterFnLegacy<any, any, any>;
|