@mui/x-data-grid 7.0.0-beta.2 → 7.0.0-beta.3
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 +73 -9
- package/DataGrid/DataGrid.js +0 -6
- package/components/GridRow.d.ts +3 -1
- package/components/GridRow.js +10 -2
- package/components/containers/GridRootStyles.js +1 -4
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -4
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/components/virtualization/GridVirtualScrollerRenderZone.js +10 -3
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -5
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +46 -48
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +9 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +7 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +19 -16
- package/hooks/features/virtualization/useGridVirtualization.d.ts +8 -0
- package/hooks/features/virtualization/useGridVirtualization.js +6 -1
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +0 -6
- package/legacy/components/GridRow.js +10 -2
- package/legacy/components/containers/GridRootStyles.js +1 -4
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +6 -3
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +7 -4
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +4 -2
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +10 -3
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +60 -63
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +9 -0
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +19 -16
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +6 -1
- package/legacy/index.js +1 -1
- package/models/events/gridEventLookup.d.ts +1 -8
- package/models/props/DataGridProps.d.ts +0 -6
- package/modern/DataGrid/DataGrid.js +0 -6
- package/modern/components/GridRow.js +10 -2
- package/modern/components/containers/GridRootStyles.js +1 -4
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -4
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +10 -3
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +46 -48
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +7 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +18 -14
- package/modern/hooks/features/virtualization/useGridVirtualization.js +6 -1
- package/modern/index.js +1 -1
- package/node/DataGrid/DataGrid.js +0 -6
- package/node/components/GridRow.js +10 -2
- package/node/components/containers/GridRootStyles.js +1 -4
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -4
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +10 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +45 -47
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +8 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -13
- package/node/hooks/features/virtualization/useGridVirtualization.js +7 -2
- package/node/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,70 @@
|
|
|
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
|
+
## v7.0.0-beta.3
|
|
7
|
+
|
|
8
|
+
_Feb 16, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🎁 Charts get a [built in grid](https://next.mui.com/x/react-charts/axis/#grid)
|
|
13
|
+
|
|
14
|
+
<img src="https://github.com/mui/mui-x/assets/45398769/74299f54-f020-4135-b38c-dc88a230db30" width="510" alt="Charts Grid" />
|
|
15
|
+
|
|
16
|
+
- 🎛️ Charts get a [Gauge component](https://next.mui.com/x/react-charts/gauge/).
|
|
17
|
+
|
|
18
|
+
<img src="https://github.com/mui/mui-x/assets/45398769/fb7a94b5-bef6-4fc2-a0cd-d6ff5b60fa8b" width="510" alt="Guage Chart" />
|
|
19
|
+
|
|
20
|
+
- 🐞 Bugfixes
|
|
21
|
+
|
|
22
|
+
- 📚 Documentation improvements
|
|
23
|
+
|
|
24
|
+
### Data Grid
|
|
25
|
+
|
|
26
|
+
#### Breaking changes
|
|
27
|
+
|
|
28
|
+
- The `rowEditCommit` event and the related prop `onRowEditCommit` was removed. The [`processRowUpdate`](https://next.mui.com/x/react-data-grid/editing/#the-processrowupdate-callback) prop can be used in place.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid@7.0.0-beta.3`
|
|
31
|
+
|
|
32
|
+
- [DataGrid] Performance: avoid style invalidation (#12019) @romgrk
|
|
33
|
+
- [DataGrid] Remove legacy editing API event: `rowEditCommit` (#12073) @MBilalShafi
|
|
34
|
+
- [DataGrid] Fix styling grid filter input single select (#11520) @FreakDroid
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-pro@7.0.0-beta.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid@7.0.0-beta.3`.
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-data-grid-premium@7.0.0-beta.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.3`.
|
|
43
|
+
|
|
44
|
+
### Charts / `@mui/x-charts@7.0.0-beta.3`
|
|
45
|
+
|
|
46
|
+
- [charts] Add Gauge component (#11996) @alexfauquette
|
|
47
|
+
- [charts] Add a `ChartsGrid` component (#11034) @alexfauquette
|
|
48
|
+
|
|
49
|
+
### Tree View / `@mui/x-tree-view@7.0.0-beta.3`
|
|
50
|
+
|
|
51
|
+
- [TreeView] Remove instance existence checks (#12066) @flaviendelangle
|
|
52
|
+
|
|
53
|
+
### Docs
|
|
54
|
+
|
|
55
|
+
- [docs] Complete charts API pages (#12038) @alexfauquette
|
|
56
|
+
- [docs] Add more illustrations to the charts overview page (#12041) @danilo-leal
|
|
57
|
+
- [docs] Fix 301 redirection to StackBlitz @oliviertassinari
|
|
58
|
+
- [docs] Fix Tree space to match the reset of the docs @oliviertassinari
|
|
59
|
+
- [docs] Fix `dayOfWeekFormatter` typo in the pickers v6 to v7 migration document (#12043) @StylesTrip
|
|
60
|
+
- [docs] Fix redirection @oliviertassinari
|
|
61
|
+
- [docs] Fix typo for `AdapterDateFnsV3` (#12036) @flaviendelangle
|
|
62
|
+
- [docs] Removed `focused` prop from demo (#12092) @michelengelen
|
|
63
|
+
|
|
64
|
+
### Core
|
|
65
|
+
|
|
66
|
+
- [core] Fix CodeSandbox CI template @oliviertassinari
|
|
67
|
+
- [core] Sort prop asc (#12033) @oliviertassinari
|
|
68
|
+
- [core] Bump monorepo (#12055) @alexfauquette
|
|
69
|
+
|
|
6
70
|
## v7.0.0-beta.2
|
|
7
71
|
|
|
8
72
|
_Feb 9, 2024_
|
|
@@ -17,7 +81,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
17
81
|
|
|
18
82
|
### Data Grid
|
|
19
83
|
|
|
20
|
-
#### `@mui/x-data-grid@
|
|
84
|
+
#### `@mui/x-data-grid@7.0.0-beta.2`
|
|
21
85
|
|
|
22
86
|
- [DataGrid] Add `removeAllFilterItems` as a reason of `onFilterModelChange` callback (#11911) @shaharyar-shamshi
|
|
23
87
|
- [DataGrid] Add slot typings (#11795) @romgrk
|
|
@@ -27,35 +91,35 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
27
91
|
- [DataGrid] Improve vertical scrolling performance (#11924) @romgrk
|
|
28
92
|
- [l10n] Improve Danish (da-DK) locale (#11877) @ShahrazH
|
|
29
93
|
|
|
30
|
-
#### `@mui/x-data-grid-pro@
|
|
94
|
+
#### `@mui/x-data-grid-pro@7.0.0-beta.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
95
|
|
|
32
96
|
Same changes as in `@mui/x-data-grid@v7.0.0-beta.2`.
|
|
33
97
|
|
|
34
98
|
#### `@mui/x-data-grid-premium@v7.0.0-beta.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
35
99
|
|
|
36
|
-
Same changes as in `@mui/x-data-grid-pro@
|
|
100
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.2`, plus:
|
|
37
101
|
|
|
38
102
|
- [DataGridPremium] Fix autosize grouping cell (#11870) @romgrk
|
|
39
103
|
- [DataGridPremium] Fix clipboard paste not working with Caps Lock enabled (#11965) @shaharyar-shamshi
|
|
40
104
|
|
|
41
105
|
### Date Pickers
|
|
42
106
|
|
|
43
|
-
#### `@mui/x-date-pickers@
|
|
107
|
+
#### `@mui/x-date-pickers@7.0.0-beta.2`
|
|
44
108
|
|
|
45
109
|
- [pickers] Avoid relying on locale in Luxon `isWithinRange` method (#11936) @LukasTy
|
|
46
110
|
- [pickers] Limit the valid values of `TDate` (#11791) @flaviendelangle
|
|
47
111
|
|
|
48
|
-
#### `@mui/x-date-pickers-pro@
|
|
112
|
+
#### `@mui/x-date-pickers-pro@7.0.0-beta.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
113
|
|
|
50
|
-
Same changes as in `@mui/x-date-pickers@
|
|
114
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-beta.2`.
|
|
51
115
|
|
|
52
|
-
### Charts / `@mui/x-charts@
|
|
116
|
+
### Charts / `@mui/x-charts@7.0.0-beta.2`
|
|
53
117
|
|
|
54
118
|
- [charts] Add `reverse` property to axes (#11899) @alexfauquette
|
|
55
119
|
- [charts] Allow series ids to be numbers (#11941) @alexfauquette
|
|
56
120
|
- [charts] Support UTC date formatting in tooltip (#11943) @shaharyar-shamshi
|
|
57
121
|
|
|
58
|
-
### Tree View / `@mui/x-tree-view@
|
|
122
|
+
### Tree View / `@mui/x-tree-view@7.0.0-beta.2`
|
|
59
123
|
|
|
60
124
|
- [TreeView] Correctly detect if an item is expandable (#11963) @swalker326
|
|
61
125
|
- [TreeView] Polish the default design & revise the simple version pages (#11529) @danilo-leal
|
|
@@ -71,7 +135,7 @@ Same changes as in `@mui/x-date-pickers@v7.0.0-beta.2`.
|
|
|
71
135
|
+import { LicenseInfo } from '@mui/x-license';
|
|
72
136
|
```
|
|
73
137
|
|
|
74
|
-
`@mui/x-license@
|
|
138
|
+
`@mui/x-license@7.0.0-beta.2`
|
|
75
139
|
|
|
76
140
|
- [license] Rename `@mui/x-license-pro` to `@mui/x-license` (#11938) @cherniavskii
|
|
77
141
|
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -493,12 +493,6 @@ DataGridRaw.propTypes = {
|
|
|
493
493
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
494
494
|
*/
|
|
495
495
|
onRowDoubleClick: PropTypes.func,
|
|
496
|
-
/**
|
|
497
|
-
* Callback fired when the row changes are committed.
|
|
498
|
-
* @param {GridRowId} id The row id.
|
|
499
|
-
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
|
|
500
|
-
*/
|
|
501
|
-
onRowEditCommit: PropTypes.func,
|
|
502
496
|
/**
|
|
503
497
|
* Callback fired when the row turns to edit mode.
|
|
504
498
|
* @param {GridRowParams} params With all properties from [[GridRowParams]].
|
package/components/GridRow.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { GridRowId, GridRowModel } from '../models/gridRows';
|
|
3
3
|
import type { GridPinnedColumns } from '../hooks/features/columns';
|
|
4
4
|
import type { GridStateColDef } from '../models/colDef/gridColDef';
|
|
5
|
-
import {
|
|
5
|
+
import type { GridVirtualizationState } from '../hooks/features/virtualization';
|
|
6
|
+
import type { GridDimensions } from '../hooks/features/dimensions';
|
|
6
7
|
export interface GridRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
8
|
rowId: GridRowId;
|
|
8
9
|
selected: boolean;
|
|
@@ -12,6 +13,7 @@ export interface GridRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
12
13
|
*/
|
|
13
14
|
index: number;
|
|
14
15
|
rowHeight: number | 'auto';
|
|
16
|
+
offsets: GridVirtualizationState['offsets'];
|
|
15
17
|
dimensions: GridDimensions;
|
|
16
18
|
firstColumnToRender: number;
|
|
17
19
|
lastColumnToRender: number;
|
package/components/GridRow.js
CHANGED
|
@@ -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 = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "renderedColumns", "pinnedColumns", "dimensions", "firstColumnToRender", "lastColumnToRender", "isFirstVisible", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "rowHeight", "className", "visibleColumns", "renderedColumns", "pinnedColumns", "offsets", "dimensions", "firstColumnToRender", "lastColumnToRender", "isFirstVisible", "isLastVisible", "focusedCellColumnIndexNotInRange", "isNotVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -67,6 +67,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
67
67
|
visibleColumns,
|
|
68
68
|
renderedColumns,
|
|
69
69
|
pinnedColumns,
|
|
70
|
+
offsets,
|
|
70
71
|
dimensions,
|
|
71
72
|
firstColumnToRender,
|
|
72
73
|
isFirstVisible,
|
|
@@ -364,8 +365,11 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
364
365
|
style: style
|
|
365
366
|
}, eventHandlers, other, {
|
|
366
367
|
children: [leftCells, /*#__PURE__*/_jsx("div", {
|
|
368
|
+
role: "presentation",
|
|
367
369
|
className: gridClasses.cellOffsetLeft,
|
|
368
|
-
|
|
370
|
+
style: {
|
|
371
|
+
width: offsets.left
|
|
372
|
+
}
|
|
369
373
|
}), cells, emptyCellWidth > 0 && /*#__PURE__*/_jsx(EmptyCell, {
|
|
370
374
|
width: emptyCellWidth
|
|
371
375
|
}), rightCells.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
@@ -434,6 +438,10 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
434
438
|
isLastVisible: PropTypes.bool.isRequired,
|
|
435
439
|
isNotVisible: PropTypes.bool,
|
|
436
440
|
lastColumnToRender: PropTypes.number.isRequired,
|
|
441
|
+
offsets: PropTypes.shape({
|
|
442
|
+
left: PropTypes.number.isRequired,
|
|
443
|
+
top: PropTypes.number.isRequired
|
|
444
|
+
}).isRequired,
|
|
437
445
|
onClick: PropTypes.func,
|
|
438
446
|
onDoubleClick: PropTypes.func,
|
|
439
447
|
onMouseEnter: PropTypes.func,
|
|
@@ -192,8 +192,6 @@ export const GridRootStyles = styled('div', {
|
|
|
192
192
|
'--DataGrid-width': '0px',
|
|
193
193
|
'--DataGrid-hasScrollX': '0',
|
|
194
194
|
'--DataGrid-hasScrollY': '0',
|
|
195
|
-
'--DataGrid-offsetTop': '0px',
|
|
196
|
-
'--DataGrid-offsetLeft': '0px',
|
|
197
195
|
'--DataGrid-scrollbarSize': '10px',
|
|
198
196
|
'--DataGrid-rowWidth': '0px',
|
|
199
197
|
'--DataGrid-columnsTotalWidth': '0px',
|
|
@@ -562,8 +560,7 @@ export const GridRootStyles = styled('div', {
|
|
|
562
560
|
},
|
|
563
561
|
[`& .${c.cellOffsetLeft}`]: {
|
|
564
562
|
flex: '0 0 auto',
|
|
565
|
-
display: 'inline-block'
|
|
566
|
-
width: 'var(--DataGrid-offsetLeft)'
|
|
563
|
+
display: 'inline-block'
|
|
567
564
|
},
|
|
568
565
|
[`& .${c.columnHeaderDraggableContainer}`]: {
|
|
569
566
|
display: 'flex',
|
|
@@ -25,7 +25,7 @@ declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<Omit
|
|
|
25
25
|
root?: import("@mui/base").SlotComponentProps<"div", import("@mui/base").PopperRootSlotPropsOverrides, import("@mui/base").PopperOwnProps> | undefined;
|
|
26
26
|
} | undefined;
|
|
27
27
|
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
28
|
-
} & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "component" | "sx" | "components" | "slotProps" | "slots" | "placement" | "disablePortal" | "
|
|
28
|
+
} & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "component" | "sx" | "components" | "slotProps" | "slots" | "placement" | "disablePortal" | "keepMounted" | "modifiers" | "anchorEl" | "popperOptions" | "popperRef" | "componentsProps" | keyof React.RefAttributes<HTMLDivElement>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
29
29
|
ownerState: OwnerState;
|
|
30
30
|
}, {}, {}>;
|
|
31
31
|
declare const GridPanel: React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<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 = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType, unstable_useId as useId } from '@mui/utils';
|
|
@@ -25,7 +25,8 @@ function GridFilterInputBoolean(props) {
|
|
|
25
25
|
focusElementRef,
|
|
26
26
|
clearButton,
|
|
27
27
|
tabIndex,
|
|
28
|
-
label: labelProp
|
|
28
|
+
label: labelProp,
|
|
29
|
+
variant = 'standard'
|
|
29
30
|
} = props,
|
|
30
31
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
32
|
const [filterValueState, setFilterValueState] = React.useState(item.value || '');
|
|
@@ -52,7 +53,7 @@ function GridFilterInputBoolean(props) {
|
|
|
52
53
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseInputLabel, {
|
|
53
54
|
id: labelId,
|
|
54
55
|
shrink: true,
|
|
55
|
-
variant:
|
|
56
|
+
variant: variant,
|
|
56
57
|
children: label
|
|
57
58
|
})), /*#__PURE__*/_jsxs(rootProps.slots.baseSelect, _extends({
|
|
58
59
|
labelId: labelId,
|
|
@@ -60,7 +61,8 @@ function GridFilterInputBoolean(props) {
|
|
|
60
61
|
label: label,
|
|
61
62
|
value: filterValueState,
|
|
62
63
|
onChange: onFilterChange,
|
|
63
|
-
variant:
|
|
64
|
+
variant: variant,
|
|
65
|
+
notched: variant === 'outlined' ? true : undefined,
|
|
64
66
|
native: isSelectNative,
|
|
65
67
|
displayEmpty: true,
|
|
66
68
|
inputProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -51,6 +51,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
51
51
|
placeholder,
|
|
52
52
|
tabIndex,
|
|
53
53
|
label: labelProp,
|
|
54
|
+
variant = 'standard',
|
|
54
55
|
clearButton
|
|
55
56
|
} = props,
|
|
56
57
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -91,7 +92,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
91
92
|
id: labelId,
|
|
92
93
|
htmlFor: id,
|
|
93
94
|
shrink: true,
|
|
94
|
-
variant:
|
|
95
|
+
variant: variant,
|
|
95
96
|
children: label
|
|
96
97
|
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
97
98
|
id: id,
|
|
@@ -99,14 +100,15 @@ function GridFilterInputSingleSelect(props) {
|
|
|
99
100
|
labelId: labelId,
|
|
100
101
|
value: filterValue,
|
|
101
102
|
onChange: onFilterChange,
|
|
102
|
-
variant:
|
|
103
|
+
variant: variant,
|
|
103
104
|
type: type || 'text',
|
|
104
105
|
inputProps: {
|
|
105
106
|
tabIndex,
|
|
106
107
|
ref: focusElementRef,
|
|
107
108
|
placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
108
109
|
},
|
|
109
|
-
native: isSelectNative
|
|
110
|
+
native: isSelectNative,
|
|
111
|
+
notched: variant === 'outlined' ? true : undefined
|
|
110
112
|
}, others /* FIXME: typing error */, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
|
|
111
113
|
children: renderSingleSelectOptions({
|
|
112
114
|
column: resolvedColumn,
|
|
@@ -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 = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
3
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useId as useId } from '@mui/utils';
|
|
@@ -18,7 +18,8 @@ function GridFilterInputValue(props) {
|
|
|
18
18
|
tabIndex,
|
|
19
19
|
disabled,
|
|
20
20
|
clearButton,
|
|
21
|
-
InputProps
|
|
21
|
+
InputProps,
|
|
22
|
+
variant = 'standard'
|
|
22
23
|
} = props,
|
|
23
24
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
24
25
|
const filterTimeout = useTimeout();
|
|
@@ -54,7 +55,7 @@ function GridFilterInputValue(props) {
|
|
|
54
55
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
55
56
|
value: filterValueState,
|
|
56
57
|
onChange: onFilterChange,
|
|
57
|
-
variant:
|
|
58
|
+
variant: variant,
|
|
58
59
|
type: type || 'text',
|
|
59
60
|
InputProps: _extends({}, applying || clearButton ? {
|
|
60
61
|
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
@@ -5,6 +5,9 @@ import * as React from 'react';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { styled } from '@mui/system';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
+
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
9
|
+
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
10
|
+
import { gridOffsetsSelector } from '../../hooks/features/virtualization';
|
|
8
11
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
12
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -25,20 +28,24 @@ const VirtualScrollerRenderZoneRoot = styled('div', {
|
|
|
25
28
|
position: 'absolute',
|
|
26
29
|
display: 'flex',
|
|
27
30
|
// Prevents margin collapsing when using `getRowSpacing`
|
|
28
|
-
flexDirection: 'column'
|
|
29
|
-
transform: 'translate3d(0, var(--DataGrid-offsetTop), 0)'
|
|
31
|
+
flexDirection: 'column'
|
|
30
32
|
});
|
|
31
33
|
const GridVirtualScrollerRenderZone = /*#__PURE__*/React.forwardRef(function GridVirtualScrollerRenderZone(props, ref) {
|
|
32
34
|
const {
|
|
33
35
|
className
|
|
34
36
|
} = props,
|
|
35
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
38
|
+
const apiRef = useGridApiContext();
|
|
36
39
|
const rootProps = useGridRootProps();
|
|
37
40
|
const classes = useUtilityClasses(rootProps);
|
|
41
|
+
const offsets = useGridSelector(apiRef, gridOffsetsSelector);
|
|
38
42
|
return /*#__PURE__*/_jsx(VirtualScrollerRenderZoneRoot, _extends({
|
|
39
43
|
ref: ref,
|
|
40
44
|
className: clsx(classes.root, className),
|
|
41
|
-
ownerState: rootProps
|
|
45
|
+
ownerState: rootProps,
|
|
46
|
+
style: {
|
|
47
|
+
transform: `translate3d(0, ${offsets.top}px, 0)`
|
|
48
|
+
}
|
|
42
49
|
}, other));
|
|
43
50
|
});
|
|
44
51
|
export { GridVirtualScrollerRenderZone };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { DataGridProcessedProps } from '../../../models/props/DataGridProps';
|
|
2
3
|
import { GridRenderContext } from '../../../models/params/gridScrollParams';
|
|
3
4
|
import { GridStateColDef } from '../../../models/colDef/gridColDef';
|
|
4
5
|
import { GridSortColumnLookup } from '../sorting';
|
|
@@ -28,15 +29,13 @@ export interface GetHeadersParams {
|
|
|
28
29
|
minFirstColumn?: number;
|
|
29
30
|
maxLastColumn?: number;
|
|
30
31
|
}
|
|
32
|
+
type OwnerState = DataGridProcessedProps;
|
|
31
33
|
export declare const GridColumnHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
32
|
-
ownerState:
|
|
33
|
-
params?: GetHeadersParams;
|
|
34
|
-
leftOverflow?: number;
|
|
35
|
-
};
|
|
34
|
+
ownerState: OwnerState;
|
|
36
35
|
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
37
36
|
export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
|
|
38
37
|
renderContext: GridRenderContext;
|
|
39
|
-
|
|
38
|
+
getFillers: (params: GetHeadersParams | undefined, children: React.ReactNode, leftOverflow: number, borderTop?: boolean) => React.JSX.Element;
|
|
40
39
|
getColumnHeaders: (params?: GetHeadersParams, other?: {}) => React.JSX.Element;
|
|
41
40
|
getColumnsToRender: (params?: GetHeadersParams) => {
|
|
42
41
|
renderedColumns: GridStateColDef[];
|
|
@@ -50,3 +49,4 @@ export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) =>
|
|
|
50
49
|
role: string;
|
|
51
50
|
};
|
|
52
51
|
};
|
|
52
|
+
export {};
|
|
@@ -3,11 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { useGridSelector } from '../../utils';
|
|
6
|
+
import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
6
7
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
7
8
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
8
9
|
import { GridColumnHeaderItem } from '../../../components/columnHeaders/GridColumnHeaderItem';
|
|
9
10
|
import { gridDimensionsSelector } from '../dimensions';
|
|
10
|
-
import { gridRenderContextColumnsSelector, gridVirtualizationColumnEnabledSelector } from '../virtualization';
|
|
11
|
+
import { gridOffsetsSelector, gridRenderContextColumnsSelector, gridVirtualizationColumnEnabledSelector } from '../virtualization';
|
|
11
12
|
import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
|
|
12
13
|
import { GridPinnedColumnPosition, gridVisiblePinnedColumnDefinitionsSelector } from '../columns';
|
|
13
14
|
import { GridScrollbarFillerCell as ScrollbarFiller } from '../../../components/GridScrollbarFillerCell';
|
|
@@ -24,19 +25,11 @@ const SpaceFiller = styled('div')({
|
|
|
24
25
|
export const GridColumnHeaderRow = styled('div', {
|
|
25
26
|
name: 'MuiDataGrid',
|
|
26
27
|
slot: 'ColumnHeaderRow',
|
|
27
|
-
overridesResolver: (
|
|
28
|
-
})(
|
|
29
|
-
ownerState: {
|
|
30
|
-
params: {
|
|
31
|
-
position
|
|
32
|
-
} = {},
|
|
33
|
-
leftOverflow = 0
|
|
34
|
-
}
|
|
35
|
-
}) => ({
|
|
28
|
+
overridesResolver: (_, styles) => styles.columnHeaderRow
|
|
29
|
+
})({
|
|
36
30
|
display: 'flex',
|
|
37
|
-
height: 'var(--DataGrid-headerHeight)'
|
|
38
|
-
|
|
39
|
-
}));
|
|
31
|
+
height: 'var(--DataGrid-headerHeight)'
|
|
32
|
+
});
|
|
40
33
|
export const useGridColumnHeaders = props => {
|
|
41
34
|
const {
|
|
42
35
|
innerRef: innerRefProp,
|
|
@@ -56,10 +49,12 @@ export const useGridColumnHeaders = props => {
|
|
|
56
49
|
const [dragCol, setDragCol] = React.useState('');
|
|
57
50
|
const [resizeCol, setResizeCol] = React.useState('');
|
|
58
51
|
const apiRef = useGridPrivateApiContext();
|
|
52
|
+
const rootProps = useGridRootProps();
|
|
59
53
|
const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
|
|
60
54
|
const innerRef = React.useRef(null);
|
|
61
55
|
const handleInnerRef = useForkRef(innerRefProp, innerRef);
|
|
62
56
|
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
57
|
+
const offsets = useGridSelector(apiRef, gridOffsetsSelector);
|
|
63
58
|
const renderContext = useGridSelector(apiRef, gridRenderContextColumnsSelector);
|
|
64
59
|
const visiblePinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);
|
|
65
60
|
React.useEffect(() => {
|
|
@@ -90,11 +85,18 @@ export const useGridColumnHeaders = props => {
|
|
|
90
85
|
lastColumnToRender
|
|
91
86
|
};
|
|
92
87
|
};
|
|
93
|
-
const
|
|
88
|
+
const getFillers = (params, children, leftOverflow, borderTop = false) => {
|
|
94
89
|
const isPinnedRight = (params == null ? void 0 : params.position) === GridPinnedColumnPosition.RIGHT;
|
|
95
|
-
const
|
|
90
|
+
const isNotPinned = (params == null ? void 0 : params.position) === undefined;
|
|
91
|
+
const hasScrollbarFiller = visiblePinnedColumns.right.length > 0 && isPinnedRight || visiblePinnedColumns.right.length === 0 && isNotPinned;
|
|
92
|
+
const leftOffsetWidth = offsets.left - leftOverflow;
|
|
96
93
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
97
|
-
children: [
|
|
94
|
+
children: [isNotPinned && /*#__PURE__*/_jsx("div", {
|
|
95
|
+
role: "presentation",
|
|
96
|
+
style: {
|
|
97
|
+
width: leftOffsetWidth
|
|
98
|
+
}
|
|
99
|
+
}), children, isNotPinned && /*#__PURE__*/_jsx(SpaceFiller, {
|
|
98
100
|
className: gridClasses.columnHeader
|
|
99
101
|
}), hasScrollbarFiller && /*#__PURE__*/_jsx(ScrollbarFiller, {
|
|
100
102
|
header: true,
|
|
@@ -128,13 +130,11 @@ export const useGridColumnHeaders = props => {
|
|
|
128
130
|
tabIndex: tabIndex
|
|
129
131
|
}, other), colDef.field));
|
|
130
132
|
}
|
|
131
|
-
return /*#__PURE__*/
|
|
133
|
+
return /*#__PURE__*/_jsx(GridColumnHeaderRow, {
|
|
132
134
|
role: "row",
|
|
133
135
|
"aria-rowindex": headerGroupingMaxDepth + 1,
|
|
134
|
-
ownerState:
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
children: [columns, getFiller(params)]
|
|
136
|
+
ownerState: rootProps,
|
|
137
|
+
children: getFillers(params, columns, 0)
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
140
|
const getColumnGroupHeaders = params => {
|
|
@@ -202,41 +202,39 @@ export const useGridColumnHeaders = props => {
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
headerToRender.forEach((depthInfo, depthIndex) => {
|
|
205
|
-
|
|
205
|
+
const children = depthInfo.elements.map(({
|
|
206
|
+
groupId,
|
|
207
|
+
width,
|
|
208
|
+
fields,
|
|
209
|
+
colIndex,
|
|
210
|
+
hasFocus,
|
|
211
|
+
tabIndex
|
|
212
|
+
}, groupIndex) => {
|
|
213
|
+
return /*#__PURE__*/_jsx(GridColumnGroupHeader, {
|
|
214
|
+
groupId: groupId,
|
|
215
|
+
width: width,
|
|
216
|
+
fields: fields,
|
|
217
|
+
colIndex: colIndex,
|
|
218
|
+
depth: depthIndex,
|
|
219
|
+
isLastColumn: colIndex === visibleColumns.length - fields.length,
|
|
220
|
+
maxDepth: headerToRender.length,
|
|
221
|
+
height: dimensions.headerHeight,
|
|
222
|
+
hasFocus: hasFocus,
|
|
223
|
+
tabIndex: tabIndex
|
|
224
|
+
}, groupIndex);
|
|
225
|
+
});
|
|
226
|
+
columns.push( /*#__PURE__*/_jsx(GridColumnHeaderRow, {
|
|
206
227
|
role: "row",
|
|
207
228
|
"aria-rowindex": depthIndex + 1,
|
|
208
|
-
ownerState:
|
|
209
|
-
|
|
210
|
-
leftOverflow: depthInfo.leftOverflow
|
|
211
|
-
},
|
|
212
|
-
children: [depthInfo.elements.map(({
|
|
213
|
-
groupId,
|
|
214
|
-
width,
|
|
215
|
-
fields,
|
|
216
|
-
colIndex,
|
|
217
|
-
hasFocus,
|
|
218
|
-
tabIndex
|
|
219
|
-
}, groupIndex) => {
|
|
220
|
-
return /*#__PURE__*/_jsx(GridColumnGroupHeader, {
|
|
221
|
-
groupId: groupId,
|
|
222
|
-
width: width,
|
|
223
|
-
fields: fields,
|
|
224
|
-
colIndex: colIndex,
|
|
225
|
-
depth: depthIndex,
|
|
226
|
-
isLastColumn: colIndex === visibleColumns.length - fields.length,
|
|
227
|
-
maxDepth: headerToRender.length,
|
|
228
|
-
height: dimensions.headerHeight,
|
|
229
|
-
hasFocus: hasFocus,
|
|
230
|
-
tabIndex: tabIndex
|
|
231
|
-
}, groupIndex);
|
|
232
|
-
}), getFiller(params)]
|
|
229
|
+
ownerState: rootProps,
|
|
230
|
+
children: getFillers(params, children, depthInfo.leftOverflow)
|
|
233
231
|
}, depthIndex));
|
|
234
232
|
});
|
|
235
233
|
return columns;
|
|
236
234
|
};
|
|
237
235
|
return {
|
|
238
236
|
renderContext,
|
|
239
|
-
|
|
237
|
+
getFillers,
|
|
240
238
|
getColumnHeaders,
|
|
241
239
|
getColumnsToRender,
|
|
242
240
|
getColumnGroupHeaders,
|
|
@@ -21,6 +21,15 @@ export declare const gridVirtualizationColumnEnabledSelector: import("../../../u
|
|
|
21
21
|
* @ignore - do not document.
|
|
22
22
|
*/
|
|
23
23
|
export declare const gridRenderContextSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, GridRenderContext>;
|
|
24
|
+
/**
|
|
25
|
+
* Get the offsets
|
|
26
|
+
* @category Virtualization
|
|
27
|
+
* @ignore - do not document.
|
|
28
|
+
*/
|
|
29
|
+
export declare const gridOffsetsSelector: import("../../../utils/createSelector").OutputSelector<GridStateCommunity, {
|
|
30
|
+
top: number;
|
|
31
|
+
left: number;
|
|
32
|
+
}>;
|
|
24
33
|
/**
|
|
25
34
|
* Get the render context, with only columns filled in.
|
|
26
35
|
* This is cached, so it can be used to only re-render when the column interval changes.
|
|
@@ -24,6 +24,13 @@ export const gridVirtualizationColumnEnabledSelector = createSelector(gridVirtua
|
|
|
24
24
|
*/
|
|
25
25
|
export const gridRenderContextSelector = createSelector(gridVirtualizationSelector, state => state.renderContext);
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Get the offsets
|
|
29
|
+
* @category Virtualization
|
|
30
|
+
* @ignore - do not document.
|
|
31
|
+
*/
|
|
32
|
+
export const gridOffsetsSelector = createSelector(gridVirtualizationSelector, state => state.offsets);
|
|
33
|
+
|
|
27
34
|
/**
|
|
28
35
|
* Get the render context, with only columns filled in.
|
|
29
36
|
* This is cached, so it can be used to only re-render when the column interval changes.
|