@mui/x-tree-view 7.2.0 → 7.3.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 CHANGED
@@ -3,6 +3,81 @@
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
+ ## 7.3.0
7
+
8
+ _Apr 18, 2024_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 📄 Support [unknown and estimated row count in server-side pagination](https://mui.com/x/react-data-grid/pagination/#index-based-pagination) (#12490) @MBilalShafi
13
+ - 🎨 Support color scales in Charts (#12490) @alexfauquette
14
+ Add a [`colorMap` configuration](https://mui.com/x/react-charts/styling/#values-color) to an axis, and the chart will use it to select colors.
15
+ Each impacted chart ([bar charts](https://mui.com/x/react-charts/bars/#color-scale), [line charts](https://mui.com/x/react-charts/lines/#color-scale), [scatter charts](https://mui.com/x/react-charts/scatter/#color-scale)) has a dedicated section explaining how this color map is impacting it.
16
+
17
+ <img src="https://github.com/mui/mui-x/assets/45398769/f0066606-3486-4c4e-b3be-7fdd56d763c3" alt="scatter chart with gradient along y-axis" />
18
+
19
+ - 🌍 Improve Danish (da-DK) locale on the Data Grid
20
+ - 🐞 Bugfixes
21
+ - 📚 Documentation improvements
22
+
23
+ ### Data Grid
24
+
25
+ #### `@mui/x-data-grid@7.3.0`
26
+
27
+ - [DataGrid] Fix calling `onCellEditStop` on error (#12747) @sai6855
28
+ - [DataGrid] Fix column resize (#12792) @romgrk
29
+ - [DataGrid] Fix column separators (#12808) @romgrk
30
+ - [DataGrid] Limit panel width to not exceed screen width (#12799) @cherniavskii
31
+ - [DataGrid] Support advanced server-side pagination use cases (#12474) @MBilalShafi
32
+ - [DataGrid] Support state export and restore on grid density (#12671) @MBilalShafi
33
+ - [l10n] Improve Danish (da-DK) locale (#12784) @EmilBahnsen
34
+
35
+ #### `@mui/x-data-grid-pro@7.3.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
36
+
37
+ Same changes as in `@mui/x-data-grid@7.3.0`, plus:
38
+
39
+ - [DataGridPro] Implement header filter height (#12666) @romgrk
40
+
41
+ #### `@mui/x-data-grid-premium@7.3.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
42
+
43
+ Same changes as in `@mui/x-data-grid-pro@7.3.0`.
44
+
45
+ ### Charts
46
+
47
+ #### Breaking change
48
+
49
+ A typo fix:
50
+
51
+ ```diff
52
+ - ContinuouseScaleName
53
+ + ContinuousScaleName
54
+ ```
55
+
56
+ #### `@mui/x-charts@7.3.0`
57
+
58
+ - [charts] Add `dataIndex` to series `valueFormatter` (#12745) @JCQuintas
59
+ - [charts] Add color scale (#12490) @alexfauquette
60
+ - [charts] Do not document the usage of `DEFAULT_X_AXIS_KEY` and `DEFAULT_Y_AXIS_KEY` (#12780) @alexfauquette
61
+ - [charts] Export more utils (#12744) @alexfauquette
62
+ - [charts] Fix passing slot props down to `PieArcLabel` (#12806) @JCQuintas
63
+
64
+ ### Tree View
65
+
66
+ #### `@mui/x-tree-view@7.3.0`
67
+
68
+ - [TreeView] Support `defaultMuiPrevented` on the `onFocus` prop of the root slot (#12813) @flaviendelangle
69
+
70
+ ### Docs
71
+
72
+ - [docs] Add grid cell display example to the migration guide (#12793) @romgrk
73
+ - [docs] Use charts classes objects (#12781) @alexfauquette
74
+ - [docs] Fix layout shift on demos (#12816) @zanivan
75
+ - [test] Increase timeout for test that sometimes fail on `DateTimeRangePicker` (#12786) @LukasTy
76
+
77
+ ### Core
78
+
79
+ - [docs-infra] Prepare infra to document charts interfaces (#12653) @alexfauquette
80
+
6
81
  ## 7.2.0
7
82
 
8
83
  _Apr 12, 2024_
@@ -3058,6 +3133,56 @@ Here is an example of the renaming for the `<ChartsTooltip />` component.
3058
3133
  - [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
3059
3134
  - [license] Correctly throw errors (#10924) @oliviertassinari
3060
3135
 
3136
+ ## 6.19.11
3137
+
3138
+ _Apr 18, 2024_
3139
+
3140
+ We'd like to offer a big thanks to the 1 contributor who made this release possible. Here are some highlights ✨:
3141
+
3142
+ - 🐞 Bugfixes
3143
+
3144
+ ### Data Grid
3145
+
3146
+ #### `@mui/x-data-grid@6.19.11`
3147
+
3148
+ - [DataGrid] Fix virtualization memory leak (#12812) @romgrk
3149
+
3150
+ #### `@mui/x-data-grid-pro@6.19.11` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
3151
+
3152
+ Same changes as in `@mui/x-data-grid@6.19.11`.
3153
+
3154
+ #### `@mui/x-data-grid-premium@6.19.11` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
3155
+
3156
+ Same changes as in `@mui/x-data-grid-pro@6.19.11`.
3157
+
3158
+ ## 6.19.10
3159
+
3160
+ _Apr 12, 2024_
3161
+
3162
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
3163
+
3164
+ - 🐞 Bugfixes
3165
+ - 📚 Documentation improvements
3166
+
3167
+ ### Data Grid
3168
+
3169
+ #### `@mui/x-data-grid@6.19.10`
3170
+
3171
+ - [DataGrid] Do not escape double quotes when copying to clipboard (#12734) @cherniavskii
3172
+ - [DataGrid] Fix bug in suspense (#12754) @cherniavskii
3173
+
3174
+ #### `@mui/x-data-grid-pro@6.19.10` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
3175
+
3176
+ Same changes as in `@mui/x-data-grid@6.19.10`.
3177
+
3178
+ #### `@mui/x-data-grid-premium@6.19.10` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
3179
+
3180
+ Same changes as in `@mui/x-data-grid-pro@6.19.10`.
3181
+
3182
+ ### Core
3183
+
3184
+ - [core] Update the docs release source branch (#12685) @LukasTy
3185
+
3061
3186
  ## 6.19.9
3062
3187
 
3063
3188
  _Apr 5, 2024_
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.2.0
2
+ * @mui/x-tree-view v7.3.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -94,8 +94,12 @@ export const useTreeViewFocus = ({
94
94
  instance.focusDefaultItem(null);
95
95
  }
96
96
  });
97
- const createHandleFocus = otherHandlers => event => {
97
+ const createRootHandleFocus = otherHandlers => event => {
98
98
  otherHandlers.onFocus?.(event);
99
+ if (event.defaultMuiPrevented) {
100
+ return;
101
+ }
102
+
99
103
  // if the event bubbled (which is React specific) we don't want to steal focus
100
104
  if (event.target === event.currentTarget) {
101
105
  instance.focusDefaultItem(event);
@@ -105,7 +109,7 @@ export const useTreeViewFocus = ({
105
109
  const activeDescendant = focusedItem ? instance.getTreeItemIdAttribute(focusedItem.id, focusedItem.idAttribute) : null;
106
110
  return {
107
111
  getRootProps: otherHandlers => ({
108
- onFocus: createHandleFocus(otherHandlers),
112
+ onFocus: createRootHandleFocus(otherHandlers),
109
113
  'aria-activedescendant': activeDescendant ?? undefined
110
114
  }),
111
115
  publicAPI: {
@@ -86,6 +86,12 @@ export const useTreeViewJSXItems = ({
86
86
  }
87
87
  };
88
88
  };
89
+ const isItemExpandable = reactChildren => {
90
+ if (Array.isArray(reactChildren)) {
91
+ return reactChildren.length > 0 && reactChildren.some(isItemExpandable);
92
+ }
93
+ return Boolean(reactChildren);
94
+ };
89
95
  const useTreeViewJSXItemsItemPlugin = ({
90
96
  props,
91
97
  rootRef,
@@ -110,13 +116,7 @@ const useTreeViewJSXItemsItemPlugin = ({
110
116
  unregisterChild,
111
117
  parentId
112
118
  } = parentContext;
113
- const isExpandable = reactChildren => {
114
- if (Array.isArray(reactChildren)) {
115
- return reactChildren.length > 0 && reactChildren.some(isExpandable);
116
- }
117
- return Boolean(reactChildren);
118
- };
119
- const expandable = isExpandable(children);
119
+ const expandable = isItemExpandable(children);
120
120
  const pluginContentRef = React.useRef(null);
121
121
  const handleContentRef = useForkRef(pluginContentRef, contentRef);
122
122
 
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.2.0
2
+ * @mui/x-tree-view v7.3.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -94,8 +94,12 @@ export const useTreeViewFocus = ({
94
94
  instance.focusDefaultItem(null);
95
95
  }
96
96
  });
97
- const createHandleFocus = otherHandlers => event => {
97
+ const createRootHandleFocus = otherHandlers => event => {
98
98
  otherHandlers.onFocus?.(event);
99
+ if (event.defaultMuiPrevented) {
100
+ return;
101
+ }
102
+
99
103
  // if the event bubbled (which is React specific) we don't want to steal focus
100
104
  if (event.target === event.currentTarget) {
101
105
  instance.focusDefaultItem(event);
@@ -105,7 +109,7 @@ export const useTreeViewFocus = ({
105
109
  const activeDescendant = focusedItem ? instance.getTreeItemIdAttribute(focusedItem.id, focusedItem.idAttribute) : null;
106
110
  return {
107
111
  getRootProps: otherHandlers => ({
108
- onFocus: createHandleFocus(otherHandlers),
112
+ onFocus: createRootHandleFocus(otherHandlers),
109
113
  'aria-activedescendant': activeDescendant ?? undefined
110
114
  }),
111
115
  publicAPI: {
@@ -86,6 +86,12 @@ export const useTreeViewJSXItems = ({
86
86
  }
87
87
  };
88
88
  };
89
+ const isItemExpandable = reactChildren => {
90
+ if (Array.isArray(reactChildren)) {
91
+ return reactChildren.length > 0 && reactChildren.some(isItemExpandable);
92
+ }
93
+ return Boolean(reactChildren);
94
+ };
89
95
  const useTreeViewJSXItemsItemPlugin = ({
90
96
  props,
91
97
  rootRef,
@@ -110,13 +116,7 @@ const useTreeViewJSXItemsItemPlugin = ({
110
116
  unregisterChild,
111
117
  parentId
112
118
  } = parentContext;
113
- const isExpandable = reactChildren => {
114
- if (Array.isArray(reactChildren)) {
115
- return reactChildren.length > 0 && reactChildren.some(isExpandable);
116
- }
117
- return Boolean(reactChildren);
118
- };
119
- const expandable = isExpandable(children);
119
+ const expandable = isItemExpandable(children);
120
120
  const pluginContentRef = React.useRef(null);
121
121
  const handleContentRef = useForkRef(pluginContentRef, contentRef);
122
122
 
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.2.0
2
+ * @mui/x-tree-view v7.3.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -103,8 +103,12 @@ const useTreeViewFocus = ({
103
103
  instance.focusDefaultItem(null);
104
104
  }
105
105
  });
106
- const createHandleFocus = otherHandlers => event => {
106
+ const createRootHandleFocus = otherHandlers => event => {
107
107
  otherHandlers.onFocus?.(event);
108
+ if (event.defaultMuiPrevented) {
109
+ return;
110
+ }
111
+
108
112
  // if the event bubbled (which is React specific) we don't want to steal focus
109
113
  if (event.target === event.currentTarget) {
110
114
  instance.focusDefaultItem(event);
@@ -114,7 +118,7 @@ const useTreeViewFocus = ({
114
118
  const activeDescendant = focusedItem ? instance.getTreeItemIdAttribute(focusedItem.id, focusedItem.idAttribute) : null;
115
119
  return {
116
120
  getRootProps: otherHandlers => ({
117
- onFocus: createHandleFocus(otherHandlers),
121
+ onFocus: createRootHandleFocus(otherHandlers),
118
122
  'aria-activedescendant': activeDescendant ?? undefined
119
123
  }),
120
124
  publicAPI: {
@@ -96,6 +96,12 @@ const useTreeViewJSXItems = ({
96
96
  };
97
97
  };
98
98
  exports.useTreeViewJSXItems = useTreeViewJSXItems;
99
+ const isItemExpandable = reactChildren => {
100
+ if (Array.isArray(reactChildren)) {
101
+ return reactChildren.length > 0 && reactChildren.some(isItemExpandable);
102
+ }
103
+ return Boolean(reactChildren);
104
+ };
99
105
  const useTreeViewJSXItemsItemPlugin = ({
100
106
  props,
101
107
  rootRef,
@@ -120,13 +126,7 @@ const useTreeViewJSXItemsItemPlugin = ({
120
126
  unregisterChild,
121
127
  parentId
122
128
  } = parentContext;
123
- const isExpandable = reactChildren => {
124
- if (Array.isArray(reactChildren)) {
125
- return reactChildren.length > 0 && reactChildren.some(isExpandable);
126
- }
127
- return Boolean(reactChildren);
128
- };
129
- const expandable = isExpandable(children);
129
+ const expandable = isItemExpandable(children);
130
130
  const pluginContentRef = React.useRef(null);
131
131
  const handleContentRef = (0, _useForkRef.default)(pluginContentRef, contentRef);
132
132
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "The community edition of the Tree View components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",