@mui/x-data-grid 7.0.0-beta.6 → 7.0.0-beta.7
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 +117 -1
- package/DataGrid/DataGrid.js +44 -0
- package/DataGrid/useDataGridComponent.js +3 -0
- package/DataGrid/useDataGridProps.js +3 -2
- package/components/GridColumnHeaders.d.ts +1 -2
- package/components/GridColumnHeaders.js +6 -17
- package/components/GridHeaders.js +1 -4
- package/components/GridPagination.js +2 -7
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +4 -19
- package/components/GridScrollArea.d.ts +10 -0
- package/components/GridScrollArea.js +150 -0
- package/components/cell/GridCell.d.ts +7 -0
- package/components/cell/GridCell.js +11 -3
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -0
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/components/containers/GridRootStyles.js +12 -20
- package/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/components/virtualization/GridVirtualScroller.js +6 -1
- package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/constants/gridClasses.d.ts +6 -32
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +5 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +23 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -99
- package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/hooks/features/columnResize/columnResizeState.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeState.js +1 -0
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +44 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
- package/hooks/features/columnResize/index.d.ts +3 -0
- package/hooks/features/columnResize/index.js +3 -0
- package/hooks/features/columnResize/useGridColumnResize.d.ts +10 -0
- package/hooks/features/columnResize/useGridColumnResize.js +563 -0
- package/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/hooks/features/editing/useGridCellEditing.js +21 -2
- package/hooks/features/export/useGridPrintExport.js +8 -7
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +1 -0
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +6 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +30 -7
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +19 -2
- package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
- package/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/hooks/features/pagination/useGridPagination.d.ts +1 -6
- package/hooks/features/pagination/useGridPagination.js +9 -157
- package/hooks/features/pagination/useGridPaginationModel.d.ts +11 -0
- package/hooks/features/pagination/useGridPaginationModel.js +170 -0
- package/hooks/features/pagination/useGridRowCount.d.ts +8 -0
- package/hooks/features/pagination/useGridRowCount.js +97 -0
- package/hooks/features/scroll/useGridScroll.js +1 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +4 -4
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -2
- package/hooks/utils/useLazyRef.d.ts +1 -2
- package/hooks/utils/useLazyRef.js +1 -11
- package/hooks/utils/useOnMount.d.ts +1 -2
- package/hooks/utils/useOnMount.js +1 -7
- package/hooks/utils/useTimeout.d.ts +1 -11
- package/hooks/utils/useTimeout.js +1 -36
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/internals/utils/getPinnedCellOffset.d.ts +3 -0
- package/internals/utils/getPinnedCellOffset.js +17 -0
- package/joy/joySlots.js +13 -52
- package/locales/jaJP.js +3 -4
- package/material/index.js +0 -2
- package/models/api/gridApiCommon.d.ts +3 -3
- package/models/api/gridCoreApi.d.ts +1 -5
- package/models/events/gridEventLookup.d.ts +6 -0
- package/models/gridHeaderFilteringModel.d.ts +1 -0
- package/models/gridSlotsComponent.d.ts +0 -5
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/params/gridScrollParams.d.ts +5 -3
- package/models/props/DataGridProps.d.ts +35 -1
- package/modern/DataGrid/DataGrid.js +44 -0
- package/modern/DataGrid/useDataGridComponent.js +3 -0
- package/modern/DataGrid/useDataGridProps.js +3 -2
- package/modern/components/GridColumnHeaders.js +6 -17
- package/modern/components/GridHeaders.js +1 -4
- package/modern/components/GridPagination.js +2 -4
- package/modern/components/GridRow.js +4 -19
- package/modern/components/GridScrollArea.js +150 -0
- package/modern/components/cell/GridCell.js +11 -3
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/modern/components/containers/GridRootStyles.js +12 -20
- package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/modern/components/virtualization/GridVirtualScroller.js +6 -1
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +184 -97
- package/modern/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/modern/hooks/features/columnResize/columnResizeState.js +1 -0
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
- package/modern/hooks/features/columnResize/index.js +3 -0
- package/modern/hooks/features/columnResize/useGridColumnResize.js +553 -0
- package/modern/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/modern/hooks/features/editing/useGridCellEditing.js +21 -2
- package/modern/hooks/features/export/useGridPrintExport.js +8 -7
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
- package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/modern/hooks/features/pagination/useGridPagination.js +8 -149
- package/modern/hooks/features/pagination/useGridPaginationModel.js +165 -0
- package/modern/hooks/features/pagination/useGridRowCount.js +94 -0
- package/modern/hooks/features/scroll/useGridScroll.js +1 -1
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/modern/hooks/utils/useLazyRef.js +1 -11
- package/modern/hooks/utils/useOnMount.js +1 -7
- package/modern/hooks/utils/useTimeout.js +1 -36
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/internals/utils/getPinnedCellOffset.js +17 -0
- package/modern/joy/joySlots.js +11 -50
- package/modern/locales/jaJP.js +3 -4
- package/modern/material/index.js +0 -2
- package/modern/utils/cellBorderUtils.js +8 -0
- package/modern/utils/domUtils.js +144 -0
- package/node/DataGrid/DataGrid.js +44 -0
- package/node/DataGrid/useDataGridComponent.js +3 -0
- package/node/DataGrid/useDataGridProps.js +3 -2
- package/node/components/GridColumnHeaders.js +6 -16
- package/node/components/GridHeaders.js +1 -4
- package/node/components/GridPagination.js +1 -3
- package/node/components/GridRow.js +3 -18
- package/node/components/GridScrollArea.js +158 -0
- package/node/components/cell/GridCell.js +12 -4
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/node/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/node/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/node/components/containers/GridRootStyles.js +12 -20
- package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/node/components/virtualization/GridVirtualScroller.js +6 -1
- package/node/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +190 -103
- package/node/hooks/features/columnResize/columnResizeSelector.js +10 -0
- package/node/hooks/features/columnResize/columnResizeState.js +5 -0
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +16 -0
- package/node/hooks/features/columnResize/index.js +38 -0
- package/node/hooks/features/columnResize/useGridColumnResize.js +564 -0
- package/node/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/node/hooks/features/editing/useGridCellEditing.js +21 -2
- package/node/hooks/features/export/useGridPrintExport.js +8 -7
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +4 -1
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/node/hooks/features/pagination/useGridPagination.js +9 -153
- package/node/hooks/features/pagination/useGridPaginationModel.js +176 -0
- package/node/hooks/features/pagination/useGridRowCount.js +103 -0
- package/node/hooks/features/scroll/useGridScroll.js +1 -1
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/node/hooks/utils/useLazyRef.js +7 -13
- package/node/hooks/utils/useOnMount.js +8 -10
- package/node/hooks/utils/useTimeout.js +7 -37
- package/node/index.js +1 -1
- package/node/internals/index.js +15 -8
- package/node/internals/utils/getPinnedCellOffset.js +24 -0
- package/node/joy/joySlots.js +11 -50
- package/node/locales/jaJP.js +3 -4
- package/node/material/index.js +0 -2
- package/node/utils/cellBorderUtils.js +16 -0
- package/node/utils/domUtils.js +155 -0
- package/package.json +1 -1
- package/utils/cellBorderUtils.d.ts +3 -0
- package/utils/cellBorderUtils.js +8 -0
- package/utils/domUtils.d.ts +14 -1
- package/utils/domUtils.js +147 -0
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +0 -8
- package/components/columnHeaders/GridColumnHeadersInner.js +0 -58
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +0 -58
- package/node/components/columnHeaders/GridColumnHeadersInner.js +0 -67
package/modern/joy/joySlots.js
CHANGED
|
@@ -4,10 +4,9 @@ const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size",
|
|
|
4
4
|
_excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
5
5
|
_excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
6
6
|
_excluded4 = ["color", "size", "sx", "touchRippleRef"],
|
|
7
|
-
_excluded5 = ["
|
|
8
|
-
_excluded6 = ["
|
|
9
|
-
_excluded7 = ["
|
|
10
|
-
_excluded8 = ["shrink", "variant", "sx"];
|
|
7
|
+
_excluded5 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
8
|
+
_excluded6 = ["native"],
|
|
9
|
+
_excluded7 = ["shrink", "variant", "sx"];
|
|
11
10
|
import * as React from 'react';
|
|
12
11
|
import JoyCheckbox from '@mui/joy/Checkbox';
|
|
13
12
|
import JoyInput from '@mui/joy/Input';
|
|
@@ -15,7 +14,6 @@ import JoyFormControl from '@mui/joy/FormControl';
|
|
|
15
14
|
import JoyFormLabel from '@mui/joy/FormLabel';
|
|
16
15
|
import JoyButton from '@mui/joy/Button';
|
|
17
16
|
import JoyIconButton from '@mui/joy/IconButton';
|
|
18
|
-
import JoySwitch from '@mui/joy/Switch';
|
|
19
17
|
import JoySelect from '@mui/joy/Select';
|
|
20
18
|
import JoyOption from '@mui/joy/Option';
|
|
21
19
|
import JoyBox from '@mui/joy/Box';
|
|
@@ -154,43 +152,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref)
|
|
|
154
152
|
sx: sx
|
|
155
153
|
}));
|
|
156
154
|
});
|
|
157
|
-
const
|
|
158
|
-
let {
|
|
159
|
-
name,
|
|
160
|
-
color: colorProp,
|
|
161
|
-
edge,
|
|
162
|
-
icon,
|
|
163
|
-
inputProps,
|
|
164
|
-
inputRef,
|
|
165
|
-
size,
|
|
166
|
-
sx,
|
|
167
|
-
onChange,
|
|
168
|
-
onClick
|
|
169
|
-
} = _ref5,
|
|
170
|
-
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
171
|
-
return /*#__PURE__*/_jsx(JoySwitch, _extends({}, props, {
|
|
172
|
-
onChange: onChange,
|
|
173
|
-
size: convertSize(size),
|
|
174
|
-
color: convertColor(colorProp),
|
|
175
|
-
ref: ref,
|
|
176
|
-
slotProps: {
|
|
177
|
-
input: _extends({}, inputProps, {
|
|
178
|
-
name,
|
|
179
|
-
onClick: onClick,
|
|
180
|
-
ref: inputRef
|
|
181
|
-
}),
|
|
182
|
-
thumb: {
|
|
183
|
-
children: icon
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
sx: [_extends({}, edge === 'start' && {
|
|
187
|
-
ml: '-8px'
|
|
188
|
-
}, edge === 'end' && {
|
|
189
|
-
mr: '-8px'
|
|
190
|
-
}), ...(Array.isArray(sx) ? sx : [sx])]
|
|
191
|
-
}));
|
|
192
|
-
});
|
|
193
|
-
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
155
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
194
156
|
let {
|
|
195
157
|
open,
|
|
196
158
|
onOpen,
|
|
@@ -202,8 +164,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
202
164
|
MenuProps,
|
|
203
165
|
inputRef,
|
|
204
166
|
labelId
|
|
205
|
-
} =
|
|
206
|
-
props = _objectWithoutPropertiesLoose(
|
|
167
|
+
} = _ref5,
|
|
168
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
207
169
|
const handleChange = (event, newValue) => {
|
|
208
170
|
if (event && onChange) {
|
|
209
171
|
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
@@ -254,17 +216,17 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
254
216
|
}
|
|
255
217
|
}));
|
|
256
218
|
});
|
|
257
|
-
const Option = /*#__PURE__*/React.forwardRef((
|
|
258
|
-
let props = _objectWithoutPropertiesLoose(
|
|
219
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
220
|
+
let props = _objectWithoutPropertiesLoose(_ref6, _excluded6);
|
|
259
221
|
return /*#__PURE__*/_jsx(JoyOption, _extends({}, props, {
|
|
260
222
|
ref: ref
|
|
261
223
|
}));
|
|
262
224
|
});
|
|
263
|
-
const InputLabel = /*#__PURE__*/React.forwardRef((
|
|
225
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
264
226
|
let {
|
|
265
227
|
sx
|
|
266
|
-
} =
|
|
267
|
-
props = _objectWithoutPropertiesLoose(
|
|
228
|
+
} = _ref7,
|
|
229
|
+
props = _objectWithoutPropertiesLoose(_ref7, _excluded7);
|
|
268
230
|
return /*#__PURE__*/_jsx(JoyFormLabel, _extends({}, props, {
|
|
269
231
|
ref: ref,
|
|
270
232
|
sx: sx
|
|
@@ -394,7 +356,6 @@ const joySlots = _extends({}, joyIconSlots, {
|
|
|
394
356
|
baseTextField: TextField,
|
|
395
357
|
baseButton: Button,
|
|
396
358
|
baseIconButton: IconButton,
|
|
397
|
-
baseSwitch: Switch,
|
|
398
359
|
baseSelect: Select,
|
|
399
360
|
baseSelectOption: Option,
|
|
400
361
|
baseInputLabel: InputLabel,
|
package/modern/locales/jaJP.js
CHANGED
|
@@ -30,10 +30,9 @@ const jaJPGrid = {
|
|
|
30
30
|
toolbarExportPrint: '印刷',
|
|
31
31
|
toolbarExportExcel: 'Excelダウンロード',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: '検索',
|
|
34
|
+
columnsManagementNoColumns: 'カラムなし',
|
|
35
|
+
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'フィルター追加',
|
|
39
38
|
filterPanelRemoveAll: 'すべて削除',
|
package/modern/material/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import MUICheckbox from '@mui/material/Checkbox';
|
|
|
3
3
|
import MUITextField from '@mui/material/TextField';
|
|
4
4
|
import MUIFormControl from '@mui/material/FormControl';
|
|
5
5
|
import MUISelect from '@mui/material/Select';
|
|
6
|
-
import MUISwitch from '@mui/material/Switch';
|
|
7
6
|
import MUIButton from '@mui/material/Button';
|
|
8
7
|
import MUIIconButton from '@mui/material/IconButton';
|
|
9
8
|
import MUIInputAdornment from '@mui/material/InputAdornment';
|
|
@@ -56,7 +55,6 @@ const materialSlots = _extends({}, iconSlots, {
|
|
|
56
55
|
baseTextField: MUITextField,
|
|
57
56
|
baseFormControl: MUIFormControl,
|
|
58
57
|
baseSelect: MUISelect,
|
|
59
|
-
baseSwitch: MUISwitch,
|
|
60
58
|
baseButton: MUIButton,
|
|
61
59
|
baseIconButton: MUIIconButton,
|
|
62
60
|
baseInputAdornment: MUIInputAdornment,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
|
|
2
|
+
export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
|
|
3
|
+
const isSectionLastCell = indexInSection === sectionLength - 1;
|
|
4
|
+
return showCellVerticalBorderRootProp && (pinnedPosition !== GridPinnedColumnPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === GridPinnedColumnPosition.LEFT && isSectionLastCell;
|
|
5
|
+
};
|
|
6
|
+
export const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
|
|
7
|
+
return pinnedPosition === GridPinnedColumnPosition.RIGHT && indexInSection === 0;
|
|
8
|
+
};
|
package/modern/utils/domUtils.js
CHANGED
|
@@ -46,4 +46,148 @@ export function isEventTargetInPortal(event) {
|
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
48
|
return false;
|
|
49
|
+
}
|
|
50
|
+
export function getFieldFromHeaderElem(colCellEl) {
|
|
51
|
+
return colCellEl.getAttribute('data-field');
|
|
52
|
+
}
|
|
53
|
+
export function findHeaderElementFromField(elem, field) {
|
|
54
|
+
return elem.querySelector(`[data-field="${field}"]`);
|
|
55
|
+
}
|
|
56
|
+
export function findGroupHeaderElementsFromField(elem, field) {
|
|
57
|
+
return Array.from(elem.querySelectorAll(`[data-fields*="|-${field}-|"]`) ?? []);
|
|
58
|
+
}
|
|
59
|
+
export function findGridCellElementsFromCol(col, api) {
|
|
60
|
+
const root = findParentElementFromClassName(col, gridClasses.root);
|
|
61
|
+
if (!root) {
|
|
62
|
+
throw new Error('MUI X: The root element is not found.');
|
|
63
|
+
}
|
|
64
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
65
|
+
if (!ariaColIndex) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
const colIndex = Number(ariaColIndex) - 1;
|
|
69
|
+
const cells = [];
|
|
70
|
+
if (!api.virtualScrollerRef?.current) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
queryRows(api).forEach(rowElement => {
|
|
74
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
75
|
+
if (!rowId) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
let columnIndex = colIndex;
|
|
79
|
+
const cellColSpanInfo = api.unstable_getCellColSpanInfo(rowId, colIndex);
|
|
80
|
+
if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {
|
|
81
|
+
columnIndex = cellColSpanInfo.leftVisibleCellIndex;
|
|
82
|
+
}
|
|
83
|
+
const cell = rowElement.querySelector(`[data-colindex="${columnIndex}"]`);
|
|
84
|
+
if (cell) {
|
|
85
|
+
cells.push(cell);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return cells;
|
|
89
|
+
}
|
|
90
|
+
export function findGridElement(api, klass) {
|
|
91
|
+
return api.rootElementRef.current.querySelector(`.${gridClasses[klass]}`);
|
|
92
|
+
}
|
|
93
|
+
const findPinnedCells = ({
|
|
94
|
+
api,
|
|
95
|
+
colIndex,
|
|
96
|
+
position,
|
|
97
|
+
filterFn
|
|
98
|
+
}) => {
|
|
99
|
+
if (colIndex === null) {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
const cells = [];
|
|
103
|
+
queryRows(api).forEach(rowElement => {
|
|
104
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
105
|
+
if (!rowId) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
rowElement.querySelectorAll(`.${gridClasses[position === 'left' ? 'cell--pinnedLeft' : 'cell--pinnedRight']}`).forEach(cell => {
|
|
109
|
+
const currentColIndex = parseCellColIndex(cell);
|
|
110
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
111
|
+
cells.push(cell);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
return cells;
|
|
116
|
+
};
|
|
117
|
+
export function findLeftPinnedCellsAfterCol(api, col) {
|
|
118
|
+
const colIndex = parseCellColIndex(col);
|
|
119
|
+
return findPinnedCells({
|
|
120
|
+
api,
|
|
121
|
+
colIndex,
|
|
122
|
+
position: 'left',
|
|
123
|
+
filterFn: index => index > colIndex
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export function findRightPinnedCellsBeforeCol(api, col) {
|
|
127
|
+
const colIndex = parseCellColIndex(col);
|
|
128
|
+
return findPinnedCells({
|
|
129
|
+
api,
|
|
130
|
+
colIndex,
|
|
131
|
+
position: 'right',
|
|
132
|
+
filterFn: index => index < colIndex
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const findPinnedHeaders = ({
|
|
136
|
+
api,
|
|
137
|
+
colIndex,
|
|
138
|
+
position,
|
|
139
|
+
filterFn
|
|
140
|
+
}) => {
|
|
141
|
+
if (!api.columnHeadersContainerRef?.current) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
if (colIndex === null) {
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
147
|
+
const elements = [];
|
|
148
|
+
api.columnHeadersContainerRef.current.querySelectorAll(`.${gridClasses[position === 'left' ? 'columnHeader--pinnedLeft' : 'columnHeader--pinnedRight']}`).forEach(element => {
|
|
149
|
+
const currentColIndex = parseCellColIndex(element);
|
|
150
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
151
|
+
elements.push(element);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
return elements;
|
|
155
|
+
};
|
|
156
|
+
export function findLeftPinnedHeadersAfterCol(api, col) {
|
|
157
|
+
const colIndex = parseCellColIndex(col);
|
|
158
|
+
return findPinnedHeaders({
|
|
159
|
+
api,
|
|
160
|
+
position: 'left',
|
|
161
|
+
colIndex,
|
|
162
|
+
filterFn: index => index > colIndex
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
export function findRightPinnedHeadersBeforeCol(api, col) {
|
|
166
|
+
const colIndex = parseCellColIndex(col);
|
|
167
|
+
return findPinnedHeaders({
|
|
168
|
+
api,
|
|
169
|
+
position: 'right',
|
|
170
|
+
colIndex,
|
|
171
|
+
filterFn: index => index < colIndex
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
export function findGridHeader(api, field) {
|
|
175
|
+
const headers = api.columnHeadersContainerRef.current;
|
|
176
|
+
return headers.querySelector(`:scope > div > [data-field="${field}"][role="columnheader"]`);
|
|
177
|
+
}
|
|
178
|
+
export function findGridCells(api, field) {
|
|
179
|
+
const container = api.virtualScrollerRef.current;
|
|
180
|
+
return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${field}"][role="gridcell"]`));
|
|
181
|
+
}
|
|
182
|
+
function queryRows(api) {
|
|
183
|
+
return api.virtualScrollerRef.current.querySelectorAll(
|
|
184
|
+
// Use > to ignore rows from nested data grids (e.g. in detail panel)
|
|
185
|
+
`:scope > div > div > .${gridClasses.row}`);
|
|
186
|
+
}
|
|
187
|
+
function parseCellColIndex(col) {
|
|
188
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
189
|
+
if (!ariaColIndex) {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
return Number(ariaColIndex) - 1;
|
|
49
193
|
}
|
|
@@ -74,6 +74,21 @@ DataGridRaw.propTypes = {
|
|
|
74
74
|
* @default false
|
|
75
75
|
*/
|
|
76
76
|
autoPageSize: _propTypes.default.bool,
|
|
77
|
+
/**
|
|
78
|
+
* If `true`, columns are autosized after the datagrid is mounted.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
autosizeOnMount: _propTypes.default.bool,
|
|
82
|
+
/**
|
|
83
|
+
* The options for autosize when user-initiated.
|
|
84
|
+
*/
|
|
85
|
+
autosizeOptions: _propTypes.default.shape({
|
|
86
|
+
columns: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
87
|
+
expand: _propTypes.default.bool,
|
|
88
|
+
includeHeaders: _propTypes.default.bool,
|
|
89
|
+
includeOutliers: _propTypes.default.bool,
|
|
90
|
+
outliersFactor: _propTypes.default.number
|
|
91
|
+
}),
|
|
77
92
|
/**
|
|
78
93
|
* Controls the modes of the cells.
|
|
79
94
|
*/
|
|
@@ -122,6 +137,11 @@ DataGridRaw.propTypes = {
|
|
|
122
137
|
* @default "standard"
|
|
123
138
|
*/
|
|
124
139
|
density: _propTypes.default.oneOf(['comfortable', 'compact', 'standard']),
|
|
140
|
+
/**
|
|
141
|
+
* If `true`, column autosizing on header separator double-click is disabled.
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
disableAutosize: _propTypes.default.bool,
|
|
125
145
|
/**
|
|
126
146
|
* If `true`, column filters are disabled.
|
|
127
147
|
* @default false
|
|
@@ -132,6 +152,11 @@ DataGridRaw.propTypes = {
|
|
|
132
152
|
* @default false
|
|
133
153
|
*/
|
|
134
154
|
disableColumnMenu: _propTypes.default.bool,
|
|
155
|
+
/**
|
|
156
|
+
* If `true`, resizing columns is disabled.
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
disableColumnResize: _propTypes.default.bool,
|
|
135
160
|
/**
|
|
136
161
|
* If `true`, hiding/showing columns is disabled.
|
|
137
162
|
* @default false
|
|
@@ -429,12 +454,26 @@ DataGridRaw.propTypes = {
|
|
|
429
454
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
430
455
|
*/
|
|
431
456
|
onColumnOrderChange: _propTypes.default.func,
|
|
457
|
+
/**
|
|
458
|
+
* Callback fired while a column is being resized.
|
|
459
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
460
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
461
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
462
|
+
*/
|
|
463
|
+
onColumnResize: _propTypes.default.func,
|
|
432
464
|
/**
|
|
433
465
|
* Callback fired when the column visibility model changes.
|
|
434
466
|
* @param {GridColumnVisibilityModel} model The new model.
|
|
435
467
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
436
468
|
*/
|
|
437
469
|
onColumnVisibilityModelChange: _propTypes.default.func,
|
|
470
|
+
/**
|
|
471
|
+
* Callback fired when the width of a column is changed.
|
|
472
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
473
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
474
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
475
|
+
*/
|
|
476
|
+
onColumnWidthChange: _propTypes.default.func,
|
|
438
477
|
/**
|
|
439
478
|
* Callback fired when the Filter model changes before the filters are applied.
|
|
440
479
|
* @param {GridFilterModel} model With all properties from [[GridFilterModel]].
|
|
@@ -495,6 +534,11 @@ DataGridRaw.propTypes = {
|
|
|
495
534
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
496
535
|
*/
|
|
497
536
|
onRowClick: _propTypes.default.func,
|
|
537
|
+
/**
|
|
538
|
+
* Callback fired when the row count has changed.
|
|
539
|
+
* @param {number} count Updated row count.
|
|
540
|
+
*/
|
|
541
|
+
onRowCountChange: _propTypes.default.func,
|
|
498
542
|
/**
|
|
499
543
|
* Callback fired when a double click event comes from a row container element.
|
|
500
544
|
* @param {GridRowParams} params With all properties from [[RowParams]].
|
|
@@ -32,6 +32,7 @@ var _useGridStatePersistence = require("../hooks/features/statePersistence/useGr
|
|
|
32
32
|
var _useGridColumnSpanning = require("../hooks/features/columns/useGridColumnSpanning");
|
|
33
33
|
var _useGridColumnGrouping = require("../hooks/features/columnGrouping/useGridColumnGrouping");
|
|
34
34
|
var _virtualization = require("../hooks/features/virtualization");
|
|
35
|
+
var _useGridColumnResize = require("../hooks/features/columnResize/useGridColumnResize");
|
|
35
36
|
const useDataGridComponent = (inputApiRef, props) => {
|
|
36
37
|
const apiRef = (0, _useGridInitialization.useGridInitialization)(inputApiRef, props);
|
|
37
38
|
|
|
@@ -54,6 +55,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
54
55
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPreferencesPanel.preferencePanelStateInitializer, apiRef, props);
|
|
55
56
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridFilter.filterStateInitializer, apiRef, props);
|
|
56
57
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridDensity.densityStateInitializer, apiRef, props);
|
|
58
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnResize.columnResizeStateInitializer, apiRef, props);
|
|
57
59
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
|
|
58
60
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
|
|
59
61
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnMenu.columnMenuStateInitializer, apiRef, props);
|
|
@@ -72,6 +74,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
72
74
|
(0, _useGridFilter.useGridFilter)(apiRef, props);
|
|
73
75
|
(0, _useGridSorting.useGridSorting)(apiRef, props);
|
|
74
76
|
(0, _useGridDensity.useGridDensity)(apiRef, props);
|
|
77
|
+
(0, _useGridColumnResize.useGridColumnResize)(apiRef, props);
|
|
75
78
|
(0, _useGridPagination.useGridPagination)(apiRef, props);
|
|
76
79
|
(0, _useGridRowsMeta.useGridRowsMeta)(apiRef, props);
|
|
77
80
|
(0, _useGridScroll.useGridScroll)(apiRef, props);
|
|
@@ -22,7 +22,6 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
22
22
|
pagination: true,
|
|
23
23
|
checkboxSelectionVisibleOnly: false,
|
|
24
24
|
disableColumnReorder: true,
|
|
25
|
-
disableColumnResize: true,
|
|
26
25
|
keepColumnPositionIfDraggedOutside: false,
|
|
27
26
|
signature: 'DataGrid'
|
|
28
27
|
};
|
|
@@ -79,7 +78,9 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
|
|
|
79
78
|
keepColumnPositionIfDraggedOutside: false,
|
|
80
79
|
ignoreValueFormatterDuringExport: false,
|
|
81
80
|
clipboardCopyCellDelimiter: '\t',
|
|
82
|
-
rowPositionsDebounceMs: 166
|
|
81
|
+
rowPositionsDebounceMs: 166,
|
|
82
|
+
autosizeOnMount: false,
|
|
83
|
+
disableAutosize: false
|
|
83
84
|
};
|
|
84
85
|
const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
85
86
|
const useDataGridProps = inProps => {
|
|
@@ -9,18 +9,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _utils = require("@mui/utils");
|
|
13
12
|
var _fastMemo = require("../utils/fastMemo");
|
|
14
13
|
var _useGridColumnHeaders = require("../hooks/features/columnHeaders/useGridColumnHeaders");
|
|
15
14
|
var _GridBaseColumnHeaders = require("./columnHeaders/GridBaseColumnHeaders");
|
|
16
|
-
var _GridColumnHeadersInner = require("./columnHeaders/GridColumnHeadersInner");
|
|
17
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["
|
|
16
|
+
const _excluded = ["className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
|
|
19
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
19
|
const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
|
|
22
20
|
const {
|
|
23
|
-
innerRef,
|
|
24
21
|
visibleColumns,
|
|
25
22
|
sortColumnLookup,
|
|
26
23
|
filterColumnLookup,
|
|
@@ -36,12 +33,10 @@ const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeade
|
|
|
36
33
|
} = props,
|
|
37
34
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
38
35
|
const {
|
|
39
|
-
isDragging,
|
|
40
36
|
getInnerProps,
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
getColumnHeadersRow,
|
|
38
|
+
getColumnGroupHeadersRows
|
|
43
39
|
} = (0, _useGridColumnHeaders.useGridColumnHeaders)({
|
|
44
|
-
innerRef,
|
|
45
40
|
visibleColumns,
|
|
46
41
|
sortColumnLookup,
|
|
47
42
|
filterColumnLookup,
|
|
@@ -55,14 +50,10 @@ const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeade
|
|
|
55
50
|
columnGroupsHeaderStructure,
|
|
56
51
|
hasOtherElementInTabSequence
|
|
57
52
|
});
|
|
58
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridBaseColumnHeaders.GridBaseColumnHeaders, (0, _extends2.default)({
|
|
59
54
|
ref: ref
|
|
60
|
-
}, other, {
|
|
61
|
-
children:
|
|
62
|
-
isDragging: isDragging
|
|
63
|
-
}, getInnerProps(), {
|
|
64
|
-
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
65
|
-
}))
|
|
55
|
+
}, other, getInnerProps(), {
|
|
56
|
+
children: [getColumnGroupHeadersRows(), getColumnHeadersRow()]
|
|
66
57
|
}));
|
|
67
58
|
});
|
|
68
59
|
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
@@ -96,7 +87,6 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
|
96
87
|
filterColumnLookup: _propTypes.default.object.isRequired,
|
|
97
88
|
hasOtherElementInTabSequence: _propTypes.default.bool.isRequired,
|
|
98
89
|
headerGroupingMaxDepth: _propTypes.default.number.isRequired,
|
|
99
|
-
innerRef: _utils.refType,
|
|
100
90
|
sortColumnLookup: _propTypes.default.object.isRequired,
|
|
101
91
|
visibleColumns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
|
|
102
92
|
} : void 0;
|
|
@@ -34,15 +34,12 @@ function GridHeaders() {
|
|
|
34
34
|
const columnVisibility = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnVisibilityModelSelector);
|
|
35
35
|
const columnGroupsHeaderStructure = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsHeaderStructureSelector);
|
|
36
36
|
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);
|
|
37
|
-
const columnHeadersRef = React.useRef(null);
|
|
38
37
|
const columnsContainerRef = React.useRef(null);
|
|
39
38
|
apiRef.current.register('private', {
|
|
40
|
-
|
|
41
|
-
columnHeadersElementRef: columnHeadersRef
|
|
39
|
+
columnHeadersContainerRef: columnsContainerRef
|
|
42
40
|
});
|
|
43
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnHeaders, {
|
|
44
42
|
ref: columnsContainerRef,
|
|
45
|
-
innerRef: columnHeadersRef,
|
|
46
43
|
visibleColumns: visibleColumns,
|
|
47
44
|
filterColumnLookup: filterColumnLookup,
|
|
48
45
|
sortColumnLookup: sortColumnLookup,
|
|
@@ -12,7 +12,6 @@ var _styles = require("@mui/material/styles");
|
|
|
12
12
|
var _useGridSelector = require("../hooks/utils/useGridSelector");
|
|
13
13
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
14
14
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
15
|
-
var _filter = require("../hooks/features/filter");
|
|
16
15
|
var _gridPaginationSelector = require("../hooks/features/pagination/gridPaginationSelector");
|
|
17
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -40,8 +39,7 @@ const GridPagination = exports.GridPagination = /*#__PURE__*/React.forwardRef(fu
|
|
|
40
39
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
41
40
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
42
41
|
const paginationModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridPaginationSelector.gridPaginationModelSelector);
|
|
43
|
-
const
|
|
44
|
-
const rowCount = React.useMemo(() => rootProps.rowCount ?? visibleTopLevelRowCount ?? 0, [rootProps.rowCount, visibleTopLevelRowCount]);
|
|
42
|
+
const rowCount = (0, _useGridSelector.useGridSelector)(apiRef, _gridPaginationSelector.gridPaginationRowCountSelector);
|
|
45
43
|
const lastPage = React.useMemo(() => {
|
|
46
44
|
const calculatedValue = Math.ceil(rowCount / (paginationModel.pageSize || 1)) - 1;
|
|
47
45
|
return Math.max(0, calculatedValue);
|
|
@@ -29,6 +29,7 @@ var _gridColumnGroupsSelector = require("../hooks/features/columnGrouping/gridCo
|
|
|
29
29
|
var _gridEditingSelectors = require("../hooks/features/editing/gridEditingSelectors");
|
|
30
30
|
var _GridCell = require("./cell/GridCell");
|
|
31
31
|
var _GridScrollbarFillerCell = require("./GridScrollbarFillerCell");
|
|
32
|
+
var _getPinnedCellOffset = require("../internals/utils/getPinnedCellOffset");
|
|
32
33
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
34
|
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "pinnedColumns", "offsetTop", "offsetLeft", "dimensions", "renderContext", "focusedColumnIndex", "isFirstVisible", "isLastVisible", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
34
35
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -259,21 +260,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
259
260
|
}
|
|
260
261
|
const width = cellColSpanInfo?.cellProps.width ?? column.computedWidth;
|
|
261
262
|
const colSpan = cellColSpanInfo?.cellProps.colSpan ?? 1;
|
|
262
|
-
|
|
263
|
-
// FIXME: Why is the switch check exhaustiveness not validated with typescript-eslint?
|
|
264
|
-
// eslint-disable-next-line default-case
|
|
265
|
-
switch (pinnedPosition) {
|
|
266
|
-
case _GridCell.PinnedPosition.LEFT:
|
|
267
|
-
pinnedOffset = columnPositions[indexRelativeToAllColumns];
|
|
268
|
-
break;
|
|
269
|
-
case _GridCell.PinnedPosition.RIGHT:
|
|
270
|
-
pinnedOffset = dimensions.columnsTotalWidth - columnPositions[indexRelativeToAllColumns] - column.computedWidth + scrollbarWidth;
|
|
271
|
-
break;
|
|
272
|
-
case _GridCell.PinnedPosition.NONE:
|
|
273
|
-
case _GridCell.PinnedPosition.VIRTUAL:
|
|
274
|
-
pinnedOffset = 0;
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
263
|
+
const pinnedOffset = (0, _getPinnedCellOffset.getPinnedCellOffset)(_GridCell.gridPinnedColumnPositionLookup[pinnedPosition], column.computedWidth, indexRelativeToAllColumns, columnPositions, dimensions);
|
|
277
264
|
if (rowNode?.type === 'skeletonRow') {
|
|
278
265
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(slots.skeletonCell, {
|
|
279
266
|
width: width,
|
|
@@ -365,9 +352,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
365
352
|
width: emptyCellWidth
|
|
366
353
|
}), rightCells.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
367
354
|
role: "presentation",
|
|
368
|
-
|
|
369
|
-
flex: '1'
|
|
370
|
-
}
|
|
355
|
+
className: _gridClasses.gridClasses.filler
|
|
371
356
|
}), rightCells, scrollbarWidth !== 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridScrollbarFillerCell.GridScrollbarFillerCell, {
|
|
372
357
|
pinnedRight: pinnedColumns.right.length > 0
|
|
373
358
|
})]
|