@mui/x-tree-view 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 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` [![pro](https://mui.com/r/x-pro-svg)](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` [![premium](https://mui.com/r/x-premium-svg)](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` [![pro](https://mui.com/r/x-pro-svg)](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` [![pro](https://mui.com/r/x-pro-svg)](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` [![pro](https://mui.com/r/x-pro-svg)](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`, `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)
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 `@mui/x-charts/colorPalettes` and set it on the `colors` property of charts.
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`
@@ -152,9 +152,7 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
152
152
  * For each feature, if the flag is not explicitly set to `true`,
153
153
  * the feature will be fully disabled and any property / method call will not have any effect.
154
154
  */
155
- experimentalFeatures: PropTypes.shape({
156
- labelEditing: PropTypes.bool
157
- }),
155
+ experimentalFeatures: PropTypes.object,
158
156
  /**
159
157
  * Used to determine the id of a given item.
160
158
  *
@@ -186,13 +184,11 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
186
184
  */
187
185
  isItemDisabled: PropTypes.func,
188
186
  /**
189
- * Determines if a given item is editable or not.
190
- * Make sure to also enable the `labelEditing` experimental feature:
191
- * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
192
- * By default, the items are not editable.
187
+ * Determine if a given item can be edited.
193
188
  * @template R
194
189
  * @param {R} item The item to check.
195
- * @returns {boolean} `true` if the item is editable.
190
+ * @returns {boolean} `true` if the item can be edited.
191
+ * @default () => false
196
192
  */
197
193
  isItemEditable: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
198
194
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v8.0.0-alpha.10
2
+ * @mui/x-tree-view v8.0.0-alpha.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { warnOnce } from '@mui/x-internals/warning';
4
3
  import { useTreeViewLabelItemPlugin } from "./useTreeViewLabel.itemPlugin.js";
5
4
  export const useTreeViewLabel = ({
6
5
  store,
@@ -54,19 +53,10 @@ export const useTreeViewLabel = ({
54
53
  };
55
54
  useTreeViewLabel.itemPlugin = useTreeViewLabelItemPlugin;
56
55
  useTreeViewLabel.getDefaultizedParams = ({
57
- params,
58
- experimentalFeatures
59
- }) => {
60
- const canUseFeature = experimentalFeatures?.labelEditing;
61
- if (process.env.NODE_ENV !== 'production') {
62
- if (params.isItemEditable && !canUseFeature) {
63
- warnOnce(['MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the Rich Tree View Pro component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/']);
64
- }
65
- }
66
- return _extends({}, params, {
67
- isItemEditable: canUseFeature ? params.isItemEditable ?? false : false
68
- });
69
- };
56
+ params
57
+ }) => _extends({}, params, {
58
+ isItemEditable: params.isItemEditable ?? false
59
+ });
70
60
  useTreeViewLabel.getInitialState = () => ({
71
61
  label: {
72
62
  editedItemId: null
@@ -27,13 +27,11 @@ export interface UseTreeViewLabelParameters<R extends {}> {
27
27
  */
28
28
  onItemLabelChange?: (itemId: TreeViewItemId, newLabel: string) => void;
29
29
  /**
30
- * Determines if a given item is editable or not.
31
- * Make sure to also enable the `labelEditing` experimental feature:
32
- * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
33
- * By default, the items are not editable.
30
+ * Determine if a given item can be edited.
34
31
  * @template R
35
32
  * @param {R} item The item to check.
36
- * @returns {boolean} `true` if the item is editable.
33
+ * @returns {boolean} `true` if the item can be edited.
34
+ * @default () => false
37
35
  */
38
36
  isItemEditable?: boolean | ((item: R) => boolean);
39
37
  }
@@ -53,7 +51,6 @@ export type UseTreeViewLabelSignature = TreeViewPluginSignature<{
53
51
  instance: UseTreeViewLabelInstance;
54
52
  state: UseTreeViewLabelState;
55
53
  contextValue: UseTreeViewLabelContextValue;
56
- experimentalFeatures: 'labelEditing';
57
54
  dependencies: [UseTreeViewItemsSignature];
58
55
  }>;
59
56
  export interface UseTreeItemLabelInputSlotPropsFromLabelEditing extends TreeItemLabelInputProps {
@@ -152,9 +152,7 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
152
152
  * For each feature, if the flag is not explicitly set to `true`,
153
153
  * the feature will be fully disabled and any property / method call will not have any effect.
154
154
  */
155
- experimentalFeatures: PropTypes.shape({
156
- labelEditing: PropTypes.bool
157
- }),
155
+ experimentalFeatures: PropTypes.object,
158
156
  /**
159
157
  * Used to determine the id of a given item.
160
158
  *
@@ -186,13 +184,11 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
186
184
  */
187
185
  isItemDisabled: PropTypes.func,
188
186
  /**
189
- * Determines if a given item is editable or not.
190
- * Make sure to also enable the `labelEditing` experimental feature:
191
- * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
192
- * By default, the items are not editable.
187
+ * Determine if a given item can be edited.
193
188
  * @template R
194
189
  * @param {R} item The item to check.
195
- * @returns {boolean} `true` if the item is editable.
190
+ * @returns {boolean} `true` if the item can be edited.
191
+ * @default () => false
196
192
  */
197
193
  isItemEditable: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
198
194
  /**
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v8.0.0-alpha.10
2
+ * @mui/x-tree-view v8.0.0-alpha.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { warnOnce } from '@mui/x-internals/warning';
4
3
  import { useTreeViewLabelItemPlugin } from "./useTreeViewLabel.itemPlugin.js";
5
4
  export const useTreeViewLabel = ({
6
5
  store,
@@ -54,19 +53,10 @@ export const useTreeViewLabel = ({
54
53
  };
55
54
  useTreeViewLabel.itemPlugin = useTreeViewLabelItemPlugin;
56
55
  useTreeViewLabel.getDefaultizedParams = ({
57
- params,
58
- experimentalFeatures
59
- }) => {
60
- const canUseFeature = experimentalFeatures?.labelEditing;
61
- if (process.env.NODE_ENV !== 'production') {
62
- if (params.isItemEditable && !canUseFeature) {
63
- warnOnce(['MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the Rich Tree View Pro component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/']);
64
- }
65
- }
66
- return _extends({}, params, {
67
- isItemEditable: canUseFeature ? params.isItemEditable ?? false : false
68
- });
69
- };
56
+ params
57
+ }) => _extends({}, params, {
58
+ isItemEditable: params.isItemEditable ?? false
59
+ });
70
60
  useTreeViewLabel.getInitialState = () => ({
71
61
  label: {
72
62
  editedItemId: null
@@ -159,9 +159,7 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
159
159
  * For each feature, if the flag is not explicitly set to `true`,
160
160
  * the feature will be fully disabled and any property / method call will not have any effect.
161
161
  */
162
- experimentalFeatures: _propTypes.default.shape({
163
- labelEditing: _propTypes.default.bool
164
- }),
162
+ experimentalFeatures: _propTypes.default.object,
165
163
  /**
166
164
  * Used to determine the id of a given item.
167
165
  *
@@ -193,13 +191,11 @@ process.env.NODE_ENV !== "production" ? RichTreeView.propTypes = {
193
191
  */
194
192
  isItemDisabled: _propTypes.default.func,
195
193
  /**
196
- * Determines if a given item is editable or not.
197
- * Make sure to also enable the `labelEditing` experimental feature:
198
- * `<RichTreeViewPro experimentalFeatures={{ labelEditing: true }} />`.
199
- * By default, the items are not editable.
194
+ * Determine if a given item can be edited.
200
195
  * @template R
201
196
  * @param {R} item The item to check.
202
- * @returns {boolean} `true` if the item is editable.
197
+ * @returns {boolean} `true` if the item can be edited.
198
+ * @default () => false
203
199
  */
204
200
  isItemEditable: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
205
201
  /**
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v8.0.0-alpha.10
2
+ * @mui/x-tree-view v8.0.0-alpha.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.useTreeViewLabel = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
- var _warning = require("@mui/x-internals/warning");
12
11
  var _useTreeViewLabel = require("./useTreeViewLabel.itemPlugin");
13
12
  const useTreeViewLabel = ({
14
13
  store,
@@ -63,19 +62,10 @@ const useTreeViewLabel = ({
63
62
  exports.useTreeViewLabel = useTreeViewLabel;
64
63
  useTreeViewLabel.itemPlugin = _useTreeViewLabel.useTreeViewLabelItemPlugin;
65
64
  useTreeViewLabel.getDefaultizedParams = ({
66
- params,
67
- experimentalFeatures
68
- }) => {
69
- const canUseFeature = experimentalFeatures?.labelEditing;
70
- if (process.env.NODE_ENV !== 'production') {
71
- if (params.isItemEditable && !canUseFeature) {
72
- (0, _warning.warnOnce)(['MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.', 'You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the Rich Tree View Pro component.', 'Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/']);
73
- }
74
- }
75
- return (0, _extends2.default)({}, params, {
76
- isItemEditable: canUseFeature ? params.isItemEditable ?? false : false
77
- });
78
- };
65
+ params
66
+ }) => (0, _extends2.default)({}, params, {
67
+ isItemEditable: params.isItemEditable ?? false
68
+ });
79
69
  useTreeViewLabel.getInitialState = () => ({
80
70
  label: {
81
71
  editedItemId: null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view",
3
- "version": "8.0.0-alpha.10",
3
+ "version": "8.0.0-alpha.11",
4
4
  "description": "The community edition of the Tree View components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -41,7 +41,7 @@
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.10"
44
+ "@mui/x-internals": "8.0.0-alpha.11"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@emotion/react": "^11.9.0",