@mui/x-date-pickers 6.20.0 → 6.20.2

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,53 @@
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.2
7
+
8
+ _Jun 20, 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
+ ### Date Pickers
15
+
16
+ #### `@mui/x-date-pickers@6.20.2`
17
+
18
+ - [fields] Do not apply digit editing when pressing `Space` (#13516) @flaviendelangle
19
+ - [pickers] Fix controlled `view` behavior (#13559) @LukasTy
20
+
21
+ ## 6.20.1
22
+
23
+ _Jun 6, 2024_
24
+
25
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
26
+
27
+ - 🐞 Bugfixes
28
+
29
+ ### Data Grid
30
+
31
+ #### `@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')
32
+
33
+ - [DataGridPremium] Fix clipboard paste not working when cell loses focus (#12737) @cherniavskii
34
+
35
+ ### Date Pickers
36
+
37
+ #### `@mui/x-date-pickers@6.20.1`
38
+
39
+ - [pickers] Fix `AdapterDayjs` timezone behavior (#13373) @LukasTy
40
+
41
+ #### `@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')
42
+
43
+ Same changes as in `@mui/x-date-pickers-pro@7.20.1`.
44
+
45
+ ### Docs
46
+
47
+ - [docs] Fix Pickers FAQ callout (#13243) @LukasTy
48
+
49
+ ### Core
50
+
51
+ - [core] Stop publishing v6 under latest tag (#13269) @cherniavskii
52
+
6
53
  ## 6.20.0
7
54
 
8
55
  _May 24, 2024_
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.20.0
2
+ * @mui/x-date-pickers v6.20.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -236,7 +236,7 @@ export const useFieldCharacterEditing = ({
236
236
  };
237
237
  const applyCharacterEditing = useEventCallback(params => {
238
238
  const activeSection = sections[params.sectionIndex];
239
- const isNumericEditing = !Number.isNaN(Number(params.keyPressed));
239
+ const isNumericEditing = params.keyPressed !== ' ' && !Number.isNaN(Number(params.keyPressed));
240
240
  const response = isNumericEditing ? applyNumericEditing(params) : applyLetterEditing(params);
241
241
  if (response == null) {
242
242
  setTempAndroidValueStr(null);
@@ -39,6 +39,7 @@ export const usePickerViews = ({
39
39
  onClose
40
40
  } = propsFromPickerValue;
41
41
  const {
42
+ view: inView,
42
43
  views,
43
44
  openTo,
44
45
  onViewChange,
@@ -54,7 +55,7 @@ export const usePickerViews = ({
54
55
  setFocusedView,
55
56
  setValueAndGoToNextView
56
57
  } = useViews({
57
- view: undefined,
58
+ view: inView,
58
59
  views,
59
60
  openTo,
60
61
  onChange,
@@ -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.20.0
2
+ * @mui/x-date-pickers v6.20.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -254,7 +254,7 @@ export var useFieldCharacterEditing = function useFieldCharacterEditing(_ref) {
254
254
  };
255
255
  var applyCharacterEditing = useEventCallback(function (params) {
256
256
  var activeSection = sections[params.sectionIndex];
257
- var isNumericEditing = !Number.isNaN(Number(params.keyPressed));
257
+ var isNumericEditing = params.keyPressed !== ' ' && !Number.isNaN(Number(params.keyPressed));
258
258
  var response = isNumericEditing ? applyNumericEditing(params) : applyLetterEditing(params);
259
259
  if (response == null) {
260
260
  setTempAndroidValueStr(null);
@@ -36,7 +36,8 @@ export var usePickerViews = function usePickerViews(_ref) {
36
36
  open = propsFromPickerValue.open,
37
37
  onSelectedSectionsChange = propsFromPickerValue.onSelectedSectionsChange,
38
38
  onClose = propsFromPickerValue.onClose;
39
- var views = props.views,
39
+ var inView = props.view,
40
+ views = props.views,
40
41
  openTo = props.openTo,
41
42
  onViewChange = props.onViewChange,
42
43
  viewRenderers = props.viewRenderers,
@@ -45,7 +46,7 @@ export var usePickerViews = function usePickerViews(_ref) {
45
46
  sx = props.sx,
46
47
  propsToForwardToView = _objectWithoutProperties(props, _excluded);
47
48
  var _useViews = useViews({
48
- view: undefined,
49
+ view: inView,
49
50
  views: views,
50
51
  openTo: openTo,
51
52
  onChange: onChange,
@@ -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.20.0
2
+ * @mui/x-date-pickers v6.20.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -235,7 +235,7 @@ export const useFieldCharacterEditing = ({
235
235
  };
236
236
  const applyCharacterEditing = useEventCallback(params => {
237
237
  const activeSection = sections[params.sectionIndex];
238
- const isNumericEditing = !Number.isNaN(Number(params.keyPressed));
238
+ const isNumericEditing = params.keyPressed !== ' ' && !Number.isNaN(Number(params.keyPressed));
239
239
  const response = isNumericEditing ? applyNumericEditing(params) : applyLetterEditing(params);
240
240
  if (response == null) {
241
241
  setTempAndroidValueStr(null);
@@ -39,6 +39,7 @@ export const usePickerViews = ({
39
39
  onClose
40
40
  } = propsFromPickerValue;
41
41
  const {
42
+ view: inView,
42
43
  views,
43
44
  openTo,
44
45
  onViewChange,
@@ -54,7 +55,7 @@ export const usePickerViews = ({
54
55
  setFocusedView,
55
56
  setValueAndGoToNextView
56
57
  } = useViews({
57
- view: undefined,
58
+ view: inView,
58
59
  views,
59
60
  openTo,
60
61
  onChange,
@@ -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.20.0
2
+ * @mui/x-date-pickers v6.20.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -243,7 +243,7 @@ const useFieldCharacterEditing = ({
243
243
  };
244
244
  const applyCharacterEditing = (0, _useEventCallback.default)(params => {
245
245
  const activeSection = sections[params.sectionIndex];
246
- const isNumericEditing = !Number.isNaN(Number(params.keyPressed));
246
+ const isNumericEditing = params.keyPressed !== ' ' && !Number.isNaN(Number(params.keyPressed));
247
247
  const response = isNumericEditing ? applyNumericEditing(params) : applyLetterEditing(params);
248
248
  if (response == null) {
249
249
  setTempAndroidValueStr(null);
@@ -47,6 +47,7 @@ const usePickerViews = ({
47
47
  onClose
48
48
  } = propsFromPickerValue;
49
49
  const {
50
+ view: inView,
50
51
  views,
51
52
  openTo,
52
53
  onViewChange,
@@ -62,7 +63,7 @@ const usePickerViews = ({
62
63
  setFocusedView,
63
64
  setValueAndGoToNextView
64
65
  } = (0, _useViews.useViews)({
65
- view: undefined,
66
+ view: inView,
66
67
  views,
67
68
  openTo,
68
69
  onChange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.20.0",
3
+ "version": "6.20.2",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",