@mui/x-data-grid 7.0.0-alpha.1 → 7.0.0-alpha.3
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 +607 -188
- package/DataGrid/DataGrid.d.ts +0 -10
- package/DataGrid/DataGrid.js +11 -23
- package/DataGrid/useDataGridProps.js +1 -1
- package/README.md +0 -1
- package/components/GridHeader.js +3 -2
- package/components/GridPagination.d.ts +2 -2
- package/components/GridRow.js +2 -4
- package/components/cell/GridCell.js +3 -3
- package/components/cell/GridEditDateCell.js +1 -20
- package/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/components/panel/index.d.ts +0 -1
- package/components/panel/index.js +0 -1
- package/constants/defaultGridSlotsComponents.js +1 -2
- package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +8 -21
- package/hooks/features/editing/useGridRowEditing.js +7 -21
- package/hooks/features/export/useGridCsvExport.d.ts +1 -1
- package/hooks/features/export/useGridCsvExport.js +1 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +1 -0
- package/hooks/features/filter/gridFilterUtils.js +7 -4
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/hooks/features/sorting/useGridSorting.js +6 -5
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +11 -23
- package/legacy/DataGrid/useDataGridProps.js +1 -1
- package/legacy/colDef/gridDefaultColumnTypes.js +2 -3
- package/legacy/components/GridHeader.js +3 -2
- package/legacy/components/GridPagination.js +3 -4
- package/legacy/components/GridRow.js +2 -4
- package/legacy/components/cell/GridCell.js +3 -3
- package/legacy/components/cell/GridEditDateCell.js +1 -20
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +4 -5
- package/legacy/components/containers/GridRootStyles.js +69 -70
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/legacy/components/panel/index.js +0 -1
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +4 -5
- package/legacy/constants/defaultGridSlotsComponents.js +1 -2
- package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/legacy/hooks/features/editing/useGridCellEditing.js +8 -21
- package/legacy/hooks/features/editing/useGridRowEditing.js +7 -23
- package/legacy/hooks/features/export/useGridCsvExport.js +1 -1
- package/legacy/hooks/features/filter/gridFilterUtils.js +7 -4
- package/legacy/hooks/features/filter/useGridFilter.js +2 -2
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/legacy/hooks/features/sorting/useGridSorting.js +6 -5
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/locales/arSD.js +1 -1
- package/legacy/locales/bgBG.js +33 -37
- package/legacy/locales/heIL.js +1 -2
- package/legacy/models/params/gridEditCellParams.js +1 -0
- package/legacy/utils/domUtils.js +10 -15
- package/locales/arSD.js +1 -1
- package/locales/bgBG.js +33 -37
- package/locales/heIL.js +1 -2
- package/models/api/gridEditingApi.d.ts +2 -4
- package/models/api/gridSortApi.d.ts +2 -2
- package/models/gridFilterModel.d.ts +2 -2
- package/models/gridSlotsComponent.d.ts +0 -5
- package/models/gridSlotsComponentsProps.d.ts +0 -3
- package/models/params/gridEditCellParams.d.ts +3 -1
- package/models/params/gridEditCellParams.js +1 -0
- package/models/params/gridRowParams.d.ts +1 -0
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +11 -23
- package/modern/DataGrid/useDataGridProps.js +1 -1
- package/modern/components/GridHeader.js +2 -1
- package/modern/components/GridRow.js +2 -4
- package/modern/components/cell/GridCell.js +2 -2
- package/modern/components/cell/GridEditDateCell.js +1 -20
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/modern/components/panel/index.js +0 -1
- package/modern/constants/defaultGridSlotsComponents.js +1 -2
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +8 -21
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -21
- package/modern/hooks/features/export/useGridCsvExport.js +1 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +4 -2
- package/modern/hooks/features/filter/useGridFilter.js +2 -2
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/modern/hooks/features/sorting/useGridSorting.js +6 -5
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/arSD.js +1 -1
- package/modern/locales/bgBG.js +33 -37
- package/modern/locales/heIL.js +1 -2
- package/modern/models/params/gridEditCellParams.js +1 -0
- package/modern/utils/domUtils.js +10 -15
- package/node/DataGrid/DataGrid.js +11 -23
- package/node/DataGrid/useDataGridProps.js +1 -1
- package/node/components/GridHeader.js +2 -1
- package/node/components/GridRow.js +1 -3
- package/node/components/cell/GridCell.js +2 -2
- package/node/components/cell/GridEditDateCell.js +1 -20
- package/node/components/columnHeaders/GridColumnGroupHeader.js +2 -1
- package/node/components/columnHeaders/GridColumnHeaderItem.js +2 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/node/components/panel/filterPanel/GridFilterForm.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/node/components/panel/index.js +0 -11
- package/node/constants/defaultGridSlotsComponents.js +0 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/editing/useGridCellEditing.js +7 -20
- package/node/hooks/features/editing/useGridRowEditing.js +6 -20
- package/node/hooks/features/export/useGridCsvExport.js +1 -1
- package/node/hooks/features/filter/gridFilterUtils.js +6 -3
- package/node/hooks/features/filter/useGridFilter.js +1 -1
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -1
- package/node/hooks/features/sorting/useGridSorting.js +6 -5
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/locales/arSD.js +1 -1
- package/node/locales/bgBG.js +33 -37
- package/node/locales/heIL.js +1 -2
- package/node/models/params/gridEditCellParams.js +1 -0
- package/node/utils/domUtils.js +11 -18
- package/package.json +6 -5
- package/utils/domUtils.d.ts +2 -3
- package/utils/domUtils.js +10 -15
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
-
var _columnHeaderStyles;
|
|
4
3
|
import { alpha, styled, darken, lighten } from '@mui/material/styles';
|
|
5
4
|
import { gridClasses } from '../../constants/gridClasses';
|
|
6
5
|
function getBorderColor(theme) {
|
|
@@ -16,13 +15,13 @@ var columnHeadersStyles = _defineProperty({}, ".".concat(gridClasses.columnSepar
|
|
|
16
15
|
visibility: 'visible',
|
|
17
16
|
width: 'auto'
|
|
18
17
|
});
|
|
19
|
-
var columnHeaderStyles = (
|
|
18
|
+
var columnHeaderStyles = _defineProperty(_defineProperty({}, "& .".concat(gridClasses.iconButtonContainer), {
|
|
20
19
|
visibility: 'visible',
|
|
21
20
|
width: 'auto'
|
|
22
|
-
}),
|
|
21
|
+
}), "& .".concat(gridClasses.menuIcon), {
|
|
23
22
|
width: 'auto',
|
|
24
23
|
visibility: 'visible'
|
|
25
|
-
})
|
|
24
|
+
});
|
|
26
25
|
export var GridRootStyles = styled('div', {
|
|
27
26
|
name: 'MuiDataGrid',
|
|
28
27
|
slot: 'Root',
|
|
@@ -31,7 +30,7 @@ export var GridRootStyles = styled('div', {
|
|
|
31
30
|
_defineProperty({}, "& .".concat(gridClasses['cell--withRenderer']), styles['cell--withRenderer']), _defineProperty({}, "& .".concat(gridClasses.cell), styles.cell), _defineProperty({}, "& .".concat(gridClasses['cell--rangeTop']), styles['cell--rangeTop']), _defineProperty({}, "& .".concat(gridClasses['cell--rangeBottom']), styles['cell--rangeBottom']), _defineProperty({}, "& .".concat(gridClasses['cell--rangeLeft']), styles['cell--rangeLeft']), _defineProperty({}, "& .".concat(gridClasses['cell--rangeRight']), styles['cell--rangeRight']), _defineProperty({}, "& .".concat(gridClasses['cell--withRightBorder']), styles['cell--withRightBorder']), _defineProperty({}, "& .".concat(gridClasses.cellContent), styles.cellContent), _defineProperty({}, "& .".concat(gridClasses.cellCheckbox), styles.cellCheckbox), _defineProperty({}, "& .".concat(gridClasses.cellSkeleton), styles.cellSkeleton), _defineProperty({}, "& .".concat(gridClasses.checkboxInput), styles.checkboxInput), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignCenter']), styles['columnHeader--alignCenter']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignLeft']), styles['columnHeader--alignLeft']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--alignRight']), styles['columnHeader--alignRight']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--dragging']), styles['columnHeader--dragging']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--moving']), styles['columnHeader--moving']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--numeric']), styles['columnHeader--numeric']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--sortable']), styles['columnHeader--sortable']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--sorted']), styles['columnHeader--sorted']), _defineProperty({}, "& .".concat(gridClasses['columnHeader--withRightBorder']), styles['columnHeader--withRightBorder']), _defineProperty({}, "& .".concat(gridClasses.columnHeader), styles.columnHeader), _defineProperty({}, "& .".concat(gridClasses.headerFilterRow), styles.headerFilterRow), _defineProperty({}, "& .".concat(gridClasses.columnHeaderCheckbox), styles.columnHeaderCheckbox), _defineProperty({}, "& .".concat(gridClasses.columnHeaderDraggableContainer), styles.columnHeaderDraggableContainer), _defineProperty({}, "& .".concat(gridClasses.columnHeaderTitleContainer), styles.columnHeaderTitleContainer), _defineProperty({}, "& .".concat(gridClasses['columnSeparator--resizable']), styles['columnSeparator--resizable']), _defineProperty({}, "& .".concat(gridClasses['columnSeparator--resizing']), styles['columnSeparator--resizing']), _defineProperty({}, "& .".concat(gridClasses.columnSeparator), styles.columnSeparator), _defineProperty({}, "& .".concat(gridClasses.filterIcon), styles.filterIcon), _defineProperty({}, "& .".concat(gridClasses.iconSeparator), styles.iconSeparator), _defineProperty({}, "& .".concat(gridClasses.menuIcon), styles.menuIcon), _defineProperty({}, "& .".concat(gridClasses.menuIconButton), styles.menuIconButton), _defineProperty({}, "& .".concat(gridClasses.menuOpen), styles.menuOpen), _defineProperty({}, "& .".concat(gridClasses.menuList), styles.menuList), _defineProperty({}, "& .".concat(gridClasses['row--editable']), styles['row--editable']), _defineProperty({}, "& .".concat(gridClasses['row--editing']), styles['row--editing']), _defineProperty({}, "& .".concat(gridClasses['row--dragging']), styles['row--dragging']), _defineProperty({}, "& .".concat(gridClasses.row), styles.row), _defineProperty({}, "& .".concat(gridClasses.rowReorderCellPlaceholder), styles.rowReorderCellPlaceholder), _defineProperty({}, "& .".concat(gridClasses.rowReorderCell), styles.rowReorderCell), _defineProperty({}, "& .".concat(gridClasses['rowReorderCell--draggable']), styles['rowReorderCell--draggable']), _defineProperty({}, "& .".concat(gridClasses.sortIcon), styles.sortIcon), _defineProperty({}, "& .".concat(gridClasses.withBorderColor), styles.withBorderColor), _defineProperty({}, "& .".concat(gridClasses.treeDataGroupingCell), styles.treeDataGroupingCell), _defineProperty({}, "& .".concat(gridClasses.treeDataGroupingCellToggle), styles.treeDataGroupingCellToggle), _defineProperty({}, "& .".concat(gridClasses.detailPanelToggleCell), styles.detailPanelToggleCell), _defineProperty({}, "& .".concat(gridClasses['detailPanelToggleCell--expanded']), styles['detailPanelToggleCell--expanded']), styles.root];
|
|
32
31
|
}
|
|
33
32
|
})(function (_ref61) {
|
|
34
|
-
var
|
|
33
|
+
var _extends2;
|
|
35
34
|
var theme = _ref61.theme;
|
|
36
35
|
var borderColor = getBorderColor(theme);
|
|
37
36
|
var radius = theme.shape.borderRadius;
|
|
@@ -57,45 +56,45 @@ export var GridRootStyles = styled('div', {
|
|
|
57
56
|
minHeight: 0,
|
|
58
57
|
flexDirection: 'column',
|
|
59
58
|
overflowAnchor: 'none'
|
|
60
|
-
}, _defineProperty(_extends2, "&.".concat(gridClasses.autoHeight), _defineProperty({
|
|
59
|
+
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extends2, "&.".concat(gridClasses.autoHeight), _defineProperty({
|
|
61
60
|
height: 'auto'
|
|
62
61
|
}, "& .".concat(gridClasses['row--lastVisible'], " .").concat(gridClasses.cell), {
|
|
63
62
|
borderBottomColor: 'transparent'
|
|
64
|
-
})),
|
|
63
|
+
})), "&.".concat(gridClasses.autosizing), _defineProperty(_defineProperty({}, "& .".concat(gridClasses.columnHeaderTitleContainerContent, " > *"), {
|
|
65
64
|
overflow: 'visible !important'
|
|
66
|
-
}),
|
|
65
|
+
}), "& .".concat(gridClasses.cell, " > *"), {
|
|
67
66
|
overflow: 'visible !important',
|
|
68
67
|
whiteSpace: 'nowrap'
|
|
69
|
-
})
|
|
68
|
+
})), "& .".concat(gridClasses['virtualScrollerContent--overflowed'], " .").concat(gridClasses['row--lastVisible'], " .").concat(gridClasses.cell), {
|
|
70
69
|
borderBottomColor: 'transparent'
|
|
71
|
-
}),
|
|
70
|
+
}), "& .".concat(gridClasses.columnHeader, ", & .").concat(gridClasses.cell), {
|
|
72
71
|
WebkitTapHighlightColor: 'transparent',
|
|
73
72
|
lineHeight: null,
|
|
74
73
|
padding: '0 10px',
|
|
75
74
|
boxSizing: 'border-box'
|
|
76
|
-
}),
|
|
75
|
+
}), "& .".concat(gridClasses.columnHeader, ":focus-within, & .").concat(gridClasses.cell, ":focus-within"), {
|
|
77
76
|
outline: "solid ".concat(theme.vars ? "rgba(".concat(theme.vars.palette.primary.mainChannel, " / 0.5)") : alpha(theme.palette.primary.main, 0.5), " 1px"),
|
|
78
77
|
outlineWidth: 1,
|
|
79
78
|
outlineOffset: -1
|
|
80
|
-
}),
|
|
79
|
+
}), "& .".concat(gridClasses.columnHeader, ":focus, & .").concat(gridClasses.cell, ":focus"), {
|
|
81
80
|
outline: "solid ".concat(theme.palette.primary.main, " 1px")
|
|
82
|
-
}),
|
|
81
|
+
}), "& .".concat(gridClasses.columnHeaderCheckbox, ", & .").concat(gridClasses.cellCheckbox), {
|
|
83
82
|
padding: 0,
|
|
84
83
|
justifyContent: 'center',
|
|
85
84
|
alignItems: 'center'
|
|
86
|
-
}),
|
|
85
|
+
}), "& .".concat(gridClasses.columnHeader), {
|
|
87
86
|
position: 'relative',
|
|
88
87
|
display: 'flex',
|
|
89
88
|
alignItems: 'center'
|
|
90
|
-
}),
|
|
89
|
+
}), "& .".concat(gridClasses['columnHeader--sorted'], " .").concat(gridClasses.iconButtonContainer, ", & .").concat(gridClasses['columnHeader--filtered'], " .").concat(gridClasses.iconButtonContainer), {
|
|
91
90
|
visibility: 'visible',
|
|
92
91
|
width: 'auto'
|
|
93
|
-
}),
|
|
92
|
+
}), "& .".concat(gridClasses.columnHeader, ":not(.").concat(gridClasses['columnHeader--sorted'], ") .").concat(gridClasses.sortIcon), {
|
|
94
93
|
opacity: 0,
|
|
95
94
|
transition: theme.transitions.create(['opacity'], {
|
|
96
95
|
duration: theme.transitions.duration.shorter
|
|
97
96
|
})
|
|
98
|
-
}), _defineProperty(_extends2, "& .".concat(gridClasses.columnHeaderTitleContainer), {
|
|
97
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extends2, "& .".concat(gridClasses.columnHeaderTitleContainer), {
|
|
99
98
|
display: 'flex',
|
|
100
99
|
alignItems: 'center',
|
|
101
100
|
minWidth: 0,
|
|
@@ -104,39 +103,39 @@ export var GridRootStyles = styled('div', {
|
|
|
104
103
|
overflow: 'hidden',
|
|
105
104
|
// to anchor the aggregation label
|
|
106
105
|
position: 'relative'
|
|
107
|
-
}),
|
|
106
|
+
}), "& .".concat(gridClasses.columnHeaderTitleContainerContent), {
|
|
108
107
|
overflow: 'hidden',
|
|
109
108
|
display: 'flex',
|
|
110
109
|
alignItems: 'center'
|
|
111
|
-
}),
|
|
110
|
+
}), "& .".concat(gridClasses['columnHeader--filledGroup'], " .").concat(gridClasses.columnHeaderTitleContainer), {
|
|
112
111
|
borderBottomWidth: '1px',
|
|
113
112
|
borderBottomStyle: 'solid',
|
|
114
113
|
boxSizing: 'border-box'
|
|
115
|
-
}),
|
|
114
|
+
}), "& .".concat(gridClasses['columnHeader--filledGroup'], ".").concat(gridClasses['columnHeader--showColumnBorder'], " .").concat(gridClasses.columnHeaderTitleContainer), {
|
|
116
115
|
borderBottom: "none"
|
|
117
|
-
}),
|
|
116
|
+
}), "& .".concat(gridClasses['columnHeader--filledGroup'], ".").concat(gridClasses['columnHeader--showColumnBorder']), {
|
|
118
117
|
borderBottomWidth: '1px',
|
|
119
118
|
borderBottomStyle: 'solid',
|
|
120
119
|
boxSizing: 'border-box'
|
|
121
|
-
}),
|
|
120
|
+
}), "& .".concat(gridClasses.headerFilterRow), {
|
|
122
121
|
borderTop: "1px solid ".concat(borderColor)
|
|
123
|
-
}),
|
|
122
|
+
}), "& .".concat(gridClasses.sortIcon, ", & .").concat(gridClasses.filterIcon), {
|
|
124
123
|
fontSize: 'inherit'
|
|
125
|
-
}),
|
|
124
|
+
}), "& .".concat(gridClasses['columnHeader--sortable']), {
|
|
126
125
|
cursor: 'pointer'
|
|
127
|
-
}),
|
|
126
|
+
}), "& .".concat(gridClasses['columnHeader--alignCenter'], " .").concat(gridClasses.columnHeaderTitleContainer), {
|
|
128
127
|
justifyContent: 'center'
|
|
129
|
-
}),
|
|
128
|
+
}), "& .".concat(gridClasses['columnHeader--alignRight'], " .").concat(gridClasses.columnHeaderDraggableContainer, ", & .").concat(gridClasses['columnHeader--alignRight'], " .").concat(gridClasses.columnHeaderTitleContainer), {
|
|
130
129
|
flexDirection: 'row-reverse'
|
|
131
|
-
}), _defineProperty(_extends2, "& .".concat(gridClasses['columnHeader--alignCenter'], " .").concat(gridClasses.menuIcon, ", & .").concat(gridClasses['columnHeader--alignRight'], " .").concat(gridClasses.menuIcon), {
|
|
130
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extends2, "& .".concat(gridClasses['columnHeader--alignCenter'], " .").concat(gridClasses.menuIcon, ", & .").concat(gridClasses['columnHeader--alignRight'], " .").concat(gridClasses.menuIcon), {
|
|
132
131
|
marginRight: 'auto',
|
|
133
132
|
marginLeft: -6
|
|
134
|
-
}),
|
|
133
|
+
}), "& .".concat(gridClasses['columnHeader--alignRight'], " .").concat(gridClasses.menuIcon, ", & .").concat(gridClasses['columnHeader--alignRight'], " .").concat(gridClasses.menuIcon), {
|
|
135
134
|
marginRight: 'auto',
|
|
136
135
|
marginLeft: -10
|
|
137
|
-
}),
|
|
136
|
+
}), "& .".concat(gridClasses['columnHeader--moving']), {
|
|
138
137
|
backgroundColor: (theme.vars || theme).palette.action.hover
|
|
139
|
-
}),
|
|
138
|
+
}), "& .".concat(gridClasses.columnSeparator), {
|
|
140
139
|
visibility: 'hidden',
|
|
141
140
|
position: 'absolute',
|
|
142
141
|
zIndex: 100,
|
|
@@ -144,13 +143,13 @@ export var GridRootStyles = styled('div', {
|
|
|
144
143
|
flexDirection: 'column',
|
|
145
144
|
justifyContent: 'center',
|
|
146
145
|
color: borderColor
|
|
147
|
-
}),
|
|
146
|
+
}), '@media (hover: hover)', _defineProperty(_defineProperty(_defineProperty({}, "& .".concat(gridClasses.columnHeaders, ":hover"), columnHeadersStyles), "& .".concat(gridClasses.columnHeader, ":hover"), columnHeaderStyles), "& .".concat(gridClasses.columnHeader, ":not(.").concat(gridClasses['columnHeader--sorted'], "):hover .").concat(gridClasses.sortIcon), {
|
|
148
147
|
opacity: 0.5
|
|
149
|
-
})
|
|
148
|
+
})), '@media (hover: none)', _defineProperty(_defineProperty({}, "& .".concat(gridClasses.columnHeaders), columnHeadersStyles), "& .".concat(gridClasses.columnHeader), columnHeaderStyles)), "& .".concat(gridClasses['columnSeparator--sideLeft']), {
|
|
150
149
|
left: -12
|
|
151
|
-
}),
|
|
150
|
+
}), "& .".concat(gridClasses['columnSeparator--sideRight']), {
|
|
152
151
|
right: -12
|
|
153
|
-
}),
|
|
152
|
+
}), "& .".concat(gridClasses['columnSeparator--resizable']), _defineProperty(_defineProperty({
|
|
154
153
|
cursor: 'col-resize',
|
|
155
154
|
touchAction: 'none',
|
|
156
155
|
'&:hover': {
|
|
@@ -160,23 +159,23 @@ export var GridRootStyles = styled('div', {
|
|
|
160
159
|
color: borderColor
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
|
-
},
|
|
162
|
+
}, "&.".concat(gridClasses['columnSeparator--resizing']), {
|
|
164
163
|
color: (theme.vars || theme).palette.text.primary
|
|
165
|
-
}),
|
|
164
|
+
}), '& svg', {
|
|
166
165
|
pointerEvents: 'none'
|
|
167
|
-
})
|
|
166
|
+
})), "& .".concat(gridClasses.iconSeparator), {
|
|
168
167
|
color: 'inherit'
|
|
169
|
-
}), _defineProperty(_extends2, "& .".concat(gridClasses.menuIcon), {
|
|
168
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extends2, "& .".concat(gridClasses.menuIcon), {
|
|
170
169
|
width: 0,
|
|
171
170
|
visibility: 'hidden',
|
|
172
171
|
fontSize: 20,
|
|
173
172
|
marginRight: -10,
|
|
174
173
|
display: 'flex',
|
|
175
174
|
alignItems: 'center'
|
|
176
|
-
}),
|
|
175
|
+
}), ".".concat(gridClasses.menuOpen), {
|
|
177
176
|
visibility: 'visible',
|
|
178
177
|
width: 'auto'
|
|
179
|
-
}),
|
|
178
|
+
}), "& .".concat(gridClasses.row), {
|
|
180
179
|
display: 'flex',
|
|
181
180
|
width: 'fit-content',
|
|
182
181
|
breakInside: 'avoid',
|
|
@@ -198,7 +197,7 @@ export var GridRootStyles = styled('div', {
|
|
|
198
197
|
}
|
|
199
198
|
}
|
|
200
199
|
}
|
|
201
|
-
}),
|
|
200
|
+
}), "& .".concat(gridClasses.cell), {
|
|
202
201
|
display: 'flex',
|
|
203
202
|
alignItems: 'center',
|
|
204
203
|
borderBottom: '1px solid',
|
|
@@ -212,17 +211,17 @@ export var GridRootStyles = styled('div', {
|
|
|
212
211
|
}
|
|
213
212
|
}
|
|
214
213
|
}
|
|
215
|
-
}),
|
|
214
|
+
}), "&.".concat(gridClasses['root--disableUserSelection'], " .").concat(gridClasses.cell), {
|
|
216
215
|
userSelect: 'none'
|
|
217
|
-
}),
|
|
216
|
+
}), "& .".concat(gridClasses.row, ":not(.").concat(gridClasses['row--dynamicHeight'], ") > .").concat(gridClasses.cell), {
|
|
218
217
|
overflow: 'hidden',
|
|
219
218
|
whiteSpace: 'nowrap'
|
|
220
|
-
}),
|
|
219
|
+
}), "& .".concat(gridClasses.cellContent), {
|
|
221
220
|
overflow: 'hidden',
|
|
222
221
|
textOverflow: 'ellipsis'
|
|
223
|
-
}),
|
|
222
|
+
}), "& .".concat(gridClasses.cell, ".").concat(gridClasses['cell--selectionMode']), {
|
|
224
223
|
cursor: 'default'
|
|
225
|
-
}),
|
|
224
|
+
}), "& .".concat(gridClasses.cell, ".").concat(gridClasses['cell--editing']), {
|
|
226
225
|
padding: 1,
|
|
227
226
|
display: 'flex',
|
|
228
227
|
boxShadow: theme.shadows[2],
|
|
@@ -231,85 +230,85 @@ export var GridRootStyles = styled('div', {
|
|
|
231
230
|
outline: "solid ".concat((theme.vars || theme).palette.primary.main, " 1px"),
|
|
232
231
|
outlineOffset: '-1px'
|
|
233
232
|
}
|
|
234
|
-
}),
|
|
233
|
+
}), "& .".concat(gridClasses['row--editing']), {
|
|
235
234
|
boxShadow: theme.shadows[2]
|
|
236
|
-
}), _defineProperty(_extends2, "& .".concat(gridClasses['row--editing'], " .").concat(gridClasses.cell), {
|
|
235
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extends2, "& .".concat(gridClasses['row--editing'], " .").concat(gridClasses.cell), {
|
|
237
236
|
boxShadow: theme.shadows[0],
|
|
238
237
|
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
239
|
-
}),
|
|
238
|
+
}), "& .".concat(gridClasses.editBooleanCell), {
|
|
240
239
|
display: 'flex',
|
|
241
240
|
height: '100%',
|
|
242
241
|
width: '100%',
|
|
243
242
|
alignItems: 'center',
|
|
244
243
|
justifyContent: 'center'
|
|
245
|
-
}),
|
|
244
|
+
}), "& .".concat(gridClasses.booleanCell, "[data-value=\"true\"]"), {
|
|
246
245
|
color: (theme.vars || theme).palette.text.secondary
|
|
247
|
-
}),
|
|
246
|
+
}), "& .".concat(gridClasses.booleanCell, "[data-value=\"false\"]"), {
|
|
248
247
|
color: (theme.vars || theme).palette.text.disabled
|
|
249
|
-
}),
|
|
248
|
+
}), "& .".concat(gridClasses.actionsCell), {
|
|
250
249
|
display: 'inline-flex',
|
|
251
250
|
alignItems: 'center',
|
|
252
251
|
gridGap: theme.spacing(1)
|
|
253
|
-
}),
|
|
252
|
+
}), "& .".concat(gridClasses.rowReorderCell), {
|
|
254
253
|
display: 'inline-flex',
|
|
255
254
|
flex: 1,
|
|
256
255
|
alignItems: 'center',
|
|
257
256
|
justifyContent: 'center',
|
|
258
257
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
259
|
-
}),
|
|
258
|
+
}), "& .".concat(gridClasses['rowReorderCell--draggable']), {
|
|
260
259
|
cursor: 'move',
|
|
261
260
|
opacity: 1
|
|
262
|
-
}),
|
|
261
|
+
}), "& .".concat(gridClasses.rowReorderCellContainer), {
|
|
263
262
|
padding: 0,
|
|
264
263
|
alignItems: 'stretch'
|
|
265
|
-
}),
|
|
264
|
+
}), ".".concat(gridClasses.withBorderColor), {
|
|
266
265
|
borderColor: borderColor
|
|
267
|
-
}),
|
|
266
|
+
}), "& .".concat(gridClasses['cell--withRightBorder']), {
|
|
268
267
|
borderRightWidth: '1px',
|
|
269
268
|
borderRightStyle: 'solid'
|
|
270
|
-
}), _defineProperty(_extends2, "& .".concat(gridClasses['columnHeader--withRightBorder']), {
|
|
269
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extends2, "& .".concat(gridClasses['columnHeader--withRightBorder']), {
|
|
271
270
|
borderRightWidth: '1px',
|
|
272
271
|
borderRightStyle: 'solid'
|
|
273
|
-
}),
|
|
272
|
+
}), "& .".concat(gridClasses['cell--textLeft']), {
|
|
274
273
|
justifyContent: 'flex-start'
|
|
275
|
-
}),
|
|
274
|
+
}), "& .".concat(gridClasses['cell--textRight']), {
|
|
276
275
|
justifyContent: 'flex-end'
|
|
277
|
-
}),
|
|
276
|
+
}), "& .".concat(gridClasses['cell--textCenter']), {
|
|
278
277
|
justifyContent: 'center'
|
|
279
|
-
}),
|
|
278
|
+
}), "& .".concat(gridClasses.columnHeaderDraggableContainer), {
|
|
280
279
|
display: 'flex',
|
|
281
280
|
width: '100%',
|
|
282
281
|
height: '100%'
|
|
283
|
-
}),
|
|
282
|
+
}), "& .".concat(gridClasses.rowReorderCellPlaceholder), {
|
|
284
283
|
display: 'none'
|
|
285
|
-
}),
|
|
284
|
+
}), "& .".concat(gridClasses['columnHeader--dragging'], ", & .").concat(gridClasses['row--dragging']), {
|
|
286
285
|
background: (theme.vars || theme).palette.background.paper,
|
|
287
286
|
padding: '0 12px',
|
|
288
287
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
289
288
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
290
|
-
}),
|
|
289
|
+
}), "& .".concat(gridClasses['row--dragging']), _defineProperty({
|
|
291
290
|
background: (theme.vars || theme).palette.background.paper,
|
|
292
291
|
padding: '0 12px',
|
|
293
292
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
294
293
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
295
294
|
}, "& .".concat(gridClasses.rowReorderCellPlaceholder), {
|
|
296
295
|
display: 'flex'
|
|
297
|
-
})),
|
|
296
|
+
})), "& .".concat(gridClasses.treeDataGroupingCell), {
|
|
298
297
|
display: 'flex',
|
|
299
298
|
alignItems: 'center',
|
|
300
299
|
width: '100%'
|
|
301
|
-
}),
|
|
300
|
+
}), "& .".concat(gridClasses.treeDataGroupingCellToggle), {
|
|
302
301
|
flex: '0 0 28px',
|
|
303
302
|
alignSelf: 'stretch',
|
|
304
303
|
marginRight: theme.spacing(2)
|
|
305
|
-
}), _defineProperty(_extends2, "& .".concat(gridClasses.groupingCriteriaCell), {
|
|
304
|
+
}), _defineProperty(_defineProperty(_extends2, "& .".concat(gridClasses.groupingCriteriaCell), {
|
|
306
305
|
display: 'flex',
|
|
307
306
|
alignItems: 'center',
|
|
308
307
|
width: '100%'
|
|
309
|
-
}),
|
|
308
|
+
}), "& .".concat(gridClasses.groupingCriteriaCellToggle), {
|
|
310
309
|
flex: '0 0 28px',
|
|
311
310
|
alignSelf: 'stretch',
|
|
312
311
|
marginRight: theme.spacing(2)
|
|
313
|
-
})
|
|
312
|
+
})));
|
|
314
313
|
return gridStyle;
|
|
315
314
|
});
|
|
@@ -29,7 +29,7 @@ function GridColumnMenuSortItem(props) {
|
|
|
29
29
|
var onSortMenuItemClick = React.useCallback(function (event) {
|
|
30
30
|
onClick(event);
|
|
31
31
|
var direction = event.currentTarget.getAttribute('data-value') || null;
|
|
32
|
-
apiRef.current.sortColumn(colDef, direction === sortDirection ? null : direction);
|
|
32
|
+
apiRef.current.sortColumn(colDef.field, direction === sortDirection ? null : direction);
|
|
33
33
|
}, [apiRef, colDef, onClick, sortDirection]);
|
|
34
34
|
if (!colDef || !colDef.sortable || !sortingOrder.some(function (item) {
|
|
35
35
|
return !!item;
|
|
@@ -205,8 +205,8 @@ var GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props
|
|
|
205
205
|
return operator.value === item.operator;
|
|
206
206
|
}) || column.filterOperators[0];
|
|
207
207
|
|
|
208
|
-
// Erase filter value if the input component is modified
|
|
209
|
-
var eraseItemValue = !newOperator.InputComponent || newOperator.InputComponent !== (currentOperator == null ? void 0 : currentOperator.InputComponent);
|
|
208
|
+
// Erase filter value if the input component or filtered column type is modified
|
|
209
|
+
var eraseItemValue = !newOperator.InputComponent || newOperator.InputComponent !== (currentOperator == null ? void 0 : currentOperator.InputComponent) || column.type !== currentColumn.type;
|
|
210
210
|
applyFilterChanges(_extends({}, item, {
|
|
211
211
|
field: field,
|
|
212
212
|
operator: newOperator.value,
|
|
@@ -47,7 +47,7 @@ function GridFilterInputValue(props) {
|
|
|
47
47
|
}, [id, applyValue, item, rootProps.filterDebounceMs, filterTimeout]);
|
|
48
48
|
React.useEffect(function () {
|
|
49
49
|
var itemPlusTag = item;
|
|
50
|
-
if (itemPlusTag.fromInput !== id) {
|
|
50
|
+
if (itemPlusTag.fromInput !== id || item.value === undefined) {
|
|
51
51
|
var _item$value2;
|
|
52
52
|
setFilterValueState(String((_item$value2 = item.value) != null ? _item$value2 : ''));
|
|
53
53
|
}
|
|
@@ -21,9 +21,8 @@ var GridToolbarQuickFilterRoot = styled(TextField, {
|
|
|
21
21
|
return styles.toolbarQuickFilter;
|
|
22
22
|
}
|
|
23
23
|
})(function (_ref) {
|
|
24
|
-
var _ref2;
|
|
25
24
|
var theme = _ref.theme;
|
|
26
|
-
return
|
|
25
|
+
return _defineProperty(_defineProperty({
|
|
27
26
|
width: 'auto',
|
|
28
27
|
paddingBottom: theme.spacing(0.5),
|
|
29
28
|
'& input': {
|
|
@@ -32,15 +31,15 @@ var GridToolbarQuickFilterRoot = styled(TextField, {
|
|
|
32
31
|
'& .MuiInput-underline:before': {
|
|
33
32
|
borderBottom: "1px solid ".concat((theme.vars || theme).palette.divider)
|
|
34
33
|
}
|
|
35
|
-
},
|
|
34
|
+
}, "& input[type=search]::-ms-clear,\n& input[type=search]::-ms-reveal", {
|
|
36
35
|
/* clears the 'X' icon from IE */
|
|
37
36
|
display: 'none',
|
|
38
37
|
width: 0,
|
|
39
38
|
height: 0
|
|
40
|
-
}),
|
|
39
|
+
}), "& input[type=\"search\"]::-webkit-search-decoration,\n & input[type=\"search\"]::-webkit-search-cancel-button,\n & input[type=\"search\"]::-webkit-search-results-button,\n & input[type=\"search\"]::-webkit-search-results-decoration", {
|
|
41
40
|
/* clears the 'X' icon from Chrome */
|
|
42
41
|
display: 'none'
|
|
43
|
-
})
|
|
42
|
+
});
|
|
44
43
|
});
|
|
45
44
|
var defaultSearchValueParser = function defaultSearchValueParser(searchText) {
|
|
46
45
|
return searchText.split(' ').filter(function (word) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel,
|
|
2
|
+
import { GridSkeletonCell, GridColumnsPanel, GridFilterPanel, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridPanel, GridRow, GridColumnHeaderFilterIconButton, GridRowCount } from '../components';
|
|
3
3
|
import { GridCellV7 } from '../components/cell/GridCell';
|
|
4
4
|
import { GridColumnHeaders } from '../components/GridColumnHeaders';
|
|
5
5
|
import { GridColumnMenu } from '../components/menu/columnMenu/GridColumnMenu';
|
|
@@ -17,7 +17,6 @@ export var DATA_GRID_DEFAULT_SLOTS_COMPONENTS = _extends({}, materialSlots, {
|
|
|
17
17
|
footer: GridFooter,
|
|
18
18
|
footerRowCount: GridRowCount,
|
|
19
19
|
toolbar: null,
|
|
20
|
-
preferencesPanel: GridPreferencesPanel,
|
|
21
20
|
loadingOverlay: GridLoadingOverlay,
|
|
22
21
|
noResultsOverlay: GridNoResultsOverlay,
|
|
23
22
|
noRowsOverlay: GridNoRowsOverlay,
|
|
@@ -51,7 +51,7 @@ function hasNativeSelection(element) {
|
|
|
51
51
|
* @requires useGridSelection (method)
|
|
52
52
|
*/
|
|
53
53
|
export var useGridClipboard = function useGridClipboard(apiRef, props) {
|
|
54
|
-
var ignoreValueFormatterProp = props.
|
|
54
|
+
var ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
55
55
|
var ignoreValueFormatter = (_typeof(ignoreValueFormatterProp) === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
|
|
56
56
|
var clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
57
57
|
var handleCopy = React.useCallback(function (event) {
|
|
@@ -8,7 +8,7 @@ var _excluded = ["id", "field"],
|
|
|
8
8
|
_excluded2 = ["id", "field"];
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
import * as React from 'react';
|
|
11
|
-
import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
11
|
+
import { unstable_useEventCallback as useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
12
12
|
import { useGridApiEventHandler, useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';
|
|
13
13
|
import { GridEditModes, GridCellModes } from '../../../models/gridEditRowModel';
|
|
14
14
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
@@ -108,7 +108,7 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
108
108
|
if (isPrintableKey(event)) {
|
|
109
109
|
_reason = GridCellEditStartReasons.printableKeyDown;
|
|
110
110
|
} else if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
111
|
-
_reason = GridCellEditStartReasons.
|
|
111
|
+
_reason = GridCellEditStartReasons.pasteKeyDown;
|
|
112
112
|
} else if (event.key === 'Enter') {
|
|
113
113
|
_reason = GridCellEditStartReasons.enterKeyDown;
|
|
114
114
|
} else if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
@@ -127,23 +127,12 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
127
127
|
var handleCellEditStart = React.useCallback(function (params) {
|
|
128
128
|
var id = params.id,
|
|
129
129
|
field = params.field,
|
|
130
|
-
reason = params.reason
|
|
131
|
-
key = params.key,
|
|
132
|
-
colDef = params.colDef;
|
|
130
|
+
reason = params.reason;
|
|
133
131
|
var startCellEditModeParams = {
|
|
134
132
|
id: id,
|
|
135
133
|
field: field
|
|
136
134
|
};
|
|
137
|
-
if (reason === GridCellEditStartReasons.printableKeyDown) {
|
|
138
|
-
if (React.version.startsWith('17')) {
|
|
139
|
-
// In React 17, cleaning the input is enough.
|
|
140
|
-
// The sequence of events makes the key pressed by the end-users update the textbox directly.
|
|
141
|
-
startCellEditModeParams.deleteValue = true;
|
|
142
|
-
} else {
|
|
143
|
-
var initialValue = colDef.valueParser ? colDef.valueParser(key) : key;
|
|
144
|
-
startCellEditModeParams.initialValue = initialValue;
|
|
145
|
-
}
|
|
146
|
-
} else if (reason === GridCellEditStartReasons.deleteKeyDown) {
|
|
135
|
+
if (reason === GridCellEditStartReasons.printableKeyDown || reason === GridCellEditStartReasons.deleteKeyDown || reason === GridCellEditStartReasons.pasteKeyDown) {
|
|
147
136
|
startCellEditModeParams.deleteValue = true;
|
|
148
137
|
}
|
|
149
138
|
apiRef.current.startCellEditMode(startCellEditModeParams);
|
|
@@ -244,17 +233,13 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
244
233
|
deleteValue = params.deleteValue,
|
|
245
234
|
initialValue = params.initialValue;
|
|
246
235
|
var newValue = apiRef.current.getCellValue(id, field);
|
|
247
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
248
|
-
var unstable_updateValueOnRender = false;
|
|
249
236
|
if (deleteValue || initialValue) {
|
|
250
237
|
newValue = deleteValue ? '' : initialValue;
|
|
251
|
-
unstable_updateValueOnRender = true;
|
|
252
238
|
}
|
|
253
239
|
var newProps = {
|
|
254
240
|
value: newValue,
|
|
255
241
|
error: false,
|
|
256
|
-
isProcessingProps: false
|
|
257
|
-
unstable_updateValueOnRender: unstable_updateValueOnRender
|
|
242
|
+
isProcessingProps: false
|
|
258
243
|
};
|
|
259
244
|
updateOrDeleteFieldState(id, field, newProps);
|
|
260
245
|
apiRef.current.setCellFocus(id, field);
|
|
@@ -439,7 +424,9 @@ export var useGridCellEditing = function useGridCellEditing(apiRef, props) {
|
|
|
439
424
|
updateCellModesModel(cellModesModelProp);
|
|
440
425
|
}
|
|
441
426
|
}, [cellModesModelProp, updateCellModesModel]);
|
|
442
|
-
|
|
427
|
+
|
|
428
|
+
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
429
|
+
useEnhancedEffect(function () {
|
|
443
430
|
var idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
444
431
|
|
|
445
432
|
// Update the ref here because updateStateToStopCellEditMode may change it later
|
|
@@ -6,7 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
6
6
|
var _excluded = ["id"],
|
|
7
7
|
_excluded2 = ["id"];
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import { unstable_useEventCallback as useEventCallback } from '@mui/utils';
|
|
9
|
+
import { unstable_useEventCallback as useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
10
10
|
import { useGridApiEventHandler, useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';
|
|
11
11
|
import { GridEditModes, GridRowModes } from '../../../models/gridEditRowModel';
|
|
12
12
|
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
@@ -179,7 +179,6 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
179
179
|
var rowParams = apiRef.current.getRowParams(params.id);
|
|
180
180
|
var _newParams = _extends({}, rowParams, {
|
|
181
181
|
field: params.field,
|
|
182
|
-
key: event.key,
|
|
183
182
|
reason: _reason
|
|
184
183
|
});
|
|
185
184
|
apiRef.current.publishEvent('rowEditStart', _newParams, event);
|
|
@@ -189,25 +188,12 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
189
188
|
var handleRowEditStart = React.useCallback(function (params) {
|
|
190
189
|
var id = params.id,
|
|
191
190
|
field = params.field,
|
|
192
|
-
reason = params.reason
|
|
193
|
-
key = params.key,
|
|
194
|
-
columns = params.columns;
|
|
191
|
+
reason = params.reason;
|
|
195
192
|
var startRowEditModeParams = {
|
|
196
193
|
id: id,
|
|
197
194
|
fieldToFocus: field
|
|
198
195
|
};
|
|
199
|
-
if (reason === GridRowEditStartReasons.printableKeyDown) {
|
|
200
|
-
if (React.version.startsWith('17')) {
|
|
201
|
-
// In React 17, cleaning the input is enough.
|
|
202
|
-
// The sequence of events makes the key pressed by the end-users update the textbox directly.
|
|
203
|
-
startRowEditModeParams.deleteValue = !!field;
|
|
204
|
-
} else {
|
|
205
|
-
var colDef = columns.find(function (col) {
|
|
206
|
-
return col.field === field;
|
|
207
|
-
});
|
|
208
|
-
startRowEditModeParams.initialValue = colDef.valueParser ? colDef.valueParser(key) : key;
|
|
209
|
-
}
|
|
210
|
-
} else if (reason === GridRowEditStartReasons.deleteKeyDown) {
|
|
196
|
+
if (reason === GridRowEditStartReasons.printableKeyDown || reason === GridRowEditStartReasons.deleteKeyDown) {
|
|
211
197
|
startRowEditModeParams.deleteValue = !!field;
|
|
212
198
|
}
|
|
213
199
|
apiRef.current.startRowEditMode(startRowEditModeParams);
|
|
@@ -322,17 +308,13 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
322
308
|
return acc;
|
|
323
309
|
}
|
|
324
310
|
var newValue = apiRef.current.getCellValue(id, field);
|
|
325
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
326
|
-
var unstable_updateValueOnRender = false;
|
|
327
311
|
if (fieldToFocus === field && (deleteValue || initialValue)) {
|
|
328
312
|
newValue = deleteValue ? '' : initialValue;
|
|
329
|
-
unstable_updateValueOnRender = true;
|
|
330
313
|
}
|
|
331
314
|
acc[field] = {
|
|
332
315
|
value: newValue,
|
|
333
316
|
error: false,
|
|
334
|
-
isProcessingProps: false
|
|
335
|
-
unstable_updateValueOnRender: unstable_updateValueOnRender
|
|
317
|
+
isProcessingProps: false
|
|
336
318
|
};
|
|
337
319
|
return acc;
|
|
338
320
|
}, {});
|
|
@@ -559,7 +541,9 @@ export var useGridRowEditing = function useGridRowEditing(apiRef, props) {
|
|
|
559
541
|
updateRowModesModel(rowModesModelProp);
|
|
560
542
|
}
|
|
561
543
|
}, [rowModesModelProp, updateRowModesModel]);
|
|
562
|
-
|
|
544
|
+
|
|
545
|
+
// Run this effect synchronously so that the keyboard event can impact the yet-to-be-rendered input.
|
|
546
|
+
useEnhancedEffect(function () {
|
|
563
547
|
var idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
|
|
564
548
|
|
|
565
549
|
// Update the ref here because updateStateToStopRowEditMode may change it later
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
18
18
|
*/
|
|
19
19
|
export var useGridCsvExport = function useGridCsvExport(apiRef, props) {
|
|
20
20
|
var logger = useGridLogger(apiRef, 'useGridCsvExport');
|
|
21
|
-
var ignoreValueFormatterProp = props.
|
|
21
|
+
var ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
22
22
|
var ignoreValueFormatter = (_typeof(ignoreValueFormatterProp) === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.csvExport : ignoreValueFormatterProp) || false;
|
|
23
23
|
var getDataAsCsv = React.useCallback(function () {
|
|
24
24
|
var _options$getRowsToExp, _options$includeHeade, _options$includeColum;
|