@mui/x-date-pickers 5.0.17 → 5.0.18

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,40 @@
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.23
7
+
8
+ _Feb 9, 2023_
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
+ - 🌍 Improve Brazilian Portuguese (pt-BR) locale
13
+ - 🎉 Add banner and callouts to inform about MUI X v6 beta
14
+ - 🐞 Bugfixes
15
+
16
+ ### `@mui/x-data-grid@v5.17.23` / `@mui/x-data-grid-pro@v5.17.23` / `@mui/x-data-grid-premium@v5.17.23`
17
+
18
+ #### Changes
19
+
20
+ - [DataGrid] Allow to customize the value displayed in the filter button tooltip (#7816) @ithrforu
21
+ - [DataGrid] Fix `getCellElement` method not working with pinned columns (#7844) @yaredtsy
22
+ - [DataGrid] Fix stale rows issue in `unstable_replaceRows` (#7694) @MBilalShafi
23
+ - [l10n] Improve Brazilian Portuguese (pt-BR) locale (#7850) @ed-ateixeira
24
+
25
+ ### `@mui/x-date-pickers@v_5.0.18` / `@mui/x-date-pickers-pro@v_5.0.18`
26
+
27
+ #### Changes
28
+
29
+ - [pickers] Update pickers when new value has a distinct timezone (#7853) @alexfauquette
30
+
31
+ ### Docs
32
+
33
+ - [docs] Add messages in v5 doc to inform people about v6 (#7838) @flaviendelangle
34
+ - [docs] Fix 301 link @oliviertassinari
35
+
36
+ ### Core
37
+
38
+ - [core] Upgrade monorepo (#7849) @cherniavskii
39
+
6
40
  ## v5.17.22
7
41
 
8
42
  _Feb 2, 2023_
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI X v5.0.17
1
+ /** @license MUI X v5.0.18
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -64,7 +64,20 @@ export const useMaskedInput = ({
64
64
 
65
65
  const newParsedValue = rawValue === null ? null : utils.date(rawValue);
66
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;
67
+ let innerEqualsParsed = innerInputValue === null && newParsedValue === null; // equal by being both null
68
+
69
+ if (innerInputValue !== null && newParsedValue !== null) {
70
+ const areEqual = utils.isEqual(innerInputValue, newParsedValue);
71
+
72
+ if (areEqual) {
73
+ innerEqualsParsed = true;
74
+ } else {
75
+ const diff = Math.abs(utils.getDiff(innerInputValue, newParsedValue)); // diff in ms
76
+
77
+ innerEqualsParsed = diff === 0 ? areEqual // if no diff, use equal to test the time-zone
78
+ : diff < 1000; // accept a difference bellow 1s
79
+ }
80
+ }
68
81
 
69
82
  if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
70
83
  return;
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI X v5.0.17
1
+ /** @license MUI X v5.0.18
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -78,7 +78,20 @@ export var useMaskedInput = function useMaskedInput(_ref) {
78
78
 
79
79
  var newParsedValue = rawValue === null ? null : utils.date(rawValue);
80
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;
81
+ var innerEqualsParsed = innerInputValue === null && newParsedValue === null; // equal by being both null
82
+
83
+ if (innerInputValue !== null && newParsedValue !== null) {
84
+ var areEqual = utils.isEqual(innerInputValue, newParsedValue);
85
+
86
+ if (areEqual) {
87
+ innerEqualsParsed = true;
88
+ } else {
89
+ var diff = Math.abs(utils.getDiff(innerInputValue, newParsedValue)); // diff in ms
90
+
91
+ innerEqualsParsed = diff === 0 ? areEqual // if no diff, use equal to test the time-zone
92
+ : diff < 1000; // accept a difference bellow 1s
93
+ }
94
+ }
82
95
 
83
96
  if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
84
97
  return;
@@ -19,10 +19,10 @@ var ptBRPickers = {
19
19
  okButtonLabel: 'OK',
20
20
  todayButtonLabel: 'Hoje',
21
21
  // Toolbar titles
22
- // datePickerDefaultToolbarTitle: 'Select date',
23
- // dateTimePickerDefaultToolbarTitle: 'Select date & time',
24
- // timePickerDefaultToolbarTitle: 'Select time',
25
- // dateRangePickerDefaultToolbarTitle: 'Select date range',
22
+ datePickerDefaultToolbarTitle: 'Selecione a data',
23
+ dateTimePickerDefaultToolbarTitle: 'Selecione data e hora',
24
+ timePickerDefaultToolbarTitle: 'Selecione a hora',
25
+ dateRangePickerDefaultToolbarTitle: 'Selecione o intervalo entre datas',
26
26
  // Clock labels
27
27
  clockLabelText: function clockLabelText(view, time, adapter) {
28
28
  return "Selecione ".concat(view, ". ").concat(time === null ? 'Hora não selecionada' : "Selecionado a hora ".concat(adapter.format(time, 'fullTime')));
package/locales/ptBR.js CHANGED
@@ -17,10 +17,10 @@ const ptBRPickers = {
17
17
  okButtonLabel: 'OK',
18
18
  todayButtonLabel: 'Hoje',
19
19
  // Toolbar titles
20
- // datePickerDefaultToolbarTitle: 'Select date',
21
- // dateTimePickerDefaultToolbarTitle: 'Select date & time',
22
- // timePickerDefaultToolbarTitle: 'Select time',
23
- // dateRangePickerDefaultToolbarTitle: 'Select date range',
20
+ datePickerDefaultToolbarTitle: 'Selecione a data',
21
+ dateTimePickerDefaultToolbarTitle: 'Selecione data e hora',
22
+ timePickerDefaultToolbarTitle: 'Selecione a hora',
23
+ dateRangePickerDefaultToolbarTitle: 'Selecione o intervalo entre datas',
24
24
  // Clock labels
25
25
  clockLabelText: (view, time, adapter) => `Selecione ${view}. ${time === null ? 'Hora não selecionada' : `Selecionado a hora ${adapter.format(time, 'fullTime')}`}`,
26
26
  hoursClockNumberText: hours => `${hours} horas`,
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI X v5.0.17
1
+ /** @license MUI X v5.0.18
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -64,7 +64,20 @@ export const useMaskedInput = ({
64
64
 
65
65
  const newParsedValue = rawValue === null ? null : utils.date(rawValue);
66
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;
67
+ let innerEqualsParsed = innerInputValue === null && newParsedValue === null; // equal by being both null
68
+
69
+ if (innerInputValue !== null && newParsedValue !== null) {
70
+ const areEqual = utils.isEqual(innerInputValue, newParsedValue);
71
+
72
+ if (areEqual) {
73
+ innerEqualsParsed = true;
74
+ } else {
75
+ const diff = Math.abs(utils.getDiff(innerInputValue, newParsedValue)); // diff in ms
76
+
77
+ innerEqualsParsed = diff === 0 ? areEqual // if no diff, use equal to test the time-zone
78
+ : diff < 1000; // accept a difference bellow 1s
79
+ }
80
+ }
68
81
 
69
82
  if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
70
83
  return;
@@ -17,10 +17,10 @@ const ptBRPickers = {
17
17
  okButtonLabel: 'OK',
18
18
  todayButtonLabel: 'Hoje',
19
19
  // Toolbar titles
20
- // datePickerDefaultToolbarTitle: 'Select date',
21
- // dateTimePickerDefaultToolbarTitle: 'Select date & time',
22
- // timePickerDefaultToolbarTitle: 'Select time',
23
- // dateRangePickerDefaultToolbarTitle: 'Select date range',
20
+ datePickerDefaultToolbarTitle: 'Selecione a data',
21
+ dateTimePickerDefaultToolbarTitle: 'Selecione data e hora',
22
+ timePickerDefaultToolbarTitle: 'Selecione a hora',
23
+ dateRangePickerDefaultToolbarTitle: 'Selecione o intervalo entre datas',
24
24
  // Clock labels
25
25
  clockLabelText: (view, time, adapter) => `Selecione ${view}. ${time === null ? 'Hora não selecionada' : `Selecionado a hora ${adapter.format(time, 'fullTime')}`}`,
26
26
  hoursClockNumberText: hours => `${hours} horas`,
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI X v5.0.17
1
+ /** @license MUI X v5.0.18
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -82,7 +82,20 @@ const useMaskedInput = ({
82
82
 
83
83
  const newParsedValue = rawValue === null ? null : utils.date(rawValue);
84
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;
85
+ let innerEqualsParsed = innerInputValue === null && newParsedValue === null; // equal by being both null
86
+
87
+ if (innerInputValue !== null && newParsedValue !== null) {
88
+ const areEqual = utils.isEqual(innerInputValue, newParsedValue);
89
+
90
+ if (areEqual) {
91
+ innerEqualsParsed = true;
92
+ } else {
93
+ const diff = Math.abs(utils.getDiff(innerInputValue, newParsedValue)); // diff in ms
94
+
95
+ innerEqualsParsed = diff === 0 ? areEqual // if no diff, use equal to test the time-zone
96
+ : diff < 1000; // accept a difference bellow 1s
97
+ }
98
+ }
86
99
 
87
100
  if (!localeHasChanged && !inputFormatHasChanged && (!isAcceptedValue || innerEqualsParsed)) {
88
101
  return;
@@ -25,10 +25,10 @@ const ptBRPickers = {
25
25
  okButtonLabel: 'OK',
26
26
  todayButtonLabel: 'Hoje',
27
27
  // Toolbar titles
28
- // datePickerDefaultToolbarTitle: 'Select date',
29
- // dateTimePickerDefaultToolbarTitle: 'Select date & time',
30
- // timePickerDefaultToolbarTitle: 'Select time',
31
- // dateRangePickerDefaultToolbarTitle: 'Select date range',
28
+ datePickerDefaultToolbarTitle: 'Selecione a data',
29
+ dateTimePickerDefaultToolbarTitle: 'Selecione data e hora',
30
+ timePickerDefaultToolbarTitle: 'Selecione a hora',
31
+ dateRangePickerDefaultToolbarTitle: 'Selecione o intervalo entre datas',
32
32
  // Clock labels
33
33
  clockLabelText: (view, time, adapter) => `Selecione ${view}. ${time === null ? 'Hora não selecionada' : `Selecionado a hora ${adapter.format(time, 'fullTime')}`}`,
34
34
  hoursClockNumberText: hours => `${hours} horas`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "5.0.17",
3
+ "version": "5.0.18",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",