@mui/x-date-pickers 6.19.12 → 6.20.1

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.
@@ -269,7 +269,11 @@ export class AdapterDayjs {
269
269
  if (((_fixedValue$$offset = fixedValue.$offset) != null ? _fixedValue$$offset : 0) === ((_value$$offset = value.$offset) != null ? _value$$offset : 0)) {
270
270
  return value;
271
271
  }
272
- return fixedValue;
272
+ // Change only what is needed to avoid creating a new object with unwanted data
273
+ // Especially important when used in an environment where utc or timezone dates are used only in some places
274
+ // Reference: https://github.com/mui/mui-x/issues/13290
275
+ // @ts-ignore
276
+ value.$offset = fixedValue.$offset;
273
277
  }
274
278
  return value;
275
279
  };
package/CHANGELOG.md CHANGED
@@ -3,6 +3,70 @@
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.1
7
+
8
+ _Jun 6, 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-premium@6.20.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
17
+
18
+ - [DataGridPremium] Fix clipboard paste not working when cell loses focus (#12737) @cherniavskii
19
+
20
+ ### Date Pickers
21
+
22
+ #### `@mui/x-date-pickers@6.20.1`
23
+
24
+ - [pickers] Fix `AdapterDayjs` timezone behavior (#13373) @LukasTy
25
+
26
+ #### `@mui/x-data-grid-pro@6.20.1` [![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-date-pickers-pro@7.20.1`.
29
+
30
+ ### Docs
31
+
32
+ - [docs] Fix Pickers FAQ callout (#13243) @LukasTy
33
+
34
+ ### Core
35
+
36
+ - [core] Stop publishing v6 under latest tag (#13269) @cherniavskii
37
+
38
+ ## 6.20.0
39
+
40
+ _May 24, 2024_
41
+
42
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
43
+
44
+ - 🐞 Bugfixes
45
+
46
+ ### Data Grid
47
+
48
+ #### `@mui/x-data-grid@6.20.0`
49
+
50
+ - [DataGrid] Escape formulas in CSV and Excel export (#13190) @cherniavskii
51
+
52
+ #### `@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')
53
+
54
+ Same changes as in `@mui/x-data-grid@6.20.0`.
55
+
56
+ #### `@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')
57
+
58
+ Same changes as in `@mui/x-data-grid-pro@6.20.0`.
59
+
60
+ ### Date Pickers
61
+
62
+ #### `@mui/x-date-pickers@6.20.0`
63
+
64
+ - [pickers] Fix `disableOpenPicker` prop behavior (#13221) @LukasTy
65
+
66
+ #### `@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')
67
+
68
+ Same changes as in `@mui/x-date-pickers@6.20.0`.
69
+
6
70
  ## 6.19.12
7
71
 
8
72
  _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.1
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;
@@ -281,7 +281,11 @@ export var AdapterDayjs = /*#__PURE__*/_createClass(function AdapterDayjs() {
281
281
  if (((_fixedValue$$offset = fixedValue.$offset) != null ? _fixedValue$$offset : 0) === ((_value$$offset = value.$offset) != null ? _value$$offset : 0)) {
282
282
  return value;
283
283
  }
284
- return fixedValue;
284
+ // Change only what is needed to avoid creating a new object with unwanted data
285
+ // Especially important when used in an environment where utc or timezone dates are used only in some places
286
+ // Reference: https://github.com/mui/mui-x/issues/13290
287
+ // @ts-ignore
288
+ value.$offset = fixedValue.$offset;
285
289
  }
286
290
  return value;
287
291
  };
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.1
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 () {
@@ -267,7 +267,11 @@ export class AdapterDayjs {
267
267
  if ((fixedValue.$offset ?? 0) === (value.$offset ?? 0)) {
268
268
  return value;
269
269
  }
270
- return fixedValue;
270
+ // Change only what is needed to avoid creating a new object with unwanted data
271
+ // Especially important when used in an environment where utc or timezone dates are used only in some places
272
+ // Reference: https://github.com/mui/mui-x/issues/13290
273
+ // @ts-ignore
274
+ value.$offset = fixedValue.$offset;
271
275
  }
272
276
  return value;
273
277
  };
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.1
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;
@@ -275,7 +275,11 @@ class AdapterDayjs {
275
275
  if ((fixedValue.$offset ?? 0) === (value.$offset ?? 0)) {
276
276
  return value;
277
277
  }
278
- return fixedValue;
278
+ // Change only what is needed to avoid creating a new object with unwanted data
279
+ // Especially important when used in an environment where utc or timezone dates are used only in some places
280
+ // Reference: https://github.com/mui/mui-x/issues/13290
281
+ // @ts-ignore
282
+ value.$offset = fixedValue.$offset;
279
283
  }
280
284
  return value;
281
285
  };
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.1
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.1",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",