@mui/x-data-grid-pro 5.10.0 → 5.11.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 +163 -10
- package/DataGridPro/DataGridPro.d.ts +1 -1
- package/DataGridPro/DataGridPro.js +36 -2
- package/DataGridPro/useDataGridProComponent.js +2 -2
- package/DataGridPro/useDataGridProProps.js +19 -5
- package/LICENSE +2 -2
- package/README.md +1 -1
- package/components/DataGridProColumnHeaders.js +2 -2
- package/components/DataGridProVirtualScroller.js +7 -5
- package/components/GridGroupingCriteriaCell.js +2 -2
- package/components/GridRowReorderCell.js +4 -4
- package/components/GridTreeDataGroupingCell.js +2 -2
- package/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/hooks/features/columnReorder/useGridColumnReorder.d.ts +0 -1
- package/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/hooks/features/columnResize/useGridColumnResize.d.ts +0 -1
- package/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/hooks/features/index.d.ts +0 -1
- package/hooks/features/index.js +0 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.d.ts +0 -1
- package/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/hooks/features/rowGrouping/createGroupingColDef.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingInterfaces.d.ts +1 -1
- package/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/hooks/features/rowGrouping/useGridRowGrouping.d.ts +0 -2
- package/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/hooks/features/rowReorder/useGridRowReorder.js +7 -7
- package/hooks/features/rowReorder/useGridRowReorderPreProcessors.d.ts +1 -1
- package/hooks/features/treeData/useGridTreeData.d.ts +0 -3
- package/hooks/features/treeData/useGridTreeData.js +2 -6
- package/index.d.ts +6 -1
- package/index.js +7 -3
- package/internals/index.d.ts +19 -0
- package/internals/index.js +17 -0
- package/internals/package.json +6 -0
- package/legacy/DataGridPro/DataGridPro.js +36 -2
- package/legacy/DataGridPro/useDataGridProComponent.js +2 -2
- package/legacy/DataGridPro/useDataGridProProps.js +19 -5
- package/legacy/components/DataGridProColumnHeaders.js +2 -2
- package/legacy/components/DataGridProVirtualScroller.js +7 -5
- package/legacy/components/GridGroupingCriteriaCell.js +2 -2
- package/legacy/components/GridRowReorderCell.js +4 -4
- package/legacy/components/GridTreeDataGroupingCell.js +2 -2
- package/legacy/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/legacy/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/legacy/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/legacy/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/legacy/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/legacy/hooks/features/index.js +0 -1
- package/legacy/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/legacy/hooks/features/rowGrouping/gridRowGroupingUtils.js +5 -5
- package/legacy/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/legacy/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/legacy/hooks/features/rowReorder/useGridRowReorder.js +7 -7
- package/legacy/hooks/features/treeData/useGridTreeData.js +2 -6
- package/legacy/index.js +7 -3
- package/legacy/internals/index.js +17 -0
- package/legacy/models/index.js +1 -3
- package/legacy/typeOverloads/index.js +1 -0
- package/legacy/utils/index.js +1 -0
- package/legacy/utils/releaseInfo.js +1 -1
- package/legacy/utils/tree/buildRowTree.js +11 -4
- package/legacy/utils/tree/index.js +1 -0
- package/models/dataGridProProps.d.ts +29 -29
- package/models/gridApiPro.d.ts +3 -2
- package/models/gridStatePro.d.ts +4 -3
- package/models/index.d.ts +0 -2
- package/models/index.js +1 -3
- package/modern/DataGridPro/DataGridPro.js +36 -2
- package/modern/DataGridPro/useDataGridProComponent.js +2 -2
- package/modern/DataGridPro/useDataGridProProps.js +15 -3
- package/modern/components/DataGridProColumnHeaders.js +2 -2
- package/modern/components/DataGridProVirtualScroller.js +7 -5
- package/modern/components/GridGroupingCriteriaCell.js +2 -2
- package/modern/components/GridRowReorderCell.js +4 -4
- package/modern/components/GridTreeDataGroupingCell.js +2 -2
- package/modern/hooks/features/columnPinning/useGridColumnPinning.js +4 -4
- package/modern/hooks/features/columnReorder/useGridColumnReorder.js +7 -8
- package/modern/hooks/features/columnResize/useGridColumnResize.js +13 -14
- package/modern/hooks/features/detailPanel/useGridDetailPanel.js +4 -4
- package/modern/hooks/features/detailPanel/useGridDetailPanelCache.js +2 -2
- package/modern/hooks/features/index.js +0 -1
- package/modern/hooks/features/infiniteLoader/useGridInfiniteLoader.js +4 -5
- package/modern/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/modern/hooks/features/rowGrouping/useGridRowGrouping.js +6 -8
- package/modern/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +2 -2
- package/modern/hooks/features/rowReorder/useGridRowReorder.js +7 -7
- package/modern/hooks/features/treeData/useGridTreeData.js +2 -6
- package/modern/index.js +7 -3
- package/modern/internals/index.js +17 -0
- package/modern/models/index.js +1 -3
- package/modern/typeOverloads/index.js +1 -0
- package/modern/utils/index.js +1 -0
- package/modern/utils/releaseInfo.js +1 -1
- package/modern/utils/tree/buildRowTree.js +9 -2
- package/modern/utils/tree/index.js +1 -0
- package/node/DataGridPro/DataGridPro.js +36 -2
- package/node/DataGridPro/useDataGridProComponent.js +4 -4
- package/node/DataGridPro/useDataGridProProps.js +20 -5
- package/node/components/DataGridProColumnHeaders.js +1 -1
- package/node/components/DataGridProVirtualScroller.js +6 -4
- package/node/components/GridGroupingCriteriaCell.js +1 -1
- package/node/components/GridRowReorderCell.js +3 -3
- package/node/components/GridTreeDataGroupingCell.js +1 -1
- package/node/hooks/features/columnPinning/useGridColumnPinning.js +3 -3
- package/node/hooks/features/columnReorder/useGridColumnReorder.js +6 -7
- package/node/hooks/features/columnResize/useGridColumnResize.js +12 -13
- package/node/hooks/features/detailPanel/useGridDetailPanel.js +3 -3
- package/node/hooks/features/detailPanel/useGridDetailPanelCache.js +1 -1
- package/node/hooks/features/index.js +0 -13
- package/node/hooks/features/infiniteLoader/useGridInfiniteLoader.js +3 -4
- package/node/hooks/features/rowGrouping/gridRowGroupingUtils.js +4 -4
- package/node/hooks/features/rowGrouping/useGridRowGrouping.js +5 -7
- package/node/hooks/features/rowGrouping/useGridRowGroupingPreProcessors.js +4 -4
- package/node/hooks/features/rowReorder/useGridRowReorder.js +6 -6
- package/node/hooks/features/treeData/useGridTreeData.js +1 -4
- package/node/index.js +45 -3
- package/node/internals/index.js +193 -0
- package/node/models/index.js +0 -13
- package/node/typeOverloads/index.js +18 -0
- package/node/utils/index.js +18 -0
- package/node/utils/releaseInfo.js +1 -1
- package/node/utils/tree/buildRowTree.js +12 -2
- package/node/utils/tree/index.js +13 -0
- package/package.json +4 -4
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +1 -0
- package/typeOverloads/modules.d.ts +38 -15
- package/typeOverloads/package.json +6 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/package.json +6 -0
- package/utils/releaseInfo.js +1 -1
- package/utils/tree/buildRowTree.d.ts +1 -0
- package/utils/tree/buildRowTree.js +9 -2
- package/utils/tree/index.d.ts +1 -0
- package/utils/tree/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,159 @@
|
|
|
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
|
+
## v5.11.0
|
|
7
|
+
|
|
8
|
+
_May 13, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Premium plan release
|
|
13
|
+
|
|
14
|
+
We’re happy to announce that the Premium plan is [finally out](https://mui.com/blog/premium-plan-release/)!
|
|
15
|
+
With it, MUI X officially steps up to the next level, supporting the most advanced use cases for UI components.
|
|
16
|
+
|
|
17
|
+
This plan is available through the new `@mui/x-data-grid-premium` package, which contains the row grouping and the Excel export features.
|
|
18
|
+
|
|
19
|
+
If you were already using the row grouping feature, you can upgrade by [installing](https://mui.com/x/react-data-grid/getting-started/#installation) `@mui/x-data-grid-premium` and replace `DataGridPro` with `DataGridPremium`, as follows.
|
|
20
|
+
Note that the experimental flag is not required anymore to use the row grouping.
|
|
21
|
+
|
|
22
|
+
```diff
|
|
23
|
+
-import { DataGridPro } from '@mui/x-data-grid-pro';
|
|
24
|
+
+import { DataGridPremium } from '@mui/x-data-grid-premium';
|
|
25
|
+
|
|
26
|
+
-<DataGridPro experimentalFeatures={{ rowGrouping: true }} />
|
|
27
|
+
+<DataGridPremium />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For more information about the revised pricing model please have a look at the [blog post](https://mui.com/blog/premium-plan-release/#the-new-licensing-model).
|
|
31
|
+
|
|
32
|
+
- 👔 Add Excel export
|
|
33
|
+
|
|
34
|
+
- 🔎 Quick filtering
|
|
35
|
+
|
|
36
|
+
You can now add a quick filtering search bar to your grid.
|
|
37
|
+
To do so, either pass `showQuickFilter` prop to the `<GridToolbar />` or use the `<GridToolbarQuickFilter />` component in your custom toolbar.
|
|
38
|
+
|
|
39
|
+
More information about how to customize the filtering logic is in the [documentation](https://mui.com/x/react-data-grid/filtering/#quick-filter)
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
- 🐞 Bugs fixes
|
|
44
|
+
|
|
45
|
+
### `@mui/x-data-grid@v5.11.0` / `@mui/x-data-grid-pro@v5.11.0` / `@mui/x-data-grid-premium@v5.11.0`
|
|
46
|
+
|
|
47
|
+
#### Breaking changes
|
|
48
|
+
|
|
49
|
+
- Moving row grouping to premium package
|
|
50
|
+
|
|
51
|
+
The use of `rowGrouping` in the `@mui/x-data-grid-pro` package is deprecated. The experimental flag will be removed in an upcoming release.
|
|
52
|
+
|
|
53
|
+
#### Changes
|
|
54
|
+
|
|
55
|
+
- [DataGrid] Add TypeScript support to the `sx` prop in inner components (#4743) @lindapaiste
|
|
56
|
+
- [DataGrid] Add props to control cell mode (#4210) @m4theushw
|
|
57
|
+
- [DataGrid] Add quick filtering engine (#4317) @alexfauquette
|
|
58
|
+
- [DataGrid] Check focus validity whenever the rows in state changes (#4683) @flaviendelangle
|
|
59
|
+
- [DataGrid] Fix infinite scroll when dragging column header cell over row cell (#4735) @DjoSmer
|
|
60
|
+
- [DataGrid] Fix scroll jump when using keyboard navigation (#4515) @cherniavskii
|
|
61
|
+
- [DataGrid] Improve sorting accessibility (#4379) @cherniavskii
|
|
62
|
+
- [DataGrid] New `getRowGroupChildren` API method (#4304) @flaviendelangle
|
|
63
|
+
- [DataGrid] Publish `preferencePanelClose` event only once when clicking on another panel button (#4810) @flaviendelangle
|
|
64
|
+
- [DataGrid] Update focused action if the currently focused one is removed (#4694) @m4theushw
|
|
65
|
+
- [DataGrid] Add `onChange` callback to edit components (#4621) @m4theushw
|
|
66
|
+
- [DataGrid] Add `keepNonExistentRowsSelected` prop (#4786) @willsoto
|
|
67
|
+
- [DataGrid] Prevent crash if row is removed with click (#4831) @m4theushw
|
|
68
|
+
- [DataGridPro] Fix detail panel not taking full width (#4610) @cherniavskii
|
|
69
|
+
- [DataGridPremium] Add Excel export (#3981) @alexfauquette
|
|
70
|
+
- [DataGridPremium] Bootstrap `@mui/x-data-grid-premium` (#4223) @flaviendelangle
|
|
71
|
+
- [DataGridPremium] Fix Excel date serialization when row grouping is enabled (#4774) @cherniavskii
|
|
72
|
+
- [l10n] Improve German (de-DE) locale (#4748) @sebastianfrey
|
|
73
|
+
- [l10n] Improve German (de-DE) locale (#4668) @izu-co
|
|
74
|
+
|
|
75
|
+
### `@mui/x-date-pickers@5.0.0-alpha.3` / `@mui/x-date-pickers-pro@5.0.0-alpha.3`
|
|
76
|
+
|
|
77
|
+
#### Breaking changes
|
|
78
|
+
|
|
79
|
+
- Rework the auto-closing behavior of the pickers.
|
|
80
|
+
|
|
81
|
+
The `disableCloseOnSelect` prop has been replaced by a new `closeOnSelect` prop which has the opposite behavior.
|
|
82
|
+
The default behavior remains the same (close after the last step on desktop but not on mobile).
|
|
83
|
+
|
|
84
|
+
```diff
|
|
85
|
+
// If you don't want to close after the last step
|
|
86
|
+
-<DatePicker disableCloseOnSelect={false} />
|
|
87
|
+
+<DatePicker closeOnSelect />
|
|
88
|
+
|
|
89
|
+
// If you want to close after the last step
|
|
90
|
+
-<DatePicker disableCloseOnSelect />
|
|
91
|
+
+<DatePicker closeOnSelect={false} />
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Changes
|
|
95
|
+
|
|
96
|
+
- [DatePicker] Ignore <kbd>Escape</kbd> when the picker is already closed (#4770) @mikewolfd
|
|
97
|
+
- [DatePicker] Make month year order changeable in header (#4695) @gky360
|
|
98
|
+
- [DateRangePicker] Open view on click, <kbd>Enter</kbd> or <kbd>Space</kbd> instead of focus (#4747) @alexfauquette
|
|
99
|
+
- [DateRangePicker] Refactor tests (#4745) @flaviendelangle
|
|
100
|
+
- [DateRangePicker] Remove `orientation` prop (#4665) @m4theushw
|
|
101
|
+
- [DateTimePicker] `Toolbar` should be visible by default on mobile (#4833) @flaviendelangle
|
|
102
|
+
- [MonthPicker] New prop `shouldDisableMonth` (#4708) @someone635
|
|
103
|
+
- [TimePicker] Disable and invalidate date with minutes not matching `minutesStep` (#4726) @flaviendelangle
|
|
104
|
+
- [TimePicker] Don't merge with previous value when new value is not valid (#4847) @flaviendelangle
|
|
105
|
+
- [TimePicker] Refactor `isTimeDisabled` method (#4688) @flaviendelangle
|
|
106
|
+
- [pickers] Add details in invalid mask error (#4501) @alexfauquette
|
|
107
|
+
- [pickers] Add explicit interfaces for components slots and components slots props (#4589) @flaviendelangle
|
|
108
|
+
- [pickers] Add missing `peerDependencies` for `yarn pnp` users (#4763) @nate-summercook
|
|
109
|
+
- [pickers] Add overrides to `PickersArrowSwitcher` (#4672) @m4theushw
|
|
110
|
+
- [pickers] Clean component interfaces and remove non-implemented props (#4758) @flaviendelangle
|
|
111
|
+
- [pickers] Do not apply the current time when no date provided in `DayPicker` (#4649) @flaviendelangle
|
|
112
|
+
- [pickers] Document and refacto the value manager (#4701) @flaviendelangle
|
|
113
|
+
- [pickers] Drop `allowSameDateSelection` prop (#4808) @flaviendelangle
|
|
114
|
+
- [pickers] Enable mask by default when using `ampm=true` (#4731) @alexfauquette
|
|
115
|
+
- [pickers] Fix `disabled` and `readOnly` behavior on calendar and clock (#4645) @alexfauquette
|
|
116
|
+
- [pickers] Invalid character does not delete last digit (#4839) @alexfauquette
|
|
117
|
+
- [pickers] Rename prop `date` into `parsedValue` when it can contain a range (#4736) @flaviendelangle
|
|
118
|
+
- [pickers] Rework `TDate`, `TInputDate`, `TValue` and `TInputValue` generics (#4617) @flaviendelangle
|
|
119
|
+
- [pickers] Rework the date lifecycle in `usePickerState` (#4408) @flaviendelangle
|
|
120
|
+
|
|
121
|
+
### Docs
|
|
122
|
+
|
|
123
|
+
- [docs] Add `scopePathNames` property to column page (#4811) @flaviendelangle
|
|
124
|
+
- [docs] Add label to each demo (#4667) @m4theushw
|
|
125
|
+
- [docs] Correctly capitalize <kbd>Ctrl</kbd> (#4707) @oliviertassinari
|
|
126
|
+
- [docs] Fix documentation on `ampm` prop (#4846) @alexfauquette
|
|
127
|
+
- [docs] Generate the event documentation from `GridEventLookup` (#4725) @flaviendelangle
|
|
128
|
+
- [docs] Keep columns section expanded when switching between pages (#4816) @cherniavskii
|
|
129
|
+
- [docs] Move `useKeepGroupingColumnsHidden` on `@mui/x-data-grid-premium` (#4319) @flaviendelangle
|
|
130
|
+
- [docs] Remove legacy pages for old URLs (#4575) @m4theushw
|
|
131
|
+
- [docs] Remove remaining pages in `docs/pages/api-docs` folder (#4709) @m4theushw
|
|
132
|
+
- [docs] SEO fixes (#4711) @oliviertassinari
|
|
133
|
+
- [docs] Set type number to movie column year (#4753) @flaviendelangle
|
|
134
|
+
- [docs] Simplify server examples (#4186) @alexfauquette
|
|
135
|
+
- [docs] Small typo (#4670) @flaviendelangle
|
|
136
|
+
- [docs] Split the 'Columns' page (#4600) @flaviendelangle
|
|
137
|
+
- [docs] Stop using `GridEvents` enum in documentation (#4699) @flaviendelangle
|
|
138
|
+
- [docs] Update mono repo to get copy code block (#4691) @siriwatknp
|
|
139
|
+
- [docs] Update the feature table in the Getting Started page of the data grid (#4619) @flaviendelangle
|
|
140
|
+
- [docs] Add demo for Premium (#4750) @m4theushw
|
|
141
|
+
|
|
142
|
+
### Core
|
|
143
|
+
|
|
144
|
+
- [core] Check if `process` is available (#4193) @m4theushw
|
|
145
|
+
- [core] Fix naming collision (#4853) @alexfauquette
|
|
146
|
+
- [core] Prevent out-of-memory when type-checking in CI (#4697) @flaviendelangle
|
|
147
|
+
- [core] Remove `rowsCache` from state (#4480) @m4theushw
|
|
148
|
+
- [core] Rework `DayPicker` api (#4783) @flaviendelangle
|
|
149
|
+
- [core] Update `x-license-pro` license to handle premium package (#4315) @DanailH
|
|
150
|
+
- [core] Update monorepo & version (#4789) @oliviertassinari
|
|
151
|
+
- [core] Update monorepo (#4772) @flaviendelangle
|
|
152
|
+
- [core] Stop using `GridEvents` enum (#4698, #4696, #4685) @flaviendelangle
|
|
153
|
+
- [core] Update monorepo (#4854) @cherniavskii
|
|
154
|
+
- [license] Allow to limit some packages to a specific license plan (#4651) @flaviendelangle
|
|
155
|
+
- [test] Fix path to detect `DataGrid` tests (#4752) @m4theushw
|
|
156
|
+
- [test] Reset cleanup tracking on Karma tests (#4679) @m4theushw
|
|
157
|
+
- [test] Restore `sinon` sandbox after each `karma` test (#4689) @m4theushw
|
|
158
|
+
|
|
6
159
|
## v5.10.0
|
|
7
160
|
|
|
8
161
|
_Apr 25, 2022_
|
|
@@ -49,7 +202,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
49
202
|
|
|
50
203
|
Now the data grid and pickers components support the concurrent mode.
|
|
51
204
|
|
|
52
|
-
- 🎁 Add support for [Column spanning](https://mui.com/x/react-data-grid/
|
|
205
|
+
- 🎁 Add support for [Column spanning](https://mui.com/x/react-data-grid/column-spanning/) (#4020) @cherniavskii
|
|
53
206
|
|
|
54
207
|
<img src="https://user-images.githubusercontent.com/13808724/162926746-93bcb180-3c9d-4eb9-afc7-c3908a5c6406.png" width="788">
|
|
55
208
|
|
|
@@ -672,7 +825,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
|
|
|
672
825
|
/>
|
|
673
826
|
```
|
|
674
827
|
|
|
675
|
-
See the [documentation](https://mui.com/x/react-data-grid/
|
|
828
|
+
See the [documentation](https://mui.com/x/react-data-grid/column-visibility/) for more details.
|
|
676
829
|
|
|
677
830
|
The `hide` property from `GridColDef` still works but has been deprecated.
|
|
678
831
|
|
|
@@ -828,7 +981,7 @@ A big thanks to the 5 contributors who made this release possible. Here are some
|
|
|
828
981
|
|
|
829
982
|
### `@mui/x-data-grid@v5.2.0` / `@mui/x-data-grid-pro@v5.2.0`
|
|
830
983
|
|
|
831
|
-
- 🚀 Introduce the [column pinning](https://mui.com/x/react-data-grid/
|
|
984
|
+
- 🚀 Introduce the [column pinning](https://mui.com/x/react-data-grid/column-pinning/) feature (#2946) @m4theushw
|
|
832
985
|
|
|
833
986
|
<img src="https://user-images.githubusercontent.com/42154031/145425635-b6314fbe-2f1e-4b73-908f-33ee1fda20c7.gif" width="964" height="657">
|
|
834
987
|
|
|
@@ -1782,7 +1935,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some
|
|
|
1782
1935
|
- 📚 Migrate to the new documentation infrastructure and design (#2441) (@DanailH, @m4theushw)
|
|
1783
1936
|
- 🎁 Add `actions` column type (#2385) @m4theushw
|
|
1784
1937
|
|
|
1785
|
-
See the documentation for [more details](https://mui.com/x/react-data-grid/
|
|
1938
|
+
See the documentation for [more details](https://mui.com/x/react-data-grid/column-definition/#column-types).
|
|
1786
1939
|
|
|
1787
1940
|
- 👁 Allow to disable virtualization with the `disableVirtualization` prop (#2326) @m4theushw
|
|
1788
1941
|
- 🚀 Introduce the new `isRowSelected` api method (#2523) @flaviendelangle
|
|
@@ -2404,11 +2557,11 @@ _July 1, 2021_
|
|
|
2404
2557
|
Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
2405
2558
|
|
|
2406
2559
|
- 🐞 As a focus of Q2, we have kept fixing bugs
|
|
2407
|
-
- 💅 End users are now allowed to copy the selected rows to the clipboard with <kbd>
|
|
2560
|
+
- 💅 End users are now allowed to copy the selected rows to the clipboard with <kbd>Ctrl</kbd> + <kbd>c</kbd> (#1929) @m4theushw
|
|
2408
2561
|
- 🐛 We have fixed the `Select all` checkbox. When triggered, it should only select the filtered rows (#1879) @ZeeshanTamboli
|
|
2409
2562
|
- ⚡️ We have added a new `singleSelect` column type (#1956) @DanailH
|
|
2410
2563
|
|
|
2411
|
-
Using the column `type: 'singleSelect'` defaults to `Select` component when the cell is in `edit` mode. You can find the documentation [following this link](https://mui.com/x/react-data-grid/
|
|
2564
|
+
Using the column `type: 'singleSelect'` defaults to `Select` component when the cell is in `edit` mode. You can find the documentation [following this link](https://mui.com/x/react-data-grid/column-definition/#column-types).
|
|
2412
2565
|
|
|
2413
2566
|
```jsx
|
|
2414
2567
|
<DataGrid
|
|
@@ -2604,7 +2757,7 @@ _June 9, 2021_
|
|
|
2604
2757
|
Big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
2605
2758
|
|
|
2606
2759
|
- 💅 Allow to customize GridToolbarExport's CSV export (#1695) @michallukowski
|
|
2607
|
-
- 🐛 Allow to deselect rows with <kbd>
|
|
2760
|
+
- 🐛 Allow to deselect rows with <kbd>Ctrl</kbd> + click (#1813) @ZeeshanTamboli
|
|
2608
2761
|
- ⚡️ Refactor scroll size detector (#1703) @dtassone
|
|
2609
2762
|
- 📖 Add [documentation](https://mui.com/x/api/data-grid/) for interfaces and events (#1529) @m4theushw
|
|
2610
2763
|
- 🐞 Bugfixes
|
|
@@ -2631,7 +2784,7 @@ Big thanks to the 6 contributors who made this release possible. Here are some h
|
|
|
2631
2784
|
|
|
2632
2785
|
- [DataGrid] Add `valueParser` to parse values entered by the user (#1785) @m4theushw
|
|
2633
2786
|
- [DataGrid] Allow to customize GridToolbarExport's CSV export (#1695) @michallukowski
|
|
2634
|
-
- [DataGrid] Allow to deselect rows with <kbd>
|
|
2787
|
+
- [DataGrid] Allow to deselect rows with <kbd>Ctrl</kbd> + click (#1813) @ZeeshanTamboli
|
|
2635
2788
|
- [DataGrid] Improve general architecture to better isolate hooks (#1720) @dtassone
|
|
2636
2789
|
- [DataGrid] Fix cell height after changing grid density (#1819) @DanailH
|
|
2637
2790
|
- [DataGrid] Fix fluid columns width when available `viewportWidth` < 0 (#1816) @DanailH
|
|
@@ -3153,7 +3306,7 @@ Big thanks to the 8 contributors who made this release possible. Here are some h
|
|
|
3153
3306
|
- [DataGrid] Rename `useGridBaseComponentProps` hook to `useGridSlotComponentProps` (#1252) @DanailH
|
|
3154
3307
|
- [DataGrid] Rename modules (#1292) @DanailH
|
|
3155
3308
|
- [DataGrid] Rename all events related to column reordering, e.g. `GRID_COL_REORDER_START` -> `GRID_COLUMN_REORDER_START` (#1299) @m4theushw
|
|
3156
|
-
- [DataGrid] Methods `onColItemDragStart`, `onColHeaderDragOver`, `onColItemDragOver`, `onColItemDragEnter` removed from the grid API. Prefer listening to [column reordering events](https://mui.com/x/react-data-grid/
|
|
3309
|
+
- [DataGrid] Methods `onColItemDragStart`, `onColHeaderDragOver`, `onColItemDragOver`, `onColItemDragEnter` removed from the grid API. Prefer listening to [column reordering events](https://mui.com/x/react-data-grid/column-ordering/) (#1299) @m4theushw
|
|
3157
3310
|
- [DataGrid] Calling `apiRef.current.getColumnHeaderParams` returns a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
|
|
3158
3311
|
- [DataGrid] Events that follow the pattern `GRID_COLUMN_HEADER_xxx` will be called with a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
|
|
3159
3312
|
- [DataGrid] The `renderHeader` will be called with a `GridColumnHeaderParams` instead of `GridColParams` (#1299) @m4theushw
|
|
@@ -3521,7 +3674,7 @@ _Jan 14, 2021_
|
|
|
3521
3674
|
Big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
3522
3675
|
|
|
3523
3676
|
- 🎛 Add support for Column selector (#837) @DanailH @dtassone.
|
|
3524
|
-
The feature can be triggered from the toolbar or the column menu. Check [the documentation](https://mui.com/x/react-data-grid/
|
|
3677
|
+
The feature can be triggered from the toolbar or the column menu. Check [the documentation](https://mui.com/x/react-data-grid/column-definition/#column-selector).
|
|
3525
3678
|
|
|
3526
3679
|

|
|
3527
3680
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridValidRowModel } from '@mui/x-data-grid';
|
|
3
|
-
import { DataGridProProps } from '../models';
|
|
3
|
+
import { DataGridProProps } from '../models/dataGridProProps';
|
|
4
4
|
interface DataGridProComponent {
|
|
5
5
|
<R extends GridValidRowModel = any>(props: DataGridProProps<R> & React.RefAttributes<HTMLDivElement>): JSX.Element;
|
|
6
6
|
propTypes?: any;
|
|
@@ -72,6 +72,11 @@ DataGridProRaw.propTypes = {
|
|
|
72
72
|
*/
|
|
73
73
|
autoPageSize: PropTypes.bool,
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Controls the modes of the cells.
|
|
77
|
+
*/
|
|
78
|
+
cellModesModel: PropTypes.object,
|
|
79
|
+
|
|
75
80
|
/**
|
|
76
81
|
* If `true`, the grid get a first column with a checkbox that allows to select rows.
|
|
77
82
|
* @default false
|
|
@@ -225,7 +230,7 @@ DataGridProRaw.propTypes = {
|
|
|
225
230
|
disableMultipleColumnsSorting: PropTypes.bool,
|
|
226
231
|
|
|
227
232
|
/**
|
|
228
|
-
* If `true`, multiple selection using the
|
|
233
|
+
* If `true`, multiple selection using the Ctrl or CMD key is disabled.
|
|
229
234
|
* @default false
|
|
230
235
|
*/
|
|
231
236
|
disableMultipleSelection: PropTypes.bool,
|
|
@@ -298,7 +303,9 @@ DataGridProRaw.propTypes = {
|
|
|
298
303
|
operatorValue: PropTypes.string,
|
|
299
304
|
value: PropTypes.any
|
|
300
305
|
})).isRequired,
|
|
301
|
-
linkOperator: PropTypes.oneOf(['and', 'or'])
|
|
306
|
+
linkOperator: PropTypes.oneOf(['and', 'or']),
|
|
307
|
+
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
308
|
+
quickFilterValues: PropTypes.array
|
|
302
309
|
}),
|
|
303
310
|
|
|
304
311
|
/**
|
|
@@ -430,6 +437,14 @@ DataGridProRaw.propTypes = {
|
|
|
430
437
|
*/
|
|
431
438
|
isRowSelectable: PropTypes.func,
|
|
432
439
|
|
|
440
|
+
/**
|
|
441
|
+
* If `true`, the selection model will retain selected rows that do not exist.
|
|
442
|
+
* Useful when using server side pagination and row selections need to be retained
|
|
443
|
+
* when changing pages.
|
|
444
|
+
* @default false
|
|
445
|
+
*/
|
|
446
|
+
keepNonExistentRowsSelected: PropTypes.bool,
|
|
447
|
+
|
|
433
448
|
/**
|
|
434
449
|
* If `true`, a loading overlay is displayed.
|
|
435
450
|
*/
|
|
@@ -517,6 +532,13 @@ DataGridProRaw.propTypes = {
|
|
|
517
532
|
*/
|
|
518
533
|
onCellKeyDown: PropTypes.func,
|
|
519
534
|
|
|
535
|
+
/**
|
|
536
|
+
* Callback fired when the `cellModesModel` prop changes.
|
|
537
|
+
* @param {GridCellModesModel} cellModesModel Object containig which cells are in "edit" mode.
|
|
538
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
539
|
+
*/
|
|
540
|
+
onCellModesModelChange: PropTypes.func,
|
|
541
|
+
|
|
520
542
|
/**
|
|
521
543
|
* Callback fired when a click event comes from a column header element.
|
|
522
544
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -740,6 +762,13 @@ DataGridProRaw.propTypes = {
|
|
|
740
762
|
*/
|
|
741
763
|
onRowGroupingModelChange: PropTypes.func,
|
|
742
764
|
|
|
765
|
+
/**
|
|
766
|
+
* Callback fired when the `rowModesModel` prop changes.
|
|
767
|
+
* @param {GridRowModesModel} rowModesModel Object containig which rows are in "edit" mode.
|
|
768
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
769
|
+
*/
|
|
770
|
+
onRowModesModelChange: PropTypes.func,
|
|
771
|
+
|
|
743
772
|
/**
|
|
744
773
|
* Callback fired when a row is being reordered.
|
|
745
774
|
* @param {GridRowOrderChangeParams} params With all properties from [[GridRowOrderChangeParams]].
|
|
@@ -854,6 +883,11 @@ DataGridProRaw.propTypes = {
|
|
|
854
883
|
*/
|
|
855
884
|
rowHeight: PropTypes.number,
|
|
856
885
|
|
|
886
|
+
/**
|
|
887
|
+
* Controls the modes of the rows.
|
|
888
|
+
*/
|
|
889
|
+
rowModesModel: PropTypes.object,
|
|
890
|
+
|
|
857
891
|
/**
|
|
858
892
|
* If `true`, the reordering of rows is enabled.
|
|
859
893
|
* @default false
|
|
@@ -5,8 +5,6 @@ import { useGridColumnReorder, columnReorderStateInitializer } from '../hooks/fe
|
|
|
5
5
|
import { useGridColumnResize, columnResizeStateInitializer } from '../hooks/features/columnResize/useGridColumnResize';
|
|
6
6
|
import { useGridTreeData } from '../hooks/features/treeData/useGridTreeData';
|
|
7
7
|
import { useGridTreeDataPreProcessors } from '../hooks/features/treeData/useGridTreeDataPreProcessors';
|
|
8
|
-
import { useGridRowGrouping, rowGroupingStateInitializer } from '../hooks/features/rowGrouping/useGridRowGrouping';
|
|
9
|
-
import { useGridRowGroupingPreProcessors } from '../hooks/features/rowGrouping/useGridRowGroupingPreProcessors';
|
|
10
8
|
import { useGridColumnPinning, columnPinningStateInitializer } from '../hooks/features/columnPinning/useGridColumnPinning';
|
|
11
9
|
import { useGridColumnPinningPreProcessors } from '../hooks/features/columnPinning/useGridColumnPinningPreProcessors';
|
|
12
10
|
import { useGridDetailPanel, detailPanelStateInitializer } from '../hooks/features/detailPanel/useGridDetailPanel';
|
|
@@ -14,6 +12,8 @@ import { useGridDetailPanelCache } from '../hooks/features/detailPanel/useGridDe
|
|
|
14
12
|
import { useGridDetailPanelPreProcessors } from '../hooks/features/detailPanel/useGridDetailPanelPreProcessors';
|
|
15
13
|
import { useGridRowReorder } from '../hooks/features/rowReorder/useGridRowReorder';
|
|
16
14
|
import { useGridRowReorderPreProcessors } from '../hooks/features/rowReorder/useGridRowReorderPreProcessors';
|
|
15
|
+
import { useGridRowGrouping, rowGroupingStateInitializer } from '../hooks/features/rowGrouping/useGridRowGrouping';
|
|
16
|
+
import { useGridRowGroupingPreProcessors } from '../hooks/features/rowGrouping/useGridRowGroupingPreProcessors';
|
|
17
17
|
export const useDataGridProComponent = (inputApiRef, props) => {
|
|
18
18
|
var _props$experimentalFe, _props$experimentalFe2;
|
|
19
19
|
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT, DATA_GRID_PROPS_DEFAULT_VALUES } from '@mui/x-data-grid';
|
|
5
|
+
import { buildWarning } from '@mui/x-data-grid/internals';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The default values of `DataGridProPropsWithDefaultValue` to inject in the props of DataGridPro.
|
|
@@ -11,13 +12,14 @@ export const DATA_GRID_PRO_PROPS_DEFAULT_VALUES = _extends({}, DATA_GRID_PROPS_D
|
|
|
11
12
|
treeData: false,
|
|
12
13
|
defaultGroupingExpansionDepth: 0,
|
|
13
14
|
disableColumnPinning: false,
|
|
14
|
-
disableRowGrouping: false,
|
|
15
15
|
disableChildrenFiltering: false,
|
|
16
16
|
disableChildrenSorting: false,
|
|
17
|
-
rowGroupingColumnMode: 'single',
|
|
18
17
|
rowReordering: false,
|
|
19
|
-
getDetailPanelHeight: () => 500
|
|
18
|
+
getDetailPanelHeight: () => 500,
|
|
19
|
+
disableRowGrouping: false,
|
|
20
|
+
rowGroupingColumnMode: 'single'
|
|
20
21
|
});
|
|
22
|
+
const rowGroupingWarning = buildWarning(['MUI: The row grouping has been moved to the new `@mui/x-data-grid-premium` package.', 'The feature is deprecated in `@mui/x-data-grid-pro`, and it will soon be removed from this package.'], 'error');
|
|
21
23
|
export const useDataGridProProps = inProps => {
|
|
22
24
|
const themedProps = useThemeProps({
|
|
23
25
|
props: inProps,
|
|
@@ -37,11 +39,23 @@ export const useDataGridProProps = inProps => {
|
|
|
37
39
|
});
|
|
38
40
|
return mergedComponents;
|
|
39
41
|
}, [themedProps.components]);
|
|
42
|
+
|
|
43
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
44
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
var _themedProps$experime;
|
|
47
|
+
|
|
48
|
+
if ((_themedProps$experime = themedProps.experimentalFeatures) != null && _themedProps$experime.rowGrouping) {
|
|
49
|
+
rowGroupingWarning();
|
|
50
|
+
}
|
|
51
|
+
}, [themedProps.experimentalFeatures]);
|
|
52
|
+
}
|
|
53
|
+
|
|
40
54
|
return React.useMemo(() => {
|
|
41
|
-
var _themedProps$
|
|
55
|
+
var _themedProps$experime2;
|
|
42
56
|
|
|
43
57
|
return _extends({}, DATA_GRID_PRO_PROPS_DEFAULT_VALUES, themedProps, {
|
|
44
|
-
disableRowGrouping: themedProps.disableRowGrouping || !((_themedProps$
|
|
58
|
+
disableRowGrouping: themedProps.disableRowGrouping || !((_themedProps$experime2 = themedProps.experimentalFeatures) != null && _themedProps$experime2.rowGrouping),
|
|
45
59
|
localeText,
|
|
46
60
|
components,
|
|
47
61
|
signature: 'DataGridPro'
|
package/LICENSE
CHANGED
|
@@ -3,10 +3,10 @@ Commercial License
|
|
|
3
3
|
Copyright (c) 2020 Material-UI SAS
|
|
4
4
|
|
|
5
5
|
MUI X Pro (https://mui.com/pricing/) is commercial software. You must purchase
|
|
6
|
-
a license and agree to the End User License Agreement (EULA: https://mui.com/x
|
|
6
|
+
a license and agree to the End User License Agreement (EULA: https://mui.com/r/x-license-eula)
|
|
7
7
|
to be able to use the software.
|
|
8
8
|
|
|
9
|
-
Commercial licenses can be obtained at https://mui.com/
|
|
9
|
+
Commercial licenses can be obtained at https://mui.com/r/x-get-license?scope=pro.
|
|
10
10
|
You are free to install and try the software without a license key as long as it
|
|
11
11
|
is not used for the development of a feature intended for production use. You can
|
|
12
12
|
find more details under the "Evaluation (trial) licenses" section of the EULA.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ const _excluded = ["style", "className", "innerRef"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
6
6
|
import { styled, alpha } from '@mui/material/styles';
|
|
7
|
-
import { getDataGridUtilityClass, gridClasses, useGridSelector, useGridApiEventHandler, gridVisibleColumnFieldsSelector,
|
|
7
|
+
import { getDataGridUtilityClass, gridClasses, useGridSelector, useGridApiEventHandler, gridVisibleColumnFieldsSelector, GridColumnHeaderSeparatorSides } from '@mui/x-data-grid';
|
|
8
8
|
import { GridColumnHeaders, GridColumnHeadersInner, useGridColumnHeaders } from '@mui/x-data-grid/internals';
|
|
9
9
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
10
10
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
@@ -87,7 +87,7 @@ export const DataGridProColumnHeaders = /*#__PURE__*/React.forwardRef(function D
|
|
|
87
87
|
const newScrollbarSize = apiRef.current.windowRef.current.offsetWidth - apiRef.current.windowRef.current.clientWidth;
|
|
88
88
|
setScrollbarSize(newScrollbarSize);
|
|
89
89
|
}, [apiRef]);
|
|
90
|
-
useGridApiEventHandler(apiRef,
|
|
90
|
+
useGridApiEventHandler(apiRef, 'virtualScrollerContentSizeChange', handleContentSizeChange);
|
|
91
91
|
const pinnedColumns = useGridSelector(apiRef, gridPinnedColumnsSelector);
|
|
92
92
|
const [leftPinnedColumns, rightPinnedColumns] = filterColumns(pinnedColumns, visibleColumnFields);
|
|
93
93
|
const {
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { styled, alpha } from '@mui/material/styles';
|
|
6
6
|
import Box from '@mui/material/Box';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
8
|
-
import { useGridSelector, getDataGridUtilityClass, gridClasses, gridVisibleColumnFieldsSelector, gridRowsMetaSelector, useGridApiEventHandler
|
|
8
|
+
import { useGridSelector, getDataGridUtilityClass, gridClasses, gridVisibleColumnFieldsSelector, gridRowsMetaSelector, useGridApiEventHandler } from '@mui/x-data-grid';
|
|
9
9
|
import { GridVirtualScroller, GridVirtualScrollerContent, GridVirtualScrollerRenderZone, useGridVirtualScroller } from '@mui/x-data-grid/internals';
|
|
10
10
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
11
11
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
@@ -71,7 +71,9 @@ const VirtualScrollerDetailPanels = styled('div', {
|
|
|
71
71
|
name: 'MuiDataGrid',
|
|
72
72
|
slot: 'DetailPanels',
|
|
73
73
|
overridesResolver: (props, styles) => styles.detailPanels
|
|
74
|
-
})({
|
|
74
|
+
})({
|
|
75
|
+
position: 'relative'
|
|
76
|
+
});
|
|
75
77
|
const VirtualScrollerDetailPanel = styled(Box, {
|
|
76
78
|
name: 'MuiDataGrid',
|
|
77
79
|
slot: 'DetailPanel',
|
|
@@ -173,9 +175,9 @@ const DataGridProVirtualScroller = /*#__PURE__*/React.forwardRef(function DataGr
|
|
|
173
175
|
updateRenderZonePosition(renderContext);
|
|
174
176
|
}
|
|
175
177
|
}, [renderContext, updateRenderZonePosition]);
|
|
176
|
-
useGridApiEventHandler(apiRef,
|
|
177
|
-
useGridApiEventHandler(apiRef,
|
|
178
|
-
useGridApiEventHandler(apiRef,
|
|
178
|
+
useGridApiEventHandler(apiRef, 'columnWidthChange', refreshRenderZonePosition);
|
|
179
|
+
useGridApiEventHandler(apiRef, 'columnOrderChange', refreshRenderZonePosition);
|
|
180
|
+
useGridApiEventHandler(apiRef, 'rowOrderChange', refreshRenderZonePosition);
|
|
179
181
|
const leftRenderContext = renderContext && leftPinnedColumns.length > 0 ? _extends({}, renderContext, {
|
|
180
182
|
firstColumnIndex: 0,
|
|
181
183
|
lastColumnIndex: leftPinnedColumns.length
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
3
3
|
import IconButton from '@mui/material/IconButton';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
|
-
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass
|
|
5
|
+
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
6
6
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
7
7
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -44,7 +44,7 @@ export const GridGroupingCriteriaCell = props => {
|
|
|
44
44
|
event.stopPropagation();
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
apiRef.current.publishEvent(
|
|
47
|
+
apiRef.current.publishEvent('cellKeyDown', props, event);
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
const handleClick = event => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
-
import {
|
|
4
|
+
import { gridRowTreeDepthSelector, gridSortModelSelector, useGridApiContext, useGridSelector, getDataGridUtilityClass, gridEditRowsStateSelector } from '@mui/x-data-grid';
|
|
5
5
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -53,9 +53,9 @@ const GridRowReorderCell = params => {
|
|
|
53
53
|
}
|
|
54
54
|
}, [apiRef, params.row.id]);
|
|
55
55
|
const draggableEventHandlers = {
|
|
56
|
-
onDragStart: publish(
|
|
57
|
-
onDragOver: publish(
|
|
58
|
-
onDragEnd: publish(
|
|
56
|
+
onDragStart: publish('rowDragStart'),
|
|
57
|
+
onDragOver: publish('rowDragOver'),
|
|
58
|
+
onDragEnd: publish('rowDragEnd')
|
|
59
59
|
};
|
|
60
60
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
61
61
|
className: classes.root,
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
4
|
import IconButton from '@mui/material/IconButton';
|
|
5
5
|
import Box from '@mui/material/Box';
|
|
6
|
-
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass
|
|
6
|
+
import { useGridSelector, gridFilteredDescendantCountLookupSelector, getDataGridUtilityClass } from '@mui/x-data-grid';
|
|
7
7
|
import { isNavigationKey } from '@mui/x-data-grid/internals';
|
|
8
8
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
9
9
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
@@ -47,7 +47,7 @@ const GridTreeDataGroupingCell = props => {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (isNavigationKey(event.key) && !event.shiftKey) {
|
|
50
|
-
apiRef.current.publishEvent(
|
|
50
|
+
apiRef.current.publishEvent('cellNavigationKeyDown', props, event);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import MuiDivider from '@mui/material/Divider';
|
|
4
|
-
import { useGridSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector, gridVisibleColumnFieldsSelector, gridClasses,
|
|
4
|
+
import { useGridSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector, gridVisibleColumnFieldsSelector, gridClasses, useGridApiMethod, useGridApiEventHandler } from '@mui/x-data-grid';
|
|
5
5
|
import { useGridRegisterPipeProcessor } from '@mui/x-data-grid/internals';
|
|
6
6
|
import { GridColumnPinningMenuItems } from '../../../components/GridColumnPinningMenuItems';
|
|
7
7
|
import { GridPinnedPosition } from './gridColumnPinningInterface';
|
|
@@ -83,8 +83,8 @@ export const useGridColumnPinning = (apiRef, props) => {
|
|
|
83
83
|
const handleMouseLeave = React.useCallback((params, event) => {
|
|
84
84
|
updateHoveredClassOnSiblingRows(event);
|
|
85
85
|
}, [updateHoveredClassOnSiblingRows]);
|
|
86
|
-
useGridApiEventHandler(apiRef,
|
|
87
|
-
useGridApiEventHandler(apiRef,
|
|
86
|
+
useGridApiEventHandler(apiRef, 'rowMouseEnter', handleMouseEnter);
|
|
87
|
+
useGridApiEventHandler(apiRef, 'rowMouseLeave', handleMouseLeave);
|
|
88
88
|
/**
|
|
89
89
|
* PRE-PROCESSING
|
|
90
90
|
*/
|
|
@@ -191,7 +191,7 @@ export const useGridColumnPinning = (apiRef, props) => {
|
|
|
191
191
|
propModel: props.pinnedColumns,
|
|
192
192
|
propOnChange: props.onPinnedColumnsChange,
|
|
193
193
|
stateSelector: gridPinnedColumnsSelector,
|
|
194
|
-
changeEvent:
|
|
194
|
+
changeEvent: 'pinnedColumnsChange'
|
|
195
195
|
});
|
|
196
196
|
const checkIfEnabled = React.useCallback(methodName => {
|
|
197
197
|
if (props.disableColumnPinning) {
|
|
@@ -4,7 +4,6 @@ import { GridApiPro } from '../../../models/gridApiPro';
|
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
5
5
|
export declare const columnReorderStateInitializer: GridStateInitializer;
|
|
6
6
|
/**
|
|
7
|
-
* Only available in DataGridPro
|
|
8
7
|
* @requires useGridColumns (method)
|
|
9
8
|
*/
|
|
10
9
|
export declare const useGridColumnReorder: (apiRef: React.MutableRefObject<GridApiPro>, props: Pick<DataGridProProcessedProps, 'disableColumnReorder' | 'classes'>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
4
|
-
import { useGridApiEventHandler, getDataGridUtilityClass,
|
|
4
|
+
import { useGridApiEventHandler, getDataGridUtilityClass, useGridLogger } from '@mui/x-data-grid';
|
|
5
5
|
import { gridColumnReorderDragColSelector } from './columnReorderSelector';
|
|
6
6
|
const CURSOR_MOVE_DIRECTION_LEFT = 'left';
|
|
7
7
|
const CURSOR_MOVE_DIRECTION_RIGHT = 'right';
|
|
@@ -28,7 +28,6 @@ export const columnReorderStateInitializer = state => _extends({}, state, {
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
31
|
-
* Only available in DataGridPro
|
|
32
31
|
* @requires useGridColumns (method)
|
|
33
32
|
*/
|
|
34
33
|
|
|
@@ -156,10 +155,10 @@ export const useGridColumnReorder = (apiRef, props) => {
|
|
|
156
155
|
}));
|
|
157
156
|
apiRef.current.forceUpdate();
|
|
158
157
|
}, [props.disableColumnReorder, logger, apiRef]);
|
|
159
|
-
useGridApiEventHandler(apiRef,
|
|
160
|
-
useGridApiEventHandler(apiRef,
|
|
161
|
-
useGridApiEventHandler(apiRef,
|
|
162
|
-
useGridApiEventHandler(apiRef,
|
|
163
|
-
useGridApiEventHandler(apiRef,
|
|
164
|
-
useGridApiEventHandler(apiRef,
|
|
158
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
|
|
159
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnter', handleDragEnter);
|
|
160
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragOver', handleDragOver);
|
|
161
|
+
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', handleDragEnd);
|
|
162
|
+
useGridApiEventHandler(apiRef, 'cellDragEnter', handleDragEnter);
|
|
163
|
+
useGridApiEventHandler(apiRef, 'cellDragOver', handleDragOver);
|
|
165
164
|
};
|
|
@@ -4,7 +4,6 @@ import { GridApiPro } from '../../../models/gridApiPro';
|
|
|
4
4
|
import { DataGridProProcessedProps } from '../../../models/dataGridProProps';
|
|
5
5
|
export declare const columnResizeStateInitializer: GridStateInitializer;
|
|
6
6
|
/**
|
|
7
|
-
* Only available in DataGridPro
|
|
8
7
|
* @requires useGridColumns (method, event)
|
|
9
8
|
* TODO: improve experience for last column
|
|
10
9
|
*/
|