@mui/x-date-pickers 6.19.8 → 6.19.12

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.
@@ -189,14 +189,10 @@ export class AdapterMomentJalaali extends AdapterMoment {
189
189
  return this.moment(value).isSame(comparing);
190
190
  };
191
191
  this.isSameYear = (value, comparing) => {
192
- // `isSame` seems to mutate the date on `moment-jalaali`
193
- // @ts-ignore
194
- return value.clone().isSame(comparing, 'jYear');
192
+ return value.jYear() === comparing.jYear();
195
193
  };
196
194
  this.isSameMonth = (value, comparing) => {
197
- // `isSame` seems to mutate the date on `moment-jalaali`
198
- // @ts-ignore
199
- return value.clone().isSame(comparing, 'jMonth');
195
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
200
196
  };
201
197
  this.isAfterYear = (value, comparing) => {
202
198
  return value.jYear() > comparing.jYear();
package/CHANGELOG.md CHANGED
@@ -3,6 +3,120 @@
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.19.12
7
+
8
+ _May 17, 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.19.12`
17
+
18
+ - [pickers] Fix `AdapterMomentJalaali` regression (#13150) @LukasTy
19
+
20
+ #### `@mui/x-date-pickers-pro@6.19.12` [![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-date-pickers@6.19.12`.
23
+
24
+ ### Docs
25
+
26
+ - [docs] Use MUI X v6 in Codesandbox and Stackblitz demos (#12838) @cherniavskii
27
+
28
+ ## 6.19.11
29
+
30
+ _Apr 18, 2024_
31
+
32
+ We'd like to offer a big thanks to the 1 contributor who made this release possible. Here are some highlights ✨:
33
+
34
+ - 🐞 Bugfixes
35
+
36
+ ### Data Grid
37
+
38
+ #### `@mui/x-data-grid@6.19.11`
39
+
40
+ - [DataGrid] Fix virtualization memory leak (#12812) @romgrk
41
+
42
+ #### `@mui/x-data-grid-pro@6.19.11` [![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-data-grid@6.19.11`.
45
+
46
+ #### `@mui/x-data-grid-premium@6.19.11` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
47
+
48
+ Same changes as in `@mui/x-data-grid-pro@6.19.11`.
49
+
50
+ ## 6.19.10
51
+
52
+ _Apr 12, 2024_
53
+
54
+ We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
55
+
56
+ - 🐞 Bugfixes
57
+ - 📚 Documentation improvements
58
+
59
+ ### Data Grid
60
+
61
+ #### `@mui/x-data-grid@6.19.10`
62
+
63
+ - [DataGrid] Do not escape double quotes when copying to clipboard (#12734) @cherniavskii
64
+ - [DataGrid] Fix bug in suspense (#12754) @cherniavskii
65
+
66
+ #### `@mui/x-data-grid-pro@6.19.10` [![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-data-grid@6.19.10`.
69
+
70
+ #### `@mui/x-data-grid-premium@6.19.10` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
71
+
72
+ Same changes as in `@mui/x-data-grid-pro@6.19.10`.
73
+
74
+ ### Core
75
+
76
+ - [core] Update the docs release source branch (#12685) @LukasTy
77
+
78
+ ## 6.19.9
79
+
80
+ _Apr 5, 2024_
81
+
82
+ We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
83
+
84
+ - 🐞 Bugfixes
85
+ - 📚 Documentation improvements
86
+
87
+ ### Data Grid
88
+
89
+ #### `@mui/x-data-grid@6.19.9`
90
+
91
+ - [DataGrid] Remove legacy editing API event: `rowEditCommit` (#12087) @MBilalShafi
92
+
93
+ #### `@mui/x-data-grid-pro@6.19.9` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
94
+
95
+ Same changes as in `@mui/x-data-grid@6.19.9`.
96
+
97
+ #### `@mui/x-data-grid-premium@6.19.9` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
98
+
99
+ Same changes as in `@mui/x-data-grid-pro@6.19.9`.
100
+
101
+ ### Date Pickers
102
+
103
+ #### `@mui/x-date-pickers@6.19.9`
104
+
105
+ No changes.
106
+
107
+ #### `@mui/x-date-pickers-pro@6.19.9` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
108
+
109
+ - [DateRangePicker] Fix selection behavior with single input field when `readOnly` (#12605) @LukasTy
110
+
111
+ ### Docs
112
+
113
+ - [docs] Adds a recipe for the `checkboxSelectionVisibleOnly` prop (#12667) @michelengelen
114
+ - [docs] Explain the use of `_action: 'delete'` in `processRowUpdate` (#12673) @michelengelen
115
+
116
+ ### Core
117
+
118
+ - [core] Use Circle CI context (#12607) @cherniavskii
119
+
6
120
  ## 6.19.8
7
121
 
8
122
  _Mar 20, 2024_
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.8
2
+ * @mui/x-date-pickers v6.19.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -403,10 +403,11 @@ export const useField = params => {
403
403
  React.useImperativeHandle(unstableFieldRef, () => ({
404
404
  getSections: () => state.sections,
405
405
  getActiveSectionIndex: () => {
406
- var _selectionStart2, _selectionEnd;
406
+ var _selectionStart2, _selectionEnd, _inputRef$current;
407
407
  const browserStartIndex = (_selectionStart2 = inputRef.current.selectionStart) != null ? _selectionStart2 : 0;
408
408
  const browserEndIndex = (_selectionEnd = inputRef.current.selectionEnd) != null ? _selectionEnd : 0;
409
- if (browserStartIndex === 0 && browserEndIndex === 0) {
409
+ const isInputReadOnly = !!((_inputRef$current = inputRef.current) != null && _inputRef$current.readOnly);
410
+ if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {
410
411
  return null;
411
412
  }
412
413
  const nextSectionIndex = browserStartIndex <= state.sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.
@@ -416,11 +417,11 @@ export const useField = params => {
416
417
  setSelectedSections: activeSectionIndex => setSelectedSections(activeSectionIndex)
417
418
  }));
418
419
  const handleClearValue = useEventCallback((event, ...args) => {
419
- var _inputRef$current;
420
+ var _inputRef$current2;
420
421
  event.preventDefault();
421
422
  onClear == null || onClear(event, ...args);
422
423
  clearValue();
423
- inputRef == null || (_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
424
+ inputRef == null || (_inputRef$current2 = inputRef.current) == null || _inputRef$current2.focus();
424
425
  setSelectedSections(0);
425
426
  });
426
427
  return _extends({
@@ -201,14 +201,10 @@ export var AdapterMomentJalaali = /*#__PURE__*/function (_AdapterMoment) {
201
201
  return _this.moment(value).isSame(comparing);
202
202
  };
203
203
  _this.isSameYear = function (value, comparing) {
204
- // `isSame` seems to mutate the date on `moment-jalaali`
205
- // @ts-ignore
206
- return value.clone().isSame(comparing, 'jYear');
204
+ return value.jYear() === comparing.jYear();
207
205
  };
208
206
  _this.isSameMonth = function (value, comparing) {
209
- // `isSame` seems to mutate the date on `moment-jalaali`
210
- // @ts-ignore
211
- return value.clone().isSame(comparing, 'jMonth');
207
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
212
208
  };
213
209
  _this.isAfterYear = function (value, comparing) {
214
210
  return value.jYear() > comparing.jYear();
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.8
2
+ * @mui/x-date-pickers v6.19.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -417,10 +417,11 @@ export var useField = function useField(params) {
417
417
  return state.sections;
418
418
  },
419
419
  getActiveSectionIndex: function getActiveSectionIndex() {
420
- var _selectionStart2, _selectionEnd;
420
+ var _selectionStart2, _selectionEnd, _inputRef$current;
421
421
  var browserStartIndex = (_selectionStart2 = inputRef.current.selectionStart) != null ? _selectionStart2 : 0;
422
422
  var browserEndIndex = (_selectionEnd = inputRef.current.selectionEnd) != null ? _selectionEnd : 0;
423
- if (browserStartIndex === 0 && browserEndIndex === 0) {
423
+ var isInputReadOnly = !!((_inputRef$current = inputRef.current) != null && _inputRef$current.readOnly);
424
+ if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {
424
425
  return null;
425
426
  }
426
427
  var nextSectionIndex = browserStartIndex <= state.sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.
@@ -435,14 +436,14 @@ export var useField = function useField(params) {
435
436
  };
436
437
  });
437
438
  var handleClearValue = useEventCallback(function (event) {
438
- var _inputRef$current;
439
+ var _inputRef$current2;
439
440
  event.preventDefault();
440
441
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
441
442
  args[_key4 - 1] = arguments[_key4];
442
443
  }
443
444
  onClear == null || onClear.apply(void 0, [event].concat(_toConsumableArray(args)));
444
445
  clearValue();
445
- inputRef == null || (_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
446
+ inputRef == null || (_inputRef$current2 = inputRef.current) == null || _inputRef$current2.focus();
446
447
  _setSelectedSections(0);
447
448
  });
448
449
  return _extends({
@@ -189,14 +189,10 @@ export class AdapterMomentJalaali extends AdapterMoment {
189
189
  return this.moment(value).isSame(comparing);
190
190
  };
191
191
  this.isSameYear = (value, comparing) => {
192
- // `isSame` seems to mutate the date on `moment-jalaali`
193
- // @ts-ignore
194
- return value.clone().isSame(comparing, 'jYear');
192
+ return value.jYear() === comparing.jYear();
195
193
  };
196
194
  this.isSameMonth = (value, comparing) => {
197
- // `isSame` seems to mutate the date on `moment-jalaali`
198
- // @ts-ignore
199
- return value.clone().isSame(comparing, 'jMonth');
195
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
200
196
  };
201
197
  this.isAfterYear = (value, comparing) => {
202
198
  return value.jYear() > comparing.jYear();
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.8
2
+ * @mui/x-date-pickers v6.19.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -401,7 +401,8 @@ export const useField = params => {
401
401
  getActiveSectionIndex: () => {
402
402
  const browserStartIndex = inputRef.current.selectionStart ?? 0;
403
403
  const browserEndIndex = inputRef.current.selectionEnd ?? 0;
404
- if (browserStartIndex === 0 && browserEndIndex === 0) {
404
+ const isInputReadOnly = !!inputRef.current?.readOnly;
405
+ if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {
405
406
  return null;
406
407
  }
407
408
  const nextSectionIndex = browserStartIndex <= state.sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.
@@ -197,14 +197,10 @@ class AdapterMomentJalaali extends _AdapterMoment.AdapterMoment {
197
197
  return this.moment(value).isSame(comparing);
198
198
  };
199
199
  this.isSameYear = (value, comparing) => {
200
- // `isSame` seems to mutate the date on `moment-jalaali`
201
- // @ts-ignore
202
- return value.clone().isSame(comparing, 'jYear');
200
+ return value.jYear() === comparing.jYear();
203
201
  };
204
202
  this.isSameMonth = (value, comparing) => {
205
- // `isSame` seems to mutate the date on `moment-jalaali`
206
- // @ts-ignore
207
- return value.clone().isSame(comparing, 'jMonth');
203
+ return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
208
204
  };
209
205
  this.isAfterYear = (value, comparing) => {
210
206
  return value.jYear() > comparing.jYear();
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v6.19.8
2
+ * @mui/x-date-pickers v6.19.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -410,7 +410,8 @@ const useField = params => {
410
410
  getActiveSectionIndex: () => {
411
411
  const browserStartIndex = inputRef.current.selectionStart ?? 0;
412
412
  const browserEndIndex = inputRef.current.selectionEnd ?? 0;
413
- if (browserStartIndex === 0 && browserEndIndex === 0) {
413
+ const isInputReadOnly = !!inputRef.current?.readOnly;
414
+ if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {
414
415
  return null;
415
416
  }
416
417
  const nextSectionIndex = browserStartIndex <= state.sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "6.19.8",
3
+ "version": "6.19.12",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",