@mui/x-data-grid 7.1.1 → 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 +86 -0
- package/components/GridRow.js +3 -1
- package/components/cell/GridCell.d.ts +1 -0
- package/components/cell/GridCell.js +4 -2
- 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/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/index.js +1 -1
- package/locales/deDE.js +3 -4
- package/locales/frFR.js +5 -6
- package/locales/svSE.js +3 -4
- package/models/api/gridCallbackDetails.d.ts +5 -0
- package/modern/components/GridRow.js +3 -1
- package/modern/components/cell/GridCell.js +4 -2
- 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/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/index.js +1 -1
- package/modern/locales/deDE.js +3 -4
- package/modern/locales/frFR.js +5 -6
- 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 -2
- 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/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/index.js +1 -1
- package/node/locales/deDE.js +3 -4
- package/node/locales/frFR.js +5 -6
- package/node/locales/svSE.js +3 -4
- package/node/utils/cellBorderUtils.js +15 -2
- package/package.json +1 -1
- package/themeAugmentation/overrides.d.ts +6 -0
- package/utils/cellBorderUtils.d.ts +1 -1
- package/utils/cellBorderUtils.js +15 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,92 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 7.2.0
|
|
7
|
+
|
|
8
|
+
_Apr 12, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎨 Make grid colors customizable through the MUI themes API
|
|
13
|
+
- 🌍 Improve French (fr-FR), German (de-DE), and Swedish (sv-SE) locales on the Data Grid and Pickers
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@7.2.0`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Add missing `api` property to `GridCallbackDetails` (#12742) @sai6855
|
|
22
|
+
- [DataGrid] Do not escape double quotes when copying to clipboard (#12722) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix column vertical border (#12741) @romgrk
|
|
24
|
+
- [DataGrid] Fix invalid date error when filtering `date`/`dateTime` columns (#12709) @cherniavskii
|
|
25
|
+
- [DataGrid] Fix overflow with dynamic row height (#12683) @romgrk
|
|
26
|
+
- [DataGrid] Make colors customizable (#12614) @romgrk
|
|
27
|
+
- [l10n] Improve French (fr-FR) locale (#12755) @derek-0000
|
|
28
|
+
- [l10n] Improve German (de-DE) locale (#12752) @Jens-Schoen
|
|
29
|
+
- [l10n] Improve Swedish (sv-SE) locale (#12731) @pontusdacke
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid-pro@7.2.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
32
|
+
|
|
33
|
+
Same changes as in `@mui/x-data-grid@7.2.0`.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid-premium@7.2.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
36
|
+
|
|
37
|
+
Same changes as in `@mui/x-data-grid-pro@7.2.0`, plus:
|
|
38
|
+
|
|
39
|
+
- [DataGridPremium] Fix clipboard paste not working when cell loses focus (#12724) @cherniavskii
|
|
40
|
+
|
|
41
|
+
### Date and Time Pickers
|
|
42
|
+
|
|
43
|
+
#### `@mui/x-date-pickers@7.2.0`
|
|
44
|
+
|
|
45
|
+
- [fields] Fix field editing after closing the picker (#12675) @LukasTy
|
|
46
|
+
- [l10n] Improve French (fr-FR) locale (#12692) @FaroukBel
|
|
47
|
+
- [l10n] Improve German (de-DE) locale (#12752) @Jens-Schoen
|
|
48
|
+
- [l10n] Improve Swedish (sv-SE) locale (#12731) @pontusdacke
|
|
49
|
+
- [pickers] Fix desktop date time Pickers grid layout (#12748) @LukasTy
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@7.2.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@7.2.0`, plus:
|
|
54
|
+
|
|
55
|
+
- [DateTimeRangePicker] Fix desktop toolbar style (#12760) @LukasTy
|
|
56
|
+
|
|
57
|
+
### Charts
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-charts@7.2.0`
|
|
60
|
+
|
|
61
|
+
- [charts] Fix Bar chart with empty dataset throwing an error (#12708) @JCQuintas
|
|
62
|
+
- [charts] Fix `tickLabelInterval` not working on `YAxis` (#12746) @JCQuintas
|
|
63
|
+
|
|
64
|
+
### Tree View
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-tree-view@7.2.0`
|
|
67
|
+
|
|
68
|
+
- [TreeView] Add a new lookup to access an item index without expansive computation (#12729) @flaviendelangle
|
|
69
|
+
- [TreeView] Clean up usage of term "node" in internals (#12655) @noraleonte
|
|
70
|
+
- [TreeView] Improve performance by removing `getNavigableChildrenIds` method (#12713) @flaviendelangle
|
|
71
|
+
- [TreeView] Remove `state.items.itemTree` (#12717) @flaviendelangle
|
|
72
|
+
- [TreeView] Remove remaining occurences of the word "node" in the codebase (#12712) @flaviendelangle
|
|
73
|
+
- [TreeView] Return `instance` and `publicAPI` methods from plugin and populate the main objects inside `useTreeView` (#12650) @flaviendelangle
|
|
74
|
+
- [TreeView] Fix behaviors when the item order changes (#12369) @flaviendelangle
|
|
75
|
+
|
|
76
|
+
### Docs
|
|
77
|
+
|
|
78
|
+
- [docs] Add `AxisFormatter` documentation for customizing tick/tooltip value formatting (#12700) @JCQuintas
|
|
79
|
+
- [docs] Add file explorer example to rich tree view customization docs (#12707) @noraleonte
|
|
80
|
+
- [docs] Do not use import of depth 3 in the doc (#12716) @flaviendelangle
|
|
81
|
+
- [docs] Explain how to clip plots with composition (#12679) @alexfauquette
|
|
82
|
+
- [docs] Fix typo in Data Grid v7 migration page (#12720) @bfaulk96
|
|
83
|
+
- [docs] Fix typo in Pickers v7 migration page (#12721) @bfaulk96
|
|
84
|
+
|
|
85
|
+
### Core
|
|
86
|
+
|
|
87
|
+
- [core] Support multiple resolved `l10n` PR packages (#12735) @LukasTy
|
|
88
|
+
- [core] Update Netlify release references in release README (#12687) @LukasTy
|
|
89
|
+
- [core] Use `describeTreeView` for icons tests (#12672) @flaviendelangle
|
|
90
|
+
- [core] Use `describeTreeView` in existing tests for `useTreeViewItems` (#12732) @flaviendelangle
|
|
91
|
+
|
|
6
92
|
## 7.1.1
|
|
7
93
|
|
|
8
94
|
_Apr 5, 2024_
|
package/components/GridRow.js
CHANGED
|
@@ -93,6 +93,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
93
93
|
const handleRef = useForkRef(ref, refProp);
|
|
94
94
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
95
95
|
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
96
|
+
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
96
97
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
97
98
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;
|
|
98
99
|
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;
|
|
@@ -284,7 +285,8 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
284
285
|
pinnedOffset: pinnedOffset,
|
|
285
286
|
pinnedPosition: pinnedPosition,
|
|
286
287
|
sectionIndex: indexInSection,
|
|
287
|
-
sectionLength: sectionLength
|
|
288
|
+
sectionLength: sectionLength,
|
|
289
|
+
gridHasFiller: gridHasFiller
|
|
288
290
|
}, slotProps?.cell), column.field);
|
|
289
291
|
};
|
|
290
292
|
|
|
@@ -29,6 +29,7 @@ export type GridCellProps = {
|
|
|
29
29
|
pinnedPosition: PinnedPosition;
|
|
30
30
|
sectionIndex: number;
|
|
31
31
|
sectionLength: number;
|
|
32
|
+
gridHasFiller: boolean;
|
|
32
33
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
33
34
|
onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
34
35
|
onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
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"],
|
|
3
|
+
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"],
|
|
4
4
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -92,6 +92,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
92
92
|
pinnedPosition,
|
|
93
93
|
sectionIndex,
|
|
94
94
|
sectionLength,
|
|
95
|
+
gridHasFiller,
|
|
95
96
|
onClick,
|
|
96
97
|
onDoubleClick,
|
|
97
98
|
onMouseDown,
|
|
@@ -162,7 +163,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
162
163
|
const isSelectionMode = rootProps.cellSelection ?? false;
|
|
163
164
|
const position = gridPinnedColumnPositionLookup[pinnedPosition];
|
|
164
165
|
const showLeftBorder = shouldCellShowLeftBorder(position, sectionIndex);
|
|
165
|
-
const showRightBorder = shouldCellShowRightBorder(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder);
|
|
166
|
+
const showRightBorder = shouldCellShowRightBorder(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
166
167
|
const ownerState = {
|
|
167
168
|
align,
|
|
168
169
|
showLeftBorder,
|
|
@@ -328,6 +329,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
328
329
|
isValidating: PropTypes.bool,
|
|
329
330
|
value: PropTypes.any
|
|
330
331
|
}),
|
|
332
|
+
gridHasFiller: PropTypes.bool.isRequired,
|
|
331
333
|
isNotVisible: PropTypes.bool.isRequired,
|
|
332
334
|
onClick: PropTypes.func,
|
|
333
335
|
onDoubleClick: PropTypes.func,
|
|
@@ -15,6 +15,7 @@ interface GridColumnGroupHeaderProps {
|
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
16
|
indexInSection: number;
|
|
17
17
|
sectionLength: number;
|
|
18
|
+
gridHasFiller: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare function GridColumnGroupHeader(props: GridColumnGroupHeaderProps): React.JSX.Element;
|
|
20
21
|
export { GridColumnGroupHeader };
|
|
@@ -43,7 +43,8 @@ function GridColumnGroupHeader(props) {
|
|
|
43
43
|
pinnedPosition,
|
|
44
44
|
style,
|
|
45
45
|
indexInSection,
|
|
46
|
-
sectionLength
|
|
46
|
+
sectionLength,
|
|
47
|
+
gridHasFiller
|
|
47
48
|
} = props;
|
|
48
49
|
const rootProps = useGridRootProps();
|
|
49
50
|
const headerCellRef = React.useRef(null);
|
|
@@ -71,7 +72,7 @@ function GridColumnGroupHeader(props) {
|
|
|
71
72
|
headerComponent = render(renderParams);
|
|
72
73
|
}
|
|
73
74
|
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
74
|
-
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder);
|
|
75
|
+
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
75
76
|
const ownerState = _extends({}, props, {
|
|
76
77
|
classes: rootProps.classes,
|
|
77
78
|
showLeftBorder,
|
|
@@ -21,6 +21,7 @@ interface GridColumnHeaderItemProps {
|
|
|
21
21
|
style?: React.CSSProperties;
|
|
22
22
|
indexInSection: number;
|
|
23
23
|
sectionLength: number;
|
|
24
|
+
gridHasFiller: boolean;
|
|
24
25
|
}
|
|
25
26
|
declare function GridColumnHeaderItem(props: GridColumnHeaderItemProps): React.JSX.Element;
|
|
26
27
|
declare namespace GridColumnHeaderItem {
|
|
@@ -54,7 +54,8 @@ function GridColumnHeaderItem(props) {
|
|
|
54
54
|
style,
|
|
55
55
|
pinnedPosition,
|
|
56
56
|
indexInSection,
|
|
57
|
-
sectionLength
|
|
57
|
+
sectionLength,
|
|
58
|
+
gridHasFiller
|
|
58
59
|
} = props;
|
|
59
60
|
const apiRef = useGridPrivateApiContext();
|
|
60
61
|
const rootProps = useGridRootProps();
|
|
@@ -69,7 +70,7 @@ function GridColumnHeaderItem(props) {
|
|
|
69
70
|
headerComponent = colDef.renderHeader(apiRef.current.getColumnHeaderParams(colDef.field));
|
|
70
71
|
}
|
|
71
72
|
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
72
|
-
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder);
|
|
73
|
+
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
73
74
|
const ownerState = _extends({}, props, {
|
|
74
75
|
classes: rootProps.classes,
|
|
75
76
|
showRightBorder,
|
|
@@ -201,6 +202,7 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderItem.propTypes = {
|
|
|
201
202
|
columnMenuOpen: PropTypes.bool.isRequired,
|
|
202
203
|
disableReorder: PropTypes.bool,
|
|
203
204
|
filterItemsCounter: PropTypes.number,
|
|
205
|
+
gridHasFiller: PropTypes.bool.isRequired,
|
|
204
206
|
hasFocus: PropTypes.bool,
|
|
205
207
|
headerHeight: PropTypes.number.isRequired,
|
|
206
208
|
indexInSection: PropTypes.number.isRequired,
|
|
@@ -48,7 +48,7 @@ function GridColumnHeaderSeparatorRaw(props) {
|
|
|
48
48
|
className: classes.root,
|
|
49
49
|
style: {
|
|
50
50
|
minHeight: height,
|
|
51
|
-
opacity: rootProps.showColumnVerticalBorder ?
|
|
51
|
+
opacity: rootProps.showColumnVerticalBorder ? 1 : 0
|
|
52
52
|
}
|
|
53
53
|
}, other, {
|
|
54
54
|
onClick: stopClick,
|
|
@@ -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
|
});
|
|
@@ -287,6 +287,11 @@ export interface GridClasses {
|
|
|
287
287
|
* @ignore - do not document.
|
|
288
288
|
*/
|
|
289
289
|
filler: string;
|
|
290
|
+
/**
|
|
291
|
+
* Styles applied to the filler row with top border.
|
|
292
|
+
* @ignore - do not document.
|
|
293
|
+
*/
|
|
294
|
+
'filler--borderTop': string;
|
|
290
295
|
/**
|
|
291
296
|
* Styles applied to the filler row pinned left section.
|
|
292
297
|
* @ignore - do not document.
|
package/constants/gridClasses.js
CHANGED
|
@@ -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,4 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
3
2
|
import type { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
|
|
4
|
-
export declare const useGridStateInitialization: <PrivateApi extends GridPrivateApiCommon>(apiRef: React.MutableRefObject<PrivateApi
|
|
3
|
+
export declare const useGridStateInitialization: <PrivateApi extends GridPrivateApiCommon>(apiRef: React.MutableRefObject<PrivateApi>) => void;
|
|
@@ -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
|
}
|
package/index.js
CHANGED
package/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/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/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,4 +1,5 @@
|
|
|
1
1
|
import { GridControlledStateReasonLookup } from '../events/gridEventLookup';
|
|
2
|
+
import { GridApiCommunity } from './gridApiCommunity';
|
|
2
3
|
/**
|
|
3
4
|
* Additional details passed to the callbacks
|
|
4
5
|
*/
|
|
@@ -7,4 +8,8 @@ export interface GridCallbackDetails<K extends keyof GridControlledStateReasonLo
|
|
|
7
8
|
* The reason for this callback to have been called.
|
|
8
9
|
*/
|
|
9
10
|
reason?: GridControlledStateReasonLookup[K];
|
|
11
|
+
/**
|
|
12
|
+
* GridApi that let you manipulate the grid.
|
|
13
|
+
*/
|
|
14
|
+
api: GridApiCommunity;
|
|
10
15
|
}
|
|
@@ -93,6 +93,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
93
93
|
const handleRef = useForkRef(ref, refProp);
|
|
94
94
|
const rowNode = apiRef.current.getRowNode(rowId);
|
|
95
95
|
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
96
|
+
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
96
97
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
97
98
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;
|
|
98
99
|
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;
|
|
@@ -284,7 +285,8 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
284
285
|
pinnedOffset: pinnedOffset,
|
|
285
286
|
pinnedPosition: pinnedPosition,
|
|
286
287
|
sectionIndex: indexInSection,
|
|
287
|
-
sectionLength: sectionLength
|
|
288
|
+
sectionLength: sectionLength,
|
|
289
|
+
gridHasFiller: gridHasFiller
|
|
288
290
|
}, slotProps?.cell), column.field);
|
|
289
291
|
};
|
|
290
292
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
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"],
|
|
3
|
+
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"],
|
|
4
4
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -92,6 +92,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
92
92
|
pinnedPosition,
|
|
93
93
|
sectionIndex,
|
|
94
94
|
sectionLength,
|
|
95
|
+
gridHasFiller,
|
|
95
96
|
onClick,
|
|
96
97
|
onDoubleClick,
|
|
97
98
|
onMouseDown,
|
|
@@ -162,7 +163,7 @@ const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
162
163
|
const isSelectionMode = rootProps.cellSelection ?? false;
|
|
163
164
|
const position = gridPinnedColumnPositionLookup[pinnedPosition];
|
|
164
165
|
const showLeftBorder = shouldCellShowLeftBorder(position, sectionIndex);
|
|
165
|
-
const showRightBorder = shouldCellShowRightBorder(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder);
|
|
166
|
+
const showRightBorder = shouldCellShowRightBorder(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
166
167
|
const ownerState = {
|
|
167
168
|
align,
|
|
168
169
|
showLeftBorder,
|
|
@@ -328,6 +329,7 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
328
329
|
isValidating: PropTypes.bool,
|
|
329
330
|
value: PropTypes.any
|
|
330
331
|
}),
|
|
332
|
+
gridHasFiller: PropTypes.bool.isRequired,
|
|
331
333
|
isNotVisible: PropTypes.bool.isRequired,
|
|
332
334
|
onClick: PropTypes.func,
|
|
333
335
|
onDoubleClick: PropTypes.func,
|
|
@@ -43,7 +43,8 @@ function GridColumnGroupHeader(props) {
|
|
|
43
43
|
pinnedPosition,
|
|
44
44
|
style,
|
|
45
45
|
indexInSection,
|
|
46
|
-
sectionLength
|
|
46
|
+
sectionLength,
|
|
47
|
+
gridHasFiller
|
|
47
48
|
} = props;
|
|
48
49
|
const rootProps = useGridRootProps();
|
|
49
50
|
const headerCellRef = React.useRef(null);
|
|
@@ -71,7 +72,7 @@ function GridColumnGroupHeader(props) {
|
|
|
71
72
|
headerComponent = render(renderParams);
|
|
72
73
|
}
|
|
73
74
|
const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
|
|
74
|
-
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder);
|
|
75
|
+
const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
75
76
|
const ownerState = _extends({}, props, {
|
|
76
77
|
classes: rootProps.classes,
|
|
77
78
|
showLeftBorder,
|