@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
package/modern/material/index.js
CHANGED
|
@@ -15,55 +15,55 @@ import { GridColumnUnsortedIcon } from './icons/GridColumnUnsortedIcon';
|
|
|
15
15
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from './icons';
|
|
16
16
|
import MUISelectOption from './components/MUISelectOption';
|
|
17
17
|
const iconSlots = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
18
|
+
booleanCellTrueIcon: GridCheckIcon,
|
|
19
|
+
booleanCellFalseIcon: GridCloseIcon,
|
|
20
|
+
columnMenuIcon: GridTripleDotsVerticalIcon,
|
|
21
|
+
openFilterButtonIcon: GridFilterListIcon,
|
|
22
|
+
filterPanelDeleteIcon: GridCloseIcon,
|
|
23
|
+
columnFilteredIcon: GridFilterAltIcon,
|
|
24
|
+
columnSelectorIcon: GridColumnIcon,
|
|
25
|
+
columnUnsortedIcon: GridColumnUnsortedIcon,
|
|
26
|
+
columnSortedAscendingIcon: GridArrowUpwardIcon,
|
|
27
|
+
columnSortedDescendingIcon: GridArrowDownwardIcon,
|
|
28
|
+
columnResizeIcon: GridSeparatorIcon,
|
|
29
|
+
densityCompactIcon: GridViewHeadlineIcon,
|
|
30
|
+
densityStandardIcon: GridTableRowsIcon,
|
|
31
|
+
densityComfortableIcon: GridViewStreamIcon,
|
|
32
|
+
exportIcon: GridSaveAltIcon,
|
|
33
|
+
moreActionsIcon: GridMoreVertIcon,
|
|
34
|
+
treeDataCollapseIcon: GridExpandMoreIcon,
|
|
35
|
+
treeDataExpandIcon: GridKeyboardArrowRight,
|
|
36
|
+
groupingCriteriaCollapseIcon: GridExpandMoreIcon,
|
|
37
|
+
groupingCriteriaExpandIcon: GridKeyboardArrowRight,
|
|
38
|
+
detailPanelExpandIcon: GridAddIcon,
|
|
39
|
+
detailPanelCollapseIcon: GridRemoveIcon,
|
|
40
|
+
rowReorderIcon: GridDragIcon,
|
|
41
|
+
quickFilterIcon: GridSearchIcon,
|
|
42
|
+
quickFilterClearIcon: GridCloseIcon,
|
|
43
|
+
columnMenuHideIcon: GridVisibilityOffIcon,
|
|
44
|
+
columnMenuSortAscendingIcon: GridArrowUpwardIcon,
|
|
45
|
+
columnMenuSortDescendingIcon: GridArrowDownwardIcon,
|
|
46
|
+
columnMenuFilterIcon: GridFilterAltIcon,
|
|
47
|
+
columnMenuManageColumnsIcon: GridViewColumnIcon,
|
|
48
|
+
columnMenuClearIcon: GridClearIcon,
|
|
49
|
+
loadIcon: GridLoadIcon,
|
|
50
|
+
filterPanelAddIcon: GridAddIcon,
|
|
51
|
+
filterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
52
|
+
columnReorderIcon: GridDragIcon
|
|
53
53
|
};
|
|
54
54
|
const materialSlots = _extends({}, iconSlots, {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
baseCheckbox: MUICheckbox,
|
|
56
|
+
baseTextField: MUITextField,
|
|
57
|
+
baseFormControl: MUIFormControl,
|
|
58
|
+
baseSelect: MUISelect,
|
|
59
|
+
baseSwitch: MUISwitch,
|
|
60
|
+
baseButton: MUIButton,
|
|
61
|
+
baseIconButton: MUIIconButton,
|
|
62
|
+
baseInputAdornment: MUIInputAdornment,
|
|
63
|
+
baseTooltip: MUITooltip,
|
|
64
|
+
basePopper: MUIPopper,
|
|
65
|
+
baseInputLabel: MUIInputLabel,
|
|
66
|
+
baseSelectOption: MUISelectOption,
|
|
67
|
+
baseChip: MUIChip
|
|
68
68
|
});
|
|
69
69
|
export default materialSlots;
|
|
@@ -133,16 +133,6 @@ DataGridRaw.propTypes = {
|
|
|
133
133
|
* If defined, the grid will ignore the `hide` property in [[GridColDef]].
|
|
134
134
|
*/
|
|
135
135
|
columnVisibilityModel: _propTypes.default.object,
|
|
136
|
-
/**
|
|
137
|
-
* Overridable components.
|
|
138
|
-
* @deprecated Use `slots` instead.
|
|
139
|
-
*/
|
|
140
|
-
components: _propTypes.default.object,
|
|
141
|
-
/**
|
|
142
|
-
* Overridable components props dynamically passed to the component at rendering.
|
|
143
|
-
* @deprecated Use the `slotProps` prop instead.
|
|
144
|
-
*/
|
|
145
|
-
componentsProps: _propTypes.default.object,
|
|
146
136
|
/**
|
|
147
137
|
* Set the density of the grid.
|
|
148
138
|
* @default "standard"
|
|
@@ -81,22 +81,20 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
|
|
|
81
81
|
clipboardCopyCellDelimiter: '\t',
|
|
82
82
|
rowPositionsDebounceMs: 166
|
|
83
83
|
};
|
|
84
|
-
const defaultSlots =
|
|
84
|
+
const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
85
85
|
const useDataGridProps = inProps => {
|
|
86
|
-
const
|
|
86
|
+
const themedProps = (0, _utils.useProps)((0, _styles.useThemeProps)({
|
|
87
87
|
props: inProps,
|
|
88
88
|
name: 'MuiDataGrid'
|
|
89
89
|
}));
|
|
90
90
|
const localeText = React.useMemo(() => (0, _extends2.default)({}, _constants.GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
91
91
|
const slots = React.useMemo(() => (0, _utils.computeSlots)({
|
|
92
92
|
defaultSlots,
|
|
93
|
-
slots: themedProps.slots
|
|
94
|
-
|
|
95
|
-
}), [components, themedProps.slots]);
|
|
93
|
+
slots: themedProps.slots
|
|
94
|
+
}), [themedProps.slots]);
|
|
96
95
|
return React.useMemo(() => (0, _extends2.default)({}, DATA_GRID_PROPS_DEFAULT_VALUES, themedProps, {
|
|
97
96
|
localeText,
|
|
98
|
-
slots
|
|
99
|
-
|
|
100
|
-
}, DATA_GRID_FORCED_PROPS), [themedProps, localeText, slots, componentsProps]);
|
|
97
|
+
slots
|
|
98
|
+
}, DATA_GRID_FORCED_PROPS), [themedProps, localeText, slots]);
|
|
101
99
|
};
|
|
102
100
|
exports.useDataGridProps = useDataGridProps;
|
|
@@ -21,6 +21,5 @@ const GRID_ACTIONS_COL_DEF = exports.GRID_ACTIONS_COL_DEF = (0, _extends2.defaul
|
|
|
21
21
|
disableColumnMenu: true,
|
|
22
22
|
disableExport: true,
|
|
23
23
|
renderCell: _GridActionsCell.renderActionsCell,
|
|
24
|
-
getApplyQuickFilterFn: undefined
|
|
25
|
-
getApplyQuickFilterFnV7: undefined
|
|
24
|
+
getApplyQuickFilterFn: undefined
|
|
26
25
|
});
|
|
@@ -43,7 +43,6 @@ const GRID_BOOLEAN_COL_DEF = exports.GRID_BOOLEAN_COL_DEF = (0, _extends2.defaul
|
|
|
43
43
|
valueFormatter: gridBooleanFormatter,
|
|
44
44
|
filterOperators: (0, _gridBooleanOperators.getGridBooleanOperators)(),
|
|
45
45
|
getApplyQuickFilterFn: undefined,
|
|
46
|
-
getApplyQuickFilterFnV7: undefined,
|
|
47
46
|
// @ts-ignore
|
|
48
47
|
aggregable: false,
|
|
49
48
|
// @ts-ignore
|
|
@@ -5,10 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getGridBooleanOperators = void 0;
|
|
7
7
|
var _GridFilterInputBoolean = require("../components/panel/filterPanel/GridFilterInputBoolean");
|
|
8
|
-
|
|
9
|
-
const getGridBooleanOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
8
|
+
const getGridBooleanOperators = () => [{
|
|
10
9
|
value: 'is',
|
|
11
|
-
|
|
10
|
+
getApplyFilterFn: filterItem => {
|
|
12
11
|
if (!filterItem.value) {
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
@@ -18,5 +17,5 @@ const getGridBooleanOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
18
17
|
};
|
|
19
18
|
},
|
|
20
19
|
InputComponent: _GridFilterInputBoolean.GridFilterInputBoolean
|
|
21
|
-
}]
|
|
20
|
+
}];
|
|
22
21
|
exports.getGridBooleanOperators = getGridBooleanOperators;
|
|
@@ -28,7 +28,6 @@ const GRID_CHECKBOX_SELECTION_COL_DEF = exports.GRID_CHECKBOX_SELECTION_COL_DEF
|
|
|
28
28
|
disableReorder: true,
|
|
29
29
|
disableExport: true,
|
|
30
30
|
getApplyQuickFilterFn: undefined,
|
|
31
|
-
getApplyQuickFilterFnV7: undefined,
|
|
32
31
|
valueGetter: params => {
|
|
33
32
|
const selectionLookup = (0, _gridRowSelectionSelector.selectedIdsLookupSelector)(params.api.state, params.api.instanceId);
|
|
34
33
|
return selectionLookup[params.id] !== undefined;
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getGridDateOperators = void 0;
|
|
7
7
|
var _GridFilterInputDate = require("../components/panel/filterPanel/GridFilterInputDate");
|
|
8
|
-
var _utils = require("./utils");
|
|
9
8
|
const dateRegex = /(\d+)-(\d+)-(\d+)/;
|
|
10
9
|
const dateTimeRegex = /(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;
|
|
11
10
|
function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
@@ -28,9 +27,9 @@ function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
|
28
27
|
return compareFn(timeToCompare, time);
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
|
-
const getGridDateOperators = showTime =>
|
|
30
|
+
const getGridDateOperators = showTime => [{
|
|
32
31
|
value: 'is',
|
|
33
|
-
|
|
32
|
+
getApplyFilterFn: filterItem => {
|
|
34
33
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 === value2, showTime);
|
|
35
34
|
},
|
|
36
35
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -39,7 +38,7 @@ const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
|
39
38
|
}
|
|
40
39
|
}, {
|
|
41
40
|
value: 'not',
|
|
42
|
-
|
|
41
|
+
getApplyFilterFn: filterItem => {
|
|
43
42
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 !== value2, showTime);
|
|
44
43
|
},
|
|
45
44
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -48,7 +47,7 @@ const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
|
48
47
|
}
|
|
49
48
|
}, {
|
|
50
49
|
value: 'after',
|
|
51
|
-
|
|
50
|
+
getApplyFilterFn: filterItem => {
|
|
52
51
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 > value2, showTime);
|
|
53
52
|
},
|
|
54
53
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -57,7 +56,7 @@ const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
|
57
56
|
}
|
|
58
57
|
}, {
|
|
59
58
|
value: 'onOrAfter',
|
|
60
|
-
|
|
59
|
+
getApplyFilterFn: filterItem => {
|
|
61
60
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 >= value2, showTime);
|
|
62
61
|
},
|
|
63
62
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -66,7 +65,7 @@ const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
|
66
65
|
}
|
|
67
66
|
}, {
|
|
68
67
|
value: 'before',
|
|
69
|
-
|
|
68
|
+
getApplyFilterFn: filterItem => {
|
|
70
69
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 < value2, showTime, !showTime);
|
|
71
70
|
},
|
|
72
71
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -75,7 +74,7 @@ const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
|
75
74
|
}
|
|
76
75
|
}, {
|
|
77
76
|
value: 'onOrBefore',
|
|
78
|
-
|
|
77
|
+
getApplyFilterFn: filterItem => {
|
|
79
78
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 <= value2, showTime);
|
|
80
79
|
},
|
|
81
80
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -84,7 +83,7 @@ const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
|
84
83
|
}
|
|
85
84
|
}, {
|
|
86
85
|
value: 'isEmpty',
|
|
87
|
-
|
|
86
|
+
getApplyFilterFn: () => {
|
|
88
87
|
return value => {
|
|
89
88
|
return value == null;
|
|
90
89
|
};
|
|
@@ -92,11 +91,11 @@ const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
|
92
91
|
requiresFilterValue: false
|
|
93
92
|
}, {
|
|
94
93
|
value: 'isNotEmpty',
|
|
95
|
-
|
|
94
|
+
getApplyFilterFn: () => {
|
|
96
95
|
return value => {
|
|
97
96
|
return value != null;
|
|
98
97
|
};
|
|
99
98
|
},
|
|
100
99
|
requiresFilterValue: false
|
|
101
|
-
}]
|
|
100
|
+
}];
|
|
102
101
|
exports.getGridDateOperators = getGridDateOperators;
|
|
@@ -10,7 +10,6 @@ var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
|
|
|
10
10
|
var _utils = require("../utils/utils");
|
|
11
11
|
var _gridNumericOperators = require("./gridNumericOperators");
|
|
12
12
|
var _gridStringColDef = require("./gridStringColDef");
|
|
13
|
-
var _utils2 = require("./utils");
|
|
14
13
|
const GRID_NUMERIC_COL_DEF = exports.GRID_NUMERIC_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
|
|
15
14
|
type: 'number',
|
|
16
15
|
align: 'right',
|
|
@@ -21,6 +20,5 @@ const GRID_NUMERIC_COL_DEF = exports.GRID_NUMERIC_COL_DEF = (0, _extends2.defaul
|
|
|
21
20
|
value
|
|
22
21
|
}) => (0, _utils.isNumber)(value) ? value.toLocaleString() : value || '',
|
|
23
22
|
filterOperators: (0, _gridNumericOperators.getGridNumericOperators)(),
|
|
24
|
-
getApplyQuickFilterFn:
|
|
25
|
-
getApplyQuickFilterFnV7: _gridNumericOperators.getGridNumericQuickFilterFn
|
|
23
|
+
getApplyQuickFilterFn: _gridNumericOperators.getGridNumericQuickFilterFn
|
|
26
24
|
});
|
|
@@ -6,24 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getGridNumericQuickFilterFn = exports.getGridNumericOperators = void 0;
|
|
7
7
|
var _GridFilterInputValue = require("../components/panel/filterPanel/GridFilterInputValue");
|
|
8
8
|
var _GridFilterInputMultipleValue = require("../components/panel/filterPanel/GridFilterInputMultipleValue");
|
|
9
|
-
var _utils = require("./utils");
|
|
10
9
|
const parseNumericValue = value => {
|
|
11
10
|
if (value == null) {
|
|
12
11
|
return null;
|
|
13
12
|
}
|
|
14
13
|
return Number(value);
|
|
15
14
|
};
|
|
16
|
-
const getGridNumericQuickFilterFn =
|
|
15
|
+
const getGridNumericQuickFilterFn = value => {
|
|
17
16
|
if (value == null || Number.isNaN(value) || value === '') {
|
|
18
17
|
return null;
|
|
19
18
|
}
|
|
20
19
|
return columnValue => {
|
|
21
20
|
return parseNumericValue(columnValue) === parseNumericValue(value);
|
|
22
21
|
};
|
|
23
|
-
}
|
|
24
|
-
|
|
22
|
+
};
|
|
23
|
+
exports.getGridNumericQuickFilterFn = getGridNumericQuickFilterFn;
|
|
24
|
+
const getGridNumericOperators = () => [{
|
|
25
25
|
value: '=',
|
|
26
|
-
|
|
26
|
+
getApplyFilterFn: filterItem => {
|
|
27
27
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
@@ -37,7 +37,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
37
37
|
}
|
|
38
38
|
}, {
|
|
39
39
|
value: '!=',
|
|
40
|
-
|
|
40
|
+
getApplyFilterFn: filterItem => {
|
|
41
41
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
@@ -51,7 +51,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
51
51
|
}
|
|
52
52
|
}, {
|
|
53
53
|
value: '>',
|
|
54
|
-
|
|
54
|
+
getApplyFilterFn: filterItem => {
|
|
55
55
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
@@ -68,7 +68,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
68
68
|
}
|
|
69
69
|
}, {
|
|
70
70
|
value: '>=',
|
|
71
|
-
|
|
71
|
+
getApplyFilterFn: filterItem => {
|
|
72
72
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
@@ -85,7 +85,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
85
85
|
}
|
|
86
86
|
}, {
|
|
87
87
|
value: '<',
|
|
88
|
-
|
|
88
|
+
getApplyFilterFn: filterItem => {
|
|
89
89
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
@@ -102,7 +102,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
102
102
|
}
|
|
103
103
|
}, {
|
|
104
104
|
value: '<=',
|
|
105
|
-
|
|
105
|
+
getApplyFilterFn: filterItem => {
|
|
106
106
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
107
107
|
return null;
|
|
108
108
|
}
|
|
@@ -119,7 +119,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
119
119
|
}
|
|
120
120
|
}, {
|
|
121
121
|
value: 'isEmpty',
|
|
122
|
-
|
|
122
|
+
getApplyFilterFn: () => {
|
|
123
123
|
return value => {
|
|
124
124
|
return value == null;
|
|
125
125
|
};
|
|
@@ -127,7 +127,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
127
127
|
requiresFilterValue: false
|
|
128
128
|
}, {
|
|
129
129
|
value: 'isNotEmpty',
|
|
130
|
-
|
|
130
|
+
getApplyFilterFn: () => {
|
|
131
131
|
return value => {
|
|
132
132
|
return value != null;
|
|
133
133
|
};
|
|
@@ -135,7 +135,7 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
135
135
|
requiresFilterValue: false
|
|
136
136
|
}, {
|
|
137
137
|
value: 'isAnyOf',
|
|
138
|
-
|
|
138
|
+
getApplyFilterFn: filterItem => {
|
|
139
139
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
140
140
|
return null;
|
|
141
141
|
}
|
|
@@ -147,5 +147,5 @@ const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
|
147
147
|
InputComponentProps: {
|
|
148
148
|
type: 'number'
|
|
149
149
|
}
|
|
150
|
-
}]
|
|
150
|
+
}];
|
|
151
151
|
exports.getGridNumericOperators = getGridNumericOperators;
|
|
@@ -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;
|
|
@@ -136,5 +136,7 @@ process.env.NODE_ENV !== "production" ? GridToolbarFilterButton.propTypes = {
|
|
|
136
136
|
* The props used for each slot inside.
|
|
137
137
|
* @default {}
|
|
138
138
|
*/
|
|
139
|
-
componentsProps: _propTypes.default.
|
|
139
|
+
componentsProps: _propTypes.default.shape({
|
|
140
|
+
button: _propTypes.default.object
|
|
141
|
+
})
|
|
140
142
|
} : void 0;
|
|
@@ -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);
|