@mui/x-tree-view 7.21.0 → 7.22.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,86 @@
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.22.0
7
+
8
+ _Oct 25, 2024_
9
+
10
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🛰 Introduce [server-side support for Data Grid row grouping](https://mui.com/x/react-data-grid/server-side-data/row-grouping/)
13
+ - 🐞 Bugfixes
14
+ - 📚 Documentation improvements
15
+ - 🌍 Improve Portuguese (pt-BR) locale on the Data Grid component
16
+
17
+ Special thanks go out to the community contributors who have helped make this release possible:
18
+ @clins1994, @GITPHLAP, @k-rajat19, @kalyan90, @merotosc, @yash49.
19
+ Following are all team members who have contributed to this release:
20
+ @cherniavskii, @flaviendelangle, @LukasTy, @MBilalShafi, @romgrk.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@7.22.0`
27
+
28
+ - [DataGrid] Fix `GridPanelAnchor` positioning (#15022) @k-rajat19
29
+ - [DataGrid] Fix ugly prop-types for the `pageStyle` prop of the `GridPrintExportMenuItem` component (#15015) @flaviendelangle
30
+ - [DataGrid] Fix value type in filter model for number and boolean column type (#14733) @k-rajat19
31
+ - [DataGrid] Focus next row when the focused row is deleted (#15067) @cherniavskii
32
+ - [DataGrid] Remove some usages of `<Box />` and `<Badge />` (#15013) @romgrk
33
+ - [DataGrid] Fix number of rows to display for page size options with negative value (#14890) @kalyan90
34
+ - [l10n] Improve Portuguese (pt-BR) locale (#15021) @k-rajat19
35
+
36
+ #### `@mui/x-data-grid-pro@7.22.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
37
+
38
+ Same changes as in `@mui/x-data-grid@7.22.0`, plus:
39
+
40
+ - [DataGridPro] Fix column pinning layout (#15073) @cherniavskii
41
+
42
+ #### `@mui/x-data-grid-premium@7.22.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
43
+
44
+ Same changes as in `@mui/x-data-grid-pro@7.22.0`, plus:
45
+
46
+ - [DataGridPremium] Server-side data source with row grouping (#15109) @MBilalShafi
47
+
48
+ ### Date and Time Pickers
49
+
50
+ #### `@mui/x-date-pickers@7.22.0`
51
+
52
+ - [pickers] Fix `DateCalendar` timezone management (#15119) @LukasTy
53
+ - [pickers] Fix `DigitalClock` time options on a `DST` switch day (#15092) @LukasTy
54
+
55
+ #### `@mui/x-date-pickers-pro@7.22.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
56
+
57
+ Same changes as in `@mui/x-date-pickers@7.22.0`.
58
+
59
+ ### Charts
60
+
61
+ #### `@mui/x-charts@7.22.0`
62
+
63
+ - [charts] Export data type in `onAxisClick(_, data)` callback (#15038) @clins1994
64
+
65
+ #### `@mui/x-charts-pro@7.0.0-beta.6` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
66
+
67
+ Same changes as in `@mui/x-charts@7.22.0`.
68
+
69
+ ### Tree View
70
+
71
+ #### `@mui/x-tree-view@7.22.0`
72
+
73
+ - [TreeView] Make the cancellable event types public (#14992) @flaviendelangle
74
+
75
+ ### Docs
76
+
77
+ - [docs] Fix typo in Tree View docs (#15047) @yash49
78
+
79
+ ### Core
80
+
81
+ - [core] Adjust cherry-pick GH actions (#15101) @LukasTy
82
+ - [core] Update prettier target branch (#15100) @MBilalShafi
83
+ - [core] Update some `default-branch-switch` instances for `v7.x` (#15085) @MBilalShafi
84
+ - [test] Revert to using `fireEvent` instead of `userEvent` (#14927) @LukasTy
85
+
6
86
  ## 7.21.0
7
87
 
8
88
  _Oct 17, 2024_
@@ -5,9 +5,8 @@ import { TransitionProps } from '@mui/material/transitions';
5
5
  import { SxProps } from '@mui/system';
6
6
  import { TreeItemContentProps } from './TreeItemContent';
7
7
  import { TreeItemClasses } from './treeItemClasses';
8
- import { TreeViewItemId } from '../models';
8
+ import { TreeViewItemId, TreeViewCancellableEventHandler } from '../models';
9
9
  import { SlotComponentPropsFromProps } from '../internals/models';
10
- import { MuiCancellableEventHandler } from '../internals/models/MuiCancellableEvent';
11
10
  import { UseTreeViewIconsSignature } from '../internals/plugins/useTreeViewIcons';
12
11
  import { UseTreeViewSelectionSignature } from '../internals/plugins/useTreeViewSelection';
13
12
  import { UseTreeViewItemsSignature } from '../internals/plugins/useTreeViewItems';
@@ -102,7 +101,7 @@ export interface TreeItemProps extends Omit<React.HTMLAttributes<HTMLLIElement>,
102
101
  /**
103
102
  * Callback fired when a key of the keyboard is pressed on the item.
104
103
  */
105
- onKeyDown?: MuiCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>;
104
+ onKeyDown?: TreeViewCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>;
106
105
  }
107
106
  export interface TreeItemOwnerState extends TreeItemProps {
108
107
  expanded: boolean;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { MuiCancellableEvent } from '../internals/models/MuiCancellableEvent';
2
+ import { TreeViewCancellableEvent } from '../models';
3
3
  export declare function useTreeItemState(itemId: string): {
4
4
  disabled: boolean;
5
5
  expanded: boolean;
@@ -16,6 +16,6 @@ export declare function useTreeItemState(itemId: string): {
16
16
  preventSelection: (event: React.MouseEvent<HTMLDivElement>) => void;
17
17
  expansionTrigger: "content" | "iconContainer" | undefined;
18
18
  toggleItemEditing: () => void;
19
- handleSaveItemLabel: (event: React.SyntheticEvent & MuiCancellableEvent, label: string) => void;
19
+ handleSaveItemLabel: (event: React.SyntheticEvent & TreeViewCancellableEvent, label: string) => void;
20
20
  handleCancelItemLabelEditing: (event: React.SyntheticEvent) => void;
21
21
  };
@@ -3,7 +3,7 @@ import { SlotComponentProps } from '@mui/utils';
3
3
  import { UseTreeItem2Parameters, UseTreeItem2Status } from '../useTreeItem2';
4
4
  import { TreeItemClasses } from '../TreeItem';
5
5
  import { TreeItem2IconSlotProps, TreeItem2IconSlots } from '../TreeItem2Icon';
6
- import { MuiCancellableEventHandler } from '../internals/models/MuiCancellableEvent';
6
+ import { TreeViewCancellableEventHandler } from '../models';
7
7
  export interface TreeItem2Slots extends TreeItem2IconSlots {
8
8
  /**
9
9
  * The component that renders the root.
@@ -82,11 +82,11 @@ export interface TreeItem2Props extends Omit<UseTreeItem2Parameters, 'rootRef'>,
82
82
  /**
83
83
  * Callback fired when the item root is blurred.
84
84
  */
85
- onBlur?: MuiCancellableEventHandler<React.FocusEvent<HTMLLIElement>>;
85
+ onBlur?: TreeViewCancellableEventHandler<React.FocusEvent<HTMLLIElement>>;
86
86
  /**
87
87
  * Callback fired when a key is pressed on the keyboard and the tree is in focus.
88
88
  */
89
- onKeyDown?: MuiCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>;
89
+ onKeyDown?: TreeViewCancellableEventHandler<React.KeyboardEvent<HTMLLIElement>>;
90
90
  }
91
91
  export interface TreeItem2OwnerState extends Omit<TreeItem2Props, 'disabled'>, UseTreeItem2Status {
92
92
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { MuiCancellableEventHandler } from '../internals/models/MuiCancellableEvent';
2
+ import { TreeViewCancellableEventHandler } from '../models';
3
3
  export interface TreeItem2LabelInputProps {
4
4
  value?: string;
5
5
  /**
@@ -7,8 +7,8 @@ export interface TreeItem2LabelInputProps {
7
7
  */
8
8
  'data-element'?: 'labelInput';
9
9
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
10
- onKeyDown?: MuiCancellableEventHandler<React.KeyboardEvent<HTMLInputElement>>;
11
- onBlur?: MuiCancellableEventHandler<React.FocusEvent<HTMLInputElement>>;
10
+ onKeyDown?: TreeViewCancellableEventHandler<React.KeyboardEvent<HTMLInputElement>>;
11
+ onBlur?: TreeViewCancellableEventHandler<React.FocusEvent<HTMLInputElement>>;
12
12
  autoFocus?: true;
13
13
  type?: 'text';
14
14
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.21.0
2
+ * @mui/x-tree-view v7.22.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,7 +2,7 @@ export { useTreeView } from './useTreeView';
2
2
  export { TreeViewProvider, useTreeViewContext } from './TreeViewProvider';
3
3
  export { RichTreeViewItems } from './components/RichTreeViewItems';
4
4
  export { unstable_resetCleanupTracking } from './hooks/useInstanceEventHandler';
5
- export type { TreeViewPlugin, TreeViewPluginSignature, ConvertPluginsIntoSignatures, MergeSignaturesProperty, TreeViewPublicAPI, TreeViewExperimentalFeatures, TreeViewItemMeta, TreeViewInstance, DefaultizedProps, TreeViewItemPlugin, MuiCancellableEvent, MuiCancellableEventHandler, } from './models';
5
+ export type { TreeViewPlugin, TreeViewPluginSignature, ConvertPluginsIntoSignatures, MergeSignaturesProperty, TreeViewPublicAPI, TreeViewExperimentalFeatures, TreeViewItemMeta, TreeViewInstance, DefaultizedProps, TreeViewItemPlugin, } from './models';
6
6
  export type { TreeViewCorePluginParameters } from './corePlugins';
7
7
  export { useTreeViewExpansion } from './plugins/useTreeViewExpansion';
8
8
  export type { UseTreeViewExpansionSignature, UseTreeViewExpansionParameters, } from './plugins/useTreeViewExpansion';
@@ -2,4 +2,3 @@ export * from './helpers';
2
2
  export * from './plugin';
3
3
  export * from './itemPlugin';
4
4
  export * from './treeView';
5
- export * from './MuiCancellableEvent';
@@ -1,5 +1,4 @@
1
1
  export * from "./helpers.js";
2
2
  export * from "./plugin.js";
3
3
  export * from "./itemPlugin.js";
4
- export * from "./treeView.js";
5
- export * from "./MuiCancellableEvent.js";
4
+ export * from "./treeView.js";
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import { TreeViewPluginSignature, MuiCancellableEvent } from '../../models';
2
+ import { TreeViewPluginSignature } from '../../models';
3
3
  import { UseTreeViewItemsSignature } from '../useTreeViewItems';
4
4
  import { UseTreeViewSelectionSignature } from '../useTreeViewSelection';
5
5
  import { UseTreeViewFocusSignature } from '../useTreeViewFocus';
6
6
  import { UseTreeViewExpansionSignature } from '../useTreeViewExpansion';
7
- import { TreeViewItemId } from '../../../models';
7
+ import { TreeViewItemId, TreeViewCancellableEvent } from '../../../models';
8
8
  import { UseTreeViewLabelSignature } from '../useTreeViewLabel';
9
9
  export interface UseTreeViewKeyboardNavigationInstance {
10
10
  /**
@@ -17,10 +17,10 @@ export interface UseTreeViewKeyboardNavigationInstance {
17
17
  /**
18
18
  * Callback fired when a key is pressed on an item.
19
19
  * Handles all the keyboard navigation logic.
20
- * @param {React.KeyboardEvent<HTMLElement> & MuiCancellableEvent} event The keyboard event that triggered the callback.
20
+ * @param {React.KeyboardEvent<HTMLElement> & TreeViewCancellableEvent} event The keyboard event that triggered the callback.
21
21
  * @param {TreeViewItemId} itemId The id of the item that the event was triggered on.
22
22
  */
23
- handleItemKeyDown: (event: React.KeyboardEvent<HTMLElement> & MuiCancellableEvent, itemId: TreeViewItemId) => void;
23
+ handleItemKeyDown: (event: React.KeyboardEvent<HTMLElement> & TreeViewCancellableEvent, itemId: TreeViewItemId) => void;
24
24
  }
25
25
  export type UseTreeViewKeyboardNavigationSignature = TreeViewPluginSignature<{
26
26
  instance: UseTreeViewKeyboardNavigationInstance;
@@ -0,0 +1,4 @@
1
+ export type TreeViewCancellableEvent = {
2
+ defaultMuiPrevented?: boolean;
3
+ };
4
+ export type TreeViewCancellableEventHandler<Event> = (event: Event & TreeViewCancellableEvent) => void;
package/models/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './items';
2
+ export * from './events';
2
3
  export type { PropsFromSlot } from '@mui/x-internals/slots';
package/models/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./items.js";
2
+ export * from "./events.js";
2
3
 
3
4
  // Utils shared across the X packages
4
5
  export {};
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.21.0
2
+ * @mui/x-tree-view v7.22.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,5 +1,4 @@
1
1
  export * from "./helpers.js";
2
2
  export * from "./plugin.js";
3
3
  export * from "./itemPlugin.js";
4
- export * from "./treeView.js";
5
- export * from "./MuiCancellableEvent.js";
4
+ export * from "./treeView.js";
@@ -1,4 +1,5 @@
1
1
  export * from "./items.js";
2
+ export * from "./events.js";
2
3
 
3
4
  // Utils shared across the X packages
4
5
  export {};
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-tree-view v7.21.0
2
+ * @mui/x-tree-view v7.22.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -46,15 +46,4 @@ Object.keys(_treeView).forEach(function (key) {
46
46
  return _treeView[key];
47
47
  }
48
48
  });
49
- });
50
- var _MuiCancellableEvent = require("./MuiCancellableEvent");
51
- Object.keys(_MuiCancellableEvent).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _MuiCancellableEvent[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _MuiCancellableEvent[key];
58
- }
59
- });
60
49
  });
@@ -13,4 +13,15 @@ Object.keys(_items).forEach(function (key) {
13
13
  return _items[key];
14
14
  }
15
15
  });
16
+ });
17
+ var _events = require("./events");
18
+ Object.keys(_events).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _events[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _events[key];
25
+ }
26
+ });
16
27
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-tree-view",
3
- "version": "7.21.0",
3
+ "version": "7.22.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",
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { TreeViewItemId } from '../models';
3
- import { TreeViewPublicAPI, MuiCancellableEventHandler } from '../internals/models';
2
+ import { TreeViewItemId, TreeViewCancellableEventHandler } from '../models';
3
+ import { TreeViewPublicAPI } from '../internals/models';
4
4
  import { UseTreeViewSelectionSignature } from '../internals/plugins/useTreeViewSelection';
5
5
  import { UseTreeViewItemsSignature } from '../internals/plugins/useTreeViewItems';
6
6
  import { UseTreeViewFocusSignature } from '../internals/plugins/useTreeViewFocus';
@@ -39,9 +39,9 @@ export interface UseTreeItem2RootSlotPropsFromUseTreeItem {
39
39
  'aria-expanded': React.AriaAttributes['aria-expanded'];
40
40
  'aria-selected': React.AriaAttributes['aria-selected'];
41
41
  'aria-disabled': React.AriaAttributes['aria-disabled'];
42
- onFocus: MuiCancellableEventHandler<React.FocusEvent<HTMLElement>>;
43
- onBlur: MuiCancellableEventHandler<React.FocusEvent<HTMLElement>>;
44
- onKeyDown: MuiCancellableEventHandler<React.KeyboardEvent<HTMLElement>>;
42
+ onFocus: TreeViewCancellableEventHandler<React.FocusEvent<HTMLElement>>;
43
+ onBlur: TreeViewCancellableEventHandler<React.FocusEvent<HTMLElement>>;
44
+ onKeyDown: TreeViewCancellableEventHandler<React.KeyboardEvent<HTMLElement>>;
45
45
  ref: React.RefCallback<HTMLLIElement>;
46
46
  /**
47
47
  * Only defined when the `indentationAtItemLevel` experimental feature is enabled.
@@ -52,8 +52,8 @@ export interface UseTreeItem2RootSlotOwnProps extends UseTreeItem2RootSlotPropsF
52
52
  }
53
53
  export type UseTreeItem2RootSlotProps<ExternalProps = {}> = ExternalProps & UseTreeItem2RootSlotOwnProps;
54
54
  export interface UseTreeItem2ContentSlotPropsFromUseTreeItem {
55
- onClick: MuiCancellableEventHandler<React.MouseEvent>;
56
- onMouseDown: MuiCancellableEventHandler<React.MouseEvent>;
55
+ onClick: TreeViewCancellableEventHandler<React.MouseEvent>;
56
+ onMouseDown: TreeViewCancellableEventHandler<React.MouseEvent>;
57
57
  ref: React.RefCallback<HTMLDivElement> | null;
58
58
  status: UseTreeItem2Status;
59
59
  /**
@@ -65,12 +65,12 @@ export interface UseTreeItem2ContentSlotOwnProps extends UseTreeItem2ContentSlot
65
65
  }
66
66
  export type UseTreeItem2ContentSlotProps<ExternalProps = {}> = ExternalProps & UseTreeItem2ContentSlotOwnProps;
67
67
  export interface UseTreeItem2IconContainerSlotOwnProps {
68
- onClick: MuiCancellableEventHandler<React.MouseEvent>;
68
+ onClick: TreeViewCancellableEventHandler<React.MouseEvent>;
69
69
  }
70
70
  export type UseTreeItemIconContainerSlotProps<ExternalProps = {}> = ExternalProps & UseTreeItem2IconContainerSlotOwnProps;
71
71
  export interface UseTreeItem2LabelSlotOwnProps {
72
72
  children: React.ReactNode;
73
- onDoubleClick: MuiCancellableEventHandler<React.MouseEvent>;
73
+ onDoubleClick: TreeViewCancellableEventHandler<React.MouseEvent>;
74
74
  /**
75
75
  * Only defined when the `isItemEditable` experimental feature is enabled.
76
76
  */
@@ -83,7 +83,7 @@ export type UseTreeItem2LabelInputSlotProps<ExternalProps = {}> = ExternalProps
83
83
  export interface UseTreeItem2CheckboxSlotOwnProps {
84
84
  visible: boolean;
85
85
  checked: boolean;
86
- onChange: MuiCancellableEventHandler<React.ChangeEvent<HTMLInputElement>>;
86
+ onChange: TreeViewCancellableEventHandler<React.ChangeEvent<HTMLInputElement>>;
87
87
  disabled: boolean;
88
88
  ref: React.RefObject<HTMLButtonElement>;
89
89
  tabIndex: -1;
@@ -1,4 +0,0 @@
1
- export type MuiCancellableEvent = {
2
- defaultMuiPrevented?: boolean;
3
- };
4
- export type MuiCancellableEventHandler<Event> = (event: Event & MuiCancellableEvent) => void;