@mui/x-data-grid 8.19.0 → 8.21.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 +174 -0
- package/components/GridRow.js +4 -1
- package/components/GridRowDragAndDropOverlay.d.ts +7 -0
- package/components/GridRowDragAndDropOverlay.js +73 -0
- package/components/containers/GridRootStyles.js +16 -39
- package/components/virtualization/GridVirtualScroller.js +5 -3
- package/components/virtualization/GridVirtualScrollerRenderZone.js +4 -16
- package/constants/gridClasses.d.ts +0 -8
- package/constants/gridClasses.js +1 -1
- package/esm/components/GridRow.js +4 -1
- package/esm/components/GridRowDragAndDropOverlay.d.ts +7 -0
- package/esm/components/GridRowDragAndDropOverlay.js +66 -0
- package/esm/components/containers/GridRootStyles.js +16 -39
- package/esm/components/virtualization/GridVirtualScroller.js +5 -3
- package/esm/components/virtualization/GridVirtualScrollerRenderZone.js +3 -15
- package/esm/constants/gridClasses.d.ts +0 -8
- package/esm/constants/gridClasses.js +1 -1
- package/esm/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
- package/esm/hooks/core/useGridVirtualizer.d.ts +6 -50
- package/esm/hooks/core/useGridVirtualizer.js +10 -9
- package/esm/hooks/features/columnResize/useGridColumnResize.js +17 -8
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
- package/esm/hooks/features/dimensions/useGridDimensions.js +3 -1
- package/esm/hooks/features/editing/useGridCellEditing.js +1 -1
- package/esm/hooks/features/editing/useGridRowEditing.js +1 -1
- package/esm/hooks/features/export/serializers/csvSerializer.js +2 -4
- package/esm/hooks/features/filter/gridFilterUtils.js +5 -11
- package/esm/hooks/features/filter/index.d.ts +1 -1
- package/esm/hooks/features/filter/index.js +1 -1
- package/esm/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
- package/esm/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
- package/esm/hooks/features/rowReorder/gridRowReorderSelector.js +19 -1
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +9 -1
- package/esm/hooks/features/rows/useGridRows.js +3 -1
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
- package/esm/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
- package/esm/hooks/features/sorting/gridSortingUtils.js +1 -3
- package/esm/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/esm/hooks/utils/useGridSelector.js +2 -4
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +5 -4
- package/esm/internals/index.js +3 -3
- package/esm/material/index.js +1 -4
- package/esm/models/api/gridRowApi.d.ts +14 -1
- package/esm/models/api/index.d.ts +1 -1
- package/esm/models/api/index.js +0 -1
- package/esm/models/configuration/gridConfiguration.d.ts +2 -2
- package/esm/models/configuration/gridRowConfiguration.d.ts +6 -5
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -3
- package/hooks/core/useGridVirtualizer.d.ts +6 -50
- package/hooks/core/useGridVirtualizer.js +9 -8
- package/hooks/features/columnResize/useGridColumnResize.js +17 -8
- package/hooks/features/dataSource/useGridDataSourceBase.js +2 -2
- package/hooks/features/dimensions/useGridDimensions.js +3 -1
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/export/serializers/csvSerializer.js +2 -4
- package/hooks/features/filter/gridFilterUtils.js +5 -11
- package/hooks/features/filter/index.d.ts +1 -1
- package/hooks/features/filter/index.js +6 -0
- package/hooks/features/rowReorder/gridRowReorderInterfaces.d.ts +19 -0
- package/hooks/features/rowReorder/gridRowReorderSelector.d.ts +20 -1
- package/hooks/features/rowReorder/gridRowReorderSelector.js +20 -2
- package/hooks/features/rowSelection/useGridRowSelection.js +9 -1
- package/hooks/features/rows/useGridRows.js +3 -1
- package/hooks/features/rows/useGridRowsOverridableMethods.d.ts +1 -0
- package/hooks/features/rows/useGridRowsOverridableMethods.js +57 -7
- package/hooks/features/sorting/gridSortingUtils.js +1 -3
- package/hooks/features/virtualization/useGridVirtualization.d.ts +2 -2
- package/hooks/utils/useGridSelector.js +2 -4
- package/index.js +1 -1
- package/internals/index.d.ts +5 -4
- package/internals/index.js +16 -9
- package/material/index.js +1 -4
- package/models/api/gridRowApi.d.ts +14 -1
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -11
- package/models/configuration/gridConfiguration.d.ts +2 -2
- package/models/configuration/gridRowConfiguration.d.ts +6 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,180 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.21.0
|
|
9
|
+
|
|
10
|
+
_Dec 3, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- ✨ Add [tick spacing property](https://mui.com/x/react-charts/axis/#tick-spacing) to charts axis to control the distance between ticks.
|
|
15
|
+
|
|
16
|
+
The following team members contributed to this release:
|
|
17
|
+
@alexfauquette, @bernardobelchior, @ElliottMiller, @Janpot, @JCQuintas, @romgrk, @sai6855, @siriwatknp
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@8.21.0`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Fix autosizing header width calculation (#20323) @siriwatknp
|
|
24
|
+
- [DataGrid] Virtualizer refactor (#19465) @romgrk
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@8.21.0`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@8.21.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@8.21.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPremium] Prevent pasting to non-editable cells (#20333) @ElliottMiller
|
|
35
|
+
|
|
36
|
+
### Date and Time Pickers
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-date-pickers@8.21.0`
|
|
39
|
+
|
|
40
|
+
Internal changes.
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-date-pickers@8.21.0`.
|
|
45
|
+
|
|
46
|
+
### Charts
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-charts@8.21.0`
|
|
49
|
+
|
|
50
|
+
- [charts] Fix string measuring types (#20454) @bernardobelchior
|
|
51
|
+
- [charts] Fix typo in performance note for CustomLineMarks demo (#20529) @sai6855
|
|
52
|
+
- [charts] Introduce the notion of series with positions (#20461) @alexfauquette
|
|
53
|
+
- [charts] Migrate from sinon to Vitest mocking utilities for x-charts\* packages (#20444) @Copilot
|
|
54
|
+
- [charts] Move series-level values to series computed data in bar plot (#20467) @bernardobelchior
|
|
55
|
+
- [charts] Refactor bar chart components in preparation for range bar chart (#20521) @bernardobelchior
|
|
56
|
+
- [charts] Remove unnecessary `any` types (#20527) @sai6855
|
|
57
|
+
- [charts] Remove unused `drawingArea` from `findClosestPoints` (#20471) @bernardobelchior
|
|
58
|
+
- [charts] Revert `useIsHydrated` to default=false (#20511) @JCQuintas
|
|
59
|
+
- [charts] Support tooltip anchor position for radar (#20422) @alexfauquette
|
|
60
|
+
- [charts] Add tick spacing property (#20282) @bernardobelchior
|
|
61
|
+
- [charts] Fix Vitest lint error (#20550) @bernardobelchior
|
|
62
|
+
- [charts] Fix infinite loop when highlighting pie slices or scatter points (#20549) @bernardobelchior
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-charts-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
65
|
+
|
|
66
|
+
Same changes as in `@mui/x-charts@8.21.0`, plus:
|
|
67
|
+
|
|
68
|
+
- [charts-pro] Add support for `anchor="node"` on Sankey tooltip (#20462) @alexfauquette
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-charts-premium@8.21.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
71
|
+
|
|
72
|
+
Same changes as in `@mui/x-charts-pro@8.21.0`.
|
|
73
|
+
|
|
74
|
+
### Tree View
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-tree-view@8.21.0`
|
|
77
|
+
|
|
78
|
+
Internal changes.
|
|
79
|
+
|
|
80
|
+
#### `@mui/x-tree-view-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
81
|
+
|
|
82
|
+
Same changes as in `@mui/x-tree-view@8.21.0`.
|
|
83
|
+
|
|
84
|
+
### Codemod
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-codemod@8.21.0`
|
|
87
|
+
|
|
88
|
+
Internal changes.
|
|
89
|
+
|
|
90
|
+
### Docs
|
|
91
|
+
|
|
92
|
+
- [docs] Migrate to `next/font` for fonts loading (#20407) @Copilot
|
|
93
|
+
|
|
94
|
+
### Core
|
|
95
|
+
|
|
96
|
+
- [code-infra] Enable vitest eslint plugin (#20530) @Janpot
|
|
97
|
+
- [code-infra] Fix missing font loading for local fonts (#20480) @Janpot
|
|
98
|
+
- [internal] Performance: use raw `useSyncExternalStore` (#20447) @romgrk
|
|
99
|
+
- [code-infra] Enable `vitest/expect-expect` and `vitest/no-standalone-expect` rules for x-charts packages (#20535) @Copilot
|
|
100
|
+
|
|
101
|
+
### Miscellaneous
|
|
102
|
+
|
|
103
|
+
- Bump @types/d3-sankey to ^0.12.5 (#20489) @renovate[bot]
|
|
104
|
+
- Bump @types/react to 19.2.7 (#20490) @renovate[bot]
|
|
105
|
+
- Bump @types/yargs to ^17.0.35 (#20491) @renovate[bot]
|
|
106
|
+
- Bump Vite & Vitest to ^4.0.14 (#20500) @renovate[bot]
|
|
107
|
+
- Bump csstype to ^3.2.3 (#20493) @renovate[bot]
|
|
108
|
+
- Bump es-toolkit to ^1.42.0 (#20494) @renovate[bot]
|
|
109
|
+
- Bump eslint to ^8.48.0 (#20495) @renovate[bot]
|
|
110
|
+
- Bump lerna to ^9.0.3 (#20496) @renovate[bot]
|
|
111
|
+
- Bump lucide-react to ^0.555.0 (#20502) @renovate[bot]
|
|
112
|
+
- Bump playwright monorepo (#20503) @renovate[bot]
|
|
113
|
+
- Bump pnpm to 10.24.0 (#20504) @renovate[bot]
|
|
114
|
+
- Bump react monorepo (#20340) @renovate[bot]
|
|
115
|
+
- Bump react-hook-form to ^7.66.1 (#20497) @renovate[bot]
|
|
116
|
+
- Bump rimraf to ^6.1.2 (#20498) @renovate[bot]
|
|
117
|
+
- Bump webpack-bundle-analyzer to ^5.0.1 (#20508) @renovate[bot]
|
|
118
|
+
- Bump next to ^15.5.6 [SECURITY] (#20555) @renovate[bot]
|
|
119
|
+
|
|
120
|
+
## 8.20.0
|
|
121
|
+
|
|
122
|
+
_Nov 26, 2025_
|
|
123
|
+
|
|
124
|
+
We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
125
|
+
|
|
126
|
+
- 🔃 Data Grid tree data now supports row reordering. See the [Drag-and-drop tree data reordering](https://mui.com/x/react-data-grid/tree-data/#drag-and-drop-tree-data-reordering) section for more details.
|
|
127
|
+
- 🐞 Bugfixes
|
|
128
|
+
|
|
129
|
+
The following team members contributed to this release:
|
|
130
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @siriwatknp, @JCQuintas, @MBilalShafi, @prakhargupta1
|
|
131
|
+
|
|
132
|
+
### Data Grid
|
|
133
|
+
|
|
134
|
+
#### `@mui/x-data-grid@8.20.0`
|
|
135
|
+
|
|
136
|
+
- [DataGrid] Fix RTL virtualization to display columns when viewport width is larger than the grid (#20409) @siriwatknp
|
|
137
|
+
- [DataGrid] Fix row range selection (#20442) @arminmeh
|
|
138
|
+
- [DataGrid] Initialize data grid core packages (#20276) @cherniavskii
|
|
139
|
+
- [DataGrid] Improve accessibility of the sort icon (#20430) @arminmeh
|
|
140
|
+
- [DataGrid] Use `viewport` as a boundary for the `BasePopper` flip (#20311) @arminmeh
|
|
141
|
+
|
|
142
|
+
#### `@mui/x-data-grid-pro@8.20.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
143
|
+
|
|
144
|
+
Same changes as in `@mui/x-data-grid@8.20.0`, plus:
|
|
145
|
+
|
|
146
|
+
- [DataGridPro] Avoid automatic scroll back to the focused header filter after it leaves the viewport (#20416) @arminmeh
|
|
147
|
+
- [DataGridPro] Tree data row reordering (#19401) @MBilalShafi
|
|
148
|
+
|
|
149
|
+
#### `@mui/x-data-grid-premium@8.20.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
150
|
+
|
|
151
|
+
Same changes as in `@mui/x-data-grid-pro@8.20.0`.
|
|
152
|
+
|
|
153
|
+
### Charts
|
|
154
|
+
|
|
155
|
+
#### `@mui/x-charts@8.20.0`
|
|
156
|
+
|
|
157
|
+
- [charts] Fix item tooltip position with node anchor (#20421) @alexfauquette
|
|
158
|
+
- [charts] Fix radar item tooltip closing bug (#20429) @alexfauquette
|
|
159
|
+
- [charts] Move series processing to selector (#20388) @JCQuintas
|
|
160
|
+
- [charts] Prevent pointer out from removing controlled highlight (#20385) @alexfauquette
|
|
161
|
+
|
|
162
|
+
#### `@mui/x-charts-pro@8.20.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
163
|
+
|
|
164
|
+
Same changes as in `@mui/x-charts@8.20.0`, plus:
|
|
165
|
+
|
|
166
|
+
- [charts-pro] Fix Content-Security-Policy nonce not being correctly set on export (#20395) @bernardobelchior
|
|
167
|
+
- [charts-pro] Improve vertical zoom slider thumb on mobile (#20439) @bernardobelchior
|
|
168
|
+
- [charts-pro] Provide arguments to the `AreaPlotRoot` styled component (#20414) @arminmeh
|
|
169
|
+
- [charts-pro] Remove grid outside the drawing area (#20412) @alexfauquette
|
|
170
|
+
|
|
171
|
+
#### `@mui/x-charts-premium@8.20.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
172
|
+
|
|
173
|
+
Same changes as in `@mui/x-charts-pro@8.20.0`, plus:
|
|
174
|
+
|
|
175
|
+
- [charts-premium] Add explicit return type to `ChartsRenderer` for better compatibility with React 18 (#20413) @arminmeh
|
|
176
|
+
|
|
177
|
+
### Docs
|
|
178
|
+
|
|
179
|
+
- [docs] Add `llms.txt` link to the sidebar (#20312) @siriwatknp
|
|
180
|
+
- [docs] Add a line chart demo for the Overview section (#20239) @prakhargupta1
|
|
181
|
+
|
|
8
182
|
## 8.19.0
|
|
9
183
|
|
|
10
184
|
_Nov 20, 2025_
|
package/components/GridRow.js
CHANGED
|
@@ -32,6 +32,7 @@ var _gridSortingSelector = require("../hooks/features/sorting/gridSortingSelecto
|
|
|
32
32
|
var _gridRowsSelector = require("../hooks/features/rows/gridRowsSelector");
|
|
33
33
|
var _gridEditingSelectors = require("../hooks/features/editing/gridEditingSelectors");
|
|
34
34
|
var _gridRowReorderSelector = require("../hooks/features/rowReorder/gridRowReorderSelector");
|
|
35
|
+
var _GridRowDragAndDropOverlay = require("./GridRowDragAndDropOverlay");
|
|
35
36
|
var _getPinnedCellOffset = require("../internals/utils/getPinnedCellOffset");
|
|
36
37
|
var _useGridConfiguration = require("../hooks/utils/useGridConfiguration");
|
|
37
38
|
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
@@ -315,7 +316,9 @@ const GridRow = (0, _forwardRef.forwardRef)(function GridRow(props, refProp) {
|
|
|
315
316
|
}), cells, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
316
317
|
role: "presentation",
|
|
317
318
|
className: (0, _clsx.default)(_gridClasses.gridClasses.cell, _gridClasses.gridClasses.cellEmpty)
|
|
318
|
-
}), rightCells
|
|
319
|
+
}), rightCells, /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridRowDragAndDropOverlay.GridRowDragAndDropOverlay, {
|
|
320
|
+
rowId: rowId
|
|
321
|
+
})]
|
|
319
322
|
}));
|
|
320
323
|
});
|
|
321
324
|
if (process.env.NODE_ENV !== "production") GridRow.displayName = "GridRow";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridRowId } from "../models/gridRows.js";
|
|
3
|
+
export interface GridRowDragAndDropOverlayProps {
|
|
4
|
+
rowId: GridRowId;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const GridRowDragAndDropOverlay: React.NamedExoticComponent<GridRowDragAndDropOverlayProps>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.GridRowDragAndDropOverlay = void 0;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _createStyled = require("@mui/system/createStyled");
|
|
14
|
+
var _useGridPrivateApiContext = require("../hooks/utils/useGridPrivateApiContext");
|
|
15
|
+
var _useGridSelector = require("../hooks/utils/useGridSelector");
|
|
16
|
+
var _gridRowReorderSelector = require("../hooks/features/rowReorder/gridRowReorderSelector");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
const GridRowDragAndDropOverlayRoot = (0, _styles.styled)('div', {
|
|
19
|
+
name: 'MuiDataGrid',
|
|
20
|
+
slot: 'RowDragOverlay',
|
|
21
|
+
shouldForwardProp: prop => (0, _createStyled.shouldForwardProp)(prop) && prop !== 'action'
|
|
22
|
+
})(({
|
|
23
|
+
theme,
|
|
24
|
+
action
|
|
25
|
+
}) => (0, _extends2.default)({
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
left: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
top: 0,
|
|
30
|
+
bottom: 0,
|
|
31
|
+
pointerEvents: 'none',
|
|
32
|
+
zIndex: 1
|
|
33
|
+
}, action === 'above' && {
|
|
34
|
+
'&::before': {
|
|
35
|
+
pointerEvents: 'none',
|
|
36
|
+
content: '""',
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
top: 0,
|
|
39
|
+
left: 0,
|
|
40
|
+
right: 0,
|
|
41
|
+
height: '2px',
|
|
42
|
+
backgroundColor: (theme.vars || theme).palette.primary.main
|
|
43
|
+
}
|
|
44
|
+
}, action === 'below' && {
|
|
45
|
+
'&::after': {
|
|
46
|
+
pointerEvents: 'none',
|
|
47
|
+
content: '""',
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
bottom: '-2px',
|
|
50
|
+
left: 0,
|
|
51
|
+
right: 0,
|
|
52
|
+
height: '2px',
|
|
53
|
+
backgroundColor: (theme.vars || theme).palette.primary.main
|
|
54
|
+
}
|
|
55
|
+
}, action === 'inside' && {
|
|
56
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / 0.1)` : (0, _styles.alpha)(theme.palette.primary.main, 0.1)
|
|
57
|
+
}));
|
|
58
|
+
const GridRowDragAndDropOverlay = exports.GridRowDragAndDropOverlay = /*#__PURE__*/React.memo(function GridRowDragAndDropOverlay(props) {
|
|
59
|
+
const {
|
|
60
|
+
rowId,
|
|
61
|
+
className
|
|
62
|
+
} = props;
|
|
63
|
+
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
64
|
+
const dropPosition = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowReorderSelector.gridRowDropPositionSelector, rowId);
|
|
65
|
+
if (!dropPosition) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridRowDragAndDropOverlayRoot, {
|
|
69
|
+
action: dropPosition,
|
|
70
|
+
className: className
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
if (process.env.NODE_ENV !== "production") GridRowDragAndDropOverlay.displayName = "GridRowDragAndDropOverlay";
|
|
@@ -239,10 +239,6 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
239
239
|
[`& .${_gridClasses.gridClasses.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle
|
|
240
240
|
}, {
|
|
241
241
|
[`& .${_gridClasses.gridClasses.withBorderColor}`]: styles.withBorderColor
|
|
242
|
-
}, {
|
|
243
|
-
[`& .${_gridClasses.gridClasses['row--dropAbove']}`]: styles['row--dropAbove']
|
|
244
|
-
}, {
|
|
245
|
-
[`& .${_gridClasses.gridClasses['row--dropBelow']}`]: styles['row--dropBelow']
|
|
246
242
|
}, {
|
|
247
243
|
[`& .${_gridClasses.gridClasses['row--beingDragged']}`]: styles['row--beingDragged']
|
|
248
244
|
}]
|
|
@@ -420,6 +416,9 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
420
416
|
alignItems: 'center',
|
|
421
417
|
backgroundColor: headerBackground
|
|
422
418
|
},
|
|
419
|
+
[`& .${_gridClasses.gridClasses.columnHeader} .${_gridClasses.gridClasses.sortButton}`]: {
|
|
420
|
+
backgroundColor: _cssVariables.vars.header.background.base
|
|
421
|
+
},
|
|
423
422
|
[`& .${_gridClasses.gridClasses['columnHeader--filter']}`]: {
|
|
424
423
|
paddingTop: 8,
|
|
425
424
|
paddingBottom: 8,
|
|
@@ -519,7 +518,16 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
519
518
|
[`& .${_gridClasses.gridClasses.columnHeader}:not(.${_gridClasses.gridClasses['columnHeader--sorted']}):hover .${_gridClasses.gridClasses.sortButton},
|
|
520
519
|
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}):hover .${_gridClasses.gridClasses.sortButton},
|
|
521
520
|
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}) .${_gridClasses.gridClasses.sortButton}:focus-visible`]: {
|
|
522
|
-
opacity:
|
|
521
|
+
opacity: 1
|
|
522
|
+
},
|
|
523
|
+
// Add opacity only to the button content to avoid affecting the background color
|
|
524
|
+
[`& .${_gridClasses.gridClasses.columnHeader}:not(.${_gridClasses.gridClasses['columnHeader--sorted']}):hover .${_gridClasses.gridClasses.sortButton} > *,
|
|
525
|
+
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}):hover .${_gridClasses.gridClasses.sortButton} > *,
|
|
526
|
+
& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}) .${_gridClasses.gridClasses.sortButton}:focus-visible > *`]: {
|
|
527
|
+
opacity: 0.78
|
|
528
|
+
},
|
|
529
|
+
[`& .${_gridClasses.gridClasses.pivotPanelFieldActionContainer} button:hover`]: {
|
|
530
|
+
backgroundColor: _cssVariables.vars.colors.background.base
|
|
523
531
|
}
|
|
524
532
|
},
|
|
525
533
|
'@media (hover: none)': {
|
|
@@ -534,7 +542,7 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
534
542
|
}
|
|
535
543
|
},
|
|
536
544
|
[`& .${_gridClasses.gridClasses.pivotPanelField}:not(.${_gridClasses.gridClasses['pivotPanelField--sorted']}) .${_gridClasses.gridClasses.sortButton}`]: {
|
|
537
|
-
opacity: 0.
|
|
545
|
+
opacity: 0.78
|
|
538
546
|
}
|
|
539
547
|
},
|
|
540
548
|
// Hide the column separator when the column has border and it is not resizable
|
|
@@ -628,7 +636,8 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
628
636
|
[`&.${_gridClasses.gridClasses.rowSkeleton}:hover`]: {
|
|
629
637
|
backgroundColor: 'transparent'
|
|
630
638
|
},
|
|
631
|
-
'&.Mui-selected': selectedStyles
|
|
639
|
+
'&.Mui-selected': selectedStyles,
|
|
640
|
+
position: 'relative'
|
|
632
641
|
},
|
|
633
642
|
/* Cell styles */
|
|
634
643
|
[`& .${_gridClasses.gridClasses.cell}`]: {
|
|
@@ -873,38 +882,6 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
873
882
|
display: 'none'
|
|
874
883
|
}
|
|
875
884
|
},
|
|
876
|
-
[`& .${_gridClasses.gridClasses['row--dropAbove']}`]: {
|
|
877
|
-
position: 'relative',
|
|
878
|
-
'&::before': {
|
|
879
|
-
pointerEvents: 'none',
|
|
880
|
-
content: '""',
|
|
881
|
-
position: 'absolute',
|
|
882
|
-
top: 0,
|
|
883
|
-
left: 0,
|
|
884
|
-
width: '100%',
|
|
885
|
-
height: '2px',
|
|
886
|
-
backgroundColor: _cssVariables.vars.colors.interactive.selected
|
|
887
|
-
}
|
|
888
|
-
},
|
|
889
|
-
[`& .${_gridClasses.gridClasses['row--dropBelow']}`]: {
|
|
890
|
-
position: 'relative',
|
|
891
|
-
'&::after': {
|
|
892
|
-
zIndex: 100,
|
|
893
|
-
pointerEvents: 'none',
|
|
894
|
-
content: '""',
|
|
895
|
-
position: 'absolute',
|
|
896
|
-
bottom: '-2px',
|
|
897
|
-
left: 0,
|
|
898
|
-
width: '100%',
|
|
899
|
-
height: '2px',
|
|
900
|
-
backgroundColor: _cssVariables.vars.colors.interactive.selected
|
|
901
|
-
},
|
|
902
|
-
[`&.${_gridClasses.gridClasses['row--lastVisible']}`]: {
|
|
903
|
-
'&::after': {
|
|
904
|
-
bottom: 'calc(var(--DataGrid-hasScrollY) * 0px + (1 - var(--DataGrid-hasScrollY)) * -2px)'
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
},
|
|
908
885
|
[`& .${_gridClasses.gridClasses['row--beingDragged']}`]: {
|
|
909
886
|
color: _cssVariables.vars.colors.foreground.disabled,
|
|
910
887
|
'&:hover': {
|
|
@@ -96,6 +96,7 @@ function GridVirtualScroller(props) {
|
|
|
96
96
|
getContainerProps,
|
|
97
97
|
getScrollerProps,
|
|
98
98
|
getContentProps,
|
|
99
|
+
getPositionerProps,
|
|
99
100
|
getScrollbarVerticalProps,
|
|
100
101
|
getScrollbarHorizontalProps,
|
|
101
102
|
getRows,
|
|
@@ -128,12 +129,13 @@ function GridVirtualScroller(props) {
|
|
|
128
129
|
loadingOverlayVariant: loadingOverlayVariant,
|
|
129
130
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Overlay, (0, _extends2.default)({}, rootProps.slotProps?.[overlayType]))
|
|
130
131
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridVirtualScrollerContent.GridVirtualScrollerContent, (0, _extends2.default)({}, getContentProps(), {
|
|
131
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridVirtualScrollerRenderZone.GridVirtualScrollerRenderZone, {
|
|
132
|
-
role: "rowgroup"
|
|
132
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridVirtualScrollerRenderZone.GridVirtualScrollerRenderZone, (0, _extends2.default)({
|
|
133
|
+
role: "rowgroup"
|
|
134
|
+
}, getPositionerProps(), {
|
|
133
135
|
children: [rows, /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.detailPanels, {
|
|
134
136
|
virtualScroller: virtualScroller
|
|
135
137
|
})]
|
|
136
|
-
})
|
|
138
|
+
}))
|
|
137
139
|
})), hasBottomFiller && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridVirtualScrollerFiller.GridVirtualScrollerFiller, {
|
|
138
140
|
rowsLength: rows.length
|
|
139
141
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.bottomContainer, {
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.GridVirtualScrollerRenderZone = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
10
|
var React = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
12
|
var _system = require("@mui/system");
|
|
14
13
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
14
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
|
-
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
|
|
17
15
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
18
16
|
var _gridClasses = require("../../constants/gridClasses");
|
|
19
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["className"];
|
|
21
18
|
const useUtilityClasses = ownerState => {
|
|
22
19
|
const {
|
|
23
20
|
classes
|
|
@@ -37,21 +34,12 @@ const VirtualScrollerRenderZoneRoot = (0, _system.styled)('div', {
|
|
|
37
34
|
flexDirection: 'column'
|
|
38
35
|
});
|
|
39
36
|
const GridVirtualScrollerRenderZone = exports.GridVirtualScrollerRenderZone = (0, _forwardRef.forwardRef)(function GridVirtualScrollerRenderZone(props, ref) {
|
|
40
|
-
const {
|
|
41
|
-
className
|
|
42
|
-
} = props,
|
|
43
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
44
|
-
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
45
37
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
46
38
|
const classes = useUtilityClasses(rootProps);
|
|
47
|
-
const offsetTop = apiRef.current.virtualizer.api.getters.getOffsetTop();
|
|
48
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(VirtualScrollerRenderZoneRoot, (0, _extends2.default)({
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
transform: `translate3d(0, ${offsetTop}px, 0)`
|
|
53
|
-
}
|
|
54
|
-
}, other, {
|
|
40
|
+
ownerState: rootProps
|
|
41
|
+
}, props, {
|
|
42
|
+
className: (0, _clsx.default)(classes.root, props.className),
|
|
55
43
|
ref: ref
|
|
56
44
|
}));
|
|
57
45
|
});
|
|
@@ -572,14 +572,6 @@ export interface GridClasses {
|
|
|
572
572
|
* Styles applied to the floating special row reorder cell element when it is dragged.
|
|
573
573
|
*/
|
|
574
574
|
'row--dragging': string;
|
|
575
|
-
/**
|
|
576
|
-
* Styles applied to the row element when it is a drop target above.
|
|
577
|
-
*/
|
|
578
|
-
'row--dropAbove': string;
|
|
579
|
-
/**
|
|
580
|
-
* Styles applied to the row element when it is a drop target below.
|
|
581
|
-
*/
|
|
582
|
-
'row--dropBelow': string;
|
|
583
575
|
/**
|
|
584
576
|
* Styles applied to the row element when it is being dragged (entire row).
|
|
585
577
|
*/
|
package/constants/gridClasses.js
CHANGED
|
@@ -13,4 +13,4 @@ function getDataGridUtilityClass(slot) {
|
|
|
13
13
|
}
|
|
14
14
|
const gridClasses = exports.gridClasses = (0, _generateUtilityClasses.default)('MuiDataGrid', ['aiAssistantPanel', 'aiAssistantPanelHeader', 'aiAssistantPanelTitleContainer', 'aiAssistantPanelTitle', 'aiAssistantPanelBody', 'aiAssistantPanelEmptyText', 'aiAssistantPanelFooter', 'aiAssistantPanelConversation', 'aiAssistantPanelConversationList', 'aiAssistantPanelConversationTitle', 'aiAssistantPanelSuggestions', 'aiAssistantPanelSuggestionsList', 'aiAssistantPanelSuggestionsItem', 'aiAssistantPanelSuggestionsLabel', 'actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'aggregationRowOverlayWrapper', 'autoHeight', 'autosizing', 'mainContent', 'withSidePanel', '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', 'collapsible', 'collapsibleTrigger', 'collapsibleIcon', 'collapsiblePanel', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--siblingFocused', 'columnHeader--filter', 'columnHeaderFilterInput', 'columnHeaderFilterOperatorLabel', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementSearchInput', 'columnsManagementFooter', 'columnsManagementScrollArea', 'columnsManagementEmptyText', 'container--top', 'container--bottom', 'detailPanel', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hiddenContent', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible',
|
|
15
15
|
// TODO v9: Rename to `cell--dragging`
|
|
16
|
-
'row--dragging', 'row--
|
|
16
|
+
'row--dragging', 'row--beingDragged', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderIcon', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea--up', 'scrollArea--down', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--pinnedRight', 'scrollShadow', 'scrollShadow--vertical', 'scrollShadow--horizontal', 'selectedRowCount', 'sortButton', 'sortIcon', 'shadowScrollArea', 'sidebar', 'sidebarHeader', 'toolbarContainer', 'toolbar', 'toolbarLabel', 'toolbarDivider', 'toolbarFilterList', 'toolbarQuickFilter', 'toolbarQuickFilterTrigger', 'toolbarQuickFilterControl', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pivotPanelAvailableFields', 'pivotPanelField', 'pivotPanelField--sorted', 'pivotPanelFieldActionContainer', 'pivotPanelFieldCheckbox', 'pivotPanelFieldDragIcon', 'pivotPanelFieldList', 'pivotPanelFieldName', 'pivotPanelHeader', 'pivotPanelPlaceholder', 'pivotPanelScrollArea', 'pivotPanelSearchContainer', 'pivotPanelSection', 'pivotPanelSectionTitle', 'pivotPanelSections', 'pivotPanelSwitch', 'pivotPanelSwitchLabel', 'prompt', 'promptContent', 'promptText', 'promptFeedback', 'promptChangeList', 'promptChangesToggle', 'promptChangesToggleIcon', 'promptIcon', 'promptIconContainer', 'promptError', 'promptAction']);
|
|
@@ -26,6 +26,7 @@ import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSele
|
|
|
26
26
|
import { gridRowNodeSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
27
27
|
import { gridEditRowsStateSelector, gridRowIsEditingSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|
|
28
28
|
import { gridIsRowDragActiveSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
|
|
29
|
+
import { GridRowDragAndDropOverlay } from "./GridRowDragAndDropOverlay.js";
|
|
29
30
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
30
31
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
31
32
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
@@ -308,7 +309,9 @@ const GridRow = forwardRef(function GridRow(props, refProp) {
|
|
|
308
309
|
}), cells, /*#__PURE__*/_jsx("div", {
|
|
309
310
|
role: "presentation",
|
|
310
311
|
className: clsx(gridClasses.cell, gridClasses.cellEmpty)
|
|
311
|
-
}), rightCells
|
|
312
|
+
}), rightCells, /*#__PURE__*/_jsx(GridRowDragAndDropOverlay, {
|
|
313
|
+
rowId: rowId
|
|
314
|
+
})]
|
|
312
315
|
}));
|
|
313
316
|
});
|
|
314
317
|
if (process.env.NODE_ENV !== "production") GridRow.displayName = "GridRow";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridRowId } from "../models/gridRows.js";
|
|
3
|
+
export interface GridRowDragAndDropOverlayProps {
|
|
4
|
+
rowId: GridRowId;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const GridRowDragAndDropOverlay: React.NamedExoticComponent<GridRowDragAndDropOverlayProps>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
6
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
7
|
+
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
8
|
+
import { useGridSelector } from "../hooks/utils/useGridSelector.js";
|
|
9
|
+
import { gridRowDropPositionSelector } from "../hooks/features/rowReorder/gridRowReorderSelector.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const GridRowDragAndDropOverlayRoot = styled('div', {
|
|
12
|
+
name: 'MuiDataGrid',
|
|
13
|
+
slot: 'RowDragOverlay',
|
|
14
|
+
shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'action'
|
|
15
|
+
})(({
|
|
16
|
+
theme,
|
|
17
|
+
action
|
|
18
|
+
}) => _extends({
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
left: 0,
|
|
21
|
+
right: 0,
|
|
22
|
+
top: 0,
|
|
23
|
+
bottom: 0,
|
|
24
|
+
pointerEvents: 'none',
|
|
25
|
+
zIndex: 1
|
|
26
|
+
}, action === 'above' && {
|
|
27
|
+
'&::before': {
|
|
28
|
+
pointerEvents: 'none',
|
|
29
|
+
content: '""',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
top: 0,
|
|
32
|
+
left: 0,
|
|
33
|
+
right: 0,
|
|
34
|
+
height: '2px',
|
|
35
|
+
backgroundColor: (theme.vars || theme).palette.primary.main
|
|
36
|
+
}
|
|
37
|
+
}, action === 'below' && {
|
|
38
|
+
'&::after': {
|
|
39
|
+
pointerEvents: 'none',
|
|
40
|
+
content: '""',
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
bottom: '-2px',
|
|
43
|
+
left: 0,
|
|
44
|
+
right: 0,
|
|
45
|
+
height: '2px',
|
|
46
|
+
backgroundColor: (theme.vars || theme).palette.primary.main
|
|
47
|
+
}
|
|
48
|
+
}, action === 'inside' && {
|
|
49
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / 0.1)` : alpha(theme.palette.primary.main, 0.1)
|
|
50
|
+
}));
|
|
51
|
+
export const GridRowDragAndDropOverlay = /*#__PURE__*/React.memo(function GridRowDragAndDropOverlay(props) {
|
|
52
|
+
const {
|
|
53
|
+
rowId,
|
|
54
|
+
className
|
|
55
|
+
} = props;
|
|
56
|
+
const apiRef = useGridPrivateApiContext();
|
|
57
|
+
const dropPosition = useGridSelector(apiRef, gridRowDropPositionSelector, rowId);
|
|
58
|
+
if (!dropPosition) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return /*#__PURE__*/_jsx(GridRowDragAndDropOverlayRoot, {
|
|
62
|
+
action: dropPosition,
|
|
63
|
+
className: className
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
if (process.env.NODE_ENV !== "production") GridRowDragAndDropOverlay.displayName = "GridRowDragAndDropOverlay";
|