@mui/x-tree-view-pro 8.0.0-alpha.10 → 8.0.0-alpha.11
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 +107 -2
- package/RichTreeViewPro/RichTreeViewPro.js +5 -12
- package/index.js +1 -1
- package/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +4 -14
- package/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.types.d.ts +1 -4
- package/internals/utils/releaseInfo.js +1 -1
- package/modern/RichTreeViewPro/RichTreeViewPro.js +5 -12
- package/modern/index.js +1 -1
- package/modern/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +4 -14
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/RichTreeViewPro/RichTreeViewPro.js +5 -12
- package/node/index.js +1 -1
- package/node/internals/plugins/useTreeViewItemsReordering/useTreeViewItemsReordering.js +4 -14
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,110 @@
|
|
|
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.0.0-alpha.11**
|
|
9
|
+
|
|
10
|
+
_Feb 7, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- ⚡ Mount and resize performance improvements for the Data Grid
|
|
15
|
+
|
|
16
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
17
|
+
@lauri865.
|
|
18
|
+
Following are all team members who have contributed to this release:
|
|
19
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @Janpot, @KenanYusuf, @LukasTy, @MBilalShafi, @noraleonte, @romgrk.
|
|
20
|
+
|
|
21
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### Breaking changes
|
|
26
|
+
|
|
27
|
+
- `createUseGridApiEventHandler()` is not exported anymore.
|
|
28
|
+
- The `filteredRowsLookup` object of the filter state does not contain `true` values anymore. If the row is filtered out, the value is `false`. Otherwise, the row id is not present in the object.
|
|
29
|
+
This change only impacts you if you relied on `filteredRowsLookup` to get ids of filtered rows. In this case,use `gridDataRowIdsSelector` selector to get row ids and check `filteredRowsLookup` for `false` values:
|
|
30
|
+
|
|
31
|
+
```diff
|
|
32
|
+
const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);
|
|
33
|
+
-const filteredRowIds = Object.keys(filteredRowsLookup).filter((rowId) => filteredRowsLookup[rowId] === true);
|
|
34
|
+
+const rowIds = gridDataRowIdsSelector(apiRef);
|
|
35
|
+
+const filteredRowIds = rowIds.filter((rowId) => filteredRowsLookup[rowId] !== false);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- The `visibleRowsLookup` state does not contain `true` values anymore. If the row is not visible, the value is `false`. Otherwise, the row id is not present in the object:
|
|
39
|
+
|
|
40
|
+
```diff
|
|
41
|
+
const visibleRowsLookup = gridVisibleRowsLookupSelector(apiRef);
|
|
42
|
+
-const isRowVisible = visibleRowsLookup[rowId] === true;
|
|
43
|
+
+const isRowVisible = visibleRowsLookup[rowId] !== false;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-data-grid@8.0.0-alpha.11`
|
|
47
|
+
|
|
48
|
+
- [DataGrid] Avoid `<GridRoot />` double-render pass on mount in SPA mode (#15648) @lauri865
|
|
49
|
+
- [DataGrid] Fix loading overlay not in sync with scroll (#16437) @MBilalShafi
|
|
50
|
+
- [DataGrid] Refactor: remove material `MenuList` import (#16444) @romgrk
|
|
51
|
+
- [DataGrid] Refactor: simplify `useGridApiEventHandler()` (#16479) @romgrk
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
54
|
+
|
|
55
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.11`, plus:
|
|
56
|
+
|
|
57
|
+
- [DataGridPro] Fix the return type of `useGridApiContext()` for Pro and Premium packages on React < 19 (#16441) @arminmeh
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.11` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
60
|
+
|
|
61
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.11`, plus:
|
|
62
|
+
|
|
63
|
+
- [DataGridPremium] Fix "no rows" overlay not showing with active aggregation (#16466) @KenanYusuf
|
|
64
|
+
|
|
65
|
+
### Date and Time Pickers
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.11`
|
|
68
|
+
|
|
69
|
+
Internal changes.
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.11`, plus:
|
|
74
|
+
|
|
75
|
+
- [DateRangeCalendar] Support arrow navigation with multiple months rendered (#16363) @flaviendelangle
|
|
76
|
+
- [DateRangePicker] Fix `currentMonthCalendarPosition` prop behavior on mobile (#16455) @LukasTy
|
|
77
|
+
- [DateRangePicker] Fix vertical alignment for multi input fields (#16489) @noraleonte
|
|
78
|
+
|
|
79
|
+
### Charts
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-charts@8.0.0-alpha.11`
|
|
82
|
+
|
|
83
|
+
- [charts] Add `color` prop to `Sparkline` and deprecate `colors` (#16477) @bernardobelchior
|
|
84
|
+
- [charts] Make typescript more flexible about plugins and their params (#16478) @alexfauquette
|
|
85
|
+
- [charts] Remove component for axis event listener (#16314) @alexfauquette
|
|
86
|
+
|
|
87
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
88
|
+
|
|
89
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.11`.
|
|
90
|
+
|
|
91
|
+
### Tree View
|
|
92
|
+
|
|
93
|
+
#### `@mui/x-tree-view@8.0.0-alpha.11`
|
|
94
|
+
|
|
95
|
+
Internal changes.
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.11` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.11`.
|
|
100
|
+
|
|
101
|
+
### Docs
|
|
102
|
+
|
|
103
|
+
- [docs] Update charts colors default value (#16484) @bernardobelchior
|
|
104
|
+
|
|
105
|
+
### Core
|
|
106
|
+
|
|
107
|
+
- [core] Fix corepack and pnpm installation in CircleCI (#16434) @flaviendelangle
|
|
108
|
+
- [code-infra] Update monorepo (#16112) @Janpot
|
|
109
|
+
- [test] Avoid test warning when running on React 18 (#16486) @LukasTy
|
|
110
|
+
- [test] Disable `react-transition-group` transitions in unit testing (#16288) @lauri865
|
|
111
|
+
|
|
8
112
|
## 8.0.0-alpha.10
|
|
9
113
|
|
|
10
114
|
_Jan 30, 2025_
|
|
@@ -50,6 +154,7 @@ Following are all team members who have contributed to this release:
|
|
|
50
154
|
+ },
|
|
51
155
|
});
|
|
52
156
|
```
|
|
157
|
+
|
|
53
158
|
- The `detailPanels`, `pinnedColumns`, and `pinnedRowsRenderZone` classes have been removed.
|
|
54
159
|
- Return type of the `useGridApiRef()` hook and the type of `apiRef` prop are updated to explicitly include the possibilty of `null`. In addition to this, `useGridApiRef()` returns a reference that is initialized with `null` instead of `{}`.
|
|
55
160
|
|
|
@@ -91,7 +196,7 @@ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.10`.
|
|
|
91
196
|
|
|
92
197
|
#### Breaking changes
|
|
93
198
|
|
|
94
|
-
- The component passed to the `field` slot no longer receives the `ref`,
|
|
199
|
+
- The component passed to the `field` slot no longer receives the `ref`, `disabled`, `className`, `sx`, `label`, `name`, `formatDensity`, `enableAccessibleFieldDOMStructure`, `selectedSections`, `onSelectedSectionsChange` and `inputRef` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-field)
|
|
95
200
|
- The `MuiPickersPopper` theme entry have been renamed `MuiPickerPopper` and some of its props have been removed — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#muipickerspopper)
|
|
96
201
|
|
|
97
202
|
#### `@mui/x-date-pickers@8.0.0-alpha.10`
|
|
@@ -111,7 +216,7 @@ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.10`.
|
|
|
111
216
|
|
|
112
217
|
- Replace `legend.position.horizontal` from `"left" | "middle" | "right"` to `"start" | "center" | "end"`.
|
|
113
218
|
This is to align with the CSS values and reflect the RTL ability of the legend component.
|
|
114
|
-
- The default colors have changed. To keep using the old palette. It is possible to import `blueberryTwilightPalette` from
|
|
219
|
+
- The default colors have changed. To keep using the old palette. It is possible to import `blueberryTwilightPalette` from `@mui/x-charts/colorPalettes` and set it on the `colors` property of charts.
|
|
115
220
|
- The `id` property is now optional on the `Pie` and `Scatter` data types.
|
|
116
221
|
|
|
117
222
|
#### `@mui/x-charts@8.0.0-alpha.10`
|
|
@@ -167,10 +167,7 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
167
167
|
* For each feature, if the flag is not explicitly set to `true`,
|
|
168
168
|
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
169
169
|
*/
|
|
170
|
-
experimentalFeatures: PropTypes.
|
|
171
|
-
itemsReordering: PropTypes.bool,
|
|
172
|
-
labelEditing: PropTypes.bool
|
|
173
|
-
}),
|
|
170
|
+
experimentalFeatures: PropTypes.object,
|
|
174
171
|
/**
|
|
175
172
|
* Used to determine the id of a given item.
|
|
176
173
|
*
|
|
@@ -202,17 +199,15 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
202
199
|
*/
|
|
203
200
|
isItemDisabled: PropTypes.func,
|
|
204
201
|
/**
|
|
205
|
-
*
|
|
206
|
-
* Make sure to also enable the `labelEditing` experimental feature:
|
|
207
|
-
* `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
|
|
208
|
-
* By default, the items are not editable.
|
|
202
|
+
* Determine if a given item can be edited.
|
|
209
203
|
* @template R
|
|
210
204
|
* @param {R} item The item to check.
|
|
211
|
-
* @returns {boolean} `true` if the item
|
|
205
|
+
* @returns {boolean} `true` if the item can be edited.
|
|
206
|
+
* @default () => false
|
|
212
207
|
*/
|
|
213
208
|
isItemEditable: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
214
209
|
/**
|
|
215
|
-
*
|
|
210
|
+
* Determine if a given item can be reordered.
|
|
216
211
|
* @param {string} itemId The id of the item to check.
|
|
217
212
|
* @returns {boolean} `true` if the item can be reordered.
|
|
218
213
|
* @default () => true
|
|
@@ -227,8 +222,6 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
227
222
|
items: PropTypes.array.isRequired,
|
|
228
223
|
/**
|
|
229
224
|
* If `true`, the reordering of items is enabled.
|
|
230
|
-
* Make sure to also enable the `itemsReordering` experimental feature:
|
|
231
|
-
* `<RichTreeViewPro experimentalFeatures={{ itemsReordering: true }} itemsReordering />`.
|
|
232
225
|
* @default false
|
|
233
226
|
*/
|
|
234
227
|
itemsReordering: PropTypes.bool,
|
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { selectorItemIndex, selectorItemMeta, selectorItemOrderedChildrenIds } from '@mui/x-tree-view/internals';
|
|
4
|
-
import { warnOnce } from '@mui/x-internals/warning';
|
|
5
4
|
import { chooseActionToApply, isAncestor, moveItemInTree } from "./useTreeViewItemsReordering.utils.js";
|
|
6
5
|
import { useTreeViewItemsReorderingItemPlugin } from "./useTreeViewItemsReordering.itemPlugin.js";
|
|
7
6
|
import { selectorItemsReordering } from "./useTreeViewItemsReordering.selectors.js";
|
|
@@ -176,19 +175,10 @@ export const useTreeViewItemsReordering = ({
|
|
|
176
175
|
};
|
|
177
176
|
useTreeViewItemsReordering.itemPlugin = useTreeViewItemsReorderingItemPlugin;
|
|
178
177
|
useTreeViewItemsReordering.getDefaultizedParams = ({
|
|
179
|
-
params
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
184
|
-
if (params.itemsReordering && !canUseFeature) {
|
|
185
|
-
warnOnce(['MUI X: The items reordering feature requires the `itemsReordering` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ itemsReordering: true }}` to the `<RichTreeViewPro />`component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/']);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return _extends({}, params, {
|
|
189
|
-
itemsReordering: canUseFeature ? params.itemsReordering ?? false : false
|
|
190
|
-
});
|
|
191
|
-
};
|
|
178
|
+
params
|
|
179
|
+
}) => _extends({}, params, {
|
|
180
|
+
itemsReordering: params.itemsReordering ?? false
|
|
181
|
+
});
|
|
192
182
|
useTreeViewItemsReordering.getInitialState = () => ({
|
|
193
183
|
itemsReordering: null
|
|
194
184
|
});
|
|
@@ -56,13 +56,11 @@ export type TreeViewItemItemReorderingValidActions = {
|
|
|
56
56
|
export interface UseTreeViewItemsReorderingParameters {
|
|
57
57
|
/**
|
|
58
58
|
* If `true`, the reordering of items is enabled.
|
|
59
|
-
* Make sure to also enable the `itemsReordering` experimental feature:
|
|
60
|
-
* `<RichTreeViewPro experimentalFeatures={{ itemsReordering: true }} itemsReordering />`.
|
|
61
59
|
* @default false
|
|
62
60
|
*/
|
|
63
61
|
itemsReordering?: boolean;
|
|
64
62
|
/**
|
|
65
|
-
*
|
|
63
|
+
* Determine if a given item can be reordered.
|
|
66
64
|
* @param {string} itemId The id of the item to check.
|
|
67
65
|
* @returns {boolean} `true` if the item can be reordered.
|
|
68
66
|
* @default () => true
|
|
@@ -115,7 +113,6 @@ export type UseTreeViewItemsReorderingSignature = TreeViewPluginSignature<{
|
|
|
115
113
|
instance: UseTreeViewItemsReorderingInstance;
|
|
116
114
|
state: UseTreeViewItemsReorderingState;
|
|
117
115
|
contextValue: UseTreeViewItemsReorderingContextValue;
|
|
118
|
-
experimentalFeatures: 'itemsReordering';
|
|
119
116
|
dependencies: [UseTreeViewItemsSignature];
|
|
120
117
|
}>;
|
|
121
118
|
export interface UseTreeItemRootSlotPropsFromItemsReordering {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ponyfillGlobal from '@mui/utils/ponyfillGlobal';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczODg4MjgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -167,10 +167,7 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
167
167
|
* For each feature, if the flag is not explicitly set to `true`,
|
|
168
168
|
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
169
169
|
*/
|
|
170
|
-
experimentalFeatures: PropTypes.
|
|
171
|
-
itemsReordering: PropTypes.bool,
|
|
172
|
-
labelEditing: PropTypes.bool
|
|
173
|
-
}),
|
|
170
|
+
experimentalFeatures: PropTypes.object,
|
|
174
171
|
/**
|
|
175
172
|
* Used to determine the id of a given item.
|
|
176
173
|
*
|
|
@@ -202,17 +199,15 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
202
199
|
*/
|
|
203
200
|
isItemDisabled: PropTypes.func,
|
|
204
201
|
/**
|
|
205
|
-
*
|
|
206
|
-
* Make sure to also enable the `labelEditing` experimental feature:
|
|
207
|
-
* `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
|
|
208
|
-
* By default, the items are not editable.
|
|
202
|
+
* Determine if a given item can be edited.
|
|
209
203
|
* @template R
|
|
210
204
|
* @param {R} item The item to check.
|
|
211
|
-
* @returns {boolean} `true` if the item
|
|
205
|
+
* @returns {boolean} `true` if the item can be edited.
|
|
206
|
+
* @default () => false
|
|
212
207
|
*/
|
|
213
208
|
isItemEditable: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
214
209
|
/**
|
|
215
|
-
*
|
|
210
|
+
* Determine if a given item can be reordered.
|
|
216
211
|
* @param {string} itemId The id of the item to check.
|
|
217
212
|
* @returns {boolean} `true` if the item can be reordered.
|
|
218
213
|
* @default () => true
|
|
@@ -227,8 +222,6 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
227
222
|
items: PropTypes.array.isRequired,
|
|
228
223
|
/**
|
|
229
224
|
* If `true`, the reordering of items is enabled.
|
|
230
|
-
* Make sure to also enable the `itemsReordering` experimental feature:
|
|
231
|
-
* `<RichTreeViewPro experimentalFeatures={{ itemsReordering: true }} itemsReordering />`.
|
|
232
225
|
* @default false
|
|
233
226
|
*/
|
|
234
227
|
itemsReordering: PropTypes.bool,
|
package/modern/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { selectorItemIndex, selectorItemMeta, selectorItemOrderedChildrenIds } from '@mui/x-tree-view/internals';
|
|
4
|
-
import { warnOnce } from '@mui/x-internals/warning';
|
|
5
4
|
import { chooseActionToApply, isAncestor, moveItemInTree } from "./useTreeViewItemsReordering.utils.js";
|
|
6
5
|
import { useTreeViewItemsReorderingItemPlugin } from "./useTreeViewItemsReordering.itemPlugin.js";
|
|
7
6
|
import { selectorItemsReordering } from "./useTreeViewItemsReordering.selectors.js";
|
|
@@ -176,19 +175,10 @@ export const useTreeViewItemsReordering = ({
|
|
|
176
175
|
};
|
|
177
176
|
useTreeViewItemsReordering.itemPlugin = useTreeViewItemsReorderingItemPlugin;
|
|
178
177
|
useTreeViewItemsReordering.getDefaultizedParams = ({
|
|
179
|
-
params
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
184
|
-
if (params.itemsReordering && !canUseFeature) {
|
|
185
|
-
warnOnce(['MUI X: The items reordering feature requires the `itemsReordering` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ itemsReordering: true }}` to the `<RichTreeViewPro />`component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/']);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return _extends({}, params, {
|
|
189
|
-
itemsReordering: canUseFeature ? params.itemsReordering ?? false : false
|
|
190
|
-
});
|
|
191
|
-
};
|
|
178
|
+
params
|
|
179
|
+
}) => _extends({}, params, {
|
|
180
|
+
itemsReordering: params.itemsReordering ?? false
|
|
181
|
+
});
|
|
192
182
|
useTreeViewItemsReordering.getInitialState = () => ({
|
|
193
183
|
itemsReordering: null
|
|
194
184
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ponyfillGlobal from '@mui/utils/ponyfillGlobal';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczODg4MjgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -174,10 +174,7 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
174
174
|
* For each feature, if the flag is not explicitly set to `true`,
|
|
175
175
|
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
176
176
|
*/
|
|
177
|
-
experimentalFeatures: _propTypes.default.
|
|
178
|
-
itemsReordering: _propTypes.default.bool,
|
|
179
|
-
labelEditing: _propTypes.default.bool
|
|
180
|
-
}),
|
|
177
|
+
experimentalFeatures: _propTypes.default.object,
|
|
181
178
|
/**
|
|
182
179
|
* Used to determine the id of a given item.
|
|
183
180
|
*
|
|
@@ -209,17 +206,15 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
209
206
|
*/
|
|
210
207
|
isItemDisabled: _propTypes.default.func,
|
|
211
208
|
/**
|
|
212
|
-
*
|
|
213
|
-
* Make sure to also enable the `labelEditing` experimental feature:
|
|
214
|
-
* `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
|
|
215
|
-
* By default, the items are not editable.
|
|
209
|
+
* Determine if a given item can be edited.
|
|
216
210
|
* @template R
|
|
217
211
|
* @param {R} item The item to check.
|
|
218
|
-
* @returns {boolean} `true` if the item
|
|
212
|
+
* @returns {boolean} `true` if the item can be edited.
|
|
213
|
+
* @default () => false
|
|
219
214
|
*/
|
|
220
215
|
isItemEditable: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
|
|
221
216
|
/**
|
|
222
|
-
*
|
|
217
|
+
* Determine if a given item can be reordered.
|
|
223
218
|
* @param {string} itemId The id of the item to check.
|
|
224
219
|
* @returns {boolean} `true` if the item can be reordered.
|
|
225
220
|
* @default () => true
|
|
@@ -234,8 +229,6 @@ process.env.NODE_ENV !== "production" ? RichTreeViewPro.propTypes = {
|
|
|
234
229
|
items: _propTypes.default.array.isRequired,
|
|
235
230
|
/**
|
|
236
231
|
* If `true`, the reordering of items is enabled.
|
|
237
|
-
* Make sure to also enable the `itemsReordering` experimental feature:
|
|
238
|
-
* `<RichTreeViewPro experimentalFeatures={{ itemsReordering: true }} itemsReordering />`.
|
|
239
232
|
* @default false
|
|
240
233
|
*/
|
|
241
234
|
itemsReordering: _propTypes.default.bool,
|
package/node/index.js
CHANGED
|
@@ -9,7 +9,6 @@ exports.useTreeViewItemsReordering = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _internals = require("@mui/x-tree-view/internals");
|
|
12
|
-
var _warning = require("@mui/x-internals/warning");
|
|
13
12
|
var _useTreeViewItemsReordering = require("./useTreeViewItemsReordering.utils");
|
|
14
13
|
var _useTreeViewItemsReordering2 = require("./useTreeViewItemsReordering.itemPlugin");
|
|
15
14
|
var _useTreeViewItemsReordering3 = require("./useTreeViewItemsReordering.selectors");
|
|
@@ -185,19 +184,10 @@ const useTreeViewItemsReordering = ({
|
|
|
185
184
|
exports.useTreeViewItemsReordering = useTreeViewItemsReordering;
|
|
186
185
|
useTreeViewItemsReordering.itemPlugin = _useTreeViewItemsReordering2.useTreeViewItemsReorderingItemPlugin;
|
|
187
186
|
useTreeViewItemsReordering.getDefaultizedParams = ({
|
|
188
|
-
params
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
193
|
-
if (params.itemsReordering && !canUseFeature) {
|
|
194
|
-
(0, _warning.warnOnce)(['MUI X: The items reordering feature requires the `itemsReordering` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ itemsReordering: true }}` to the `<RichTreeViewPro />`component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/']);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return (0, _extends2.default)({}, params, {
|
|
198
|
-
itemsReordering: canUseFeature ? params.itemsReordering ?? false : false
|
|
199
|
-
});
|
|
200
|
-
};
|
|
187
|
+
params
|
|
188
|
+
}) => (0, _extends2.default)({}, params, {
|
|
189
|
+
itemsReordering: params.itemsReordering ?? false
|
|
190
|
+
});
|
|
201
191
|
useTreeViewItemsReordering.getInitialState = () => ({
|
|
202
192
|
itemsReordering: null
|
|
203
193
|
});
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getReleaseInfo = void 0;
|
|
8
8
|
var _ponyfillGlobal = _interopRequireDefault(require("@mui/utils/ponyfillGlobal"));
|
|
9
9
|
const getReleaseInfo = () => {
|
|
10
|
-
const releaseInfo = "
|
|
10
|
+
const releaseInfo = "MTczODg4MjgwMDAwMA==";
|
|
11
11
|
if (process.env.NODE_ENV !== 'production') {
|
|
12
12
|
// A simple hack to set the value in the test environment (has no build step).
|
|
13
13
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-tree-view-pro",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.11",
|
|
4
4
|
"description": "The Pro plan edition of the Tree View components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"react-transition-group": "^4.4.5",
|
|
42
42
|
"reselect": "^5.1.1",
|
|
43
43
|
"use-sync-external-store": "^1.4.0",
|
|
44
|
-
"@mui/x-internals": "8.0.0-alpha.
|
|
45
|
-
"@mui/x-
|
|
46
|
-
"@mui/x-
|
|
44
|
+
"@mui/x-internals": "8.0.0-alpha.11",
|
|
45
|
+
"@mui/x-license": "8.0.0-alpha.11",
|
|
46
|
+
"@mui/x-tree-view": "8.0.0-alpha.11"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|