@mui/x-date-pickers 5.0.9 → 5.0.10

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,51 @@
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.15
7
+
8
+ _Dec 8, 2022_
9
+
10
+ We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - ✨ Fix lazy-loading not working in `DataGridPremium` (#7130) @m4theushw
13
+ - 🐞 Bugfixes
14
+
15
+ ### `@mui/x-data-grid@v5.17.15` / `@mui/x-data-grid-pro@v5.17.15` / `@mui/x-data-grid-premium@v5.17.15`
16
+
17
+ #### Changes
18
+
19
+ - [DataGridPremium] Add support for lazy-loading (#7130) @m4theushw
20
+ - [DataGridPremium] Pass `groupId` to the aggregation function (#7143) @m4theushw
21
+
22
+ ### `@mui/x-date-pickers@v5.0.10` / `@mui/x-date-pickers-pro@v5.0.10`
23
+
24
+ #### Changes
25
+
26
+ - [pickers] Initialize date without time when selecting year or month (#7136) @LukasTy
27
+
28
+ ### Docs
29
+
30
+ - [docs] Fix the nested import on the api pages (#7134) @flaviendelangle
31
+ - [docs] Keep track of the localization completion (#7099) @alexfauquette
32
+ - [docs] Update localization doc to use existing locale (#7104) @LukasTy
33
+
34
+ ## 5.17.14
35
+
36
+ _Dec 1, 2022_
37
+
38
+ We'd like to offer a big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:
39
+
40
+ - 🌍 Improve Ukrainian (uk-UA) locale (#7035) @rettoua
41
+ - 🐞 Bugfixes
42
+
43
+ ### `@mui/x-data-grid@v5.17.14` / `@mui/x-data-grid-pro@v5.17.14` / `@mui/x-data-grid-premium@v5.17.14`
44
+
45
+ #### Changes
46
+
47
+ - [DataGrid] Fix row selection when clicking blank cell (#7056) @yami03
48
+ - [DataGridPremium] Update cache before hydrating columns (#7043) @m4theushw
49
+ - [l10n] Improve Ukrainian (uk-UA) locale (#7035) @rettoua
50
+
6
51
  ## 5.17.13
7
52
 
8
53
  _Nov 24, 2022_
@@ -76,7 +76,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
76
76
  const ownerState = props;
77
77
  const classes = useUtilityClasses(ownerState);
78
78
  const theme = useTheme();
79
- const selectedDateOrToday = date != null ? date : now;
79
+ const selectedDateOrStartOfMonth = React.useMemo(() => date != null ? date : utils.startOfMonth(now), [now, utils, date]);
80
80
  const selectedMonth = React.useMemo(() => {
81
81
  if (date != null) {
82
82
  return utils.getMonth(date);
@@ -113,7 +113,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
113
113
  return;
114
114
  }
115
115
 
116
- const newDate = utils.setMonth(selectedDateOrToday, month);
116
+ const newDate = utils.setMonth(selectedDateOrStartOfMonth, month);
117
117
  onChange(newDate, 'finish');
118
118
  };
119
119
 
@@ -131,7 +131,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
131
131
  }
132
132
  }, [setInternalHasFocus, onFocusedViewChange]);
133
133
  const focusMonth = React.useCallback(month => {
134
- if (!isMonthDisabled(utils.setMonth(selectedDateOrToday, month))) {
134
+ if (!isMonthDisabled(utils.setMonth(selectedDateOrStartOfMonth, month))) {
135
135
  setFocusedMonth(month);
136
136
  changeHasFocus(true);
137
137
 
@@ -139,7 +139,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
139
139
  onMonthFocus(month);
140
140
  }
141
141
  }
142
- }, [selectedDateOrToday, isMonthDisabled, utils, onMonthFocus, changeHasFocus]);
142
+ }, [isMonthDisabled, utils, selectedDateOrStartOfMonth, changeHasFocus, onMonthFocus]);
143
143
  React.useEffect(() => {
144
144
  setFocusedMonth(prevFocusedMonth => selectedMonth !== null && prevFocusedMonth !== selectedMonth ? selectedMonth : prevFocusedMonth);
145
145
  }, [selectedMonth]);
@@ -185,7 +185,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
185
185
  ownerState: ownerState,
186
186
  onKeyDown: handleKeyDown
187
187
  }, other, {
188
- children: utils.getMonthArray(selectedDateOrToday).map(month => {
188
+ children: utils.getMonthArray(selectedDateOrStartOfMonth).map(month => {
189
189
  const monthNumber = utils.getMonth(month);
190
190
  const monthText = utils.format(month, 'monthShort');
191
191
  const isDisabled = disabled || isMonthDisabled(month);
@@ -76,7 +76,7 @@ export const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inPr
76
76
  } = props;
77
77
  const ownerState = props;
78
78
  const classes = useUtilityClasses(ownerState);
79
- const selectedDateOrToday = date != null ? date : now;
79
+ const selectedDateOrStartOfYear = React.useMemo(() => date != null ? date : utils.startOfYear(now), [now, utils, date]);
80
80
  const currentYear = React.useMemo(() => {
81
81
  if (date != null) {
82
82
  return utils.getYear(date);
@@ -133,17 +133,17 @@ export const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inPr
133
133
  return;
134
134
  }
135
135
 
136
- const newDate = utils.setYear(selectedDateOrToday, year);
136
+ const newDate = utils.setYear(selectedDateOrStartOfYear, year);
137
137
  onChange(newDate, isFinish);
138
138
  };
139
139
 
140
140
  const focusYear = React.useCallback(year => {
141
- if (!isYearDisabled(utils.setYear(selectedDateOrToday, year))) {
141
+ if (!isYearDisabled(utils.setYear(selectedDateOrStartOfYear, year))) {
142
142
  setFocusedYear(year);
143
143
  changeHasFocus(true);
144
144
  onYearFocus == null ? void 0 : onYearFocus(year);
145
145
  }
146
- }, [isYearDisabled, utils, selectedDateOrToday, changeHasFocus, onYearFocus]);
146
+ }, [isYearDisabled, utils, selectedDateOrStartOfYear, changeHasFocus, onYearFocus]);
147
147
  React.useEffect(() => {
148
148
  setFocusedYear(prevFocusedYear => currentYear !== null && prevFocusedYear !== currentYear ? currentYear : prevFocusedYear);
149
149
  }, [currentYear]);
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.9
1
+ /** @license MUI v5.0.10
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.
@@ -76,7 +76,9 @@ export var MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inPr
76
76
  var ownerState = props;
77
77
  var classes = useUtilityClasses(ownerState);
78
78
  var theme = useTheme();
79
- var selectedDateOrToday = date != null ? date : now;
79
+ var selectedDateOrStartOfMonth = React.useMemo(function () {
80
+ return date != null ? date : utils.startOfMonth(now);
81
+ }, [now, utils, date]);
80
82
  var selectedMonth = React.useMemo(function () {
81
83
  if (date != null) {
82
84
  return utils.getMonth(date);
@@ -120,7 +122,7 @@ export var MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inPr
120
122
  return;
121
123
  }
122
124
 
123
- var newDate = utils.setMonth(selectedDateOrToday, month);
125
+ var newDate = utils.setMonth(selectedDateOrStartOfMonth, month);
124
126
  onChange(newDate, 'finish');
125
127
  };
126
128
 
@@ -142,7 +144,7 @@ export var MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inPr
142
144
  }
143
145
  }, [setInternalHasFocus, onFocusedViewChange]);
144
146
  var focusMonth = React.useCallback(function (month) {
145
- if (!isMonthDisabled(utils.setMonth(selectedDateOrToday, month))) {
147
+ if (!isMonthDisabled(utils.setMonth(selectedDateOrStartOfMonth, month))) {
146
148
  setFocusedMonth(month);
147
149
  changeHasFocus(true);
148
150
 
@@ -150,7 +152,7 @@ export var MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inPr
150
152
  onMonthFocus(month);
151
153
  }
152
154
  }
153
- }, [selectedDateOrToday, isMonthDisabled, utils, onMonthFocus, changeHasFocus]);
155
+ }, [isMonthDisabled, utils, selectedDateOrStartOfMonth, changeHasFocus, onMonthFocus]);
154
156
  React.useEffect(function () {
155
157
  setFocusedMonth(function (prevFocusedMonth) {
156
158
  return selectedMonth !== null && prevFocusedMonth !== selectedMonth ? selectedMonth : prevFocusedMonth;
@@ -198,7 +200,7 @@ export var MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inPr
198
200
  ownerState: ownerState,
199
201
  onKeyDown: handleKeyDown
200
202
  }, other, {
201
- children: utils.getMonthArray(selectedDateOrToday).map(function (month) {
203
+ children: utils.getMonthArray(selectedDateOrStartOfMonth).map(function (month) {
202
204
  var monthNumber = utils.getMonth(month);
203
205
  var monthText = utils.format(month, 'monthShort');
204
206
  var isDisabled = disabled || isMonthDisabled(month);
@@ -75,7 +75,9 @@ export var YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inProp
75
75
  onFocusedViewChange = props.onFocusedViewChange;
76
76
  var ownerState = props;
77
77
  var classes = useUtilityClasses(ownerState);
78
- var selectedDateOrToday = date != null ? date : now;
78
+ var selectedDateOrStartOfYear = React.useMemo(function () {
79
+ return date != null ? date : utils.startOfYear(now);
80
+ }, [now, utils, date]);
79
81
  var currentYear = React.useMemo(function () {
80
82
  if (date != null) {
81
83
  return utils.getYear(date);
@@ -145,17 +147,17 @@ export var YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inProp
145
147
  return;
146
148
  }
147
149
 
148
- var newDate = utils.setYear(selectedDateOrToday, year);
150
+ var newDate = utils.setYear(selectedDateOrStartOfYear, year);
149
151
  onChange(newDate, isFinish);
150
152
  };
151
153
 
152
154
  var focusYear = React.useCallback(function (year) {
153
- if (!isYearDisabled(utils.setYear(selectedDateOrToday, year))) {
155
+ if (!isYearDisabled(utils.setYear(selectedDateOrStartOfYear, year))) {
154
156
  setFocusedYear(year);
155
157
  changeHasFocus(true);
156
158
  onYearFocus == null ? void 0 : onYearFocus(year);
157
159
  }
158
- }, [isYearDisabled, utils, selectedDateOrToday, changeHasFocus, onYearFocus]);
160
+ }, [isYearDisabled, utils, selectedDateOrStartOfYear, changeHasFocus, onYearFocus]);
159
161
  React.useEffect(function () {
160
162
  setFocusedYear(function (prevFocusedYear) {
161
163
  return currentYear !== null && prevFocusedYear !== currentYear ? currentYear : prevFocusedYear;
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.9
1
+ /** @license MUI v5.0.10
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.
@@ -76,7 +76,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
76
76
  const ownerState = props;
77
77
  const classes = useUtilityClasses(ownerState);
78
78
  const theme = useTheme();
79
- const selectedDateOrToday = date ?? now;
79
+ const selectedDateOrStartOfMonth = React.useMemo(() => date ?? utils.startOfMonth(now), [now, utils, date]);
80
80
  const selectedMonth = React.useMemo(() => {
81
81
  if (date != null) {
82
82
  return utils.getMonth(date);
@@ -113,7 +113,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
113
113
  return;
114
114
  }
115
115
 
116
- const newDate = utils.setMonth(selectedDateOrToday, month);
116
+ const newDate = utils.setMonth(selectedDateOrStartOfMonth, month);
117
117
  onChange(newDate, 'finish');
118
118
  };
119
119
 
@@ -131,7 +131,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
131
131
  }
132
132
  }, [setInternalHasFocus, onFocusedViewChange]);
133
133
  const focusMonth = React.useCallback(month => {
134
- if (!isMonthDisabled(utils.setMonth(selectedDateOrToday, month))) {
134
+ if (!isMonthDisabled(utils.setMonth(selectedDateOrStartOfMonth, month))) {
135
135
  setFocusedMonth(month);
136
136
  changeHasFocus(true);
137
137
 
@@ -139,7 +139,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
139
139
  onMonthFocus(month);
140
140
  }
141
141
  }
142
- }, [selectedDateOrToday, isMonthDisabled, utils, onMonthFocus, changeHasFocus]);
142
+ }, [isMonthDisabled, utils, selectedDateOrStartOfMonth, changeHasFocus, onMonthFocus]);
143
143
  React.useEffect(() => {
144
144
  setFocusedMonth(prevFocusedMonth => selectedMonth !== null && prevFocusedMonth !== selectedMonth ? selectedMonth : prevFocusedMonth);
145
145
  }, [selectedMonth]);
@@ -185,7 +185,7 @@ export const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(in
185
185
  ownerState: ownerState,
186
186
  onKeyDown: handleKeyDown
187
187
  }, other, {
188
- children: utils.getMonthArray(selectedDateOrToday).map(month => {
188
+ children: utils.getMonthArray(selectedDateOrStartOfMonth).map(month => {
189
189
  const monthNumber = utils.getMonth(month);
190
190
  const monthText = utils.format(month, 'monthShort');
191
191
  const isDisabled = disabled || isMonthDisabled(month);
@@ -76,7 +76,7 @@ export const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inPr
76
76
  } = props;
77
77
  const ownerState = props;
78
78
  const classes = useUtilityClasses(ownerState);
79
- const selectedDateOrToday = date ?? now;
79
+ const selectedDateOrStartOfYear = React.useMemo(() => date ?? utils.startOfYear(now), [now, utils, date]);
80
80
  const currentYear = React.useMemo(() => {
81
81
  if (date != null) {
82
82
  return utils.getYear(date);
@@ -133,17 +133,17 @@ export const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inPr
133
133
  return;
134
134
  }
135
135
 
136
- const newDate = utils.setYear(selectedDateOrToday, year);
136
+ const newDate = utils.setYear(selectedDateOrStartOfYear, year);
137
137
  onChange(newDate, isFinish);
138
138
  };
139
139
 
140
140
  const focusYear = React.useCallback(year => {
141
- if (!isYearDisabled(utils.setYear(selectedDateOrToday, year))) {
141
+ if (!isYearDisabled(utils.setYear(selectedDateOrStartOfYear, year))) {
142
142
  setFocusedYear(year);
143
143
  changeHasFocus(true);
144
144
  onYearFocus?.(year);
145
145
  }
146
- }, [isYearDisabled, utils, selectedDateOrToday, changeHasFocus, onYearFocus]);
146
+ }, [isYearDisabled, utils, selectedDateOrStartOfYear, changeHasFocus, onYearFocus]);
147
147
  React.useEffect(() => {
148
148
  setFocusedYear(prevFocusedYear => currentYear !== null && prevFocusedYear !== currentYear ? currentYear : prevFocusedYear);
149
149
  }, [currentYear]);
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.9
1
+ /** @license MUI v5.0.10
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.
@@ -102,7 +102,7 @@ const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inProps,
102
102
  const ownerState = props;
103
103
  const classes = useUtilityClasses(ownerState);
104
104
  const theme = (0, _system.useTheme)();
105
- const selectedDateOrToday = date != null ? date : now;
105
+ const selectedDateOrStartOfMonth = React.useMemo(() => date != null ? date : utils.startOfMonth(now), [now, utils, date]);
106
106
  const selectedMonth = React.useMemo(() => {
107
107
  if (date != null) {
108
108
  return utils.getMonth(date);
@@ -139,7 +139,7 @@ const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inProps,
139
139
  return;
140
140
  }
141
141
 
142
- const newDate = utils.setMonth(selectedDateOrToday, month);
142
+ const newDate = utils.setMonth(selectedDateOrStartOfMonth, month);
143
143
  onChange(newDate, 'finish');
144
144
  };
145
145
 
@@ -157,7 +157,7 @@ const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inProps,
157
157
  }
158
158
  }, [setInternalHasFocus, onFocusedViewChange]);
159
159
  const focusMonth = React.useCallback(month => {
160
- if (!isMonthDisabled(utils.setMonth(selectedDateOrToday, month))) {
160
+ if (!isMonthDisabled(utils.setMonth(selectedDateOrStartOfMonth, month))) {
161
161
  setFocusedMonth(month);
162
162
  changeHasFocus(true);
163
163
 
@@ -165,7 +165,7 @@ const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inProps,
165
165
  onMonthFocus(month);
166
166
  }
167
167
  }
168
- }, [selectedDateOrToday, isMonthDisabled, utils, onMonthFocus, changeHasFocus]);
168
+ }, [isMonthDisabled, utils, selectedDateOrStartOfMonth, changeHasFocus, onMonthFocus]);
169
169
  React.useEffect(() => {
170
170
  setFocusedMonth(prevFocusedMonth => selectedMonth !== null && prevFocusedMonth !== selectedMonth ? selectedMonth : prevFocusedMonth);
171
171
  }, [selectedMonth]);
@@ -211,7 +211,7 @@ const MonthPicker = /*#__PURE__*/React.forwardRef(function MonthPicker(inProps,
211
211
  ownerState: ownerState,
212
212
  onKeyDown: handleKeyDown
213
213
  }, other, {
214
- children: utils.getMonthArray(selectedDateOrToday).map(month => {
214
+ children: utils.getMonthArray(selectedDateOrStartOfMonth).map(month => {
215
215
  const monthNumber = utils.getMonth(month);
216
216
  const monthText = utils.format(month, 'monthShort');
217
217
  const isDisabled = disabled || isMonthDisabled(month);
@@ -102,7 +102,7 @@ const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inProps, re
102
102
  } = props;
103
103
  const ownerState = props;
104
104
  const classes = useUtilityClasses(ownerState);
105
- const selectedDateOrToday = date != null ? date : now;
105
+ const selectedDateOrStartOfYear = React.useMemo(() => date != null ? date : utils.startOfYear(now), [now, utils, date]);
106
106
  const currentYear = React.useMemo(() => {
107
107
  if (date != null) {
108
108
  return utils.getYear(date);
@@ -159,17 +159,17 @@ const YearPicker = /*#__PURE__*/React.forwardRef(function YearPicker(inProps, re
159
159
  return;
160
160
  }
161
161
 
162
- const newDate = utils.setYear(selectedDateOrToday, year);
162
+ const newDate = utils.setYear(selectedDateOrStartOfYear, year);
163
163
  onChange(newDate, isFinish);
164
164
  };
165
165
 
166
166
  const focusYear = React.useCallback(year => {
167
- if (!isYearDisabled(utils.setYear(selectedDateOrToday, year))) {
167
+ if (!isYearDisabled(utils.setYear(selectedDateOrStartOfYear, year))) {
168
168
  setFocusedYear(year);
169
169
  changeHasFocus(true);
170
170
  onYearFocus == null ? void 0 : onYearFocus(year);
171
171
  }
172
- }, [isYearDisabled, utils, selectedDateOrToday, changeHasFocus, onYearFocus]);
172
+ }, [isYearDisabled, utils, selectedDateOrStartOfYear, changeHasFocus, onYearFocus]);
173
173
  React.useEffect(() => {
174
174
  setFocusedYear(prevFocusedYear => currentYear !== null && prevFocusedYear !== currentYear ? currentYear : prevFocusedYear);
175
175
  }, [currentYear]);
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.0.9
1
+ /** @license MUI v5.0.10
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-date-pickers",
3
- "version": "5.0.9",
3
+ "version": "5.0.10",
4
4
  "description": "The community edition of the date picker components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",