@mui/x-data-grid 7.1.0 → 7.2.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 +261 -4
- package/README.md +1 -1
- package/components/GridRow.js +3 -1
- package/components/cell/GridCell.d.ts +1 -0
- package/components/cell/GridCell.js +4 -3
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +1 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +3 -2
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +1 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +4 -2
- package/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/components/containers/GridRootStyles.js +5 -3
- package/components/panel/filterPanel/GridFilterInputDate.js +5 -1
- package/components/virtualization/GridMainContainer.js +8 -1
- package/components/virtualization/GridTopContainer.js +1 -0
- package/constants/gridClasses.d.ts +5 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/core/useGridInitialization.js +1 -1
- package/hooks/core/useGridStateInitialization.d.ts +1 -2
- package/hooks/core/useGridStateInitialization.js +6 -10
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +7 -3
- package/hooks/features/editing/useGridCellEditing.js +3 -1
- package/hooks/features/editing/useGridRowEditing.js +3 -1
- package/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +2 -2
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +4 -7
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -3
- package/hooks/features/virtualization/useGridVirtualScroller.js +17 -6
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/utils/propValidation.d.ts +1 -0
- package/internals/utils/propValidation.js +9 -4
- package/locales/deDE.js +3 -4
- package/locales/esES.js +3 -4
- package/locales/faIR.js +3 -4
- package/locales/frFR.js +5 -6
- package/locales/ptBR.js +3 -4
- package/locales/svSE.js +3 -4
- package/models/api/gridCallbackDetails.d.ts +5 -0
- package/models/gridExport.d.ts +2 -2
- package/models/gridFilterModel.d.ts +3 -3
- package/models/params/gridCellParams.d.ts +0 -22
- package/models/props/DataGridProps.d.ts +19 -0
- package/modern/components/GridRow.js +3 -1
- package/modern/components/cell/GridCell.js +4 -3
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +3 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +4 -2
- package/modern/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/modern/components/containers/GridRootStyles.js +5 -3
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +5 -1
- package/modern/components/virtualization/GridMainContainer.js +8 -1
- package/modern/components/virtualization/GridTopContainer.js +1 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/core/useGridInitialization.js +1 -1
- package/modern/hooks/core/useGridStateInitialization.js +6 -10
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +7 -3
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -1
- package/modern/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +4 -7
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -3
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +17 -6
- package/modern/index.js +1 -1
- package/modern/internals/utils/propValidation.js +9 -4
- package/modern/locales/deDE.js +3 -4
- package/modern/locales/esES.js +3 -4
- package/modern/locales/faIR.js +3 -4
- package/modern/locales/frFR.js +5 -6
- package/modern/locales/ptBR.js +3 -4
- package/modern/locales/svSE.js +3 -4
- package/modern/utils/cellBorderUtils.js +15 -2
- package/node/components/GridRow.js +3 -1
- package/node/components/cell/GridCell.js +4 -3
- package/node/components/columnHeaders/GridColumnGroupHeader.js +3 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +4 -2
- package/node/components/columnHeaders/GridColumnHeaderSeparator.js +1 -1
- package/node/components/containers/GridRootStyles.js +5 -3
- package/node/components/panel/filterPanel/GridFilterInputDate.js +5 -1
- package/node/components/virtualization/GridMainContainer.js +8 -1
- package/node/components/virtualization/GridTopContainer.js +1 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/core/useGridInitialization.js +1 -1
- package/node/hooks/core/useGridStateInitialization.js +6 -10
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +7 -3
- package/node/hooks/features/editing/useGridCellEditing.js +3 -1
- package/node/hooks/features/editing/useGridRowEditing.js +3 -1
- package/node/hooks/features/export/serializers/csvSerializer.js +6 -5
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +4 -7
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -3
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -6
- package/node/index.js +1 -1
- package/node/internals/utils/propValidation.js +12 -6
- package/node/locales/deDE.js +3 -4
- package/node/locales/esES.js +3 -4
- package/node/locales/faIR.js +3 -4
- package/node/locales/frFR.js +5 -6
- package/node/locales/ptBR.js +3 -4
- package/node/locales/svSE.js +3 -4
- package/node/utils/cellBorderUtils.js +15 -2
- package/package.json +2 -2
- package/themeAugmentation/overrides.d.ts +6 -0
- package/utils/cellBorderUtils.d.ts +1 -1
- package/utils/cellBorderUtils.js +15 -2
|
@@ -151,8 +151,8 @@ export const GridRootStyles = styled('div', {
|
|
|
151
151
|
}) => {
|
|
152
152
|
const borderColor = getBorderColor(t);
|
|
153
153
|
const radius = t.shape.borderRadius;
|
|
154
|
-
const containerBackground = t.vars ? t.vars.palette.background.default : t.palette.background.default;
|
|
155
|
-
const pinnedBackground = containerBackground;
|
|
154
|
+
const containerBackground = t.vars ? t.vars.palette.background.default : t.mixins.MuiDataGrid?.containerBackground ?? t.palette.background.default;
|
|
155
|
+
const pinnedBackground = t.mixins.MuiDataGrid?.pinnedBackground ?? containerBackground;
|
|
156
156
|
const overlayBackground = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : alpha(t.palette.background.default, t.palette.action.disabledOpacity);
|
|
157
157
|
const hoverOpacity = (t.vars || t).palette.action.hoverOpacity;
|
|
158
158
|
const hoverColor = (t.vars || t).palette.action.hover;
|
|
@@ -450,7 +450,6 @@ export const GridRootStyles = styled('div', {
|
|
|
450
450
|
userSelect: 'none'
|
|
451
451
|
},
|
|
452
452
|
[`& .${c['row--dynamicHeight']} > .${c.cell}`]: {
|
|
453
|
-
overflow: 'initial',
|
|
454
453
|
whiteSpace: 'initial',
|
|
455
454
|
lineHeight: 'inherit'
|
|
456
455
|
},
|
|
@@ -632,6 +631,9 @@ export const GridRootStyles = styled('div', {
|
|
|
632
631
|
},
|
|
633
632
|
[`& .${c.filler}`]: {
|
|
634
633
|
flex: 1
|
|
634
|
+
},
|
|
635
|
+
[`& .${c['filler--borderTop']}`]: {
|
|
636
|
+
borderTop: '1px solid var(--DataGrid-rowBorderColor)'
|
|
635
637
|
}
|
|
636
638
|
});
|
|
637
639
|
return gridStyle;
|
|
@@ -12,6 +12,9 @@ function convertFilterItemValueToInputValue(itemValue, inputType) {
|
|
|
12
12
|
return '';
|
|
13
13
|
}
|
|
14
14
|
const dateCopy = new Date(itemValue);
|
|
15
|
+
if (Number.isNaN(dateCopy.getTime())) {
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
15
18
|
// The date picker expects the date to be in the local timezone.
|
|
16
19
|
// But .toISOString() converts it to UTC with zero offset.
|
|
17
20
|
// So we need to subtract the timezone offset.
|
|
@@ -48,8 +51,9 @@ function GridFilterInputDate(props) {
|
|
|
48
51
|
setFilterValueState(value);
|
|
49
52
|
setIsApplying(true);
|
|
50
53
|
filterTimeout.start(rootProps.filterDebounceMs, () => {
|
|
54
|
+
const date = new Date(value);
|
|
51
55
|
applyValue(_extends({}, item, {
|
|
52
|
-
value:
|
|
56
|
+
value: Number.isNaN(date.getTime()) ? undefined : date
|
|
53
57
|
}));
|
|
54
58
|
setIsApplying(false);
|
|
55
59
|
});
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { styled } from '@mui/system';
|
|
4
|
+
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
4
5
|
import { useGridAriaAttributes } from '../../hooks/utils/useGridAriaAttributes';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const Element = styled('div'
|
|
7
|
+
const Element = styled('div', {
|
|
8
|
+
name: 'MuiDataGrid',
|
|
9
|
+
slot: 'Main',
|
|
10
|
+
overridesResolver: (props, styles) => styles.main
|
|
11
|
+
})({
|
|
7
12
|
flexGrow: 1,
|
|
8
13
|
position: 'relative',
|
|
9
14
|
overflow: 'hidden'
|
|
10
15
|
});
|
|
11
16
|
export const GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
17
|
const ariaAttributes = useGridAriaAttributes();
|
|
18
|
+
const rootProps = useGridRootProps();
|
|
13
19
|
return /*#__PURE__*/_jsx(Element, _extends({
|
|
14
20
|
ref: ref,
|
|
21
|
+
ownerState: rootProps,
|
|
15
22
|
className: props.className,
|
|
16
23
|
tabIndex: -1
|
|
17
24
|
}, ariaAttributes, {
|
|
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_gen
|
|
|
2
2
|
export function getDataGridUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiDataGrid', slot);
|
|
4
4
|
}
|
|
5
|
-
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
5
|
+
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderTop', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -15,7 +15,7 @@ export const useGridInitialization = (inputApiRef, props) => {
|
|
|
15
15
|
useGridRefs(privateApiRef);
|
|
16
16
|
useGridTheme(privateApiRef);
|
|
17
17
|
useGridLoggerFactory(privateApiRef, props);
|
|
18
|
-
useGridStateInitialization(privateApiRef
|
|
18
|
+
useGridStateInitialization(privateApiRef);
|
|
19
19
|
useGridPipeProcessing(privateApiRef);
|
|
20
20
|
useGridStrategyProcessing(privateApiRef);
|
|
21
21
|
useGridLocaleText(privateApiRef, props);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { GridSignature } from '../utils/useGridApiEventHandler';
|
|
4
3
|
import { useGridApiMethod } from '../utils';
|
|
5
4
|
import { isFunction } from '../../utils/utils';
|
|
6
|
-
export const useGridStateInitialization =
|
|
5
|
+
export const useGridStateInitialization = apiRef => {
|
|
7
6
|
const controlStateMapRef = React.useRef({});
|
|
8
7
|
const [, rawForceUpdate] = React.useState();
|
|
9
8
|
const registerControlState = React.useCallback(controlStateItem => {
|
|
@@ -62,13 +61,10 @@ export const useGridStateInitialization = (apiRef, props) => {
|
|
|
62
61
|
const controlState = controlStateMapRef.current[stateId];
|
|
63
62
|
const model = controlState.stateSelector(newState, apiRef.current.instanceId);
|
|
64
63
|
if (controlState.propOnChange && hasPropChanged) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
reason
|
|
70
|
-
};
|
|
71
|
-
controlState.propOnChange(model, details);
|
|
64
|
+
controlState.propOnChange(model, {
|
|
65
|
+
reason,
|
|
66
|
+
api: apiRef.current
|
|
67
|
+
});
|
|
72
68
|
}
|
|
73
69
|
if (!ignoreSetState) {
|
|
74
70
|
apiRef.current.publishEvent(controlState.changeEvent, model, {
|
|
@@ -77,7 +73,7 @@ export const useGridStateInitialization = (apiRef, props) => {
|
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
75
|
return !ignoreSetState;
|
|
80
|
-
}, [apiRef
|
|
76
|
+
}, [apiRef]);
|
|
81
77
|
const updateControlState = React.useCallback((key, state, reason) => {
|
|
82
78
|
return apiRef.current.setState(previousState => {
|
|
83
79
|
return _extends({}, previousState, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
3
4
|
import { styled, useTheme } from '@mui/material/styles';
|
|
4
5
|
import { useGridSelector } from '../../utils';
|
|
5
6
|
import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
@@ -51,6 +52,7 @@ export const useGridColumnHeaders = props => {
|
|
|
51
52
|
const renderContext = useGridSelector(apiRef, gridRenderContextColumnsSelector);
|
|
52
53
|
const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);
|
|
53
54
|
const offsetLeft = computeOffsetLeft(columnPositions, renderContext, theme.direction, pinnedColumns.left.length);
|
|
55
|
+
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
54
56
|
React.useEffect(() => {
|
|
55
57
|
apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
|
|
56
58
|
}, [apiRef]);
|
|
@@ -104,7 +106,7 @@ export const useGridColumnHeaders = props => {
|
|
|
104
106
|
}
|
|
105
107
|
}), children, isNotPinned && /*#__PURE__*/_jsx("div", {
|
|
106
108
|
role: "presentation",
|
|
107
|
-
className: gridClasses.filler
|
|
109
|
+
className: clsx(gridClasses.filler, borderTop && gridClasses['filler--borderTop'])
|
|
108
110
|
}), hasScrollbarFiller && /*#__PURE__*/_jsx(ScrollbarFiller, {
|
|
109
111
|
header: true,
|
|
110
112
|
borderTop: borderTop,
|
|
@@ -165,7 +167,8 @@ export const useGridColumnHeaders = props => {
|
|
|
165
167
|
pinnedPosition: pinnedPosition,
|
|
166
168
|
style: style,
|
|
167
169
|
indexInSection: i,
|
|
168
|
-
sectionLength: renderedColumns.length
|
|
170
|
+
sectionLength: renderedColumns.length,
|
|
171
|
+
gridHasFiller: gridHasFiller
|
|
169
172
|
}, other), colDef.field));
|
|
170
173
|
}
|
|
171
174
|
return getFillers(params, columns, 0);
|
|
@@ -275,7 +278,8 @@ export const useGridColumnHeaders = props => {
|
|
|
275
278
|
pinnedPosition: pinnedPosition,
|
|
276
279
|
style: style,
|
|
277
280
|
indexInSection: indexInSection,
|
|
278
|
-
sectionLength: renderedColumns.length
|
|
281
|
+
sectionLength: renderedColumns.length,
|
|
282
|
+
gridHasFiller: gridHasFiller
|
|
279
283
|
}, index);
|
|
280
284
|
});
|
|
281
285
|
return getFillers(params, children, leftOverflow);
|
|
@@ -168,7 +168,9 @@ export const useGridCellEditing = (apiRef, props) => {
|
|
|
168
168
|
const updateCellModesModel = useEventCallback(newModel => {
|
|
169
169
|
const isNewModelDifferentFromProp = newModel !== props.cellModesModel;
|
|
170
170
|
if (onCellModesModelChange && isNewModelDifferentFromProp) {
|
|
171
|
-
onCellModesModelChange(newModel, {
|
|
171
|
+
onCellModesModelChange(newModel, {
|
|
172
|
+
api: apiRef.current
|
|
173
|
+
});
|
|
172
174
|
}
|
|
173
175
|
if (props.cellModesModel && isNewModelDifferentFromProp) {
|
|
174
176
|
return; // The prop always win
|
|
@@ -242,7 +242,9 @@ export const useGridRowEditing = (apiRef, props) => {
|
|
|
242
242
|
const updateRowModesModel = useEventCallback(newModel => {
|
|
243
243
|
const isNewModelDifferentFromProp = newModel !== props.rowModesModel;
|
|
244
244
|
if (onRowModesModelChange && isNewModelDifferentFromProp) {
|
|
245
|
-
onRowModesModelChange(newModel, {
|
|
245
|
+
onRowModesModelChange(newModel, {
|
|
246
|
+
api: apiRef.current
|
|
247
|
+
});
|
|
246
248
|
}
|
|
247
249
|
if (props.rowModesModel && isNewModelDifferentFromProp) {
|
|
248
250
|
return; // The prop always win
|
|
@@ -2,12 +2,13 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../../colDef';
|
|
|
2
2
|
import { buildWarning } from '../../../../utils/warning';
|
|
3
3
|
function sanitizeCellValue(value, delimiterCharacter, shouldAppendQuotes) {
|
|
4
4
|
if (typeof value === 'string') {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
if (shouldAppendQuotes) {
|
|
6
|
+
const escapedValue = value.replace(/"/g, '""');
|
|
7
|
+
// Make sure value containing delimiter or line break won't be split into multiple rows
|
|
8
|
+
if ([delimiterCharacter, '\n', '\r', '"'].some(delimiter => value.includes(delimiter))) {
|
|
9
|
+
return `"${escapedValue}"`;
|
|
9
10
|
}
|
|
10
|
-
return
|
|
11
|
+
return escapedValue;
|
|
11
12
|
}
|
|
12
13
|
return value;
|
|
13
14
|
}
|
|
@@ -4,7 +4,6 @@ import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
|
4
4
|
import { useGridLogger } from '../../utils';
|
|
5
5
|
import { gridColumnLookupSelector, gridColumnVisibilityModelSelector, gridColumnFieldsSelector } from '../columns/gridColumnsSelector';
|
|
6
6
|
export const headerFilteringStateInitializer = (state, props) => _extends({}, state, {
|
|
7
|
-
// @ts-expect-error Access `Pro` prop in MIT
|
|
8
7
|
headerFiltering: {
|
|
9
8
|
enabled: props.headerFilters ?? false,
|
|
10
9
|
editing: null,
|
|
@@ -13,8 +12,6 @@ export const headerFilteringStateInitializer = (state, props) => _extends({}, st
|
|
|
13
12
|
});
|
|
14
13
|
export const useGridHeaderFiltering = (apiRef, props) => {
|
|
15
14
|
const logger = useGridLogger(apiRef, 'useGridHeaderFiltering');
|
|
16
|
-
// @ts-expect-error Access `Pro` prop in MIT
|
|
17
|
-
const isHeaderFilteringEnabled = props.headerFilters ?? false;
|
|
18
15
|
const setHeaderFilterState = React.useCallback(headerFilterState => {
|
|
19
16
|
apiRef.current.setState(state => {
|
|
20
17
|
// Safety check to avoid MIT users from using it
|
|
@@ -24,14 +21,14 @@ export const useGridHeaderFiltering = (apiRef, props) => {
|
|
|
24
21
|
}
|
|
25
22
|
return _extends({}, state, {
|
|
26
23
|
headerFiltering: {
|
|
27
|
-
enabled:
|
|
24
|
+
enabled: props.headerFilters ?? false,
|
|
28
25
|
editing: headerFilterState.editing ?? null,
|
|
29
26
|
menuOpen: headerFilterState.menuOpen ?? null
|
|
30
27
|
}
|
|
31
28
|
});
|
|
32
29
|
});
|
|
33
30
|
apiRef.current.forceUpdate();
|
|
34
|
-
}, [apiRef, props.signature,
|
|
31
|
+
}, [apiRef, props.signature, props.headerFilters]);
|
|
35
32
|
const startHeaderFilterEditMode = React.useCallback(field => {
|
|
36
33
|
logger.debug(`Starting edit mode on header filter for field: ${field}`);
|
|
37
34
|
apiRef.current.setHeaderFilterState({
|
|
@@ -102,8 +99,8 @@ export const useGridHeaderFiltering = (apiRef, props) => {
|
|
|
102
99
|
isFirstRender.current = false;
|
|
103
100
|
} else {
|
|
104
101
|
apiRef.current.setHeaderFilterState({
|
|
105
|
-
enabled:
|
|
102
|
+
enabled: props.headerFilters ?? false
|
|
106
103
|
});
|
|
107
104
|
}
|
|
108
|
-
}, [apiRef,
|
|
105
|
+
}, [apiRef, props.headerFilters]);
|
|
109
106
|
};
|
|
@@ -69,9 +69,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
|
|
|
69
69
|
const initialCurrentPageRows = useGridVisibleRows(apiRef, props).rows;
|
|
70
70
|
const theme = useTheme();
|
|
71
71
|
const currentPageRows = React.useMemo(() => enrichPageRowsWithPinnedRows(apiRef, initialCurrentPageRows), [apiRef, initialCurrentPageRows]);
|
|
72
|
-
const headerFilteringEnabled =
|
|
73
|
-
// @ts-expect-error // TODO move relevant code to the `DataGridPro`
|
|
74
|
-
props.signature !== 'DataGrid' && props.headerFilters;
|
|
72
|
+
const headerFilteringEnabled = props.signature !== 'DataGrid' && props.headerFilters;
|
|
75
73
|
|
|
76
74
|
/**
|
|
77
75
|
* @param {number} colIndex Index of the column to focus
|
|
@@ -38,9 +38,9 @@ const EMPTY_SCROLL_POSITION = {
|
|
|
38
38
|
left: 0
|
|
39
39
|
};
|
|
40
40
|
export const EMPTY_DETAIL_PANELS = Object.freeze(new Map());
|
|
41
|
-
const createScrollCache = (rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) => ({
|
|
41
|
+
const createScrollCache = (mode, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) => ({
|
|
42
42
|
direction: ScrollDirection.NONE,
|
|
43
|
-
buffer: bufferForDirection(ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
|
|
43
|
+
buffer: bufferForDirection(mode, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
|
|
44
44
|
});
|
|
45
45
|
const isJSDOM = typeof window !== 'undefined' ? /jsdom/.test(window.navigator.userAgent) : false;
|
|
46
46
|
export const useGridVirtualScroller = () => {
|
|
@@ -92,7 +92,7 @@ export const useGridVirtualScroller = () => {
|
|
|
92
92
|
const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
|
|
93
93
|
const scrollTimeout = useTimeout();
|
|
94
94
|
const frozenContext = React.useRef(undefined);
|
|
95
|
-
const scrollCache = useLazyRef(() => createScrollCache(rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;
|
|
95
|
+
const scrollCache = useLazyRef(() => createScrollCache(theme.direction, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;
|
|
96
96
|
const focusedCell = {
|
|
97
97
|
rowIndex: React.useMemo(() => cellFocus ? currentPage.rows.findIndex(row => row.id === cellFocus.id) : -1, [cellFocus, currentPage.rows]),
|
|
98
98
|
columnIndex: React.useMemo(() => cellFocus ? visibleColumns.findIndex(column => column.field === cellFocus.field) : -1, [cellFocus, visibleColumns])
|
|
@@ -157,7 +157,7 @@ export const useGridVirtualScroller = () => {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
scrollCache.direction = direction;
|
|
160
|
-
scrollCache.buffer = bufferForDirection(direction, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6);
|
|
160
|
+
scrollCache.buffer = bufferForDirection(theme.direction, direction, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6);
|
|
161
161
|
const inputs = inputsSelector(apiRef, rootProps, enabled, enabledForColumns);
|
|
162
162
|
const nextRenderContext = computeRenderContext(inputs, scrollPosition.current, scrollCache);
|
|
163
163
|
|
|
@@ -638,7 +638,7 @@ export function areRenderContextsEqual(context1, context2) {
|
|
|
638
638
|
export function computeOffsetLeft(columnPositions, renderContext, direction, pinnedLeftLength) {
|
|
639
639
|
const factor = direction === 'ltr' ? 1 : -1;
|
|
640
640
|
const left = factor * (columnPositions[renderContext.firstColumnIndex] ?? 0) - (columnPositions[pinnedLeftLength] ?? 0);
|
|
641
|
-
return left;
|
|
641
|
+
return Math.abs(left);
|
|
642
642
|
}
|
|
643
643
|
function directionForDelta(dx, dy) {
|
|
644
644
|
if (dx === 0 && dy === 0) {
|
|
@@ -660,7 +660,18 @@ function directionForDelta(dx, dy) {
|
|
|
660
660
|
}
|
|
661
661
|
/* eslint-enable */
|
|
662
662
|
}
|
|
663
|
-
function bufferForDirection(direction, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) {
|
|
663
|
+
function bufferForDirection(mode, direction, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) {
|
|
664
|
+
if (mode === 'rtl') {
|
|
665
|
+
switch (direction) {
|
|
666
|
+
case ScrollDirection.LEFT:
|
|
667
|
+
direction = ScrollDirection.RIGHT;
|
|
668
|
+
break;
|
|
669
|
+
case ScrollDirection.RIGHT:
|
|
670
|
+
direction = ScrollDirection.LEFT;
|
|
671
|
+
break;
|
|
672
|
+
default:
|
|
673
|
+
}
|
|
674
|
+
}
|
|
664
675
|
switch (direction) {
|
|
665
676
|
case ScrollDirection.NONE:
|
|
666
677
|
return {
|
package/modern/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { isNumber } from '../../utils/utils';
|
|
2
|
+
import { GridSignature } from '../../hooks/utils/useGridApiEventHandler';
|
|
3
|
+
export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && 'MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect. `rowCount` is only meant to be used with `paginationMode="server"`.' || undefined];
|
|
4
|
+
const warnedOnceCache = new Set();
|
|
3
5
|
const warnOnce = message => {
|
|
4
|
-
if (!
|
|
6
|
+
if (!warnedOnceCache.has(message)) {
|
|
5
7
|
console.error(message);
|
|
6
|
-
|
|
8
|
+
warnedOnceCache.add(message);
|
|
7
9
|
}
|
|
8
10
|
};
|
|
9
11
|
export const validateProps = (props, validators) => {
|
|
@@ -16,4 +18,7 @@ export const validateProps = (props, validators) => {
|
|
|
16
18
|
warnOnce(warning);
|
|
17
19
|
}
|
|
18
20
|
});
|
|
21
|
+
};
|
|
22
|
+
export const clearWarningsCache = () => {
|
|
23
|
+
warnedOnceCache.clear();
|
|
19
24
|
};
|
package/modern/locales/deDE.js
CHANGED
|
@@ -30,10 +30,9 @@ const deDEGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Drucken',
|
|
31
31
|
toolbarExportExcel: 'Download als Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Suche',
|
|
34
|
+
columnsManagementNoColumns: 'Keine Spalten',
|
|
35
|
+
columnsManagementShowHideAllText: 'Alle anzeigen/verbergen',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Filter hinzufügen',
|
|
39
38
|
filterPanelRemoveAll: 'Alle entfernen',
|
package/modern/locales/esES.js
CHANGED
|
@@ -30,10 +30,9 @@ const esESGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Imprimir',
|
|
31
31
|
toolbarExportExcel: 'Descargar como Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Buscar',
|
|
34
|
+
columnsManagementNoColumns: 'Sin columnas',
|
|
35
|
+
columnsManagementShowHideAllText: 'Mostrar/Ocultar todas',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Agregar filtro',
|
|
39
38
|
filterPanelRemoveAll: 'Remover todos',
|
package/modern/locales/faIR.js
CHANGED
|
@@ -30,10 +30,9 @@ const faIRGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'چاپ',
|
|
31
31
|
toolbarExportExcel: 'دانلود به صورت اکسل',
|
|
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/locales/frFR.js
CHANGED
|
@@ -16,7 +16,7 @@ const frFRGrid = {
|
|
|
16
16
|
// Filters toolbar button text
|
|
17
17
|
toolbarFilters: 'Filtres',
|
|
18
18
|
toolbarFiltersLabel: 'Afficher les filtres',
|
|
19
|
-
toolbarFiltersTooltipHide: '
|
|
19
|
+
toolbarFiltersTooltipHide: 'Masquer les filtres',
|
|
20
20
|
toolbarFiltersTooltipShow: 'Afficher les filtres',
|
|
21
21
|
toolbarFiltersTooltipActive: count => count > 1 ? `${count} filtres actifs` : `${count} filtre actif`,
|
|
22
22
|
// Quick filter toolbar field
|
|
@@ -30,10 +30,9 @@ const frFRGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Imprimer',
|
|
31
31
|
toolbarExportExcel: 'Télécharger pour Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Rechercher',
|
|
34
|
+
columnsManagementNoColumns: 'Pas de colonnes',
|
|
35
|
+
columnsManagementShowHideAllText: 'Afficher/masquer toutes',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Ajouter un filtre',
|
|
39
38
|
filterPanelRemoveAll: 'Tout supprimer',
|
|
@@ -94,7 +93,7 @@ const frFRGrid = {
|
|
|
94
93
|
columnMenuShowColumns: 'Afficher les colonnes',
|
|
95
94
|
columnMenuManageColumns: 'Gérer les colonnes',
|
|
96
95
|
columnMenuFilter: 'Filtrer',
|
|
97
|
-
columnMenuHideColumn: '
|
|
96
|
+
columnMenuHideColumn: 'Masquer',
|
|
98
97
|
columnMenuUnsort: 'Annuler le tri',
|
|
99
98
|
columnMenuSortAsc: 'Tri ascendant',
|
|
100
99
|
columnMenuSortDesc: 'Tri descendant',
|
package/modern/locales/ptBR.js
CHANGED
|
@@ -30,10 +30,9 @@ const ptBRGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Imprimir',
|
|
31
31
|
toolbarExportExcel: 'Baixar como Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Buscar',
|
|
34
|
+
columnsManagementNoColumns: 'Nenhuma coluna',
|
|
35
|
+
columnsManagementShowHideAllText: 'Mostrar/Ocultar Todas',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Adicionar filtro',
|
|
39
38
|
filterPanelRemoveAll: 'Remover todos',
|
package/modern/locales/svSE.js
CHANGED
|
@@ -30,10 +30,9 @@ const svSEGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Skriv ut',
|
|
31
31
|
toolbarExportExcel: 'Ladda ner som Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Sök',
|
|
34
|
+
columnsManagementNoColumns: 'Inga kolumner',
|
|
35
|
+
columnsManagementShowHideAllText: 'Visa/Dölj alla',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'Lägg till filter',
|
|
39
38
|
filterPanelRemoveAll: 'Ta bort alla',
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
|
|
2
|
-
export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
|
|
2
|
+
export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp, gridHasFiller) => {
|
|
3
3
|
const isSectionLastCell = indexInSection === sectionLength - 1;
|
|
4
|
-
|
|
4
|
+
if (pinnedPosition === GridPinnedColumnPosition.LEFT && isSectionLastCell) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
if (showCellVerticalBorderRootProp) {
|
|
8
|
+
if (pinnedPosition === GridPinnedColumnPosition.LEFT) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
if (pinnedPosition === GridPinnedColumnPosition.RIGHT) {
|
|
12
|
+
return !isSectionLastCell;
|
|
13
|
+
}
|
|
14
|
+
// pinnedPosition === undefined, middle section
|
|
15
|
+
return !isSectionLastCell || gridHasFiller;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
5
18
|
};
|
|
6
19
|
export const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
|
|
7
20
|
return pinnedPosition === GridPinnedColumnPosition.RIGHT && indexInSection === 0;
|
|
@@ -101,6 +101,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
101
101
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, refProp);
|
|
102
102
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
103
103
|
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
104
|
+
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
104
105
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
105
106
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;
|
|
106
107
|
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;
|
|
@@ -292,7 +293,8 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
292
293
|
pinnedOffset: pinnedOffset,
|
|
293
294
|
pinnedPosition: pinnedPosition,
|
|
294
295
|
sectionIndex: indexInSection,
|
|
295
|
-
sectionLength: sectionLength
|
|
296
|
+
sectionLength: sectionLength,
|
|
297
|
+
gridHasFiller: gridHasFiller
|
|
296
298
|
}, slotProps?.cell), column.field);
|
|
297
299
|
};
|
|
298
300
|
|
|
@@ -23,7 +23,7 @@ var _useGridParamsApi = require("../../hooks/features/rows/useGridParamsApi");
|
|
|
23
23
|
var _cellBorderUtils = require("../../utils/cellBorderUtils");
|
|
24
24
|
var _gridColumnsInterfaces = require("../../hooks/features/columns/gridColumnsInterfaces");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "gridHasScrollX", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
26
|
+
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "gridHasScrollX", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "gridHasFiller", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
27
27
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
28
28
|
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); }
|
|
29
29
|
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; }
|
|
@@ -101,6 +101,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
101
101
|
pinnedPosition,
|
|
102
102
|
sectionIndex,
|
|
103
103
|
sectionLength,
|
|
104
|
+
gridHasFiller,
|
|
104
105
|
onClick,
|
|
105
106
|
onDoubleClick,
|
|
106
107
|
onMouseDown,
|
|
@@ -168,11 +169,10 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
168
169
|
const cellRef = React.useRef(null);
|
|
169
170
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, cellRef);
|
|
170
171
|
const focusElementRef = React.useRef(null);
|
|
171
|
-
// @ts-expect-error To access `cellSelection` flag as it's a `premium` feature
|
|
172
172
|
const isSelectionMode = rootProps.cellSelection ?? false;
|
|
173
173
|
const position = gridPinnedColumnPositionLookup[pinnedPosition];
|
|
174
174
|
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(position, sectionIndex);
|
|
175
|
-
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder);
|
|
175
|
+
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
176
176
|
const ownerState = {
|
|
177
177
|
align,
|
|
178
178
|
showLeftBorder,
|
|
@@ -338,6 +338,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
338
338
|
isValidating: _propTypes.default.bool,
|
|
339
339
|
value: _propTypes.default.any
|
|
340
340
|
}),
|
|
341
|
+
gridHasFiller: _propTypes.default.bool.isRequired,
|
|
341
342
|
isNotVisible: _propTypes.default.bool.isRequired,
|
|
342
343
|
onClick: _propTypes.default.func,
|
|
343
344
|
onDoubleClick: _propTypes.default.func,
|
|
@@ -52,7 +52,8 @@ function GridColumnGroupHeader(props) {
|
|
|
52
52
|
pinnedPosition,
|
|
53
53
|
style,
|
|
54
54
|
indexInSection,
|
|
55
|
-
sectionLength
|
|
55
|
+
sectionLength,
|
|
56
|
+
gridHasFiller
|
|
56
57
|
} = props;
|
|
57
58
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
58
59
|
const headerCellRef = React.useRef(null);
|
|
@@ -80,7 +81,7 @@ function GridColumnGroupHeader(props) {
|
|
|
80
81
|
headerComponent = render(renderParams);
|
|
81
82
|
}
|
|
82
83
|
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
|
|
83
|
-
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder);
|
|
84
|
+
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
84
85
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
85
86
|
classes: rootProps.classes,
|
|
86
87
|
showLeftBorder,
|