@mui/x-date-pickers-pro 7.22.2 → 7.22.3

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,81 @@
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
+ ## 7.22.3
7
+
8
+ _Nov 21, 2024_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 📊 Charts Pro get stable. The [zoom](https://mui.com/x/react-charts/zoom-and-pan/) and [Heatmap](https://mui.com/x/react-charts/heatmap/) are now stable.
13
+ - 🌍 Improve Chinese, Spanish, Swedish, and Turkish locales on the Data Grid
14
+ - 🐞 Bugfixes
15
+
16
+ Special thanks go out to the community contributors who have helped make this release possible:
17
+ @CarlosLopezLg, @headironc, @viktormelin, @qerkules, @DungTiger, @hendrikpeilke, @k-rajat19.
18
+ Following are all team members who have contributed to this release:
19
+ @alexfauquette, @LukasTy, @MBilalShafi, @flaviendelangle.
20
+
21
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
22
+
23
+ ### Data Grid
24
+
25
+ #### `@mui/x-data-grid@7.22.3`
26
+
27
+ - [DataGrid] Add prop to override search input props in `GridColumnsManagement` (#15476) @k-rajat19
28
+ - [DataGrid] Add test coverage for issues fixed in #15184 @MBilalShafi
29
+ - [DataGrid] Fix memoized selectors with arguments (#15336) @MBilalShafi
30
+ - [DataGrid] Fix right column group header border with virtualization (#15503) @hendrikpeilke
31
+ - [DataGrid] Pass reason to `onPaginationModelChange` (#15402) @DungTiger
32
+ - [DataGrid] Set default overlay height in flex parent layout (#15535) @cherniavskii
33
+ - [l10n] Improve Chinese (zh-CN) locale (#15365) @headironc
34
+ - [l10n] Improve Spanish (es-ES) locale (#15369) @CarlosLopezLg
35
+ - [l10n] Improve Swedish (sv-SE) locale (#15371) @viktormelin
36
+ - [l10n] Improve Turkish (tr-TR) locale (#15414) @qerkules
37
+
38
+ #### `@mui/x-data-grid-pro@7.22.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
39
+
40
+ Same changes as in `@mui/x-data-grid@7.22.3`.
41
+
42
+ #### `@mui/x-data-grid-premium@7.22.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
43
+
44
+ Same changes as in `@mui/x-data-grid-pro@7.22.3`.
45
+
46
+ ### Date and Time Pickers
47
+
48
+ #### `@mui/x-date-pickers@7.22.3`
49
+
50
+ - [pickers] Always use `props.value` when it changes (#15500) @flaviendelangle
51
+ - [pickers] Ensure internal value timezone is updated (#15491) @LukasTy
52
+ - [pickers] Fix `DateTimeRangePicker` error when using format without time (#15341) @fxnoob
53
+ - [pickers] Fix unused code in `PickersToolbar` component (#15525) @LukasTy
54
+
55
+ #### `@mui/x-date-pickers-pro@7.22.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
56
+
57
+ Same changes as in `@mui/x-date-pickers@7.22.3`, plus:
58
+
59
+ - [DateTimeRangePicker] Use time in `referenceDate` when selecting date (#15431) @LukasTy
60
+
61
+ ### Charts
62
+
63
+ #### `@mui/x-charts@7.22.3`
64
+
65
+ No changes since `@mui/x-charts@7.22.2`.
66
+
67
+ #### `@mui/x-charts-pro@7.22.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
68
+
69
+ - [charts-pro] Fix missing typeOverload (#15400) @alexfauquette
70
+
71
+ ### Docs
72
+
73
+ - [docs] Add `PickersPopper` component to customization playground (#15397) @LukasTy
74
+ - [docs] Add `next` version links (#15423) @LukasTy
75
+ - [docs] Use the `loading` state in the demos (#15538) @cherniavskii
76
+
77
+ - [code-infra] Tentative fix for Argos flaky screenshot tests (#15399) @JCQuintas
78
+ - [docs-infra] Transpile `.ts` demo files (#15421) @KenanYusuf
79
+ - [core] Clarify release version bump strategy (#15536) @cherniavskii
80
+
6
81
  ## 7.22.2
7
82
 
8
83
  _Nov 8, 2024_
@@ -213,7 +213,8 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
213
213
  range: value,
214
214
  rangePosition,
215
215
  allowRangeFlip,
216
- shouldMergeDateAndTime: true
216
+ shouldMergeDateAndTime: true,
217
+ referenceDate
217
218
  });
218
219
  const isNextSectionAvailable = availableRangePositions.includes(nextSelection);
219
220
  if (isNextSectionAvailable) {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.22.2
2
+ * @mui/x-date-pickers-pro v7.22.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -12,11 +12,12 @@ interface CalculateRangeChangeOptions<TDate extends PickerValidDate> {
12
12
  */
13
13
  allowRangeFlip?: boolean;
14
14
  shouldMergeDateAndTime?: boolean;
15
+ referenceDate?: TDate | null;
15
16
  }
16
17
  interface CalculateRangeChangeResponse<TDate extends PickerValidDate> {
17
18
  nextSelection: RangePosition;
18
19
  newRange: DateRange<TDate>;
19
20
  }
20
- export declare function calculateRangeChange<TDate extends PickerValidDate>({ utils, range, newDate: selectedDate, rangePosition, allowRangeFlip, shouldMergeDateAndTime, }: CalculateRangeChangeOptions<TDate>): CalculateRangeChangeResponse<TDate>;
21
+ export declare function calculateRangeChange<TDate extends PickerValidDate>({ utils, range, newDate: selectedDate, rangePosition, allowRangeFlip, shouldMergeDateAndTime, referenceDate, }: CalculateRangeChangeOptions<TDate>): CalculateRangeChangeResponse<TDate>;
21
22
  export declare function calculateRangePreview<TDate extends PickerValidDate>(options: CalculateRangeChangeOptions<TDate>): DateRange<TDate>;
22
23
  export {};
@@ -5,7 +5,8 @@ export function calculateRangeChange({
5
5
  newDate: selectedDate,
6
6
  rangePosition,
7
7
  allowRangeFlip = false,
8
- shouldMergeDateAndTime = false
8
+ shouldMergeDateAndTime = false,
9
+ referenceDate
9
10
  }) {
10
11
  const [start, end] = range;
11
12
  if (shouldMergeDateAndTime && selectedDate) {
@@ -17,29 +18,30 @@ export function calculateRangeChange({
17
18
  selectedDate = mergeDateAndTime(utils, selectedDate, end);
18
19
  }
19
20
  }
21
+ const newSelectedDate = referenceDate && selectedDate && shouldMergeDateAndTime ? mergeDateAndTime(utils, selectedDate, referenceDate) : selectedDate;
20
22
  if (rangePosition === 'start') {
21
23
  const truthyResult = allowRangeFlip ? {
22
24
  nextSelection: 'start',
23
- newRange: [end, selectedDate]
25
+ newRange: [end, newSelectedDate]
24
26
  } : {
25
27
  nextSelection: 'end',
26
- newRange: [selectedDate, null]
28
+ newRange: [newSelectedDate, null]
27
29
  };
28
- return Boolean(end) && utils.isAfter(selectedDate, end) ? truthyResult : {
30
+ return Boolean(end) && utils.isAfter(newSelectedDate, end) ? truthyResult : {
29
31
  nextSelection: 'end',
30
- newRange: [selectedDate, end]
32
+ newRange: [newSelectedDate, end]
31
33
  };
32
34
  }
33
35
  const truthyResult = allowRangeFlip ? {
34
36
  nextSelection: 'end',
35
- newRange: [selectedDate, start]
37
+ newRange: [newSelectedDate, start]
36
38
  } : {
37
39
  nextSelection: 'end',
38
- newRange: [selectedDate, null]
40
+ newRange: [newSelectedDate, null]
39
41
  };
40
- return Boolean(start) && utils.isBeforeDay(selectedDate, start) ? truthyResult : {
42
+ return Boolean(start) && utils.isBeforeDay(newSelectedDate, start) ? truthyResult : {
41
43
  nextSelection: 'start',
42
- newRange: [start, selectedDate]
44
+ newRange: [start, newSelectedDate]
43
45
  };
44
46
  }
45
47
  export function calculateRangePreview(options) {
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTczMTAyMDQwMDAwMA==";
3
+ const releaseInfo = "MTczMjE0MzYwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -213,7 +213,8 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
213
213
  range: value,
214
214
  rangePosition,
215
215
  allowRangeFlip,
216
- shouldMergeDateAndTime: true
216
+ shouldMergeDateAndTime: true,
217
+ referenceDate
217
218
  });
218
219
  const isNextSectionAvailable = availableRangePositions.includes(nextSelection);
219
220
  if (isNextSectionAvailable) {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.22.2
2
+ * @mui/x-date-pickers-pro v7.22.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -5,7 +5,8 @@ export function calculateRangeChange({
5
5
  newDate: selectedDate,
6
6
  rangePosition,
7
7
  allowRangeFlip = false,
8
- shouldMergeDateAndTime = false
8
+ shouldMergeDateAndTime = false,
9
+ referenceDate
9
10
  }) {
10
11
  const [start, end] = range;
11
12
  if (shouldMergeDateAndTime && selectedDate) {
@@ -17,29 +18,30 @@ export function calculateRangeChange({
17
18
  selectedDate = mergeDateAndTime(utils, selectedDate, end);
18
19
  }
19
20
  }
21
+ const newSelectedDate = referenceDate && selectedDate && shouldMergeDateAndTime ? mergeDateAndTime(utils, selectedDate, referenceDate) : selectedDate;
20
22
  if (rangePosition === 'start') {
21
23
  const truthyResult = allowRangeFlip ? {
22
24
  nextSelection: 'start',
23
- newRange: [end, selectedDate]
25
+ newRange: [end, newSelectedDate]
24
26
  } : {
25
27
  nextSelection: 'end',
26
- newRange: [selectedDate, null]
28
+ newRange: [newSelectedDate, null]
27
29
  };
28
- return Boolean(end) && utils.isAfter(selectedDate, end) ? truthyResult : {
30
+ return Boolean(end) && utils.isAfter(newSelectedDate, end) ? truthyResult : {
29
31
  nextSelection: 'end',
30
- newRange: [selectedDate, end]
32
+ newRange: [newSelectedDate, end]
31
33
  };
32
34
  }
33
35
  const truthyResult = allowRangeFlip ? {
34
36
  nextSelection: 'end',
35
- newRange: [selectedDate, start]
37
+ newRange: [newSelectedDate, start]
36
38
  } : {
37
39
  nextSelection: 'end',
38
- newRange: [selectedDate, null]
40
+ newRange: [newSelectedDate, null]
39
41
  };
40
- return Boolean(start) && utils.isBeforeDay(selectedDate, start) ? truthyResult : {
42
+ return Boolean(start) && utils.isBeforeDay(newSelectedDate, start) ? truthyResult : {
41
43
  nextSelection: 'start',
42
- newRange: [start, selectedDate]
44
+ newRange: [start, newSelectedDate]
43
45
  };
44
46
  }
45
47
  export function calculateRangePreview(options) {
@@ -1,6 +1,6 @@
1
1
  import { ponyfillGlobal } from '@mui/utils';
2
2
  export const getReleaseInfo = () => {
3
- const releaseInfo = "MTczMTAyMDQwMDAwMA==";
3
+ const releaseInfo = "MTczMjE0MzYwMDAwMA==";
4
4
  if (process.env.NODE_ENV !== 'production') {
5
5
  // A simple hack to set the value in the test environment (has no build step).
6
6
  // eslint-disable-next-line no-useless-concat
@@ -220,7 +220,8 @@ const DateRangeCalendar = exports.DateRangeCalendar = /*#__PURE__*/React.forward
220
220
  range: value,
221
221
  rangePosition,
222
222
  allowRangeFlip,
223
- shouldMergeDateAndTime: true
223
+ shouldMergeDateAndTime: true,
224
+ referenceDate
224
225
  });
225
226
  const isNextSectionAvailable = availableRangePositions.includes(nextSelection);
226
227
  if (isNextSectionAvailable) {
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers-pro v7.22.2
2
+ * @mui/x-date-pickers-pro v7.22.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -12,7 +12,8 @@ function calculateRangeChange({
12
12
  newDate: selectedDate,
13
13
  rangePosition,
14
14
  allowRangeFlip = false,
15
- shouldMergeDateAndTime = false
15
+ shouldMergeDateAndTime = false,
16
+ referenceDate
16
17
  }) {
17
18
  const [start, end] = range;
18
19
  if (shouldMergeDateAndTime && selectedDate) {
@@ -24,29 +25,30 @@ function calculateRangeChange({
24
25
  selectedDate = (0, _internals.mergeDateAndTime)(utils, selectedDate, end);
25
26
  }
26
27
  }
28
+ const newSelectedDate = referenceDate && selectedDate && shouldMergeDateAndTime ? (0, _internals.mergeDateAndTime)(utils, selectedDate, referenceDate) : selectedDate;
27
29
  if (rangePosition === 'start') {
28
30
  const truthyResult = allowRangeFlip ? {
29
31
  nextSelection: 'start',
30
- newRange: [end, selectedDate]
32
+ newRange: [end, newSelectedDate]
31
33
  } : {
32
34
  nextSelection: 'end',
33
- newRange: [selectedDate, null]
35
+ newRange: [newSelectedDate, null]
34
36
  };
35
- return Boolean(end) && utils.isAfter(selectedDate, end) ? truthyResult : {
37
+ return Boolean(end) && utils.isAfter(newSelectedDate, end) ? truthyResult : {
36
38
  nextSelection: 'end',
37
- newRange: [selectedDate, end]
39
+ newRange: [newSelectedDate, end]
38
40
  };
39
41
  }
40
42
  const truthyResult = allowRangeFlip ? {
41
43
  nextSelection: 'end',
42
- newRange: [selectedDate, start]
44
+ newRange: [newSelectedDate, start]
43
45
  } : {
44
46
  nextSelection: 'end',
45
- newRange: [selectedDate, null]
47
+ newRange: [newSelectedDate, null]
46
48
  };
47
- return Boolean(start) && utils.isBeforeDay(selectedDate, start) ? truthyResult : {
49
+ return Boolean(start) && utils.isBeforeDay(newSelectedDate, start) ? truthyResult : {
48
50
  nextSelection: 'start',
49
- newRange: [start, selectedDate]
51
+ newRange: [start, newSelectedDate]
50
52
  };
51
53
  }
52
54
  function calculateRangePreview(options) {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getReleaseInfo = void 0;
7
7
  var _utils = require("@mui/utils");
8
8
  const getReleaseInfo = () => {
9
- const releaseInfo = "MTczMTAyMDQwMDAwMA==";
9
+ const releaseInfo = "MTczMjE0MzYwMDAwMA==";
10
10
  if (process.env.NODE_ENV !== 'production') {
11
11
  // A simple hack to set the value in the test environment (has no build step).
12
12
  // eslint-disable-next-line no-useless-concat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers-pro",
3
- "version": "7.22.2",
3
+ "version": "7.22.3",
4
4
  "description": "The Pro plan edition of the Date and Time Picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -37,7 +37,7 @@
37
37
  "clsx": "^2.1.1",
38
38
  "prop-types": "^15.8.1",
39
39
  "react-transition-group": "^4.4.5",
40
- "@mui/x-date-pickers": "7.22.2",
40
+ "@mui/x-date-pickers": "7.22.3",
41
41
  "@mui/x-internals": "7.21.0",
42
42
  "@mui/x-license": "7.21.0"
43
43
  },