@mui/x-tree-view-pro 8.16.0 → 8.18.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 +208 -1
- package/RichTreeViewPro/RichTreeViewPro.js +21 -21
- package/esm/RichTreeViewPro/RichTreeViewPro.js +21 -21
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useTreeViewItemsReordering/itemPlugin.d.ts +23 -0
- package/esm/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +1 -1
- package/esm/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.selectors.d.ts +3 -2
- package/esm/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.d.ts +20 -38
- package/index.js +1 -1
- package/internals/plugins/useTreeViewItemsReordering/itemPlugin.d.ts +23 -0
- package/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +6 -6
- package/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.selectors.d.ts +3 -2
- package/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.d.ts +20 -38
- package/package.json +5 -5
- package/esm/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.itemPlugin.d.ts +0 -3
- package/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.itemPlugin.d.ts +0 -3
- /package/esm/internals/plugins/useTreeViewItemsReordering/{useTreeViewItemsReordering.itemPlugin.js → itemPlugin.js} +0 -0
- /package/internals/plugins/useTreeViewItemsReordering/{useTreeViewItemsReordering.itemPlugin.js → itemPlugin.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,213 @@
|
|
|
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.18.0
|
|
9
|
+
|
|
10
|
+
<!-- generated comparing v8.17.0..master -->
|
|
11
|
+
|
|
12
|
+
_Nov 13, 2025_
|
|
13
|
+
|
|
14
|
+
We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
15
|
+
|
|
16
|
+
- Add `barLabelPlacement` property to customize the bar label position in bar charts, enabling labels to be placed above bars.
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
- Add `source` property to the date/time picker lifecycle and event handler context, enabling clearer differentiation between changes initiated by the picker UI and those from direct field input.
|
|
21
|
+
- 🐞 Bugfixes
|
|
22
|
+
- 📚 Documentation improvements
|
|
23
|
+
|
|
24
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
25
|
+
@htollefsen, @sai6855, @Sigdriv
|
|
26
|
+
|
|
27
|
+
The following team members contributed to this release:
|
|
28
|
+
@arminmeh, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @JCQuintas, @michelengelen, @noraleonte, @prakhargupta1, @rita-codes, @siriwatknp
|
|
29
|
+
|
|
30
|
+
### Data Grid
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid@8.18.0`
|
|
33
|
+
|
|
34
|
+
- [DataGrid] Allow default event in the column action cell item click event handler (#20272) @arminmeh
|
|
35
|
+
- [DataGrid] Remove unnecessary generic from `useGridApiRef` (#20277) @cherniavskii
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
38
|
+
|
|
39
|
+
Same changes as in `@mui/x-data-grid@8.18.0`.
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid-premium@8.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-data-grid-pro@8.18.0`, plus:
|
|
44
|
+
|
|
45
|
+
- [DataGridPremium] Return the correct `cellParams` value from the aggregation cells (#20224) @arminmeh
|
|
46
|
+
|
|
47
|
+
### Date and Time Pickers
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-date-pickers@8.18.0`
|
|
50
|
+
|
|
51
|
+
- [pickers] Keep invalid date state consistent (#20040) @michelengelen
|
|
52
|
+
- [pickers] Adds new `source` property to `onChange` and `onAccept` context object (#20234) @michelengelen
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-date-pickers@8.18.0`.
|
|
57
|
+
|
|
58
|
+
### Charts
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts@8.18.0`
|
|
61
|
+
|
|
62
|
+
- [charts] Add prop for positioning a bar label (#20194) @Sigdriv
|
|
63
|
+
- [charts] Fix applying dark mode styles in `ChartAxisZoomSliderThumb` (#20232) @sai6855
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-charts-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
66
|
+
|
|
67
|
+
Same changes as in `@mui/x-charts@8.18.0`, plus:
|
|
68
|
+
|
|
69
|
+
- [charts-pro] Allow specifying Content Security Policy nonce on export (#20053) @bernardobelchior
|
|
70
|
+
- [charts-pro] Fix applying dark mode styles to slider (#20220) @sai6855
|
|
71
|
+
- [charts-pro] Sankey should respect node order (#20065) @JCQuintas
|
|
72
|
+
|
|
73
|
+
#### `@mui/x-charts-premium@8.18.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
74
|
+
|
|
75
|
+
Same changes as in `@mui/x-charts-pro@8.18.0`.
|
|
76
|
+
|
|
77
|
+
### Tree View
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-tree-view@8.18.0`
|
|
80
|
+
|
|
81
|
+
- [tree view] Prepare tests for the new store structure (#20225) @flaviendelangle
|
|
82
|
+
- [tree view] Prepare the item plugin files for the store migration (#20240) @flaviendelangle
|
|
83
|
+
- [tree view] Use `TreeItemId` type instead of raw string (#20233) @flaviendelangle
|
|
84
|
+
|
|
85
|
+
#### `@mui/x-tree-view-pro@8.18.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
86
|
+
|
|
87
|
+
Same changes as in `@mui/x-tree-view@8.18.0`.
|
|
88
|
+
|
|
89
|
+
### Codemod
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-codemod@8.18.0`
|
|
92
|
+
|
|
93
|
+
Internal changes.
|
|
94
|
+
|
|
95
|
+
### Docs
|
|
96
|
+
|
|
97
|
+
- [charts] Add a demo for a custom tick label (#20073) @prakhargupta1
|
|
98
|
+
- [charts] Create `useAxes()` hook documentation page (#20229) @JCQuintas
|
|
99
|
+
- [charts] Fix logo alignment (#20228) @JCQuintas
|
|
100
|
+
- [charts] Fixes typo in import example (#20236) @htollefsen
|
|
101
|
+
- [Data Grid] Add recipe for cursor pagination with data source (#19700) @siriwatknp
|
|
102
|
+
- [Data Grid] Add a demo for pinned rows aggregation (#20198) @cherniavskii
|
|
103
|
+
|
|
104
|
+
### Core
|
|
105
|
+
|
|
106
|
+
- [docs-infra] Use deployment config from docs-infra package (#20243) @brijeshb42
|
|
107
|
+
|
|
108
|
+
## 8.17.0
|
|
109
|
+
|
|
110
|
+
_Nov 5, 2025_
|
|
111
|
+
|
|
112
|
+
We'd like to extend a big thank you to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
113
|
+
|
|
114
|
+
- Add `colorGetter` prop to cartesian charts series
|
|
115
|
+
|
|
116
|
+
<img width="400" alt="Image" src="https://github.com/user-attachments/assets/d8b1263f-794e-4939-b17e-87350fdd1746" />
|
|
117
|
+
|
|
118
|
+
- 🌎 Add Catalan (ca-ES) locale on the Data Grid
|
|
119
|
+
- 🌎 Add Norwegian Bokmål (nb-NO) locale on the Charts
|
|
120
|
+
- 🐞 Bugfixes
|
|
121
|
+
- 📚 Documentation improvements
|
|
122
|
+
|
|
123
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
124
|
+
@frncesc, @Methuselah96, @samuelwalk, @htollefsen
|
|
125
|
+
|
|
126
|
+
The following team members contributed to this release:
|
|
127
|
+
@alexfauquette, @bernardobelchior, @flaviendelangle, @Janpot, @JCQuintas, @mnajdova, @rita-codes, @arminmeh, @brijeshb42
|
|
128
|
+
|
|
129
|
+
### Data Grid
|
|
130
|
+
|
|
131
|
+
#### `@mui/x-data-grid@8.17.0`
|
|
132
|
+
|
|
133
|
+
- [DataGrid] Stop event propagation on data grid action buttons (GridActionsCellItem) (#19513) @Copilot
|
|
134
|
+
- [DataGrid] Update cell editable state if `editable` prop is updated in the column definition (#20147) @arminmeh
|
|
135
|
+
- [DataGrid] Wait for external model updates before resetting pagination after sort/filter (#20162) @arminmeh
|
|
136
|
+
- [l10n] Add Catalan (ca-ES) locale (#20154) @frncesc
|
|
137
|
+
- [l10n] Improve Arabic (ar-SD) locale (#20185) @samuelwalk
|
|
138
|
+
|
|
139
|
+
#### `@mui/x-data-grid-pro@8.17.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
140
|
+
|
|
141
|
+
Same changes as in `@mui/x-data-grid@8.17.0`.
|
|
142
|
+
|
|
143
|
+
#### `@mui/x-data-grid-premium@8.17.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
144
|
+
|
|
145
|
+
Same changes as in `@mui/x-data-grid-pro@8.17.0`.
|
|
146
|
+
|
|
147
|
+
### Date and Time Pickers
|
|
148
|
+
|
|
149
|
+
#### `@mui/x-date-pickers@8.17.0`
|
|
150
|
+
|
|
151
|
+
Internal changes.
|
|
152
|
+
|
|
153
|
+
#### `@mui/x-date-pickers-pro@8.17.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
154
|
+
|
|
155
|
+
Same changes as in `@mui/x-date-pickers@8.17.0`.
|
|
156
|
+
|
|
157
|
+
### Charts
|
|
158
|
+
|
|
159
|
+
#### `@mui/x-charts@8.17.0`
|
|
160
|
+
|
|
161
|
+
- [charts] Add `barLabel` to bar series. Deprecate `barLabel` in `BarPlot`. (#20184) @bernardobelchior
|
|
162
|
+
- [charts] Add series color callback (#20084) @bernardobelchior
|
|
163
|
+
- [charts] Expose `ChartsSurface` classes (#20180) @bernardobelchior
|
|
164
|
+
- [charts] Fix chart cut off when inside `overflow: scroll` container (#20182) @bernardobelchior
|
|
165
|
+
- [charts] Fix tick label overflow on multiple axes and series demo (#20152) @bernardobelchior
|
|
166
|
+
- [charts] Organize series config (#20155) @bernardobelchior
|
|
167
|
+
- [charts] Use selectors from `@mui/x-internals` (#20052) @alexfauquette
|
|
168
|
+
- [charts] Use store from `@mui/x-internals` (#20121) @alexfauquette
|
|
169
|
+
- [charts] Add `useDataset` hook (#20205) @JCQuintas
|
|
170
|
+
- [l10n] Add Norwegian Bokmål (nb-NO) locale (#20197) @htollefsen
|
|
171
|
+
|
|
172
|
+
#### `@mui/x-charts-pro@8.17.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
173
|
+
|
|
174
|
+
Same changes as in `@mui/x-charts@8.17.0`, plus:
|
|
175
|
+
|
|
176
|
+
- [charts-pro] Fix zoom pan issue when controlled (#20163) @JCQuintas
|
|
177
|
+
|
|
178
|
+
#### `@mui/x-charts-premium@8.17.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
179
|
+
|
|
180
|
+
Same changes as in `@mui/x-charts-pro@8.17.0`.
|
|
181
|
+
|
|
182
|
+
### Tree View
|
|
183
|
+
|
|
184
|
+
#### `@mui/x-tree-view@8.17.0`
|
|
185
|
+
|
|
186
|
+
- [tree view] Accept read only arrays in `expandedItems` prop (#20181) @Methuselah96
|
|
187
|
+
- [tree view] Use `aria-checked` instead of `aria-selected` on items (#19851) @flaviendelangle
|
|
188
|
+
|
|
189
|
+
#### `@mui/x-tree-view-pro@8.17.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
190
|
+
|
|
191
|
+
Same changes as in `@mui/x-tree-view@8.17.0`.
|
|
192
|
+
|
|
193
|
+
### Codemod
|
|
194
|
+
|
|
195
|
+
#### `@mui/x-codemod@8.17.0`
|
|
196
|
+
|
|
197
|
+
Internal changes.
|
|
198
|
+
|
|
199
|
+
### Docs
|
|
200
|
+
|
|
201
|
+
- [docs] Fix focus issues in the action column demo (#20178) @arminmeh
|
|
202
|
+
- [docs] Remove hidden Tree View headless page (#20119) @flaviendelangle
|
|
203
|
+
- [docs] Fix some external redirects (#20211) @Janpot
|
|
204
|
+
|
|
205
|
+
### Core
|
|
206
|
+
|
|
207
|
+
- [code-infra] Fix cci job timeout due to buffered test output (#20193) @Janpot
|
|
208
|
+
- [code-infra] Fix publish workflow (#20140) @bernardobelchior
|
|
209
|
+
- [code-infra] Increase JSDOM test parallelism (#20179) @Janpot
|
|
210
|
+
- [code-infra] Remove React import requirement for jsx (#20144) @brijeshb42
|
|
211
|
+
- [code-infra] Replace `getInitialProps` with `getStaticProps` (#20192) @Janpot
|
|
212
|
+
- [code-infra] git-ignore next-env.d.ts (#20177) @Janpot
|
|
213
|
+
- [code-infra] Stabilize screenshot testing (#19868) @Janpot
|
|
214
|
+
|
|
8
215
|
## 8.16.0
|
|
9
216
|
|
|
10
217
|
_Oct 29, 2025_
|
|
@@ -39,7 +246,7 @@ Same changes as in `@mui/x-data-grid@8.16.0`, plus:
|
|
|
39
246
|
Same changes as in `@mui/x-data-grid-pro@8.16.0`, plus:
|
|
40
247
|
|
|
41
248
|
- [DataGridPremium] Export and restore chart integration state (#20079) @arminmeh
|
|
42
|
-
- [DataGridPremium] Fix grouping column `valueFormatter()` crash
|
|
249
|
+
- [DataGridPremium] Fix grouping column `valueFormatter()` crash (#20070) @sai6855
|
|
43
250
|
- [DataGridPremium] Refetch aggregation data after row update with server-side aggregation (#20039) @arminmeh
|
|
44
251
|
|
|
45
252
|
### Date and Time Pickers
|
|
@@ -52,7 +52,7 @@ const RichTreeViewProRoot = exports.RichTreeViewProRoot = (0, _zeroStyled.styled
|
|
|
52
52
|
outline: 0,
|
|
53
53
|
position: 'relative'
|
|
54
54
|
});
|
|
55
|
-
const releaseInfo = "
|
|
55
|
+
const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
*
|
|
@@ -141,15 +141,15 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
141
141
|
}),
|
|
142
142
|
/**
|
|
143
143
|
* Used to determine if a given item can move to some new position.
|
|
144
|
-
* @param {object}
|
|
145
|
-
* @param {
|
|
146
|
-
* @param {TreeViewItemReorderPosition}
|
|
147
|
-
* @param {TreeViewItemReorderPosition}
|
|
144
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
145
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item that is being moved to a new position.
|
|
146
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
147
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
148
148
|
* @returns {boolean} `true` if the item can move to the new position.
|
|
149
149
|
*/
|
|
150
150
|
canMoveItemToNewPosition: _propTypes.default.func,
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* Whether the Tree View renders a checkbox at the left of its label that allows selecting it.
|
|
153
153
|
* @default false
|
|
154
154
|
*/
|
|
155
155
|
checkboxSelection: _propTypes.default.bool,
|
|
@@ -186,12 +186,12 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
186
186
|
*/
|
|
187
187
|
defaultSelectedItems: _propTypes.default.any,
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
189
|
+
* Whether the items should be focusable when disabled.
|
|
190
190
|
* @default false
|
|
191
191
|
*/
|
|
192
192
|
disabledItemsFocusable: _propTypes.default.bool,
|
|
193
193
|
/**
|
|
194
|
-
*
|
|
194
|
+
* Whether selection is disabled.
|
|
195
195
|
* @default false
|
|
196
196
|
*/
|
|
197
197
|
disableSelection: _propTypes.default.bool,
|
|
@@ -219,7 +219,7 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
219
219
|
*
|
|
220
220
|
* @template R
|
|
221
221
|
* @param {R} item The item to check.
|
|
222
|
-
* @returns {
|
|
222
|
+
* @returns {TreeViewItemId} The id of the item.
|
|
223
223
|
* @default (item) => item.id
|
|
224
224
|
*/
|
|
225
225
|
getItemId: _propTypes.default.func,
|
|
@@ -254,7 +254,7 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
254
254
|
isItemEditable: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
|
|
255
255
|
/**
|
|
256
256
|
* Determine if a given item can be reordered.
|
|
257
|
-
* @param {
|
|
257
|
+
* @param {TreeViewItemId} itemId The id of the item to check.
|
|
258
258
|
* @returns {boolean} `true` if the item can be reordered.
|
|
259
259
|
* @default () => true
|
|
260
260
|
*/
|
|
@@ -272,33 +272,33 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
272
272
|
*/
|
|
273
273
|
itemsReordering: _propTypes.default.bool,
|
|
274
274
|
/**
|
|
275
|
-
*
|
|
275
|
+
* Whether multiple items can be selected.
|
|
276
276
|
* @default false
|
|
277
277
|
*/
|
|
278
278
|
multiSelect: _propTypes.default.bool,
|
|
279
279
|
/**
|
|
280
280
|
* Callback fired when Tree Items are expanded/collapsed.
|
|
281
281
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
|
|
282
|
-
* @param {
|
|
282
|
+
* @param {TreeViewItemId[]} itemIds The ids of the expanded items.
|
|
283
283
|
*/
|
|
284
284
|
onExpandedItemsChange: _propTypes.default.func,
|
|
285
285
|
/**
|
|
286
286
|
* Callback fired when the `content` slot of a given Tree Item is clicked.
|
|
287
287
|
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
288
|
-
* @param {
|
|
288
|
+
* @param {TreeViewItemId} itemId The id of the focused item.
|
|
289
289
|
*/
|
|
290
290
|
onItemClick: _propTypes.default.func,
|
|
291
291
|
/**
|
|
292
292
|
* Callback fired when a Tree Item is expanded or collapsed.
|
|
293
293
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
|
|
294
|
-
* @param {
|
|
294
|
+
* @param {TreeViewItemId} itemId The itemId of the modified item.
|
|
295
295
|
* @param {boolean} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
|
|
296
296
|
*/
|
|
297
297
|
onItemExpansionToggle: _propTypes.default.func,
|
|
298
298
|
/**
|
|
299
299
|
* Callback fired when a given Tree Item is focused.
|
|
300
300
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
|
|
301
|
-
* @param {
|
|
301
|
+
* @param {TreeViewItemId} itemId The id of the focused item.
|
|
302
302
|
*/
|
|
303
303
|
onItemFocus: _propTypes.default.func,
|
|
304
304
|
/**
|
|
@@ -309,23 +309,23 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
309
309
|
onItemLabelChange: _propTypes.default.func,
|
|
310
310
|
/**
|
|
311
311
|
* Callback fired when a Tree Item is moved in the tree.
|
|
312
|
-
* @param {object}
|
|
313
|
-
* @param {
|
|
314
|
-
* @param {TreeViewItemReorderPosition}
|
|
315
|
-
* @param {TreeViewItemReorderPosition}
|
|
312
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
313
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item moved.
|
|
314
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
315
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
316
316
|
*/
|
|
317
317
|
onItemPositionChange: _propTypes.default.func,
|
|
318
318
|
/**
|
|
319
319
|
* Callback fired when a Tree Item is selected or deselected.
|
|
320
320
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
321
|
-
* @param {
|
|
321
|
+
* @param {TreeViewItemId} itemId The itemId of the modified item.
|
|
322
322
|
* @param {boolean} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
323
323
|
*/
|
|
324
324
|
onItemSelectionToggle: _propTypes.default.func,
|
|
325
325
|
/**
|
|
326
326
|
* Callback fired when Tree Items are selected/deselected.
|
|
327
327
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
328
|
-
* @param {
|
|
328
|
+
* @param {TreeViewItemId[] | TreeViewItemId} itemIds The ids of the selected items.
|
|
329
329
|
* When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
|
|
330
330
|
*/
|
|
331
331
|
onSelectedItemsChange: _propTypes.default.func,
|
|
@@ -45,7 +45,7 @@ export const RichTreeViewProRoot = styled('ul', {
|
|
|
45
45
|
outline: 0,
|
|
46
46
|
position: 'relative'
|
|
47
47
|
});
|
|
48
|
-
const releaseInfo = "
|
|
48
|
+
const releaseInfo = "MTc2Mjk5MjAwMDAwMA==";
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
*
|
|
@@ -134,15 +134,15 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
134
134
|
}),
|
|
135
135
|
/**
|
|
136
136
|
* Used to determine if a given item can move to some new position.
|
|
137
|
-
* @param {object}
|
|
138
|
-
* @param {
|
|
139
|
-
* @param {TreeViewItemReorderPosition}
|
|
140
|
-
* @param {TreeViewItemReorderPosition}
|
|
137
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
138
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item that is being moved to a new position.
|
|
139
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
140
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
141
141
|
* @returns {boolean} `true` if the item can move to the new position.
|
|
142
142
|
*/
|
|
143
143
|
canMoveItemToNewPosition: PropTypes.func,
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* Whether the Tree View renders a checkbox at the left of its label that allows selecting it.
|
|
146
146
|
* @default false
|
|
147
147
|
*/
|
|
148
148
|
checkboxSelection: PropTypes.bool,
|
|
@@ -179,12 +179,12 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
179
179
|
*/
|
|
180
180
|
defaultSelectedItems: PropTypes.any,
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
182
|
+
* Whether the items should be focusable when disabled.
|
|
183
183
|
* @default false
|
|
184
184
|
*/
|
|
185
185
|
disabledItemsFocusable: PropTypes.bool,
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
187
|
+
* Whether selection is disabled.
|
|
188
188
|
* @default false
|
|
189
189
|
*/
|
|
190
190
|
disableSelection: PropTypes.bool,
|
|
@@ -212,7 +212,7 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
212
212
|
*
|
|
213
213
|
* @template R
|
|
214
214
|
* @param {R} item The item to check.
|
|
215
|
-
* @returns {
|
|
215
|
+
* @returns {TreeViewItemId} The id of the item.
|
|
216
216
|
* @default (item) => item.id
|
|
217
217
|
*/
|
|
218
218
|
getItemId: PropTypes.func,
|
|
@@ -247,7 +247,7 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
247
247
|
isItemEditable: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
248
248
|
/**
|
|
249
249
|
* Determine if a given item can be reordered.
|
|
250
|
-
* @param {
|
|
250
|
+
* @param {TreeViewItemId} itemId The id of the item to check.
|
|
251
251
|
* @returns {boolean} `true` if the item can be reordered.
|
|
252
252
|
* @default () => true
|
|
253
253
|
*/
|
|
@@ -265,33 +265,33 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
265
265
|
*/
|
|
266
266
|
itemsReordering: PropTypes.bool,
|
|
267
267
|
/**
|
|
268
|
-
*
|
|
268
|
+
* Whether multiple items can be selected.
|
|
269
269
|
* @default false
|
|
270
270
|
*/
|
|
271
271
|
multiSelect: PropTypes.bool,
|
|
272
272
|
/**
|
|
273
273
|
* Callback fired when Tree Items are expanded/collapsed.
|
|
274
274
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
|
|
275
|
-
* @param {
|
|
275
|
+
* @param {TreeViewItemId[]} itemIds The ids of the expanded items.
|
|
276
276
|
*/
|
|
277
277
|
onExpandedItemsChange: PropTypes.func,
|
|
278
278
|
/**
|
|
279
279
|
* Callback fired when the `content` slot of a given Tree Item is clicked.
|
|
280
280
|
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
281
|
-
* @param {
|
|
281
|
+
* @param {TreeViewItemId} itemId The id of the focused item.
|
|
282
282
|
*/
|
|
283
283
|
onItemClick: PropTypes.func,
|
|
284
284
|
/**
|
|
285
285
|
* Callback fired when a Tree Item is expanded or collapsed.
|
|
286
286
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemExpansion()` method.
|
|
287
|
-
* @param {
|
|
287
|
+
* @param {TreeViewItemId} itemId The itemId of the modified item.
|
|
288
288
|
* @param {boolean} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
|
|
289
289
|
*/
|
|
290
290
|
onItemExpansionToggle: PropTypes.func,
|
|
291
291
|
/**
|
|
292
292
|
* Callback fired when a given Tree Item is focused.
|
|
293
293
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
|
|
294
|
-
* @param {
|
|
294
|
+
* @param {TreeViewItemId} itemId The id of the focused item.
|
|
295
295
|
*/
|
|
296
296
|
onItemFocus: PropTypes.func,
|
|
297
297
|
/**
|
|
@@ -302,23 +302,23 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
302
302
|
onItemLabelChange: PropTypes.func,
|
|
303
303
|
/**
|
|
304
304
|
* Callback fired when a Tree Item is moved in the tree.
|
|
305
|
-
* @param {object}
|
|
306
|
-
* @param {
|
|
307
|
-
* @param {TreeViewItemReorderPosition}
|
|
308
|
-
* @param {TreeViewItemReorderPosition}
|
|
305
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
306
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item moved.
|
|
307
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
308
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
309
309
|
*/
|
|
310
310
|
onItemPositionChange: PropTypes.func,
|
|
311
311
|
/**
|
|
312
312
|
* Callback fired when a Tree Item is selected or deselected.
|
|
313
313
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
314
|
-
* @param {
|
|
314
|
+
* @param {TreeViewItemId} itemId The itemId of the modified item.
|
|
315
315
|
* @param {boolean} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
316
316
|
*/
|
|
317
317
|
onItemSelectionToggle: PropTypes.func,
|
|
318
318
|
/**
|
|
319
319
|
* Callback fired when Tree Items are selected/deselected.
|
|
320
320
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change. Can be null when the change is caused by the `publicAPI.setItemSelection()` method.
|
|
321
|
-
* @param {
|
|
321
|
+
* @param {TreeViewItemId[] | TreeViewItemId} itemIds The ids of the selected items.
|
|
322
322
|
* When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
|
|
323
323
|
*/
|
|
324
324
|
onSelectedItemsChange: PropTypes.func,
|
package/esm/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TreeViewCancellableEventHandler } from '@mui/x-tree-view/models';
|
|
3
|
+
import { TreeViewItemPlugin } from '@mui/x-tree-view/internals';
|
|
4
|
+
import { TreeItemDragAndDropOverlayProps } from '@mui/x-tree-view/TreeItemDragAndDropOverlay';
|
|
5
|
+
export declare const isAndroid: () => boolean;
|
|
6
|
+
export declare const useTreeViewItemsReorderingItemPlugin: TreeViewItemPlugin;
|
|
7
|
+
interface UseTreeItemRootSlotPropsFromItemsReordering {
|
|
8
|
+
draggable?: true;
|
|
9
|
+
onDragStart?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
10
|
+
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
11
|
+
onDragEnd?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
12
|
+
}
|
|
13
|
+
interface UseTreeItemContentSlotPropsFromItemsReordering {
|
|
14
|
+
onDragEnter?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
15
|
+
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
16
|
+
}
|
|
17
|
+
interface UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering extends TreeItemDragAndDropOverlayProps {}
|
|
18
|
+
declare module '@mui/x-tree-view/useTreeItem' {
|
|
19
|
+
interface UseTreeItemRootSlotOwnProps extends UseTreeItemRootSlotPropsFromItemsReordering {}
|
|
20
|
+
interface UseTreeItemContentSlotOwnProps extends UseTreeItemContentSlotPropsFromItemsReordering {}
|
|
21
|
+
interface UseTreeItemDragAndDropOverlaySlotOwnProps extends UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering {}
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
|
|
4
4
|
import { itemsSelectors, labelSelectors } from '@mui/x-tree-view/internals';
|
|
5
5
|
import { chooseActionToApply, isAncestor, moveItemInTree } from "./useTreeViewItemsReordering.utils.js";
|
|
6
|
-
import { useTreeViewItemsReorderingItemPlugin } from "./
|
|
6
|
+
import { useTreeViewItemsReorderingItemPlugin } from "./itemPlugin.js";
|
|
7
7
|
import { itemsReorderingSelectors } from "./useTreeViewItemsReordering.selectors.js";
|
|
8
8
|
export const useTreeViewItemsReordering = ({
|
|
9
9
|
params,
|
package/esm/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.selectors.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { TreeViewState } from '@mui/x-tree-view/internals';
|
|
2
|
+
import { TreeViewItemId } from '@mui/x-tree-view/models';
|
|
2
3
|
import { UseTreeViewItemsReorderingSignature } from "./useTreeViewItemsReordering.types.js";
|
|
3
4
|
export declare const itemsReorderingSelectors: {
|
|
4
5
|
/**
|
|
5
6
|
* Gets the properties of the current reordering.
|
|
6
7
|
*/
|
|
7
8
|
currentReorder: (state: TreeViewState<[UseTreeViewItemsReorderingSignature]>) => {
|
|
8
|
-
draggedItemId:
|
|
9
|
-
targetItemId:
|
|
9
|
+
draggedItemId: TreeViewItemId;
|
|
10
|
+
targetItemId: TreeViewItemId;
|
|
10
11
|
newPosition: import("./useTreeViewItemsReordering.types.js").TreeViewItemReorderPosition | null;
|
|
11
12
|
action: import("@mui/x-tree-view").TreeViewItemsReorderingAction | null;
|
|
12
13
|
} | null;
|
package/esm/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
2
|
import { TreeViewPluginSignature, UseTreeViewItemsSignature } from '@mui/x-tree-view/internals';
|
|
4
|
-
import { TreeViewItemId, TreeViewItemsReorderingAction
|
|
5
|
-
import { TreeItemDragAndDropOverlayProps } from '@mui/x-tree-view/TreeItemDragAndDropOverlay';
|
|
3
|
+
import { TreeViewItemId, TreeViewItemsReorderingAction } from '@mui/x-tree-view/models';
|
|
6
4
|
export interface UseTreeViewItemsReorderingInstance {
|
|
7
5
|
/**
|
|
8
6
|
* Check if a given item can be dragged.
|
|
@@ -51,7 +49,7 @@ export interface UseTreeViewItemsReorderingInstance {
|
|
|
51
49
|
}) => void;
|
|
52
50
|
}
|
|
53
51
|
export interface TreeViewItemReorderPosition {
|
|
54
|
-
parentId:
|
|
52
|
+
parentId: TreeViewItemId | null;
|
|
55
53
|
index: number;
|
|
56
54
|
}
|
|
57
55
|
export type TreeViewItemItemReorderingValidActions = { [key in TreeViewItemsReorderingAction]?: TreeViewItemReorderPosition };
|
|
@@ -63,33 +61,33 @@ export interface UseTreeViewItemsReorderingParameters {
|
|
|
63
61
|
itemsReordering?: boolean;
|
|
64
62
|
/**
|
|
65
63
|
* Determine if a given item can be reordered.
|
|
66
|
-
* @param {
|
|
64
|
+
* @param {TreeViewItemId} itemId The id of the item to check.
|
|
67
65
|
* @returns {boolean} `true` if the item can be reordered.
|
|
68
66
|
* @default () => true
|
|
69
67
|
*/
|
|
70
|
-
isItemReorderable?: (itemId:
|
|
68
|
+
isItemReorderable?: (itemId: TreeViewItemId) => boolean;
|
|
71
69
|
/**
|
|
72
70
|
* Used to determine if a given item can move to some new position.
|
|
73
|
-
* @param {object}
|
|
74
|
-
* @param {
|
|
75
|
-
* @param {TreeViewItemReorderPosition}
|
|
76
|
-
* @param {TreeViewItemReorderPosition}
|
|
71
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
72
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item that is being moved to a new position.
|
|
73
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
74
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
77
75
|
* @returns {boolean} `true` if the item can move to the new position.
|
|
78
76
|
*/
|
|
79
|
-
canMoveItemToNewPosition?: (
|
|
80
|
-
itemId:
|
|
77
|
+
canMoveItemToNewPosition?: (parameters: {
|
|
78
|
+
itemId: TreeViewItemId;
|
|
81
79
|
oldPosition: TreeViewItemReorderPosition;
|
|
82
80
|
newPosition: TreeViewItemReorderPosition;
|
|
83
81
|
}) => boolean;
|
|
84
82
|
/**
|
|
85
83
|
* Callback fired when a Tree Item is moved in the tree.
|
|
86
|
-
* @param {object}
|
|
87
|
-
* @param {
|
|
88
|
-
* @param {TreeViewItemReorderPosition}
|
|
89
|
-
* @param {TreeViewItemReorderPosition}
|
|
84
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
85
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item moved.
|
|
86
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
87
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
90
88
|
*/
|
|
91
|
-
onItemPositionChange?: (
|
|
92
|
-
itemId:
|
|
89
|
+
onItemPositionChange?: (parameters: {
|
|
90
|
+
itemId: TreeViewItemId;
|
|
93
91
|
oldPosition: TreeViewItemReorderPosition;
|
|
94
92
|
newPosition: TreeViewItemReorderPosition;
|
|
95
93
|
}) => void;
|
|
@@ -97,10 +95,10 @@ export interface UseTreeViewItemsReorderingParameters {
|
|
|
97
95
|
export type UseTreeViewItemsReorderingParametersWithDefaults = DefaultizedProps<UseTreeViewItemsReorderingParameters, 'itemsReordering'>;
|
|
98
96
|
export interface UseTreeViewItemsReorderingState {
|
|
99
97
|
itemsReordering: {
|
|
100
|
-
isItemReorderable: (itemId:
|
|
98
|
+
isItemReorderable: (itemId: TreeViewItemId) => boolean;
|
|
101
99
|
currentReorder: {
|
|
102
|
-
draggedItemId:
|
|
103
|
-
targetItemId:
|
|
100
|
+
draggedItemId: TreeViewItemId;
|
|
101
|
+
targetItemId: TreeViewItemId;
|
|
104
102
|
newPosition: TreeViewItemReorderPosition | null;
|
|
105
103
|
action: TreeViewItemsReorderingAction | null;
|
|
106
104
|
} | null;
|
|
@@ -112,20 +110,4 @@ export type UseTreeViewItemsReorderingSignature = TreeViewPluginSignature<{
|
|
|
112
110
|
instance: UseTreeViewItemsReorderingInstance;
|
|
113
111
|
state: UseTreeViewItemsReorderingState;
|
|
114
112
|
dependencies: [UseTreeViewItemsSignature];
|
|
115
|
-
}>;
|
|
116
|
-
export interface UseTreeItemRootSlotPropsFromItemsReordering {
|
|
117
|
-
draggable?: true;
|
|
118
|
-
onDragStart?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
119
|
-
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
120
|
-
onDragEnd?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
121
|
-
}
|
|
122
|
-
export interface UseTreeItemContentSlotPropsFromItemsReordering {
|
|
123
|
-
onDragEnter?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
124
|
-
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
125
|
-
}
|
|
126
|
-
export interface UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering extends TreeItemDragAndDropOverlayProps {}
|
|
127
|
-
declare module '@mui/x-tree-view/useTreeItem' {
|
|
128
|
-
interface UseTreeItemRootSlotOwnProps extends UseTreeItemRootSlotPropsFromItemsReordering {}
|
|
129
|
-
interface UseTreeItemContentSlotOwnProps extends UseTreeItemContentSlotPropsFromItemsReordering {}
|
|
130
|
-
interface UseTreeItemDragAndDropOverlaySlotOwnProps extends UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering {}
|
|
131
|
-
}
|
|
113
|
+
}>;
|
package/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TreeViewCancellableEventHandler } from '@mui/x-tree-view/models';
|
|
3
|
+
import { TreeViewItemPlugin } from '@mui/x-tree-view/internals';
|
|
4
|
+
import { TreeItemDragAndDropOverlayProps } from '@mui/x-tree-view/TreeItemDragAndDropOverlay';
|
|
5
|
+
export declare const isAndroid: () => boolean;
|
|
6
|
+
export declare const useTreeViewItemsReorderingItemPlugin: TreeViewItemPlugin;
|
|
7
|
+
interface UseTreeItemRootSlotPropsFromItemsReordering {
|
|
8
|
+
draggable?: true;
|
|
9
|
+
onDragStart?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
10
|
+
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
11
|
+
onDragEnd?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
12
|
+
}
|
|
13
|
+
interface UseTreeItemContentSlotPropsFromItemsReordering {
|
|
14
|
+
onDragEnter?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
15
|
+
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
16
|
+
}
|
|
17
|
+
interface UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering extends TreeItemDragAndDropOverlayProps {}
|
|
18
|
+
declare module '@mui/x-tree-view/useTreeItem' {
|
|
19
|
+
interface UseTreeItemRootSlotOwnProps extends UseTreeItemRootSlotPropsFromItemsReordering {}
|
|
20
|
+
interface UseTreeItemContentSlotOwnProps extends UseTreeItemContentSlotPropsFromItemsReordering {}
|
|
21
|
+
interface UseTreeItemDragAndDropOverlaySlotOwnProps extends UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering {}
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -11,8 +11,8 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _useIsoLayoutEffect = require("@base-ui-components/utils/useIsoLayoutEffect");
|
|
12
12
|
var _internals = require("@mui/x-tree-view/internals");
|
|
13
13
|
var _useTreeViewItemsReordering = require("./useTreeViewItemsReordering.utils");
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var _itemPlugin = require("./itemPlugin");
|
|
15
|
+
var _useTreeViewItemsReordering2 = require("./useTreeViewItemsReordering.selectors");
|
|
16
16
|
const useTreeViewItemsReordering = ({
|
|
17
17
|
params,
|
|
18
18
|
store
|
|
@@ -28,7 +28,7 @@ const useTreeViewItemsReordering = ({
|
|
|
28
28
|
return true;
|
|
29
29
|
}, [params.itemsReordering, params.isItemReorderable]);
|
|
30
30
|
const getDroppingTargetValidActions = React.useCallback(itemId => {
|
|
31
|
-
const currentReorder =
|
|
31
|
+
const currentReorder = _useTreeViewItemsReordering2.itemsReorderingSelectors.currentReorder(store.state);
|
|
32
32
|
if (!currentReorder) {
|
|
33
33
|
throw new Error('There is no ongoing reordering.');
|
|
34
34
|
}
|
|
@@ -103,7 +103,7 @@ const useTreeViewItemsReordering = ({
|
|
|
103
103
|
}));
|
|
104
104
|
}, [store]);
|
|
105
105
|
const cancelDraggingItem = React.useCallback(() => {
|
|
106
|
-
const currentReorder =
|
|
106
|
+
const currentReorder = _useTreeViewItemsReordering2.itemsReorderingSelectors.currentReorder(store.state);
|
|
107
107
|
if (currentReorder == null) {
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
@@ -112,7 +112,7 @@ const useTreeViewItemsReordering = ({
|
|
|
112
112
|
}));
|
|
113
113
|
}, [store]);
|
|
114
114
|
const completeDraggingItem = React.useCallback(itemId => {
|
|
115
|
-
const currentReorder =
|
|
115
|
+
const currentReorder = _useTreeViewItemsReordering2.itemsReorderingSelectors.currentReorder(store.state);
|
|
116
116
|
if (currentReorder == null || currentReorder.draggedItemId !== itemId) {
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
@@ -196,7 +196,7 @@ const useTreeViewItemsReordering = ({
|
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
198
|
exports.useTreeViewItemsReordering = useTreeViewItemsReordering;
|
|
199
|
-
useTreeViewItemsReordering.itemPlugin =
|
|
199
|
+
useTreeViewItemsReordering.itemPlugin = _itemPlugin.useTreeViewItemsReorderingItemPlugin;
|
|
200
200
|
useTreeViewItemsReordering.applyDefaultValuesToParams = ({
|
|
201
201
|
params
|
|
202
202
|
}) => (0, _extends2.default)({}, params, {
|
package/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.selectors.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { TreeViewState } from '@mui/x-tree-view/internals';
|
|
2
|
+
import { TreeViewItemId } from '@mui/x-tree-view/models';
|
|
2
3
|
import { UseTreeViewItemsReorderingSignature } from "./useTreeViewItemsReordering.types.js";
|
|
3
4
|
export declare const itemsReorderingSelectors: {
|
|
4
5
|
/**
|
|
5
6
|
* Gets the properties of the current reordering.
|
|
6
7
|
*/
|
|
7
8
|
currentReorder: (state: TreeViewState<[UseTreeViewItemsReorderingSignature]>) => {
|
|
8
|
-
draggedItemId:
|
|
9
|
-
targetItemId:
|
|
9
|
+
draggedItemId: TreeViewItemId;
|
|
10
|
+
targetItemId: TreeViewItemId;
|
|
10
11
|
newPosition: import("./useTreeViewItemsReordering.types.js").TreeViewItemReorderPosition | null;
|
|
11
12
|
action: import("@mui/x-tree-view").TreeViewItemsReorderingAction | null;
|
|
12
13
|
} | null;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
2
|
import { TreeViewPluginSignature, UseTreeViewItemsSignature } from '@mui/x-tree-view/internals';
|
|
4
|
-
import { TreeViewItemId, TreeViewItemsReorderingAction
|
|
5
|
-
import { TreeItemDragAndDropOverlayProps } from '@mui/x-tree-view/TreeItemDragAndDropOverlay';
|
|
3
|
+
import { TreeViewItemId, TreeViewItemsReorderingAction } from '@mui/x-tree-view/models';
|
|
6
4
|
export interface UseTreeViewItemsReorderingInstance {
|
|
7
5
|
/**
|
|
8
6
|
* Check if a given item can be dragged.
|
|
@@ -51,7 +49,7 @@ export interface UseTreeViewItemsReorderingInstance {
|
|
|
51
49
|
}) => void;
|
|
52
50
|
}
|
|
53
51
|
export interface TreeViewItemReorderPosition {
|
|
54
|
-
parentId:
|
|
52
|
+
parentId: TreeViewItemId | null;
|
|
55
53
|
index: number;
|
|
56
54
|
}
|
|
57
55
|
export type TreeViewItemItemReorderingValidActions = { [key in TreeViewItemsReorderingAction]?: TreeViewItemReorderPosition };
|
|
@@ -63,33 +61,33 @@ export interface UseTreeViewItemsReorderingParameters {
|
|
|
63
61
|
itemsReordering?: boolean;
|
|
64
62
|
/**
|
|
65
63
|
* Determine if a given item can be reordered.
|
|
66
|
-
* @param {
|
|
64
|
+
* @param {TreeViewItemId} itemId The id of the item to check.
|
|
67
65
|
* @returns {boolean} `true` if the item can be reordered.
|
|
68
66
|
* @default () => true
|
|
69
67
|
*/
|
|
70
|
-
isItemReorderable?: (itemId:
|
|
68
|
+
isItemReorderable?: (itemId: TreeViewItemId) => boolean;
|
|
71
69
|
/**
|
|
72
70
|
* Used to determine if a given item can move to some new position.
|
|
73
|
-
* @param {object}
|
|
74
|
-
* @param {
|
|
75
|
-
* @param {TreeViewItemReorderPosition}
|
|
76
|
-
* @param {TreeViewItemReorderPosition}
|
|
71
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
72
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item that is being moved to a new position.
|
|
73
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
74
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
77
75
|
* @returns {boolean} `true` if the item can move to the new position.
|
|
78
76
|
*/
|
|
79
|
-
canMoveItemToNewPosition?: (
|
|
80
|
-
itemId:
|
|
77
|
+
canMoveItemToNewPosition?: (parameters: {
|
|
78
|
+
itemId: TreeViewItemId;
|
|
81
79
|
oldPosition: TreeViewItemReorderPosition;
|
|
82
80
|
newPosition: TreeViewItemReorderPosition;
|
|
83
81
|
}) => boolean;
|
|
84
82
|
/**
|
|
85
83
|
* Callback fired when a Tree Item is moved in the tree.
|
|
86
|
-
* @param {object}
|
|
87
|
-
* @param {
|
|
88
|
-
* @param {TreeViewItemReorderPosition}
|
|
89
|
-
* @param {TreeViewItemReorderPosition}
|
|
84
|
+
* @param {object} parameters The params describing the item re-ordering.
|
|
85
|
+
* @param {TreeViewItemId} parameters.itemId The id of the item moved.
|
|
86
|
+
* @param {TreeViewItemReorderPosition} parameters.oldPosition The old position of the item.
|
|
87
|
+
* @param {TreeViewItemReorderPosition} parameters.newPosition The new position of the item.
|
|
90
88
|
*/
|
|
91
|
-
onItemPositionChange?: (
|
|
92
|
-
itemId:
|
|
89
|
+
onItemPositionChange?: (parameters: {
|
|
90
|
+
itemId: TreeViewItemId;
|
|
93
91
|
oldPosition: TreeViewItemReorderPosition;
|
|
94
92
|
newPosition: TreeViewItemReorderPosition;
|
|
95
93
|
}) => void;
|
|
@@ -97,10 +95,10 @@ export interface UseTreeViewItemsReorderingParameters {
|
|
|
97
95
|
export type UseTreeViewItemsReorderingParametersWithDefaults = DefaultizedProps<UseTreeViewItemsReorderingParameters, 'itemsReordering'>;
|
|
98
96
|
export interface UseTreeViewItemsReorderingState {
|
|
99
97
|
itemsReordering: {
|
|
100
|
-
isItemReorderable: (itemId:
|
|
98
|
+
isItemReorderable: (itemId: TreeViewItemId) => boolean;
|
|
101
99
|
currentReorder: {
|
|
102
|
-
draggedItemId:
|
|
103
|
-
targetItemId:
|
|
100
|
+
draggedItemId: TreeViewItemId;
|
|
101
|
+
targetItemId: TreeViewItemId;
|
|
104
102
|
newPosition: TreeViewItemReorderPosition | null;
|
|
105
103
|
action: TreeViewItemsReorderingAction | null;
|
|
106
104
|
} | null;
|
|
@@ -112,20 +110,4 @@ export type UseTreeViewItemsReorderingSignature = TreeViewPluginSignature<{
|
|
|
112
110
|
instance: UseTreeViewItemsReorderingInstance;
|
|
113
111
|
state: UseTreeViewItemsReorderingState;
|
|
114
112
|
dependencies: [UseTreeViewItemsSignature];
|
|
115
|
-
}>;
|
|
116
|
-
export interface UseTreeItemRootSlotPropsFromItemsReordering {
|
|
117
|
-
draggable?: true;
|
|
118
|
-
onDragStart?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
119
|
-
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
120
|
-
onDragEnd?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
121
|
-
}
|
|
122
|
-
export interface UseTreeItemContentSlotPropsFromItemsReordering {
|
|
123
|
-
onDragEnter?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
124
|
-
onDragOver?: TreeViewCancellableEventHandler<React.DragEvent>;
|
|
125
|
-
}
|
|
126
|
-
export interface UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering extends TreeItemDragAndDropOverlayProps {}
|
|
127
|
-
declare module '@mui/x-tree-view/useTreeItem' {
|
|
128
|
-
interface UseTreeItemRootSlotOwnProps extends UseTreeItemRootSlotPropsFromItemsReordering {}
|
|
129
|
-
interface UseTreeItemContentSlotOwnProps extends UseTreeItemContentSlotPropsFromItemsReordering {}
|
|
130
|
-
interface UseTreeItemDragAndDropOverlaySlotOwnProps extends UseTreeItemDragAndDropOverlaySlotPropsFromItemsReordering {}
|
|
131
|
-
}
|
|
113
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-tree-view-pro",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.18.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Tree View components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.28.4",
|
|
35
35
|
"@base-ui-components/utils": "0.1.2",
|
|
36
|
-
"@mui/utils": "^7.3.
|
|
36
|
+
"@mui/utils": "^7.3.5",
|
|
37
37
|
"@types/react-transition-group": "^4.4.12",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
39
|
"prop-types": "^15.8.1",
|
|
40
40
|
"react-transition-group": "^4.4.5",
|
|
41
41
|
"reselect": "^5.1.1",
|
|
42
42
|
"use-sync-external-store": "^1.6.0",
|
|
43
|
-
"@mui/x-
|
|
44
|
-
"@mui/x-tree-view": "8.
|
|
45
|
-
"@mui/x-
|
|
43
|
+
"@mui/x-license": "8.18.0",
|
|
44
|
+
"@mui/x-tree-view": "8.18.0",
|
|
45
|
+
"@mui/x-internals": "8.18.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@emotion/react": "^11.9.0",
|
|
File without changes
|
|
File without changes
|