@mui/x-date-pickers 7.22.1 → 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,145 @@
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
+
81
+ ## 7.22.2
82
+
83
+ _Nov 8, 2024_
84
+
85
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
86
+
87
+ - 👨🏽‍💻 API enhancements
88
+ - 🐞 Bugfixes
89
+
90
+ Special thanks go out to the community contributors who have helped make this release possible:
91
+ @clins1994, @GuillaumeMeheut, @k-rajat19.
92
+ Following are all team members who have contributed to this release:
93
+ @LukasTy, @MBilalShafi, @KenanYusuf, @arminmeh.
94
+
95
+ ### Upcoming alpha
96
+
97
+ Keep an eye out for the MUI⠀X `v8.0.0-aplha.0` release soon. It will follow a weekly release schedule as always until it is stable.
98
+
99
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
100
+
101
+ ### Data Grid
102
+
103
+ #### `@mui/x-data-grid@7.22.2`
104
+
105
+ - [DataGrid] Fix `null` reference error in `GridVirtualScrollbar` (#15289) @MBilalShafi
106
+ - [DataGrid] Fix filtering with `boolean` column type (#15257) @k-rajat19
107
+ - [DataGrid] Improve row selection propagation trigger (#15274) @MBilalShafi
108
+ - [DataGrid] Preprocess edit cell props on backspace/delete (#15223) @KenanYusuf
109
+ - [DataGrid] Add a recipe to persist column width and order (#15309) @MBilalShafi
110
+
111
+ #### `@mui/x-data-grid-pro@7.22.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
112
+
113
+ Same changes as in `@mui/x-data-grid@7.22.2`, plus:
114
+
115
+ - [DataGridPro] Apply default properties if they are not passed in a reorder column (#15320) @k-rajat19
116
+ - [DataGridPro] Toggle row expansion with `Enter` key in Tree data (#15313) @k-rajat19
117
+
118
+ #### `@mui/x-data-grid-premium@7.22.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
119
+
120
+ Same changes as in `@mui/x-data-grid-pro@7.22.2`, plus:
121
+
122
+ - [DataGridPremium] Fix incorrect rows selection count when selection propagation is enabled with row grouping (#15222) @arminmeh
123
+
124
+ ### Date and Time Pickers
125
+
126
+ #### `@mui/x-date-pickers@7.22.2`
127
+
128
+ - [pickers] Add support for `moment-hijri@3.0.0` (#15248) @LukasTy
129
+
130
+ #### `@mui/x-date-pickers-pro@7.22.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
131
+
132
+ Same changes as in `@mui/x-date-pickers@7.22.2`.
133
+
134
+ ### Charts
135
+
136
+ #### `@mui/x-charts@7.22.2`
137
+
138
+ - [charts] Allow `SeriesValueFormatter` to return `null` value (#15295) @clins1994
139
+ - [charts] Allow configuring the `domainLimit` for each axis. (#15325) @GuillaumeMeheut
140
+
141
+ #### `@mui/x-charts-pro@7.0.0-beta.7` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
142
+
143
+ Same changes as in `@mui/x-charts@7.22.2`.
144
+
6
145
  ## 7.22.1
7
146
 
8
147
  _Nov 1, 2024_
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.22.1
2
+ * @mui/x-date-pickers v7.22.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -10,13 +10,11 @@ import { getPickersToolbarUtilityClass } from "./pickersToolbarClasses.js";
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  const useUtilityClasses = ownerState => {
12
12
  const {
13
- classes,
14
- isLandscape
13
+ classes
15
14
  } = ownerState;
16
15
  const slots = {
17
16
  root: ['root'],
18
- content: ['content'],
19
- penIconButton: ['penIconButton', isLandscape && 'penIconButtonLandscape']
17
+ content: ['content']
20
18
  };
21
19
  return composeClasses(slots, getPickersToolbarUtilityClass, classes);
22
20
  };
@@ -571,7 +571,8 @@ export const parseSelectedSections = (selectedSections, sections) => {
571
571
  return 'all';
572
572
  }
573
573
  if (typeof selectedSections === 'string') {
574
- return sections.findIndex(section => section.type === selectedSections);
574
+ const index = sections.findIndex(section => section.type === selectedSections);
575
+ return index === -1 ? null : index;
575
576
  }
576
577
  return selectedSections;
577
578
  };
@@ -129,6 +129,7 @@ export const usePickerValue = ({
129
129
  const {
130
130
  current: isControlled
131
131
  } = React.useRef(inValueWithoutRenderTimezone !== undefined);
132
+ const [previousTimezoneProp, setPreviousTimezoneProp] = React.useState(timezoneProp);
132
133
 
133
134
  /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
134
135
  if (process.env.NODE_ENV !== 'production') {
@@ -175,10 +176,19 @@ export const usePickerValue = ({
175
176
  draft: initialValue,
176
177
  lastPublishedValue: initialValue,
177
178
  lastCommittedValue: initialValue,
178
- lastControlledValue: inValueWithTimezoneToRender,
179
+ lastControlledValue: inValueWithoutRenderTimezone,
179
180
  hasBeenModifiedSinceMount: false
180
181
  };
181
182
  });
183
+ const timezoneFromDraftValue = valueManager.getTimezone(utils, dateState.draft);
184
+ if (previousTimezoneProp !== timezoneProp) {
185
+ setPreviousTimezoneProp(timezoneProp);
186
+ if (timezoneProp && timezoneFromDraftValue && timezoneProp !== timezoneFromDraftValue) {
187
+ setDateState(prev => _extends({}, prev, {
188
+ draft: valueManager.setTimezone(utils, timezoneProp, prev.draft)
189
+ }));
190
+ }
191
+ }
182
192
  const {
183
193
  getValidationErrorForNewValue
184
194
  } = useValidation({
@@ -228,10 +238,10 @@ export const usePickerValue = ({
228
238
  setIsOpen(false);
229
239
  }
230
240
  });
231
- if (inValueWithTimezoneToRender !== undefined && (dateState.lastControlledValue === undefined || !valueManager.areValuesEqual(utils, dateState.lastControlledValue, inValueWithTimezoneToRender))) {
241
+ if (dateState.lastControlledValue !== inValueWithoutRenderTimezone) {
232
242
  const isUpdateComingFromPicker = valueManager.areValuesEqual(utils, dateState.draft, inValueWithTimezoneToRender);
233
243
  setDateState(prev => _extends({}, prev, {
234
- lastControlledValue: inValueWithTimezoneToRender
244
+ lastControlledValue: inValueWithoutRenderTimezone
235
245
  }, isUpdateComingFromPicker ? {} : {
236
246
  lastCommittedValue: inValueWithTimezoneToRender,
237
247
  lastPublishedValue: inValueWithTimezoneToRender,
@@ -123,7 +123,7 @@ export interface UsePickerValueState<TValue> {
123
123
  */
124
124
  lastCommittedValue: TValue;
125
125
  /**
126
- * Last value passed with `props.value`.
126
+ * Last value passed to `props.value`.
127
127
  * Used to update the `draft` value whenever the `value` prop changes.
128
128
  */
129
129
  lastControlledValue: TValue | undefined;
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.22.1
2
+ * @mui/x-date-pickers v7.22.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -10,13 +10,11 @@ import { getPickersToolbarUtilityClass } from "./pickersToolbarClasses.js";
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  const useUtilityClasses = ownerState => {
12
12
  const {
13
- classes,
14
- isLandscape
13
+ classes
15
14
  } = ownerState;
16
15
  const slots = {
17
16
  root: ['root'],
18
- content: ['content'],
19
- penIconButton: ['penIconButton', isLandscape && 'penIconButtonLandscape']
17
+ content: ['content']
20
18
  };
21
19
  return composeClasses(slots, getPickersToolbarUtilityClass, classes);
22
20
  };
@@ -571,7 +571,8 @@ export const parseSelectedSections = (selectedSections, sections) => {
571
571
  return 'all';
572
572
  }
573
573
  if (typeof selectedSections === 'string') {
574
- return sections.findIndex(section => section.type === selectedSections);
574
+ const index = sections.findIndex(section => section.type === selectedSections);
575
+ return index === -1 ? null : index;
575
576
  }
576
577
  return selectedSections;
577
578
  };
@@ -129,6 +129,7 @@ export const usePickerValue = ({
129
129
  const {
130
130
  current: isControlled
131
131
  } = React.useRef(inValueWithoutRenderTimezone !== undefined);
132
+ const [previousTimezoneProp, setPreviousTimezoneProp] = React.useState(timezoneProp);
132
133
 
133
134
  /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
134
135
  if (process.env.NODE_ENV !== 'production') {
@@ -175,10 +176,19 @@ export const usePickerValue = ({
175
176
  draft: initialValue,
176
177
  lastPublishedValue: initialValue,
177
178
  lastCommittedValue: initialValue,
178
- lastControlledValue: inValueWithTimezoneToRender,
179
+ lastControlledValue: inValueWithoutRenderTimezone,
179
180
  hasBeenModifiedSinceMount: false
180
181
  };
181
182
  });
183
+ const timezoneFromDraftValue = valueManager.getTimezone(utils, dateState.draft);
184
+ if (previousTimezoneProp !== timezoneProp) {
185
+ setPreviousTimezoneProp(timezoneProp);
186
+ if (timezoneProp && timezoneFromDraftValue && timezoneProp !== timezoneFromDraftValue) {
187
+ setDateState(prev => _extends({}, prev, {
188
+ draft: valueManager.setTimezone(utils, timezoneProp, prev.draft)
189
+ }));
190
+ }
191
+ }
182
192
  const {
183
193
  getValidationErrorForNewValue
184
194
  } = useValidation({
@@ -228,10 +238,10 @@ export const usePickerValue = ({
228
238
  setIsOpen(false);
229
239
  }
230
240
  });
231
- if (inValueWithTimezoneToRender !== undefined && (dateState.lastControlledValue === undefined || !valueManager.areValuesEqual(utils, dateState.lastControlledValue, inValueWithTimezoneToRender))) {
241
+ if (dateState.lastControlledValue !== inValueWithoutRenderTimezone) {
232
242
  const isUpdateComingFromPicker = valueManager.areValuesEqual(utils, dateState.draft, inValueWithTimezoneToRender);
233
243
  setDateState(prev => _extends({}, prev, {
234
- lastControlledValue: inValueWithTimezoneToRender
244
+ lastControlledValue: inValueWithoutRenderTimezone
235
245
  }, isUpdateComingFromPicker ? {} : {
236
246
  lastCommittedValue: inValueWithTimezoneToRender,
237
247
  lastPublishedValue: inValueWithTimezoneToRender,
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-date-pickers v7.22.1
2
+ * @mui/x-date-pickers v7.22.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -18,13 +18,11 @@ var _jsxRuntime = require("react/jsx-runtime");
18
18
  const _excluded = ["children", "className", "toolbarTitle", "hidden", "titleId", "isLandscape", "classes", "landscapeDirection"];
19
19
  const useUtilityClasses = ownerState => {
20
20
  const {
21
- classes,
22
- isLandscape
21
+ classes
23
22
  } = ownerState;
24
23
  const slots = {
25
24
  root: ['root'],
26
- content: ['content'],
27
- penIconButton: ['penIconButton', isLandscape && 'penIconButtonLandscape']
25
+ content: ['content']
28
26
  };
29
27
  return (0, _composeClasses.default)(slots, _pickersToolbarClasses.getPickersToolbarUtilityClass, classes);
30
28
  };
@@ -598,7 +598,8 @@ const parseSelectedSections = (selectedSections, sections) => {
598
598
  return 'all';
599
599
  }
600
600
  if (typeof selectedSections === 'string') {
601
- return sections.findIndex(section => section.type === selectedSections);
601
+ const index = sections.findIndex(section => section.type === selectedSections);
602
+ return index === -1 ? null : index;
602
603
  }
603
604
  return selectedSections;
604
605
  };
@@ -137,6 +137,7 @@ const usePickerValue = ({
137
137
  const {
138
138
  current: isControlled
139
139
  } = React.useRef(inValueWithoutRenderTimezone !== undefined);
140
+ const [previousTimezoneProp, setPreviousTimezoneProp] = React.useState(timezoneProp);
140
141
 
141
142
  /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
142
143
  if (process.env.NODE_ENV !== 'production') {
@@ -183,10 +184,19 @@ const usePickerValue = ({
183
184
  draft: initialValue,
184
185
  lastPublishedValue: initialValue,
185
186
  lastCommittedValue: initialValue,
186
- lastControlledValue: inValueWithTimezoneToRender,
187
+ lastControlledValue: inValueWithoutRenderTimezone,
187
188
  hasBeenModifiedSinceMount: false
188
189
  };
189
190
  });
191
+ const timezoneFromDraftValue = valueManager.getTimezone(utils, dateState.draft);
192
+ if (previousTimezoneProp !== timezoneProp) {
193
+ setPreviousTimezoneProp(timezoneProp);
194
+ if (timezoneProp && timezoneFromDraftValue && timezoneProp !== timezoneFromDraftValue) {
195
+ setDateState(prev => (0, _extends2.default)({}, prev, {
196
+ draft: valueManager.setTimezone(utils, timezoneProp, prev.draft)
197
+ }));
198
+ }
199
+ }
190
200
  const {
191
201
  getValidationErrorForNewValue
192
202
  } = (0, _validation.useValidation)({
@@ -236,10 +246,10 @@ const usePickerValue = ({
236
246
  setIsOpen(false);
237
247
  }
238
248
  });
239
- if (inValueWithTimezoneToRender !== undefined && (dateState.lastControlledValue === undefined || !valueManager.areValuesEqual(utils, dateState.lastControlledValue, inValueWithTimezoneToRender))) {
249
+ if (dateState.lastControlledValue !== inValueWithoutRenderTimezone) {
240
250
  const isUpdateComingFromPicker = valueManager.areValuesEqual(utils, dateState.draft, inValueWithTimezoneToRender);
241
251
  setDateState(prev => (0, _extends2.default)({}, prev, {
242
- lastControlledValue: inValueWithTimezoneToRender
252
+ lastControlledValue: inValueWithoutRenderTimezone
243
253
  }, isUpdateComingFromPicker ? {} : {
244
254
  lastCommittedValue: inValueWithTimezoneToRender,
245
255
  lastPublishedValue: inValueWithTimezoneToRender,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "7.22.1",
3
+ "version": "7.22.3",
4
4
  "description": "The community edition of the Date and Time Picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -53,7 +53,7 @@
53
53
  "dayjs": "^1.10.7",
54
54
  "luxon": "^3.0.2",
55
55
  "moment": "^2.29.4",
56
- "moment-hijri": "^2.1.2",
56
+ "moment-hijri": "^2.1.2 || ^3.0.0",
57
57
  "moment-jalaali": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0",
58
58
  "react": "^17.0.0 || ^18.0.0",
59
59
  "react-dom": "^17.0.0 || ^18.0.0"