@mui/x-date-pickers 6.19.12 → 6.20.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,38 @@
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
+ ## 6.20.0
7
+
8
+ _May 24, 2024_
9
+
10
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🐞 Bugfixes
13
+
14
+ ### Data Grid
15
+
16
+ #### `@mui/x-data-grid@6.20.0`
17
+
18
+ - [DataGrid] Escape formulas in CSV and Excel export (#13190) @cherniavskii
19
+
20
+ #### `@mui/x-data-grid-pro@6.20.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
21
+
22
+ Same changes as in `@mui/x-data-grid@6.20.0`.
23
+
24
+ #### `@mui/x-data-grid-premium@6.20.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
25
+
26
+ Same changes as in `@mui/x-data-grid-pro@6.20.0`.
27
+
28
+ ### Date Pickers
29
+
30
+ #### `@mui/x-date-pickers@6.20.0`
31
+
32
+ - [pickers] Fix `disableOpenPicker` prop behavior (#13221) @LukasTy
33
+
34
+ #### `@mui/x-date-pickers-pro@6.20.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
35
+
36
+ Same changes as in `@mui/x-date-pickers@6.20.0`.
37
+
6
38
  ## 6.19.12
7
39
 
8
40
  _May 17, 2024_
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.12
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -115,7 +115,8 @@ export const useDesktopPicker = _ref => {
115
115
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
116
116
  if (hasUIView) {
117
117
  fieldProps.InputProps = _extends({}, fieldProps.InputProps, {
118
- ref: containerRef,
118
+ ref: containerRef
119
+ }, !props.disableOpenPicker && {
119
120
  [`${inputAdornmentProps.position}Adornment`]: /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
120
121
  children: /*#__PURE__*/_jsx(OpenPickerButton, _extends({}, openPickerButtonProps, {
121
122
  children: /*#__PURE__*/_jsx(OpenPickerIcon, _extends({}, innerSlotProps == null ? void 0 : innerSlotProps.openPickerIcon))
@@ -55,7 +55,7 @@ export interface UsePickerViewsNonStaticProps {
55
55
  /**
56
56
  * Props used to handle the value of the pickers.
57
57
  */
58
- export interface UsePickerViewsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps>, UsePickerViewsNonStaticProps {
58
+ export interface UsePickerViewsProps<TValue, TDate, TView extends DateOrTimeViewWithMeridiem, TExternalProps extends UsePickerViewsProps<TValue, TDate, TView, any, any>, TAdditionalProps extends {}> extends UsePickerViewsBaseProps<TValue, TDate, TView, TExternalProps, TAdditionalProps> {
59
59
  className?: string;
60
60
  sx?: SxProps<Theme>;
61
61
  }
@@ -68,8 +68,7 @@ export interface UsePickerViewParams<TValue, TDate, TView extends DateOrTimeView
68
68
  }
69
69
  export interface UsePickerViewsResponse<TView extends DateOrTimeViewWithMeridiem> {
70
70
  /**
71
- * Does the picker have at least one view that should be rendered in UI mode ?
72
- * If not, we can hide the icon to open the picker.
71
+ * Indicates if the the picker has at least one view that should be rendered in UI.
73
72
  */
74
73
  hasUIView: boolean;
75
74
  renderCurrentView: () => React.ReactNode;
@@ -42,7 +42,6 @@ export const usePickerViews = ({
42
42
  views,
43
43
  openTo,
44
44
  onViewChange,
45
- disableOpenPicker,
46
45
  viewRenderers,
47
46
  timezone
48
47
  } = props;
@@ -67,9 +66,7 @@ export const usePickerViews = ({
67
66
  viewModeLookup
68
67
  } = React.useMemo(() => views.reduce((acc, viewForReduce) => {
69
68
  let viewMode;
70
- if (disableOpenPicker) {
71
- viewMode = 'field';
72
- } else if (viewRenderers[viewForReduce] != null) {
69
+ if (viewRenderers[viewForReduce] != null) {
73
70
  viewMode = 'UI';
74
71
  } else {
75
72
  viewMode = 'field';
@@ -82,7 +79,7 @@ export const usePickerViews = ({
82
79
  }, {
83
80
  hasUIView: false,
84
81
  viewModeLookup: {}
85
- }), [disableOpenPicker, viewRenderers, views]);
82
+ }), [viewRenderers, views]);
86
83
  const timeViewsCount = React.useMemo(() => views.reduce((acc, viewForReduce) => {
87
84
  if (viewRenderers[viewForReduce] != null && isTimeView(viewForReduce)) {
88
85
  return acc + 1;
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.12
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -112,9 +112,9 @@ export var useDesktopPicker = function useDesktopPicker(_ref) {
112
112
 
113
113
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
114
114
  if (hasUIView) {
115
- fieldProps.InputProps = _extends({}, fieldProps.InputProps, _defineProperty({
115
+ fieldProps.InputProps = _extends({}, fieldProps.InputProps, {
116
116
  ref: containerRef
117
- }, "".concat(inputAdornmentProps.position, "Adornment"), /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
117
+ }, !props.disableOpenPicker && _defineProperty({}, "".concat(inputAdornmentProps.position, "Adornment"), /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
118
118
  children: /*#__PURE__*/_jsx(OpenPickerButton, _extends({}, openPickerButtonProps, {
119
119
  children: /*#__PURE__*/_jsx(OpenPickerIcon, _extends({}, innerSlotProps == null ? void 0 : innerSlotProps.openPickerIcon))
120
120
  }))
@@ -39,7 +39,6 @@ export var usePickerViews = function usePickerViews(_ref) {
39
39
  var views = props.views,
40
40
  openTo = props.openTo,
41
41
  onViewChange = props.onViewChange,
42
- disableOpenPicker = props.disableOpenPicker,
43
42
  viewRenderers = props.viewRenderers,
44
43
  timezone = props.timezone;
45
44
  var className = props.className,
@@ -62,9 +61,7 @@ export var usePickerViews = function usePickerViews(_ref) {
62
61
  var _React$useMemo = React.useMemo(function () {
63
62
  return views.reduce(function (acc, viewForReduce) {
64
63
  var viewMode;
65
- if (disableOpenPicker) {
66
- viewMode = 'field';
67
- } else if (viewRenderers[viewForReduce] != null) {
64
+ if (viewRenderers[viewForReduce] != null) {
68
65
  viewMode = 'UI';
69
66
  } else {
70
67
  viewMode = 'field';
@@ -78,7 +75,7 @@ export var usePickerViews = function usePickerViews(_ref) {
78
75
  hasUIView: false,
79
76
  viewModeLookup: {}
80
77
  });
81
- }, [disableOpenPicker, viewRenderers, views]),
78
+ }, [viewRenderers, views]),
82
79
  hasUIView = _React$useMemo.hasUIView,
83
80
  viewModeLookup = _React$useMemo.viewModeLookup;
84
81
  var timeViewsCount = React.useMemo(function () {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.12
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -114,7 +114,8 @@ export const useDesktopPicker = _ref => {
114
114
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
115
115
  if (hasUIView) {
116
116
  fieldProps.InputProps = _extends({}, fieldProps.InputProps, {
117
- ref: containerRef,
117
+ ref: containerRef
118
+ }, !props.disableOpenPicker && {
118
119
  [`${inputAdornmentProps.position}Adornment`]: /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {
119
120
  children: /*#__PURE__*/_jsx(OpenPickerButton, _extends({}, openPickerButtonProps, {
120
121
  children: /*#__PURE__*/_jsx(OpenPickerIcon, _extends({}, innerSlotProps?.openPickerIcon))
@@ -42,7 +42,6 @@ export const usePickerViews = ({
42
42
  views,
43
43
  openTo,
44
44
  onViewChange,
45
- disableOpenPicker,
46
45
  viewRenderers,
47
46
  timezone
48
47
  } = props;
@@ -67,9 +66,7 @@ export const usePickerViews = ({
67
66
  viewModeLookup
68
67
  } = React.useMemo(() => views.reduce((acc, viewForReduce) => {
69
68
  let viewMode;
70
- if (disableOpenPicker) {
71
- viewMode = 'field';
72
- } else if (viewRenderers[viewForReduce] != null) {
69
+ if (viewRenderers[viewForReduce] != null) {
73
70
  viewMode = 'UI';
74
71
  } else {
75
72
  viewMode = 'field';
@@ -82,7 +79,7 @@ export const usePickerViews = ({
82
79
  }, {
83
80
  hasUIView: false,
84
81
  viewModeLookup: {}
85
- }), [disableOpenPicker, viewRenderers, views]);
82
+ }), [viewRenderers, views]);
86
83
  const timeViewsCount = React.useMemo(() => views.reduce((acc, viewForReduce) => {
87
84
  if (viewRenderers[viewForReduce] != null && isTimeView(viewForReduce)) {
88
85
  return acc + 1;
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.12
2
+ * @mui/x-date-pickers v6.20.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -122,7 +122,8 @@ const useDesktopPicker = _ref => {
122
122
  // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged
123
123
  if (hasUIView) {
124
124
  fieldProps.InputProps = (0, _extends2.default)({}, fieldProps.InputProps, {
125
- ref: containerRef,
125
+ ref: containerRef
126
+ }, !props.disableOpenPicker && {
126
127
  [`${inputAdornmentProps.position}Adornment`]: /*#__PURE__*/(0, _jsxRuntime.jsx)(InputAdornment, (0, _extends2.default)({}, inputAdornmentProps, {
127
128
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OpenPickerButton, (0, _extends2.default)({}, openPickerButtonProps, {
128
129
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OpenPickerIcon, (0, _extends2.default)({}, innerSlotProps?.openPickerIcon))
@@ -50,7 +50,6 @@ const usePickerViews = ({
50
50
  views,
51
51
  openTo,
52
52
  onViewChange,
53
- disableOpenPicker,
54
53
  viewRenderers,
55
54
  timezone
56
55
  } = props;
@@ -75,9 +74,7 @@ const usePickerViews = ({
75
74
  viewModeLookup
76
75
  } = React.useMemo(() => views.reduce((acc, viewForReduce) => {
77
76
  let viewMode;
78
- if (disableOpenPicker) {
79
- viewMode = 'field';
80
- } else if (viewRenderers[viewForReduce] != null) {
77
+ if (viewRenderers[viewForReduce] != null) {
81
78
  viewMode = 'UI';
82
79
  } else {
83
80
  viewMode = 'field';
@@ -90,7 +87,7 @@ const usePickerViews = ({
90
87
  }, {
91
88
  hasUIView: false,
92
89
  viewModeLookup: {}
93
- }), [disableOpenPicker, viewRenderers, views]);
90
+ }), [viewRenderers, views]);
94
91
  const timeViewsCount = React.useMemo(() => views.reduce((acc, viewForReduce) => {
95
92
  if (viewRenderers[viewForReduce] != null && (0, _timeUtils.isTimeView)(viewForReduce)) {
96
93
  return acc + 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.19.12",
3
+ "version": "6.20.0",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",