@mui/x-data-grid 6.7.0 → 6.9.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 +145 -5541
- package/components/GridColumnHeaders.d.ts +2 -2
- package/components/GridColumnHeaders.js +3 -1
- package/components/GridPagination.d.ts +2 -2
- package/components/GridRow.d.ts +2 -2
- package/components/GridRow.js +33 -79
- package/components/cell/GridCell.d.ts +24 -15
- package/components/cell/GridCell.js +422 -45
- package/components/cell/GridEditInputCell.js +9 -9
- package/components/cell/index.d.ts +2 -1
- package/components/cell/index.js +1 -1
- package/components/containers/GridRootStyles.js +30 -16
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +2 -2
- package/components/virtualization/GridVirtualScroller.js +4 -9
- package/components/virtualization/GridVirtualScrollerContent.js +11 -20
- package/constants/defaultGridSlotsComponents.js +6 -2
- package/hooks/core/useGridApiInitialization.js +4 -1
- package/hooks/core/useGridStateInitialization.js +2 -9
- package/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/hooks/features/columns/gridColumnsSelector.js +7 -7
- package/hooks/features/dimensions/useGridDimensions.js +6 -12
- package/hooks/features/editing/useGridCellEditing.js +5 -3
- package/hooks/features/editing/useGridRowEditing.js +14 -6
- package/hooks/features/filter/gridFilterSelector.js +8 -8
- package/hooks/features/filter/gridFilterUtils.d.ts +4 -1
- package/hooks/features/filter/gridFilterUtils.js +19 -13
- package/hooks/features/filter/useGridFilter.js +2 -1
- package/hooks/features/focus/useGridFocus.js +9 -4
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/hooks/features/pagination/gridPaginationSelector.js +4 -4
- package/hooks/features/rowSelection/gridRowSelectionSelector.js +3 -3
- package/hooks/features/rows/gridRowsSelector.js +3 -3
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -0
- package/hooks/features/rows/useGridParamsApi.js +7 -15
- package/hooks/features/sorting/gridSortingSelector.js +3 -3
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +8 -816
- package/hooks/features/virtualization/useGridVirtualScroller.js +40 -38
- package/hooks/utils/index.d.ts +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/useGridSelector.d.ts +3 -1
- package/hooks/utils/useGridSelector.js +37 -6
- package/hooks/utils/useLazyRef.d.ts +2 -0
- package/hooks/utils/useLazyRef.js +9 -0
- package/hooks/utils/useOnMount.d.ts +2 -0
- package/hooks/utils/useOnMount.js +7 -0
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/legacy/components/GridColumnHeaders.js +3 -1
- package/legacy/components/GridRow.js +35 -79
- package/legacy/components/cell/GridCell.js +425 -46
- package/legacy/components/cell/GridEditInputCell.js +9 -9
- package/legacy/components/cell/index.js +1 -1
- package/legacy/components/containers/GridRootStyles.js +20 -17
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/legacy/components/toolbar/GridToolbar.js +2 -2
- package/legacy/components/virtualization/GridVirtualScroller.js +4 -7
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +10 -17
- package/legacy/constants/defaultGridSlotsComponents.js +6 -2
- package/legacy/hooks/core/useGridApiInitialization.js +4 -1
- package/legacy/hooks/core/useGridStateInitialization.js +2 -7
- package/legacy/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -4
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/legacy/hooks/features/columns/gridColumnsSelector.js +7 -7
- package/legacy/hooks/features/dimensions/useGridDimensions.js +6 -12
- package/legacy/hooks/features/editing/useGridCellEditing.js +5 -3
- package/legacy/hooks/features/editing/useGridRowEditing.js +15 -7
- package/legacy/hooks/features/filter/gridFilterSelector.js +8 -8
- package/legacy/hooks/features/filter/gridFilterUtils.js +23 -19
- package/legacy/hooks/features/filter/useGridFilter.js +2 -1
- package/legacy/hooks/features/focus/useGridFocus.js +9 -4
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/legacy/hooks/features/pagination/gridPaginationSelector.js +4 -4
- package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +3 -3
- package/legacy/hooks/features/rows/gridRowsSelector.js +3 -3
- package/legacy/hooks/features/rows/useGridParamsApi.js +23 -15
- package/legacy/hooks/features/sorting/gridSortingSelector.js +3 -3
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +38 -34
- package/legacy/hooks/utils/index.js +1 -1
- package/legacy/hooks/utils/useGridSelector.js +43 -5
- package/legacy/hooks/utils/useLazyRef.js +9 -0
- package/legacy/hooks/utils/useOnMount.js +7 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/locales/elGR.js +70 -79
- package/legacy/locales/ptBR.js +12 -13
- package/legacy/utils/Store.js +34 -0
- package/legacy/utils/createSelector.js +74 -6
- package/legacy/utils/doesSupportPreventScroll.js +13 -0
- package/legacy/utils/fastMemo.js +5 -0
- package/legacy/utils/fastObjectShallowCompare.js +32 -0
- package/legacy/utils/keyboardUtils.js +4 -2
- package/locales/elGR.js +66 -79
- package/locales/ptBR.js +12 -13
- package/models/api/gridCoreApi.d.ts +6 -0
- package/models/colDef/gridColDef.d.ts +4 -3
- package/models/colDef/gridColType.d.ts +3 -1
- package/models/events/gridEventLookup.d.ts +3 -3
- package/modern/components/GridColumnHeaders.js +3 -1
- package/modern/components/GridRow.js +32 -79
- package/modern/components/cell/GridCell.js +421 -45
- package/modern/components/cell/GridEditInputCell.js +9 -9
- package/modern/components/cell/index.js +1 -1
- package/modern/components/containers/GridRootStyles.js +30 -16
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/modern/components/toolbar/GridToolbar.js +2 -2
- package/modern/components/virtualization/GridVirtualScroller.js +4 -9
- package/modern/components/virtualization/GridVirtualScrollerContent.js +10 -20
- package/modern/constants/defaultGridSlotsComponents.js +6 -2
- package/modern/hooks/core/useGridApiInitialization.js +4 -1
- package/modern/hooks/core/useGridStateInitialization.js +2 -9
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/modern/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +9 -3
- package/modern/hooks/features/columns/gridColumnsSelector.js +7 -7
- package/modern/hooks/features/dimensions/useGridDimensions.js +6 -12
- package/modern/hooks/features/editing/useGridCellEditing.js +5 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +14 -6
- package/modern/hooks/features/filter/gridFilterSelector.js +8 -8
- package/modern/hooks/features/filter/gridFilterUtils.js +17 -12
- package/modern/hooks/features/filter/useGridFilter.js +2 -1
- package/modern/hooks/features/focus/useGridFocus.js +8 -4
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/modern/hooks/features/pagination/gridPaginationSelector.js +4 -4
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +3 -3
- package/modern/hooks/features/rows/gridRowsSelector.js +3 -3
- package/modern/hooks/features/rows/useGridParamsApi.js +7 -15
- package/modern/hooks/features/sorting/gridSortingSelector.js +3 -3
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +40 -38
- package/modern/hooks/utils/index.js +1 -1
- package/modern/hooks/utils/useGridSelector.js +37 -6
- package/modern/hooks/utils/useLazyRef.js +9 -0
- package/modern/hooks/utils/useOnMount.js +7 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/elGR.js +66 -79
- package/modern/locales/ptBR.js +12 -13
- package/modern/utils/Store.js +24 -0
- package/modern/utils/createSelector.js +74 -6
- package/modern/utils/doesSupportPreventScroll.js +13 -0
- package/modern/utils/fastMemo.js +5 -0
- package/modern/utils/fastObjectShallowCompare.js +32 -0
- package/modern/utils/keyboardUtils.js +4 -2
- package/node/components/GridColumnHeaders.js +4 -2
- package/node/components/GridRow.js +32 -79
- package/node/components/cell/GridCell.js +424 -47
- package/node/components/cell/GridEditInputCell.js +9 -9
- package/node/components/cell/index.js +17 -10
- package/node/components/containers/GridRootStyles.js +30 -16
- package/node/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/node/components/toolbar/GridToolbar.js +2 -2
- package/node/components/virtualization/GridVirtualScroller.js +4 -9
- package/node/components/virtualization/GridVirtualScrollerContent.js +10 -20
- package/node/constants/defaultGridSlotsComponents.js +4 -1
- package/node/hooks/core/useGridApiInitialization.js +4 -1
- package/node/hooks/core/useGridStateInitialization.js +2 -9
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -4
- package/node/hooks/features/columnGrouping/gridColumnGroupsSelector.js +3 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -2
- package/node/hooks/features/columns/gridColumnsSelector.js +6 -6
- package/node/hooks/features/dimensions/useGridDimensions.js +6 -12
- package/node/hooks/features/editing/useGridCellEditing.js +5 -3
- package/node/hooks/features/editing/useGridRowEditing.js +14 -6
- package/node/hooks/features/filter/gridFilterSelector.js +7 -7
- package/node/hooks/features/filter/gridFilterUtils.js +17 -12
- package/node/hooks/features/filter/useGridFilter.js +2 -1
- package/node/hooks/features/focus/useGridFocus.js +8 -4
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -3
- package/node/hooks/features/pagination/gridPaginationSelector.js +3 -3
- package/node/hooks/features/rowSelection/gridRowSelectionSelector.js +2 -2
- package/node/hooks/features/rows/gridRowsSelector.js +2 -2
- package/node/hooks/features/rows/useGridParamsApi.js +9 -15
- package/node/hooks/features/sorting/gridSortingSelector.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +40 -36
- package/node/hooks/utils/index.js +14 -10
- package/node/hooks/utils/useGridSelector.js +41 -7
- package/node/hooks/utils/useLazyRef.js +17 -0
- package/node/hooks/utils/useOnMount.js +15 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/locales/elGR.js +66 -79
- package/node/locales/ptBR.js +12 -13
- package/node/utils/Store.js +31 -0
- package/node/utils/createSelector.js +77 -8
- package/node/utils/doesSupportPreventScroll.js +19 -0
- package/node/utils/fastMemo.js +13 -0
- package/node/utils/fastObjectShallowCompare.js +38 -0
- package/node/utils/keyboardUtils.js +4 -2
- package/package.json +2 -2
- package/utils/Store.d.ts +11 -0
- package/utils/Store.js +24 -0
- package/utils/createSelector.d.ts +1 -0
- package/utils/createSelector.js +74 -6
- package/utils/doesSupportPreventScroll.d.ts +1 -0
- package/utils/doesSupportPreventScroll.js +13 -0
- package/utils/fastMemo.d.ts +1 -0
- package/utils/fastMemo.js +5 -0
- package/utils/fastObjectShallowCompare.d.ts +1 -0
- package/utils/fastObjectShallowCompare.js +32 -0
- package/utils/keyboardUtils.js +4 -2
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["changeReason", "unstable_updateValueOnRender"],
|
|
4
|
+
_excluded2 = ["align", "children", "colIndex", "column", "cellMode", "field", "formattedValue", "hasFocus", "height", "isEditable", "isSelected", "rowId", "tabIndex", "value", "width", "className", "showRightBorder", "extendRowFullWidth", "row", "colSpan", "disableDragEvents", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
5
|
+
_excluded3 = ["column", "rowId", "editCellState", "align", "children", "colIndex", "height", "width", "className", "showRightBorder", "extendRowFullWidth", "row", "colSpan", "disableDragEvents", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
6
|
+
_excluded4 = ["changeReason", "unstable_updateValueOnRender"];
|
|
4
7
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
5
8
|
import * as React from 'react';
|
|
6
9
|
import PropTypes from 'prop-types';
|
|
7
10
|
import clsx from 'clsx';
|
|
8
11
|
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
|
|
9
|
-
import {
|
|
12
|
+
import { fastMemo } from '../../utils/fastMemo';
|
|
13
|
+
import { doesSupportPreventScroll } from '../../utils/doesSupportPreventScroll';
|
|
14
|
+
import { getDataGridUtilityClass, gridClasses } from '../../constants/gridClasses';
|
|
10
15
|
import { GridCellModes } from '../../models';
|
|
16
|
+
import { useGridSelector, objectShallowCompare } from '../../hooks/utils/useGridSelector';
|
|
11
17
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
12
18
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
13
19
|
import { gridFocusCellSelector } from '../../hooks/features/focus/gridFocusStateSelector';
|
|
20
|
+
import { MissingRowIdError } from '../../hooks/features/rows/useGridParamsApi';
|
|
14
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
const EMPTY_CELL_PARAMS = {
|
|
23
|
+
id: -1,
|
|
24
|
+
field: '__unset__',
|
|
25
|
+
row: {},
|
|
26
|
+
rowNode: {
|
|
27
|
+
id: -1,
|
|
28
|
+
depth: 0,
|
|
29
|
+
type: 'leaf',
|
|
30
|
+
parent: -1,
|
|
31
|
+
groupingKey: null
|
|
32
|
+
},
|
|
33
|
+
colDef: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
field: '__unset__',
|
|
36
|
+
computedWidth: 0
|
|
37
|
+
},
|
|
38
|
+
cellMode: GridCellModes.View,
|
|
39
|
+
hasFocus: false,
|
|
40
|
+
tabIndex: -1,
|
|
41
|
+
value: null,
|
|
42
|
+
formattedValue: '__unset__',
|
|
43
|
+
isEditable: false,
|
|
44
|
+
api: {}
|
|
45
|
+
};
|
|
28
46
|
const useUtilityClasses = ownerState => {
|
|
29
47
|
const {
|
|
30
48
|
align,
|
|
@@ -40,12 +58,110 @@ const useUtilityClasses = ownerState => {
|
|
|
40
58
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
41
59
|
};
|
|
42
60
|
let warnedOnce = false;
|
|
61
|
+
|
|
62
|
+
// GridCellWrapper is a compatibility layer for the V6 cell slot. If we can use the more efficient
|
|
63
|
+
// `GridCellV7`, we should. That component is a merge of `GridCellWrapper` and `GridCell`.
|
|
64
|
+
// TODO(v7): Remove the wrapper & cellV6 and use the cellV7 exclusively.
|
|
65
|
+
// TODO(v7): Removing the wrapper will break the docs performance visualization demo.
|
|
66
|
+
const GridCellWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
67
|
+
const {
|
|
68
|
+
column,
|
|
69
|
+
rowId,
|
|
70
|
+
editCellState
|
|
71
|
+
} = props;
|
|
72
|
+
const apiRef = useGridApiContext();
|
|
73
|
+
const rootProps = useGridRootProps();
|
|
74
|
+
const field = column.field;
|
|
75
|
+
const cellParamsWithAPI = useGridSelector(apiRef, () => {
|
|
76
|
+
// This is required because `.getCellParams` tries to get the `state.rows.tree` entry
|
|
77
|
+
// associated with `rowId`/`fieldId`, but this selector runs after the state has been
|
|
78
|
+
// updated, while `rowId`/`fieldId` reference an entry in the old state.
|
|
79
|
+
try {
|
|
80
|
+
const cellParams = apiRef.current.getCellParams(rowId, field);
|
|
81
|
+
const result = cellParams;
|
|
82
|
+
result.api = apiRef.current;
|
|
83
|
+
return result;
|
|
84
|
+
} catch (e) {
|
|
85
|
+
if (e instanceof MissingRowIdError) {
|
|
86
|
+
return EMPTY_CELL_PARAMS;
|
|
87
|
+
}
|
|
88
|
+
throw e;
|
|
89
|
+
}
|
|
90
|
+
}, objectShallowCompare);
|
|
91
|
+
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
92
|
+
id: rowId,
|
|
93
|
+
field
|
|
94
|
+
}));
|
|
95
|
+
if (cellParamsWithAPI === EMPTY_CELL_PARAMS) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const {
|
|
99
|
+
cellMode,
|
|
100
|
+
hasFocus,
|
|
101
|
+
isEditable,
|
|
102
|
+
value,
|
|
103
|
+
formattedValue
|
|
104
|
+
} = cellParamsWithAPI;
|
|
105
|
+
const managesOwnFocus = column.type === 'actions';
|
|
106
|
+
const tabIndex = (cellMode === 'view' || !isEditable) && !managesOwnFocus ? cellParamsWithAPI.tabIndex : -1;
|
|
107
|
+
const {
|
|
108
|
+
classes: rootClasses,
|
|
109
|
+
getCellClassName
|
|
110
|
+
} = rootProps;
|
|
111
|
+
const classNames = apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {
|
|
112
|
+
id: rowId,
|
|
113
|
+
field
|
|
114
|
+
});
|
|
115
|
+
if (column.cellClassName) {
|
|
116
|
+
classNames.push(typeof column.cellClassName === 'function' ? column.cellClassName(cellParamsWithAPI) : column.cellClassName);
|
|
117
|
+
}
|
|
118
|
+
if (getCellClassName) {
|
|
119
|
+
classNames.push(getCellClassName(cellParamsWithAPI));
|
|
120
|
+
}
|
|
121
|
+
let children;
|
|
122
|
+
if (editCellState == null && column.renderCell) {
|
|
123
|
+
children = column.renderCell(cellParamsWithAPI);
|
|
124
|
+
classNames.push(gridClasses['cell--withRenderer']);
|
|
125
|
+
classNames.push(rootClasses == null ? void 0 : rootClasses['cell--withRenderer']);
|
|
126
|
+
}
|
|
127
|
+
if (editCellState != null && column.renderEditCell) {
|
|
128
|
+
const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
|
|
129
|
+
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
131
|
+
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded);
|
|
132
|
+
const params = _extends({}, cellParamsWithAPI, {
|
|
133
|
+
row: updatedRow
|
|
134
|
+
}, editCellStateRest);
|
|
135
|
+
children = column.renderEditCell(params);
|
|
136
|
+
classNames.push(gridClasses['cell--editing']);
|
|
137
|
+
classNames.push(rootClasses == null ? void 0 : rootClasses['cell--editing']);
|
|
138
|
+
}
|
|
139
|
+
const {
|
|
140
|
+
slots
|
|
141
|
+
} = rootProps;
|
|
142
|
+
const CellComponent = slots.cell;
|
|
143
|
+
const cellProps = _extends({}, props, {
|
|
144
|
+
ref,
|
|
145
|
+
field,
|
|
146
|
+
formattedValue,
|
|
147
|
+
hasFocus,
|
|
148
|
+
isEditable,
|
|
149
|
+
isSelected,
|
|
150
|
+
value,
|
|
151
|
+
cellMode,
|
|
152
|
+
children,
|
|
153
|
+
tabIndex,
|
|
154
|
+
className: clsx(classNames)
|
|
155
|
+
});
|
|
156
|
+
return /*#__PURE__*/React.createElement(CellComponent, cellProps);
|
|
157
|
+
});
|
|
43
158
|
const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
44
159
|
var _rootProps$experiment;
|
|
45
160
|
const {
|
|
46
161
|
align,
|
|
47
|
-
children,
|
|
162
|
+
children: childrenProp,
|
|
48
163
|
colIndex,
|
|
164
|
+
column,
|
|
49
165
|
cellMode,
|
|
50
166
|
field,
|
|
51
167
|
formattedValue,
|
|
@@ -71,7 +187,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
71
187
|
onDragEnter,
|
|
72
188
|
onDragOver
|
|
73
189
|
} = props,
|
|
74
|
-
other = _objectWithoutPropertiesLoose(props,
|
|
190
|
+
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
75
191
|
const valueToRender = formattedValue == null ? value : formattedValue;
|
|
76
192
|
const cellRef = React.useRef(null);
|
|
77
193
|
const handleRef = useForkRef(ref, cellRef);
|
|
@@ -153,24 +269,21 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
153
269
|
}
|
|
154
270
|
};
|
|
155
271
|
}
|
|
156
|
-
const column = apiRef.current.getColumn(field);
|
|
157
272
|
const managesOwnFocus = column.type === 'actions';
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return children;
|
|
173
|
-
};
|
|
273
|
+
let children = childrenProp;
|
|
274
|
+
if (children === undefined) {
|
|
275
|
+
const valueString = valueToRender == null ? void 0 : valueToRender.toString();
|
|
276
|
+
children = /*#__PURE__*/_jsx("div", {
|
|
277
|
+
className: classes.content,
|
|
278
|
+
title: valueString,
|
|
279
|
+
children: valueString
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {
|
|
283
|
+
children = /*#__PURE__*/React.cloneElement(children, {
|
|
284
|
+
focusElementRef
|
|
285
|
+
});
|
|
286
|
+
}
|
|
174
287
|
const draggableEventHandlers = disableDragEvents ? null : {
|
|
175
288
|
onDragEnter: publish('cellDragEnter', onDragEnter),
|
|
176
289
|
onDragOver: publish('cellDragOver', onDragOver)
|
|
@@ -184,7 +297,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
184
297
|
"aria-colindex": colIndex + 1,
|
|
185
298
|
"aria-colspan": colSpan,
|
|
186
299
|
style: style,
|
|
187
|
-
tabIndex:
|
|
300
|
+
tabIndex: tabIndex,
|
|
188
301
|
onClick: publish('cellClick', onClick),
|
|
189
302
|
onDoubleClick: publish('cellDoubleClick', onDoubleClick),
|
|
190
303
|
onMouseOver: publish('cellMouseOver', onMouseOver),
|
|
@@ -194,10 +307,33 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
194
307
|
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
195
308
|
}, draggableEventHandlers, other, {
|
|
196
309
|
onFocus: handleFocus,
|
|
197
|
-
children:
|
|
310
|
+
children: children
|
|
198
311
|
}));
|
|
199
312
|
});
|
|
200
|
-
const
|
|
313
|
+
const MemoizedCellWrapper = fastMemo(GridCellWrapper);
|
|
314
|
+
process.env.NODE_ENV !== "production" ? GridCellWrapper.propTypes = {
|
|
315
|
+
// ----------------------------- Warning --------------------------------
|
|
316
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
317
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
318
|
+
// ----------------------------------------------------------------------
|
|
319
|
+
align: PropTypes.oneOf(['center', 'left', 'right']),
|
|
320
|
+
className: PropTypes.string,
|
|
321
|
+
colIndex: PropTypes.number,
|
|
322
|
+
colSpan: PropTypes.number,
|
|
323
|
+
column: PropTypes.object,
|
|
324
|
+
disableDragEvents: PropTypes.bool,
|
|
325
|
+
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
326
|
+
onClick: PropTypes.func,
|
|
327
|
+
onDoubleClick: PropTypes.func,
|
|
328
|
+
onDragEnter: PropTypes.func,
|
|
329
|
+
onDragOver: PropTypes.func,
|
|
330
|
+
onKeyDown: PropTypes.func,
|
|
331
|
+
onMouseDown: PropTypes.func,
|
|
332
|
+
onMouseUp: PropTypes.func,
|
|
333
|
+
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
334
|
+
showRightBorder: PropTypes.bool,
|
|
335
|
+
width: PropTypes.number
|
|
336
|
+
} : void 0;
|
|
201
337
|
process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
202
338
|
// ----------------------------- Warning --------------------------------
|
|
203
339
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -209,13 +345,15 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
209
345
|
className: PropTypes.string,
|
|
210
346
|
colIndex: PropTypes.number,
|
|
211
347
|
colSpan: PropTypes.number,
|
|
348
|
+
column: PropTypes.object,
|
|
212
349
|
disableDragEvents: PropTypes.bool,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
350
|
+
editCellState: PropTypes.shape({
|
|
351
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
352
|
+
isProcessingProps: PropTypes.bool,
|
|
353
|
+
isValidating: PropTypes.bool,
|
|
354
|
+
value: PropTypes.any
|
|
355
|
+
}),
|
|
216
356
|
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
217
|
-
isEditable: PropTypes.bool,
|
|
218
|
-
isSelected: PropTypes.bool,
|
|
219
357
|
onClick: PropTypes.func,
|
|
220
358
|
onDoubleClick: PropTypes.func,
|
|
221
359
|
onDragEnter: PropTypes.func,
|
|
@@ -225,8 +363,247 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
225
363
|
onMouseUp: PropTypes.func,
|
|
226
364
|
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
227
365
|
showRightBorder: PropTypes.bool,
|
|
228
|
-
tabIndex: PropTypes.oneOf([-1, 0]),
|
|
229
|
-
value: PropTypes.any,
|
|
230
366
|
width: PropTypes.number
|
|
231
367
|
} : void 0;
|
|
232
|
-
export {
|
|
368
|
+
export { MemoizedCellWrapper as GridCellWrapper, GridCell };
|
|
369
|
+
const GridCellV7 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
370
|
+
var _rootProps$experiment2;
|
|
371
|
+
const {
|
|
372
|
+
column,
|
|
373
|
+
rowId,
|
|
374
|
+
editCellState,
|
|
375
|
+
align,
|
|
376
|
+
colIndex,
|
|
377
|
+
height,
|
|
378
|
+
width,
|
|
379
|
+
className,
|
|
380
|
+
showRightBorder,
|
|
381
|
+
colSpan,
|
|
382
|
+
disableDragEvents,
|
|
383
|
+
onClick,
|
|
384
|
+
onDoubleClick,
|
|
385
|
+
onMouseDown,
|
|
386
|
+
onMouseUp,
|
|
387
|
+
onMouseOver,
|
|
388
|
+
onKeyDown,
|
|
389
|
+
onKeyUp,
|
|
390
|
+
onDragEnter,
|
|
391
|
+
onDragOver
|
|
392
|
+
} = props,
|
|
393
|
+
other = _objectWithoutPropertiesLoose(props, _excluded3);
|
|
394
|
+
const apiRef = useGridApiContext();
|
|
395
|
+
const rootProps = useGridRootProps();
|
|
396
|
+
const field = column.field;
|
|
397
|
+
const cellParamsWithAPI = useGridSelector(apiRef, () => {
|
|
398
|
+
// This is required because `.getCellParams` tries to get the `state.rows.tree` entry
|
|
399
|
+
// associated with `rowId`/`fieldId`, but this selector runs after the state has been
|
|
400
|
+
// updated, while `rowId`/`fieldId` reference an entry in the old state.
|
|
401
|
+
try {
|
|
402
|
+
const cellParams = apiRef.current.getCellParams(rowId, field);
|
|
403
|
+
const result = cellParams;
|
|
404
|
+
result.api = apiRef.current;
|
|
405
|
+
return result;
|
|
406
|
+
} catch (e) {
|
|
407
|
+
if (e instanceof MissingRowIdError) {
|
|
408
|
+
return EMPTY_CELL_PARAMS;
|
|
409
|
+
}
|
|
410
|
+
throw e;
|
|
411
|
+
}
|
|
412
|
+
}, objectShallowCompare);
|
|
413
|
+
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
414
|
+
id: rowId,
|
|
415
|
+
field
|
|
416
|
+
}));
|
|
417
|
+
const {
|
|
418
|
+
cellMode,
|
|
419
|
+
hasFocus,
|
|
420
|
+
isEditable,
|
|
421
|
+
value,
|
|
422
|
+
formattedValue
|
|
423
|
+
} = cellParamsWithAPI;
|
|
424
|
+
const managesOwnFocus = column.type === 'actions';
|
|
425
|
+
const tabIndex = (cellMode === 'view' || !isEditable) && !managesOwnFocus ? cellParamsWithAPI.tabIndex : -1;
|
|
426
|
+
const {
|
|
427
|
+
classes: rootClasses,
|
|
428
|
+
getCellClassName
|
|
429
|
+
} = rootProps;
|
|
430
|
+
const classNames = apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {
|
|
431
|
+
id: rowId,
|
|
432
|
+
field
|
|
433
|
+
});
|
|
434
|
+
if (column.cellClassName) {
|
|
435
|
+
classNames.push(typeof column.cellClassName === 'function' ? column.cellClassName(cellParamsWithAPI) : column.cellClassName);
|
|
436
|
+
}
|
|
437
|
+
if (getCellClassName) {
|
|
438
|
+
classNames.push(getCellClassName(cellParamsWithAPI));
|
|
439
|
+
}
|
|
440
|
+
const valueToRender = formattedValue == null ? value : formattedValue;
|
|
441
|
+
const cellRef = React.useRef(null);
|
|
442
|
+
const handleRef = useForkRef(ref, cellRef);
|
|
443
|
+
const focusElementRef = React.useRef(null);
|
|
444
|
+
const ownerState = {
|
|
445
|
+
align,
|
|
446
|
+
showRightBorder,
|
|
447
|
+
isEditable,
|
|
448
|
+
classes: rootProps.classes,
|
|
449
|
+
isSelected
|
|
450
|
+
};
|
|
451
|
+
const classes = useUtilityClasses(ownerState);
|
|
452
|
+
const publishMouseUp = React.useCallback(eventName => event => {
|
|
453
|
+
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
454
|
+
apiRef.current.publishEvent(eventName, params, event);
|
|
455
|
+
if (onMouseUp) {
|
|
456
|
+
onMouseUp(event);
|
|
457
|
+
}
|
|
458
|
+
}, [apiRef, field, onMouseUp, rowId]);
|
|
459
|
+
const publishMouseDown = React.useCallback(eventName => event => {
|
|
460
|
+
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
461
|
+
apiRef.current.publishEvent(eventName, params, event);
|
|
462
|
+
if (onMouseDown) {
|
|
463
|
+
onMouseDown(event);
|
|
464
|
+
}
|
|
465
|
+
}, [apiRef, field, onMouseDown, rowId]);
|
|
466
|
+
const publish = React.useCallback((eventName, propHandler) => event => {
|
|
467
|
+
// The row might have been deleted during the click
|
|
468
|
+
if (!apiRef.current.getRow(rowId)) {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
const params = apiRef.current.getCellParams(rowId, field || '');
|
|
472
|
+
apiRef.current.publishEvent(eventName, params, event);
|
|
473
|
+
if (propHandler) {
|
|
474
|
+
propHandler(event);
|
|
475
|
+
}
|
|
476
|
+
}, [apiRef, field, rowId]);
|
|
477
|
+
const style = {
|
|
478
|
+
minWidth: width,
|
|
479
|
+
maxWidth: width,
|
|
480
|
+
minHeight: height,
|
|
481
|
+
maxHeight: height === 'auto' ? 'none' : height // max-height doesn't support "auto"
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
React.useEffect(() => {
|
|
485
|
+
if (!hasFocus || cellMode === GridCellModes.Edit) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
const doc = ownerDocument(apiRef.current.rootElementRef.current);
|
|
489
|
+
if (cellRef.current && !cellRef.current.contains(doc.activeElement)) {
|
|
490
|
+
const focusableElement = cellRef.current.querySelector('[tabindex="0"]');
|
|
491
|
+
const elementToFocus = focusElementRef.current || focusableElement || cellRef.current;
|
|
492
|
+
if (doesSupportPreventScroll()) {
|
|
493
|
+
elementToFocus.focus({
|
|
494
|
+
preventScroll: true
|
|
495
|
+
});
|
|
496
|
+
} else {
|
|
497
|
+
const scrollPosition = apiRef.current.getScrollPosition();
|
|
498
|
+
elementToFocus.focus();
|
|
499
|
+
apiRef.current.scroll(scrollPosition);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}, [hasFocus, cellMode, apiRef]);
|
|
503
|
+
if (cellParamsWithAPI === EMPTY_CELL_PARAMS) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
let handleFocus = other.onFocus;
|
|
507
|
+
if (process.env.NODE_ENV === 'test' && (_rootProps$experiment2 = rootProps.experimentalFeatures) != null && _rootProps$experiment2.warnIfFocusStateIsNotSynced) {
|
|
508
|
+
handleFocus = event => {
|
|
509
|
+
const focusedCell = gridFocusCellSelector(apiRef);
|
|
510
|
+
if ((focusedCell == null ? void 0 : focusedCell.id) === rowId && focusedCell.field === field) {
|
|
511
|
+
if (typeof other.onFocus === 'function') {
|
|
512
|
+
other.onFocus(event);
|
|
513
|
+
}
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (!warnedOnce) {
|
|
517
|
+
console.warn([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : focusedCell.field}.`, "Not syncing the state may cause unwanted behaviors since the `cellFocusIn` event won't be fired.", 'Call `fireEvent.mouseUp` before the `fireEvent.click` to sync the focus with the state.'].join('\n'));
|
|
518
|
+
warnedOnce = true;
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
let children;
|
|
523
|
+
if (editCellState == null && column.renderCell) {
|
|
524
|
+
children = column.renderCell(cellParamsWithAPI);
|
|
525
|
+
classNames.push(gridClasses['cell--withRenderer']);
|
|
526
|
+
classNames.push(rootClasses == null ? void 0 : rootClasses['cell--withRenderer']);
|
|
527
|
+
}
|
|
528
|
+
if (editCellState != null && column.renderEditCell) {
|
|
529
|
+
const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
|
|
530
|
+
|
|
531
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
532
|
+
const editCellStateRest = _objectWithoutPropertiesLoose(editCellState, _excluded4);
|
|
533
|
+
const params = _extends({}, cellParamsWithAPI, {
|
|
534
|
+
row: updatedRow
|
|
535
|
+
}, editCellStateRest);
|
|
536
|
+
children = column.renderEditCell(params);
|
|
537
|
+
classNames.push(gridClasses['cell--editing']);
|
|
538
|
+
classNames.push(rootClasses == null ? void 0 : rootClasses['cell--editing']);
|
|
539
|
+
}
|
|
540
|
+
if (children === undefined) {
|
|
541
|
+
const valueString = valueToRender == null ? void 0 : valueToRender.toString();
|
|
542
|
+
children = /*#__PURE__*/_jsx("div", {
|
|
543
|
+
className: classes.content,
|
|
544
|
+
title: valueString,
|
|
545
|
+
children: valueString
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {
|
|
549
|
+
children = /*#__PURE__*/React.cloneElement(children, {
|
|
550
|
+
focusElementRef
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
const draggableEventHandlers = disableDragEvents ? null : {
|
|
554
|
+
onDragEnter: publish('cellDragEnter', onDragEnter),
|
|
555
|
+
onDragOver: publish('cellDragOver', onDragOver)
|
|
556
|
+
};
|
|
557
|
+
return /*#__PURE__*/_jsx("div", _extends({
|
|
558
|
+
ref: handleRef,
|
|
559
|
+
className: clsx(className, classNames, classes.root),
|
|
560
|
+
role: "cell",
|
|
561
|
+
"data-field": field,
|
|
562
|
+
"data-colindex": colIndex,
|
|
563
|
+
"aria-colindex": colIndex + 1,
|
|
564
|
+
"aria-colspan": colSpan,
|
|
565
|
+
style: style,
|
|
566
|
+
tabIndex: tabIndex,
|
|
567
|
+
onClick: publish('cellClick', onClick),
|
|
568
|
+
onDoubleClick: publish('cellDoubleClick', onDoubleClick),
|
|
569
|
+
onMouseOver: publish('cellMouseOver', onMouseOver),
|
|
570
|
+
onMouseDown: publishMouseDown('cellMouseDown'),
|
|
571
|
+
onMouseUp: publishMouseUp('cellMouseUp'),
|
|
572
|
+
onKeyDown: publish('cellKeyDown', onKeyDown),
|
|
573
|
+
onKeyUp: publish('cellKeyUp', onKeyUp)
|
|
574
|
+
}, draggableEventHandlers, other, {
|
|
575
|
+
onFocus: handleFocus,
|
|
576
|
+
children: children
|
|
577
|
+
}));
|
|
578
|
+
});
|
|
579
|
+
process.env.NODE_ENV !== "production" ? GridCellV7.propTypes = {
|
|
580
|
+
// ----------------------------- Warning --------------------------------
|
|
581
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
582
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
583
|
+
// ----------------------------------------------------------------------
|
|
584
|
+
align: PropTypes.oneOf(['center', 'left', 'right']).isRequired,
|
|
585
|
+
className: PropTypes.string,
|
|
586
|
+
colIndex: PropTypes.number.isRequired,
|
|
587
|
+
colSpan: PropTypes.number,
|
|
588
|
+
column: PropTypes.object.isRequired,
|
|
589
|
+
disableDragEvents: PropTypes.bool,
|
|
590
|
+
editCellState: PropTypes.shape({
|
|
591
|
+
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
592
|
+
isProcessingProps: PropTypes.bool,
|
|
593
|
+
isValidating: PropTypes.bool,
|
|
594
|
+
value: PropTypes.any
|
|
595
|
+
}),
|
|
596
|
+
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,
|
|
597
|
+
onClick: PropTypes.func,
|
|
598
|
+
onDoubleClick: PropTypes.func,
|
|
599
|
+
onDragEnter: PropTypes.func,
|
|
600
|
+
onDragOver: PropTypes.func,
|
|
601
|
+
onKeyDown: PropTypes.func,
|
|
602
|
+
onMouseDown: PropTypes.func,
|
|
603
|
+
onMouseUp: PropTypes.func,
|
|
604
|
+
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
605
|
+
showRightBorder: PropTypes.bool,
|
|
606
|
+
width: PropTypes.number.isRequired
|
|
607
|
+
} : void 0;
|
|
608
|
+
const MemoizedGridCellV7 = fastMemo(GridCellV7);
|
|
609
|
+
export { MemoizedGridCellV7 as GridCellV7 };
|
|
@@ -102,21 +102,21 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
102
102
|
/**
|
|
103
103
|
* GridApi that let you manipulate the grid.
|
|
104
104
|
*/
|
|
105
|
-
api: PropTypes.object,
|
|
105
|
+
api: PropTypes.object.isRequired,
|
|
106
106
|
/**
|
|
107
107
|
* The mode of the cell.
|
|
108
108
|
*/
|
|
109
|
-
cellMode: PropTypes.oneOf(['edit', 'view']),
|
|
109
|
+
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
110
110
|
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
111
111
|
/**
|
|
112
112
|
* The column of the row that the current cell belongs to.
|
|
113
113
|
*/
|
|
114
|
-
colDef: PropTypes.object,
|
|
114
|
+
colDef: PropTypes.object.isRequired,
|
|
115
115
|
debounceMs: PropTypes.number,
|
|
116
116
|
/**
|
|
117
117
|
* The column field of the cell that triggered the event.
|
|
118
118
|
*/
|
|
119
|
-
field: PropTypes.string,
|
|
119
|
+
field: PropTypes.string.isRequired,
|
|
120
120
|
/**
|
|
121
121
|
* The cell value formatted with the column valueFormatter.
|
|
122
122
|
*/
|
|
@@ -124,11 +124,11 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
124
124
|
/**
|
|
125
125
|
* If true, the cell is the active element.
|
|
126
126
|
*/
|
|
127
|
-
hasFocus: PropTypes.bool,
|
|
127
|
+
hasFocus: PropTypes.bool.isRequired,
|
|
128
128
|
/**
|
|
129
129
|
* The grid row id.
|
|
130
130
|
*/
|
|
131
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
131
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
132
132
|
/**
|
|
133
133
|
* If true, the cell is editable.
|
|
134
134
|
*/
|
|
@@ -145,15 +145,15 @@ process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
|
145
145
|
/**
|
|
146
146
|
* The row model of the row that the current cell belongs to.
|
|
147
147
|
*/
|
|
148
|
-
row: PropTypes.any,
|
|
148
|
+
row: PropTypes.any.isRequired,
|
|
149
149
|
/**
|
|
150
150
|
* The node of the row that the current cell belongs to.
|
|
151
151
|
*/
|
|
152
|
-
rowNode: PropTypes.object,
|
|
152
|
+
rowNode: PropTypes.object.isRequired,
|
|
153
153
|
/**
|
|
154
154
|
* the tabIndex value.
|
|
155
155
|
*/
|
|
156
|
-
tabIndex: PropTypes.oneOf([-1, 0]),
|
|
156
|
+
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
157
157
|
/**
|
|
158
158
|
* The cell value.
|
|
159
159
|
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
package/components/cell/index.js
CHANGED