@mui/x-date-pickers 5.0.5 → 5.0.6
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 +37 -0
- package/index.js +1 -1
- package/internals/hooks/useMaskedInput.js +6 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useMaskedInput.js +6 -2
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useMaskedInput.js +6 -2
- package/node/index.js +1 -1
- package/node/internals/hooks/useMaskedInput.js +6 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
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
|
+
## 5.17.9
|
|
7
|
+
|
|
8
|
+
_Oct 28, 2022_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⚡ Fix memory leak during unmount of the DataGrid (#6579) @cherniavskii
|
|
13
|
+
- 🎁 Allow to disable the autofocus of the search field when opening the column visibility panel (#6630) @e-cloud
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### `@mui/x-data-grid@v5.17.9` / `@mui/x-data-grid-pro@v5.17.9` / `@mui/x-data-grid-premium@v5.17.9`
|
|
17
|
+
|
|
18
|
+
#### Changes
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Allow to disable autofocusing the search field in the columns panel (#6630) @e-cloud
|
|
21
|
+
- [DataGrid] Fix `setRows` method not persisting new rows data after `loading` prop change (#6637) @cherniavskii
|
|
22
|
+
- [DataGrid] Fix memory leak on grid unmount (#6579) @cherniavskii
|
|
23
|
+
- [l10n] Improve Bulgarian (bg-BG) locale (#6635) @AtanasVA
|
|
24
|
+
|
|
25
|
+
### `@mui/x-date-pickers@v5.0.6` / `@mui/x-date-pickers-pro@v5.0.6`
|
|
26
|
+
|
|
27
|
+
#### Changes
|
|
28
|
+
|
|
29
|
+
- [pickers] Ignore milliseconds in mask logic (#6618) @alexfauquette
|
|
30
|
+
- [pickers] Update input when `inputFormat` is modified (#6617) @alexfauquette
|
|
31
|
+
|
|
32
|
+
### Docs
|
|
33
|
+
|
|
34
|
+
- [docs] Add token to redirect feedbacks on slack (#6592) @alexfauquette
|
|
35
|
+
- [docs] Disable translations (#6639) @cherniavskii
|
|
36
|
+
- [docs] Fix code edit for when v6 will be stable (#6600) @oliviertassinari
|
|
37
|
+
- [docs] Fix typo in DataGrid demo page (#6632) (#6634) @LukasTy
|
|
38
|
+
|
|
39
|
+
### Core
|
|
40
|
+
|
|
41
|
+
- [core] Upgrade monorepo (#6570) @cherniavskii
|
|
42
|
+
|
|
6
43
|
## 5.17.8
|
|
7
44
|
|
|
8
45
|
_Oct 20, 2022_
|
package/index.js
CHANGED
|
@@ -49,20 +49,24 @@ export const useMaskedInput = ({
|
|
|
49
49
|
|
|
50
50
|
const prevRawValue = React.useRef();
|
|
51
51
|
const prevLocale = React.useRef(utils.locale);
|
|
52
|
+
const prevInputFormat = React.useRef(inputFormat);
|
|
52
53
|
React.useEffect(() => {
|
|
53
54
|
const rawValueHasChanged = rawValue !== prevRawValue.current;
|
|
54
55
|
const localeHasChanged = utils.locale !== prevLocale.current;
|
|
56
|
+
const inputFormatHasChanged = inputFormat !== prevInputFormat.current;
|
|
55
57
|
prevRawValue.current = rawValue;
|
|
56
58
|
prevLocale.current = utils.locale;
|
|
59
|
+
prevInputFormat.current = inputFormat;
|
|
57
60
|
|
|
58
|
-
if (!rawValueHasChanged && !localeHasChanged) {
|
|
61
|
+
if (!rawValueHasChanged && !localeHasChanged && !inputFormatHasChanged) {
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
const newParsedValue = rawValue === null ? null : utils.date(rawValue);
|
|
63
66
|
const isAcceptedValue = rawValue === null || utils.isValid(newParsedValue);
|
|
67
|
+
const innerEqualsParsed = innerInputValue === null ? newParsedValue === null : newParsedValue !== null && Math.abs(utils.getDiff(innerInputValue, newParsedValue, 'seconds')) === 0;
|
|
64
68
|
|
|
65
|
-
if (!localeHasChanged && (!isAcceptedValue ||
|
|
69
|
+
if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
|
|
66
70
|
return;
|
|
67
71
|
} // When dev set a new valid value, we trust them
|
|
68
72
|
|
package/legacy/index.js
CHANGED
|
@@ -63,20 +63,24 @@ export var useMaskedInput = function useMaskedInput(_ref) {
|
|
|
63
63
|
|
|
64
64
|
var prevRawValue = React.useRef();
|
|
65
65
|
var prevLocale = React.useRef(utils.locale);
|
|
66
|
+
var prevInputFormat = React.useRef(inputFormat);
|
|
66
67
|
React.useEffect(function () {
|
|
67
68
|
var rawValueHasChanged = rawValue !== prevRawValue.current;
|
|
68
69
|
var localeHasChanged = utils.locale !== prevLocale.current;
|
|
70
|
+
var inputFormatHasChanged = inputFormat !== prevInputFormat.current;
|
|
69
71
|
prevRawValue.current = rawValue;
|
|
70
72
|
prevLocale.current = utils.locale;
|
|
73
|
+
prevInputFormat.current = inputFormat;
|
|
71
74
|
|
|
72
|
-
if (!rawValueHasChanged && !localeHasChanged) {
|
|
75
|
+
if (!rawValueHasChanged && !localeHasChanged && !inputFormatHasChanged) {
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
var newParsedValue = rawValue === null ? null : utils.date(rawValue);
|
|
77
80
|
var isAcceptedValue = rawValue === null || utils.isValid(newParsedValue);
|
|
81
|
+
var innerEqualsParsed = innerInputValue === null ? newParsedValue === null : newParsedValue !== null && Math.abs(utils.getDiff(innerInputValue, newParsedValue, 'seconds')) === 0;
|
|
78
82
|
|
|
79
|
-
if (!localeHasChanged && (!isAcceptedValue ||
|
|
83
|
+
if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
|
|
80
84
|
return;
|
|
81
85
|
} // When dev set a new valid value, we trust them
|
|
82
86
|
|
package/modern/index.js
CHANGED
|
@@ -49,20 +49,24 @@ export const useMaskedInput = ({
|
|
|
49
49
|
|
|
50
50
|
const prevRawValue = React.useRef();
|
|
51
51
|
const prevLocale = React.useRef(utils.locale);
|
|
52
|
+
const prevInputFormat = React.useRef(inputFormat);
|
|
52
53
|
React.useEffect(() => {
|
|
53
54
|
const rawValueHasChanged = rawValue !== prevRawValue.current;
|
|
54
55
|
const localeHasChanged = utils.locale !== prevLocale.current;
|
|
56
|
+
const inputFormatHasChanged = inputFormat !== prevInputFormat.current;
|
|
55
57
|
prevRawValue.current = rawValue;
|
|
56
58
|
prevLocale.current = utils.locale;
|
|
59
|
+
prevInputFormat.current = inputFormat;
|
|
57
60
|
|
|
58
|
-
if (!rawValueHasChanged && !localeHasChanged) {
|
|
61
|
+
if (!rawValueHasChanged && !localeHasChanged && !inputFormatHasChanged) {
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
const newParsedValue = rawValue === null ? null : utils.date(rawValue);
|
|
63
66
|
const isAcceptedValue = rawValue === null || utils.isValid(newParsedValue);
|
|
67
|
+
const innerEqualsParsed = innerInputValue === null ? newParsedValue === null : newParsedValue !== null && Math.abs(utils.getDiff(innerInputValue, newParsedValue, 'seconds')) === 0;
|
|
64
68
|
|
|
65
|
-
if (!localeHasChanged && (!isAcceptedValue ||
|
|
69
|
+
if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
|
|
66
70
|
return;
|
|
67
71
|
} // When dev set a new valid value, we trust them
|
|
68
72
|
|
package/node/index.js
CHANGED
|
@@ -67,20 +67,24 @@ const useMaskedInput = ({
|
|
|
67
67
|
|
|
68
68
|
const prevRawValue = React.useRef();
|
|
69
69
|
const prevLocale = React.useRef(utils.locale);
|
|
70
|
+
const prevInputFormat = React.useRef(inputFormat);
|
|
70
71
|
React.useEffect(() => {
|
|
71
72
|
const rawValueHasChanged = rawValue !== prevRawValue.current;
|
|
72
73
|
const localeHasChanged = utils.locale !== prevLocale.current;
|
|
74
|
+
const inputFormatHasChanged = inputFormat !== prevInputFormat.current;
|
|
73
75
|
prevRawValue.current = rawValue;
|
|
74
76
|
prevLocale.current = utils.locale;
|
|
77
|
+
prevInputFormat.current = inputFormat;
|
|
75
78
|
|
|
76
|
-
if (!rawValueHasChanged && !localeHasChanged) {
|
|
79
|
+
if (!rawValueHasChanged && !localeHasChanged && !inputFormatHasChanged) {
|
|
77
80
|
return;
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
const newParsedValue = rawValue === null ? null : utils.date(rawValue);
|
|
81
84
|
const isAcceptedValue = rawValue === null || utils.isValid(newParsedValue);
|
|
85
|
+
const innerEqualsParsed = innerInputValue === null ? newParsedValue === null : newParsedValue !== null && Math.abs(utils.getDiff(innerInputValue, newParsedValue, 'seconds')) === 0;
|
|
82
86
|
|
|
83
|
-
if (!localeHasChanged && (!isAcceptedValue ||
|
|
87
|
+
if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
|
|
84
88
|
return;
|
|
85
89
|
} // When dev set a new valid value, we trust them
|
|
86
90
|
|