@mui/x-date-pickers 7.3.2 → 7.4.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,73 @@
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.4.0
7
+
8
+ _May 10, 2024_
9
+
10
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - ✨ Add optional `id` attribute on shortcut items of the Date and Time Pickers
13
+ - 🎁 Add support for `date-fns-jalali` v3 in the Date and Time Pickers
14
+ - 🚀 Support rounded corners on `BarChart`
15
+ - 🌍 Add accessibility page to TreeView docs
16
+ - 🐞 Bugfixes
17
+ - 📚 Documentation improvements
18
+
19
+ ### Data Grid
20
+
21
+ #### `@mui/x-data-grid@7.4.0`
22
+
23
+ - [DataGrid] Fix error when focus moves from column header to `svg` element (#13028) @oukunan
24
+ - [DataGrid] Fix error on column groups change (#12965) @romgrk
25
+
26
+ #### `@mui/x-data-grid-pro@7.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
27
+
28
+ Same changes as in `@mui/x-data-grid@7.4.0`.
29
+
30
+ #### `@mui/x-data-grid-premium@7.4.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
31
+
32
+ Same changes as in `@mui/x-data-grid-pro@7.4.0`.
33
+
34
+ ### Date and Time Pickers
35
+
36
+ #### `@mui/x-date-pickers@7.4.0`
37
+
38
+ - [fields] Fix regression preventing form submit on "Enter" click (#13065) @LukasTy
39
+ - [pickers] Add `AdapterDateFnsJalaliV3` adapter (#12891) @smmoosavi
40
+ - [pickers] Add optional `id` attribute on shortcut items (#12976) @noraleonte
41
+
42
+ #### `@mui/x-date-pickers-pro@7.4.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
43
+
44
+ Same changes as in `@mui/x-date-pickers@7.4.0`.
45
+
46
+ ### Charts
47
+
48
+ #### `@mui/x-charts@7.4.0`
49
+
50
+ - [charts] Add `ChartsGrid` to `themeAugmentation` (#13026) @noraleonte
51
+ - [charts] Support rounded corners on `BarChart` (#12834) @JCQuintas
52
+
53
+ ### Tree View
54
+
55
+ #### `@mui/x-tree-view@7.4.0`
56
+
57
+ - [TreeView] Fix props propagation and theme entry in `TreeItem2` (#12889) @flaviendelangle
58
+
59
+ ### Docs
60
+
61
+ - [docs] Add accessibility page to TreeView docs (#12845) @noraleonte
62
+ - [docs] Fix Charts styling typos (#13061) @oliviertassinari
63
+ - [docs] Fix legal link to EULA free trial (#13013) @oliviertassinari
64
+ - [docs] Update interface name in pinned columns docs (#13070) @cherniavskii
65
+
66
+ ### Core
67
+
68
+ - [core] Improve release process docs (#12977) @JCQuintas
69
+ - [core] Prepare React 19 (#12991) @oliviertassinari
70
+ - [docs-infra] Fix Netlify PR preview path (#12993) @oliviertassinari
71
+ - [infra] Automation: Add release PR reviewers (#12982) @michelengelen
72
+
6
73
  ## 7.3.2
7
74
 
8
75
  _May 2, 2024_
@@ -17,8 +84,6 @@ We'd like to offer a big thanks to the 11 contributors who made this release pos
17
84
  - 🐞 Bugfixes
18
85
  - 📚 Documentation improvements
19
86
 
20
- <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
21
-
22
87
  ### Data Grid
23
88
 
24
89
  #### `@mui/x-data-grid@7.3.2`
@@ -6,6 +6,11 @@ interface PickersShortcutsItemGetValueParams<TValue> {
6
6
  export interface PickersShortcutsItem<TValue> {
7
7
  label: string;
8
8
  getValue: (params: PickersShortcutsItemGetValueParams<TValue>) => TValue;
9
+ /**
10
+ * Identifier of the shortcut.
11
+ * If provided, it will be used as the key of the shortcut.
12
+ */
13
+ id?: string;
9
14
  }
10
15
  export type PickersShortcutsItemContext = Omit<PickersShortcutsItem<unknown>, 'getValue'>;
11
16
  export type PickerShortcutChangeImportance = 'set' | 'accept';
@@ -37,13 +37,13 @@ function PickersShortcuts(props) {
37
37
  const newValue = getValue({
38
38
  isValid
39
39
  });
40
- return {
40
+ return _extends({}, item, {
41
41
  label: item.label,
42
42
  onClick: () => {
43
43
  onChange(newValue, changeImportance, item);
44
44
  },
45
45
  disabled: !isValid(newValue)
46
- };
46
+ });
47
47
  });
48
48
  return /*#__PURE__*/_jsx(List, _extends({
49
49
  dense: true,
@@ -56,7 +56,7 @@ function PickersShortcuts(props) {
56
56
  children: resolvedItems.map(item => {
57
57
  return /*#__PURE__*/_jsx(ListItem, {
58
58
  children: /*#__PURE__*/_jsx(Chip, _extends({}, item))
59
- }, item.label);
59
+ }, item.id ?? item.label);
60
60
  })
61
61
  }));
62
62
  }
@@ -95,6 +95,7 @@ process.env.NODE_ENV !== "production" ? PickersShortcuts.propTypes = {
95
95
  */
96
96
  items: PropTypes.arrayOf(PropTypes.shape({
97
97
  getValue: PropTypes.func.isRequired,
98
+ id: PropTypes.string,
98
99
  label: PropTypes.string.isRequired
99
100
  })),
100
101
  onChange: PropTypes.func.isRequired,
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.3.2
2
+ * @mui/x-date-pickers v7.4.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -82,11 +82,6 @@ export const useField = params => {
82
82
  setSelectedSections('all');
83
83
  break;
84
84
  }
85
- case event.key === 'Enter':
86
- {
87
- event.preventDefault();
88
- break;
89
- }
90
85
 
91
86
  // Move selection to next section
92
87
  case event.key === 'ArrowRight':
@@ -282,6 +282,11 @@ export const useFieldV7TextField = params => {
282
282
  revertDOMSectionChange(sectionIndex);
283
283
  return;
284
284
  }
285
+ const inputType = event.nativeEvent.inputType;
286
+ if (inputType === 'insertParagraph' || inputType === 'insertLineBreak') {
287
+ revertDOMSectionChange(sectionIndex);
288
+ return;
289
+ }
285
290
  resetCharacterQuery();
286
291
  clearActiveSection();
287
292
  return;
@@ -527,6 +527,9 @@ export class AdapterDateFnsJalali {
527
527
  }
528
528
  return years;
529
529
  };
530
+ if (typeof addDays !== 'function') {
531
+ throw new Error(['MUI: The `date-fns-jalali` package v3.x is not compatible with this adapter.', 'Please, install v2.x of the package or use the `AdapterDateFnsJalaliV3` instead.'].join('\n'));
532
+ }
530
533
  this.locale = _locale;
531
534
  this.formats = _extends({}, defaultFormats, formats);
532
535
  }