@mui/x-date-pickers 6.16.0 → 6.16.2
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/AdapterDayjs/AdapterDayjs.js +6 -4
- package/AdapterMoment/AdapterMoment.js +2 -5
- package/CHANGELOG.md +165 -1
- package/DateCalendar/DateCalendar.js +3 -1
- package/DateCalendar/DayCalendar.js +2 -2
- package/DateCalendar/PickersFadeTransitionGroup.js +6 -6
- package/DateCalendar/PickersSlideTransition.d.ts +0 -1
- package/DateCalendar/PickersSlideTransition.js +5 -5
- package/DateField/DateField.d.ts +10 -0
- package/DateField/DateField.js +10 -0
- package/DateTimeField/DateTimeField.d.ts +10 -0
- package/DateTimeField/DateTimeField.js +10 -0
- package/DateTimePicker/DateTimePicker.d.ts +10 -0
- package/DateTimePicker/DateTimePicker.js +15 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +10 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -7
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +4 -3
- package/DesktopTimePicker/DesktopTimePicker.d.ts +10 -0
- package/DesktopTimePicker/DesktopTimePicker.js +18 -9
- package/DigitalClock/DigitalClock.js +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +10 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/MobileTimePicker/MobileTimePicker.d.ts +10 -0
- package/MobileTimePicker/MobileTimePicker.js +10 -0
- package/MonthCalendar/MonthCalendar.js +4 -1
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +10 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/StaticTimePicker/StaticTimePicker.d.ts +10 -0
- package/StaticTimePicker/StaticTimePicker.js +10 -0
- package/TimeField/TimeField.d.ts +10 -0
- package/TimeField/TimeField.js +10 -0
- package/TimePicker/TimePicker.d.ts +10 -0
- package/TimePicker/TimePicker.js +10 -0
- package/YearCalendar/PickersYear.js +1 -1
- package/YearCalendar/YearCalendar.js +6 -3
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +52 -33
- package/index.js +1 -1
- package/internals/components/FakeTextField/FakeTextField.d.ts +7 -0
- package/internals/components/FakeTextField/FakeTextField.js +19 -0
- package/internals/components/FakeTextField/index.d.ts +1 -0
- package/internals/components/FakeTextField/index.js +1 -0
- package/internals/constants/dimensions.d.ts +2 -1
- package/internals/constants/dimensions.js +2 -1
- package/internals/hooks/useField/useField.js +6 -4
- package/internals/hooks/useField/useField.types.d.ts +6 -0
- package/internals/utils/date-time-utils.d.ts +11 -0
- package/internals/utils/date-time-utils.js +32 -2
- package/legacy/AdapterDayjs/AdapterDayjs.js +6 -4
- package/legacy/AdapterMoment/AdapterMoment.js +2 -5
- package/legacy/DateCalendar/DateCalendar.js +3 -1
- package/legacy/DateCalendar/DayCalendar.js +2 -2
- package/legacy/DateCalendar/PickersFadeTransitionGroup.js +6 -6
- package/legacy/DateCalendar/PickersSlideTransition.js +5 -5
- package/legacy/DateField/DateField.js +10 -0
- package/legacy/DateTimeField/DateTimeField.js +10 -0
- package/legacy/DateTimePicker/DateTimePicker.js +15 -0
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +24 -8
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +19 -10
- package/legacy/DigitalClock/DigitalClock.js +1 -1
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/legacy/MobileTimePicker/MobileTimePicker.js +10 -0
- package/legacy/MonthCalendar/MonthCalendar.js +4 -1
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/legacy/StaticTimePicker/StaticTimePicker.js +10 -0
- package/legacy/TimeField/TimeField.js +10 -0
- package/legacy/TimePicker/TimePicker.js +10 -0
- package/legacy/YearCalendar/PickersYear.js +1 -1
- package/legacy/YearCalendar/YearCalendar.js +6 -4
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +51 -33
- package/legacy/index.js +1 -1
- package/legacy/internals/components/FakeTextField/FakeTextField.js +19 -0
- package/legacy/internals/components/FakeTextField/index.js +1 -0
- package/legacy/internals/constants/dimensions.js +2 -1
- package/legacy/internals/hooks/useField/useField.js +5 -3
- package/legacy/internals/utils/date-time-utils.js +34 -2
- package/legacy/locales/esES.js +1 -1
- package/locales/esES.js +1 -1
- package/modern/AdapterDayjs/AdapterDayjs.js +6 -4
- package/modern/AdapterMoment/AdapterMoment.js +2 -5
- package/modern/DateCalendar/DateCalendar.js +3 -1
- package/modern/DateCalendar/DayCalendar.js +2 -2
- package/modern/DateCalendar/PickersFadeTransitionGroup.js +6 -6
- package/modern/DateCalendar/PickersSlideTransition.js +5 -5
- package/modern/DateField/DateField.js +10 -0
- package/modern/DateTimeField/DateTimeField.js +10 -0
- package/modern/DateTimePicker/DateTimePicker.js +15 -0
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -7
- package/modern/DesktopTimePicker/DesktopTimePicker.js +17 -8
- package/modern/DigitalClock/DigitalClock.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +10 -0
- package/modern/MobileTimePicker/MobileTimePicker.js +10 -0
- package/modern/MonthCalendar/MonthCalendar.js +4 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +10 -0
- package/modern/StaticTimePicker/StaticTimePicker.js +10 -0
- package/modern/TimeField/TimeField.js +10 -0
- package/modern/TimePicker/TimePicker.js +10 -0
- package/modern/YearCalendar/PickersYear.js +1 -1
- package/modern/YearCalendar/YearCalendar.js +5 -3
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +52 -33
- package/modern/index.js +1 -1
- package/modern/internals/components/FakeTextField/FakeTextField.js +19 -0
- package/modern/internals/components/FakeTextField/index.js +1 -0
- package/modern/internals/constants/dimensions.js +2 -1
- package/modern/internals/hooks/useField/useField.js +6 -4
- package/modern/internals/utils/date-time-utils.js +29 -2
- package/modern/locales/esES.js +1 -1
- package/node/AdapterDayjs/AdapterDayjs.js +6 -4
- package/node/AdapterMoment/AdapterMoment.js +2 -5
- package/node/DateCalendar/DateCalendar.js +4 -3
- package/node/DateCalendar/DayCalendar.js +2 -2
- package/node/DateCalendar/PickersFadeTransitionGroup.js +6 -6
- package/node/DateCalendar/PickersSlideTransition.js +5 -7
- package/node/DateCalendar/dateCalendarClasses.js +1 -2
- package/node/DateCalendar/dayCalendarClasses.js +1 -2
- package/node/DateCalendar/pickersFadeTransitionGroupClasses.js +1 -2
- package/node/DateCalendar/pickersSlideTransitionClasses.js +1 -2
- package/node/DateField/DateField.js +11 -2
- package/node/DatePicker/DatePicker.js +1 -2
- package/node/DatePicker/DatePickerToolbar.js +1 -2
- package/node/DatePicker/datePickerToolbarClasses.js +1 -2
- package/node/DateTimeField/DateTimeField.js +11 -2
- package/node/DateTimePicker/DateTimePicker.js +16 -2
- package/node/DateTimePicker/DateTimePickerTabs.js +1 -2
- package/node/DateTimePicker/dateTimePickerTabsClasses.js +1 -2
- package/node/DateTimePicker/dateTimePickerToolbarClasses.js +1 -2
- package/node/DayCalendarSkeleton/dayCalendarSkeletonClasses.js +1 -2
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -2
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +25 -8
- package/node/DesktopTimePicker/DesktopTimePicker.js +18 -10
- package/node/DigitalClock/DigitalClock.js +2 -3
- package/node/DigitalClock/digitalClockClasses.js +1 -2
- package/node/LocalizationProvider/LocalizationProvider.js +2 -4
- package/node/MobileDatePicker/MobileDatePicker.js +1 -2
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +11 -2
- package/node/MobileTimePicker/MobileTimePicker.js +11 -2
- package/node/MonthCalendar/MonthCalendar.js +5 -3
- package/node/MonthCalendar/PickersMonth.js +2 -3
- package/node/MonthCalendar/monthCalendarClasses.js +1 -2
- package/node/MonthCalendar/pickersMonthClasses.js +1 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -2
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +2 -3
- package/node/MultiSectionDigitalClock/multiSectionDigitalClockClasses.js +1 -2
- package/node/MultiSectionDigitalClock/multiSectionDigitalClockSectionClasses.js +1 -2
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +1 -2
- package/node/PickersCalendarHeader/pickersCalendarHeaderClasses.js +1 -2
- package/node/PickersDay/PickersDay.js +1 -2
- package/node/PickersDay/pickersDayClasses.js +1 -2
- package/node/PickersLayout/PickersLayout.js +3 -6
- package/node/PickersLayout/pickersLayoutClasses.js +1 -2
- package/node/PickersLayout/usePickerLayout.js +1 -2
- package/node/StaticDatePicker/StaticDatePicker.js +1 -2
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +11 -2
- package/node/StaticTimePicker/StaticTimePicker.js +11 -2
- package/node/TimeClock/TimeClock.js +1 -2
- package/node/TimeClock/clockClasses.js +1 -2
- package/node/TimeClock/clockNumberClasses.js +1 -2
- package/node/TimeClock/clockPointerClasses.js +1 -2
- package/node/TimeClock/shared.js +2 -4
- package/node/TimeClock/timeClockClasses.js +1 -2
- package/node/TimeField/TimeField.js +11 -2
- package/node/TimePicker/TimePicker.js +11 -2
- package/node/TimePicker/timePickerToolbarClasses.js +1 -2
- package/node/YearCalendar/PickersYear.js +3 -4
- package/node/YearCalendar/YearCalendar.js +6 -5
- package/node/YearCalendar/pickersYearClasses.js +1 -2
- package/node/YearCalendar/yearCalendarClasses.js +1 -2
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +51 -32
- package/node/icons/index.js +9 -17
- package/node/index.js +1 -1
- package/node/internals/components/DateTimeViewWrapper/DateTimeViewWrapper.js +2 -3
- package/node/internals/components/FakeTextField/FakeTextField.js +27 -0
- package/node/internals/components/FakeTextField/index.js +12 -0
- package/node/internals/components/PickerViewRoot/PickerViewRoot.js +2 -3
- package/node/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +2 -3
- package/node/internals/components/PickersArrowSwitcher/pickersArrowSwitcherClasses.js +1 -2
- package/node/internals/components/PickersToolbar.js +2 -3
- package/node/internals/components/PickersToolbarButton.js +2 -3
- package/node/internals/components/PickersToolbarText.js +2 -3
- package/node/internals/components/pickersPopperClasses.js +1 -2
- package/node/internals/components/pickersToolbarButtonClasses.js +1 -2
- package/node/internals/components/pickersToolbarClasses.js +1 -2
- package/node/internals/components/pickersToolbarTextClasses.js +1 -2
- package/node/internals/constants/dimensions.js +8 -13
- package/node/internals/hooks/useDefaultReduceAnimations.js +1 -2
- package/node/internals/hooks/useField/useField.js +6 -4
- package/node/internals/utils/date-time-utils.js +29 -1
- package/node/internals/utils/getDefaultReferenceDate.js +1 -2
- package/node/internals/utils/utils.js +1 -2
- package/node/internals/utils/validation/extractValidationProps.js +3 -6
- package/node/internals/utils/valueManagers.js +3 -5
- package/node/locales/beBY.js +1 -2
- package/node/locales/caES.js +1 -2
- package/node/locales/csCZ.js +1 -2
- package/node/locales/daDK.js +1 -2
- package/node/locales/deDE.js +1 -2
- package/node/locales/elGR.js +1 -2
- package/node/locales/enUS.js +2 -4
- package/node/locales/esES.js +2 -3
- package/node/locales/faIR.js +1 -2
- package/node/locales/fiFI.js +1 -2
- package/node/locales/frFR.js +1 -2
- package/node/locales/heIL.js +1 -2
- package/node/locales/huHU.js +1 -2
- package/node/locales/isIS.js +1 -2
- package/node/locales/itIT.js +1 -2
- package/node/locales/jaJP.js +1 -2
- package/node/locales/koKR.js +1 -2
- package/node/locales/kzKZ.js +1 -2
- package/node/locales/nbNO.js +1 -2
- package/node/locales/nlNL.js +1 -2
- package/node/locales/plPL.js +1 -2
- package/node/locales/ptBR.js +1 -2
- package/node/locales/roRO.js +1 -2
- package/node/locales/ruRU.js +1 -2
- package/node/locales/skSK.js +1 -2
- package/node/locales/svSE.js +1 -2
- package/node/locales/trTR.js +1 -2
- package/node/locales/ukUA.js +1 -2
- package/node/locales/urPK.js +1 -2
- package/node/locales/viVN.js +1 -2
- package/node/locales/zhCN.js +1 -2
- package/node/locales/zhHK.js +1 -2
- package/package.json +5 -5
|
@@ -297,14 +297,16 @@ export class AdapterDayjs {
|
|
|
297
297
|
return parsedValue.locale(this.locale);
|
|
298
298
|
};
|
|
299
299
|
this.getTimezone = value => {
|
|
300
|
-
if (this.hasUTCPlugin() && value.isUTC()) {
|
|
301
|
-
return 'UTC';
|
|
302
|
-
}
|
|
303
300
|
if (this.hasTimezonePlugin()) {
|
|
304
301
|
var _value$$x;
|
|
305
302
|
// @ts-ignore
|
|
306
303
|
const zone = (_value$$x = value.$x) == null ? void 0 : _value$$x.$timezone;
|
|
307
|
-
|
|
304
|
+
if (zone) {
|
|
305
|
+
return zone;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (this.hasUTCPlugin() && value.isUTC()) {
|
|
309
|
+
return 'UTC';
|
|
308
310
|
}
|
|
309
311
|
return 'system';
|
|
310
312
|
};
|
|
@@ -241,16 +241,13 @@ export class AdapterMoment {
|
|
|
241
241
|
};
|
|
242
242
|
this.getTimezone = value => {
|
|
243
243
|
var _value$_z, _ref, _this$moment$defaultZ;
|
|
244
|
-
if (value.isUTC()) {
|
|
245
|
-
return 'UTC';
|
|
246
|
-
}
|
|
247
|
-
|
|
248
244
|
// @ts-ignore
|
|
249
245
|
// eslint-disable-next-line no-underscore-dangle
|
|
250
246
|
const zone = (_value$_z = value._z) == null ? void 0 : _value$_z.name;
|
|
247
|
+
const defaultZone = value.isUTC() ? 'UTC' : 'system';
|
|
251
248
|
|
|
252
249
|
// @ts-ignore
|
|
253
|
-
return (_ref = zone != null ? zone : (_this$moment$defaultZ = this.moment.defaultZone) == null ? void 0 : _this$moment$defaultZ.name) != null ? _ref :
|
|
250
|
+
return (_ref = zone != null ? zone : (_this$moment$defaultZ = this.moment.defaultZone) == null ? void 0 : _this$moment$defaultZ.name) != null ? _ref : defaultZone;
|
|
254
251
|
};
|
|
255
252
|
this.setTimezone = (value, timezone) => {
|
|
256
253
|
var _this$moment$defaultZ2, _this$moment$defaultZ3;
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,170 @@
|
|
|
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
|
+
## 6.16.2
|
|
7
|
+
|
|
8
|
+
_Oct 12, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 📊 Chart's legend text management has been reworked and contains breaking changes (#10138) @alexfauquette
|
|
13
|
+
- 📝 Add [Bulk editing](https://mui.com/x/react-data-grid/recipes-editing/#bulk-editing) demo (#10333) @cherniavskii
|
|
14
|
+
- 🚀 Column grouping now works smoothly with column pinning (#10518) @MBilalShafi
|
|
15
|
+
- 🌍 Improve Arabic (ar-SD) and Spanish (es-ES) locales
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
- 📚 Documentation improvements
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@6.16.2`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Fix `LazyLoading` demo crash (#10621) @MBilalShafi
|
|
24
|
+
- [DataGrid] Fix cells overlapping the scrollbar in iOS Safari (#10633) @cherniavskii
|
|
25
|
+
- [DataGrid] Fix `getRowId is not defined` error (#10613) @romgrk
|
|
26
|
+
- [DataGrid] Get quick filter to work OOTB with `date` and `dateTime` fields (#10636) @MBilalShafi
|
|
27
|
+
- [DataGrid] Make cursor for selectable cells to be `default` unless editable (#9997) @gitstart
|
|
28
|
+
- [DataGrid] Remove unnecessary syntax in JSDoc (#10567) @Lev-Shapiro
|
|
29
|
+
- [DataGrid] Update row hover behavior to match native hover (#10623) @cherniavskii
|
|
30
|
+
- [l10n] Improve Arabic (ar-SD) locale (#10625) @alabenyahia
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@6.16.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@6.16.2`, plus:
|
|
35
|
+
|
|
36
|
+
- [DataGridPro] Improve column grouping and column pinning friendship (#10518) @MBilalShafi
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-premium@6.16.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.2`.
|
|
41
|
+
|
|
42
|
+
### Date Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@6.16.2`
|
|
45
|
+
|
|
46
|
+
- [DateTimePicker] Add support for `DigitalClock` view renderer (#10624) @LukasTy
|
|
47
|
+
- [fields] Bootstrap the multi-HTML input component (#10638) @flaviendelangle
|
|
48
|
+
- [pickers] Fix timezone `UTC` false positive (#10586) @alexfauquette
|
|
49
|
+
- [l10n] Improve Spanish (es-ES) locale (#10588) @eduardodallmann
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@6.16.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@6.16.2`.
|
|
54
|
+
|
|
55
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.15`
|
|
56
|
+
|
|
57
|
+
#### Breaking changes
|
|
58
|
+
|
|
59
|
+
The charts have a new text display mechanism.
|
|
60
|
+
It adds line break support and avoids overlapping text in the legend.
|
|
61
|
+
This comes with some breaking changes.
|
|
62
|
+
|
|
63
|
+
- The DOM structure is modified. An intermediary `<tspan />` element has been added. This can impact how your style is applied.
|
|
64
|
+
```diff
|
|
65
|
+
- <text>The label</text>
|
|
66
|
+
+ <text><tspan>The label</tspan></text>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- The top margin has been reduced from 100 to 50 to benefit from the denser legend.
|
|
70
|
+
|
|
71
|
+
- To accurately compute the text size and then place it, styling should be provided as a JS object. For example, to set the legend font size, you should do:
|
|
72
|
+
```jsx
|
|
73
|
+
<PieChart
|
|
74
|
+
{/** ... */}
|
|
75
|
+
slotProps={{
|
|
76
|
+
legend: {
|
|
77
|
+
labelStyle: {
|
|
78
|
+
fontSize: 16,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
Support for other text elements (axis labels and tick labels) will be implemented in follow-up PR.
|
|
85
|
+
|
|
86
|
+
#### Changes
|
|
87
|
+
|
|
88
|
+
- [charts] Fix typo between internal/external variable (#10640) @alexfauquette
|
|
89
|
+
- [charts] Improve the management of the text (#10138) @alexfauquette
|
|
90
|
+
|
|
91
|
+
### Docs
|
|
92
|
+
|
|
93
|
+
- [docs] Add bulk editing demo (#10333) @cherniavskii
|
|
94
|
+
- [docs] Add reference links to DateRangePicker components (#10629) @michelengelen
|
|
95
|
+
- [docs] Add reference links to DateTimePicker components (#10628) @michelengelen
|
|
96
|
+
- [docs] Add reference links to picker field components (#10631) @michelengelen
|
|
97
|
+
- [docs] Added reference links to TimePicker components (#10627) @michelengelen
|
|
98
|
+
- [docs] Avoid Pickers playground error due to empty views (#10654) @LukasTy
|
|
99
|
+
- [docs] Fix DataGrid[Pro/Premium] reference links (#10620) @michelengelen
|
|
100
|
+
|
|
101
|
+
### Core
|
|
102
|
+
|
|
103
|
+
- [core] Bump monorepo (#10619) @alexfauquette
|
|
104
|
+
- [core] Update `no-response` workflow (#10491) @MBilalShafi
|
|
105
|
+
- [core] Update the issue templates to reflect the new support workflow (#10651) @MBilalShafi
|
|
106
|
+
- [test] Fix `testEval` not invoking test assertions (#10587) @cherniavskii
|
|
107
|
+
- [test] Fix dev mode warning (#10610) @oliviertassinari
|
|
108
|
+
- [test] Set UUID chance seed in visual tests (#10609) @oliviertassinari
|
|
109
|
+
|
|
110
|
+
## 6.16.1
|
|
111
|
+
|
|
112
|
+
_Oct 6, 2023_
|
|
113
|
+
|
|
114
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
115
|
+
|
|
116
|
+
- 🥧 Support interaction with pie chart
|
|
117
|
+
- 🐞 Bugfixes
|
|
118
|
+
- 📚 Documentation improvements
|
|
119
|
+
|
|
120
|
+
### Data Grid
|
|
121
|
+
|
|
122
|
+
#### `@mui/x-data-grid@6.16.1`
|
|
123
|
+
|
|
124
|
+
- [DataGrid] Add a new demo with sparklines (#9228) @flaviendelangle
|
|
125
|
+
- [DataGrid] Fix autosize missing a few pixels (#10471) @romgrk
|
|
126
|
+
- [DataGrid] Make `disableColumnSelector` demo idempotent (#10548) @MBilalShafi
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-data-grid-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
129
|
+
|
|
130
|
+
Same changes as in `@mui/x-data-grid@6.16.1`.
|
|
131
|
+
|
|
132
|
+
#### `@mui/x-data-grid-premium@6.16.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
133
|
+
|
|
134
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.1`.
|
|
135
|
+
|
|
136
|
+
### Date Pickers
|
|
137
|
+
|
|
138
|
+
#### `@mui/x-date-pickers@6.16.1`
|
|
139
|
+
|
|
140
|
+
- [pickers] Avoid calendar layout shifting when changing views (#10541) @LukasTy
|
|
141
|
+
- [pickers] Fix clearable behavior when disabled (#10542) @noraleonte
|
|
142
|
+
- [pickers] Improve customization playground examples (#10544) @noraleonte
|
|
143
|
+
|
|
144
|
+
#### `@mui/x-date-pickers-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
145
|
+
|
|
146
|
+
Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
|
|
147
|
+
|
|
148
|
+
- [DateRangePicker] Fix `InputProps` propagation in multi input (#10564) @alexfauquette
|
|
149
|
+
|
|
150
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.14`
|
|
151
|
+
|
|
152
|
+
- [charts] Display cursor pointer for pie chart only if `onClick` is provided (#10551) @giladappsforce
|
|
153
|
+
- [charts] Add `onClick` prop to PieChart (#10506) @giladappsforce
|
|
154
|
+
- [charts] Support `slots`/`slotProps` for the tooltip (#10515) @alexfauquette
|
|
155
|
+
|
|
156
|
+
### Docs
|
|
157
|
+
|
|
158
|
+
- [docs] Add `DateRangePicker` example with a `Button` trigger (#10485) @LukasTy
|
|
159
|
+
- [docs] Add section about disabling columns panel (#10328) @MBilalShafi
|
|
160
|
+
- [docs] Add section about overriding slots to base concepts (#10421) @noraleonte
|
|
161
|
+
- [docs] Add "What's new" page listing all release announcements (#9727) @joserodolfofreitas
|
|
162
|
+
- [docs] Update RTL Support section of the grid localization docs (#10561) @MBilalShafi
|
|
163
|
+
|
|
164
|
+
### Core
|
|
165
|
+
|
|
166
|
+
- [core] Fix casing consistency with legal and marketing content @oliviertassinari
|
|
167
|
+
- [core] Revert the link in the priority support ticket description (#10517) @michelengelen
|
|
168
|
+
- [CHANGELOG] Polish image @oliviertassinari
|
|
169
|
+
|
|
6
170
|
## 6.16.0
|
|
7
171
|
|
|
8
172
|
_Sep 29, 2023_
|
|
@@ -13,7 +177,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
13
177
|
|
|
14
178
|
The pickers and fields now have an out-of-the box implementation for clearing the field value. You can see the documentation for this behavior on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value).
|
|
15
179
|
|
|
16
|
-
<img width="
|
|
180
|
+
<img width="337" height="139" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/3165635/a5407cb6-0b8a-443c-b4b9-1f81ceb4d087">
|
|
17
181
|
|
|
18
182
|
- 💫 Add Date Picker customization playground (#9581) @noraleonte
|
|
19
183
|
|
|
@@ -21,6 +21,7 @@ import { useDefaultReduceAnimations } from '../internals/hooks/useDefaultReduceA
|
|
|
21
21
|
import { getDateCalendarUtilityClass } from './dateCalendarClasses';
|
|
22
22
|
import { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';
|
|
23
23
|
import { singleItemValueManager } from '../internals/utils/valueManagers';
|
|
24
|
+
import { VIEW_HEIGHT } from '../internals/constants/dimensions';
|
|
24
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
26
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
27
|
const useUtilityClasses = ownerState => {
|
|
@@ -62,7 +63,8 @@ const DateCalendarRoot = styled(PickerViewRoot, {
|
|
|
62
63
|
overridesResolver: (props, styles) => styles.root
|
|
63
64
|
})({
|
|
64
65
|
display: 'flex',
|
|
65
|
-
flexDirection: 'column'
|
|
66
|
+
flexDirection: 'column',
|
|
67
|
+
height: VIEW_HEIGHT
|
|
66
68
|
});
|
|
67
69
|
const DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {
|
|
68
70
|
name: 'MuiDateCalendar',
|
|
@@ -67,7 +67,7 @@ const PickersCalendarWeekDayLabel = styled(Typography, {
|
|
|
67
67
|
color: (theme.vars || theme).palette.text.secondary
|
|
68
68
|
}));
|
|
69
69
|
const PickersCalendarWeekNumberLabel = styled(Typography, {
|
|
70
|
-
name: '
|
|
70
|
+
name: 'MuiDayCalendar',
|
|
71
71
|
slot: 'WeekNumberLabel',
|
|
72
72
|
overridesResolver: (_, styles) => styles.weekNumberLabel
|
|
73
73
|
})(({
|
|
@@ -83,7 +83,7 @@ const PickersCalendarWeekNumberLabel = styled(Typography, {
|
|
|
83
83
|
color: theme.palette.text.disabled
|
|
84
84
|
}));
|
|
85
85
|
const PickersCalendarWeekNumber = styled(Typography, {
|
|
86
|
-
name: '
|
|
86
|
+
name: 'MuiDayCalendar',
|
|
87
87
|
slot: 'WeekNumber',
|
|
88
88
|
overridesResolver: (_, styles) => styles.weekNumber
|
|
89
89
|
})(({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import Fade from '@mui/material/Fade';
|
|
4
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
5
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
6
3
|
import { TransitionGroup } from 'react-transition-group';
|
|
4
|
+
import Fade from '@mui/material/Fade';
|
|
5
|
+
import { styled, useTheme, useThemeProps } from '@mui/material/styles';
|
|
6
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
7
7
|
import { getPickersFadeTransitionGroupUtilityClass } from './pickersFadeTransitionGroupClasses';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
const useUtilityClasses = ownerState => {
|
|
@@ -15,7 +15,6 @@ const useUtilityClasses = ownerState => {
|
|
|
15
15
|
};
|
|
16
16
|
return composeClasses(slots, getPickersFadeTransitionGroupUtilityClass, classes);
|
|
17
17
|
};
|
|
18
|
-
const animationDuration = 500;
|
|
19
18
|
const PickersFadeTransitionGroupRoot = styled(TransitionGroup, {
|
|
20
19
|
name: 'MuiPickersFadeTransitionGroup',
|
|
21
20
|
slot: 'Root',
|
|
@@ -40,6 +39,7 @@ export function PickersFadeTransitionGroup(inProps) {
|
|
|
40
39
|
transKey
|
|
41
40
|
} = props;
|
|
42
41
|
const classes = useUtilityClasses(props);
|
|
42
|
+
const theme = useTheme();
|
|
43
43
|
if (reduceAnimations) {
|
|
44
44
|
return children;
|
|
45
45
|
}
|
|
@@ -50,8 +50,8 @@ export function PickersFadeTransitionGroup(inProps) {
|
|
|
50
50
|
mountOnEnter: true,
|
|
51
51
|
unmountOnExit: true,
|
|
52
52
|
timeout: {
|
|
53
|
-
appear:
|
|
54
|
-
enter:
|
|
53
|
+
appear: theme.transitions.duration.enteringScreen,
|
|
54
|
+
enter: theme.transitions.duration.enteringScreen,
|
|
55
55
|
exit: 0
|
|
56
56
|
},
|
|
57
57
|
children: children
|
|
@@ -3,8 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["children", "className", "reduceAnimations", "slideDirection", "transKey", "classes"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
7
|
-
import
|
|
6
|
+
import { styled, useTheme, useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
|
9
9
|
import { getPickersSlideTransitionUtilityClass, pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,7 +22,6 @@ const useUtilityClasses = ownerState => {
|
|
|
22
22
|
};
|
|
23
23
|
return composeClasses(slots, getPickersSlideTransitionUtilityClass, classes);
|
|
24
24
|
};
|
|
25
|
-
export const slideAnimationDuration = 350;
|
|
26
25
|
const PickersSlideTransitionRoot = styled(TransitionGroup, {
|
|
27
26
|
name: 'MuiPickersSlideTransition',
|
|
28
27
|
slot: 'Root',
|
|
@@ -43,7 +42,7 @@ const PickersSlideTransitionRoot = styled(TransitionGroup, {
|
|
|
43
42
|
theme
|
|
44
43
|
}) => {
|
|
45
44
|
const slideTransition = theme.transitions.create('transform', {
|
|
46
|
-
duration:
|
|
45
|
+
duration: theme.transitions.duration.complex,
|
|
47
46
|
easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)'
|
|
48
47
|
});
|
|
49
48
|
return {
|
|
@@ -105,6 +104,7 @@ export function PickersSlideTransition(inProps) {
|
|
|
105
104
|
} = props,
|
|
106
105
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
107
106
|
const classes = useUtilityClasses(props);
|
|
107
|
+
const theme = useTheme();
|
|
108
108
|
if (reduceAnimations) {
|
|
109
109
|
return /*#__PURE__*/_jsx("div", {
|
|
110
110
|
className: clsx(classes.root, className),
|
|
@@ -126,7 +126,7 @@ export function PickersSlideTransition(inProps) {
|
|
|
126
126
|
children: /*#__PURE__*/_jsx(CSSTransition, _extends({
|
|
127
127
|
mountOnEnter: true,
|
|
128
128
|
unmountOnExit: true,
|
|
129
|
-
timeout:
|
|
129
|
+
timeout: theme.transitions.duration.complex,
|
|
130
130
|
classNames: transitionClasses
|
|
131
131
|
}, other, {
|
|
132
132
|
children: children
|
package/DateField/DateField.d.ts
CHANGED
|
@@ -3,5 +3,15 @@ import { DateFieldProps } from './DateField.types';
|
|
|
3
3
|
type DateFieldComponent = (<TDate>(props: DateFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Demos:
|
|
8
|
+
*
|
|
9
|
+
* - [DateField](http://mui.com/x/react-date-pickers/date-field/)
|
|
10
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
11
|
+
*
|
|
12
|
+
* API:
|
|
13
|
+
*
|
|
14
|
+
* - [DateField API](https://mui.com/x/api/date-pickers/date-field/)
|
|
15
|
+
*/
|
|
6
16
|
declare const DateField: DateFieldComponent;
|
|
7
17
|
export { DateField };
|
package/DateField/DateField.js
CHANGED
|
@@ -12,6 +12,16 @@ import { refType } from '@mui/utils';
|
|
|
12
12
|
import { useDateField } from './useDateField';
|
|
13
13
|
import { useClearableField } from '../hooks';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateField](http://mui.com/x/react-date-pickers/date-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [DateField API](https://mui.com/x/api/date-pickers/date-field/)
|
|
24
|
+
*/
|
|
15
25
|
const DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, ref) {
|
|
16
26
|
var _ref, _slots$textField, _slotProps$textField;
|
|
17
27
|
const themeProps = useThemeProps({
|
|
@@ -3,5 +3,15 @@ import { DateTimeFieldProps } from './DateTimeField.types';
|
|
|
3
3
|
type DateTimeFieldComponent = (<TDate>(props: DateTimeFieldProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Demos:
|
|
8
|
+
*
|
|
9
|
+
* - [DateTimeField](http://mui.com/x/react-date-pickers/date-time-field/)
|
|
10
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
11
|
+
*
|
|
12
|
+
* API:
|
|
13
|
+
*
|
|
14
|
+
* - [DateTimeField API](https://mui.com/x/api/date-pickers/date-time-field/)
|
|
15
|
+
*/
|
|
6
16
|
declare const DateTimeField: DateTimeFieldComponent;
|
|
7
17
|
export { DateTimeField };
|
|
@@ -12,6 +12,16 @@ import { refType } from '@mui/utils';
|
|
|
12
12
|
import { useDateTimeField } from './useDateTimeField';
|
|
13
13
|
import { useClearableField } from '../hooks';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [DateTimeField](http://mui.com/x/react-date-pickers/date-time-field/)
|
|
19
|
+
* - [Fields](https://mui.com/x/react-date-pickers/fields/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [DateTimeField API](https://mui.com/x/api/date-pickers/date-time-field/)
|
|
24
|
+
*/
|
|
15
25
|
const DateTimeField = /*#__PURE__*/React.forwardRef(function DateTimeField(inProps, ref) {
|
|
16
26
|
var _ref, _slots$textField, _slotProps$textField;
|
|
17
27
|
const themeProps = useThemeProps({
|
|
@@ -3,5 +3,15 @@ import { DateTimePickerProps } from './DateTimePicker.types';
|
|
|
3
3
|
type DateTimePickerComponent = (<TDate>(props: DateTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Demos:
|
|
8
|
+
*
|
|
9
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
10
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
11
|
+
*
|
|
12
|
+
* API:
|
|
13
|
+
*
|
|
14
|
+
* - [DateTimePicker API](https://mui.com/x/api/date-pickers/date-time-picker/)
|
|
15
|
+
*/
|
|
6
16
|
declare const DateTimePicker: DateTimePickerComponent;
|
|
7
17
|
export { DateTimePicker };
|
|
@@ -10,6 +10,16 @@ import { DesktopDateTimePicker } from '../DesktopDateTimePicker';
|
|
|
10
10
|
import { MobileDateTimePicker } from '../MobileDateTimePicker';
|
|
11
11
|
import { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* Demos:
|
|
15
|
+
*
|
|
16
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
17
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [DateTimePicker API](https://mui.com/x/api/date-pickers/date-time-picker/)
|
|
22
|
+
*/
|
|
13
23
|
const DateTimePicker = /*#__PURE__*/React.forwardRef(function DateTimePicker(inProps, ref) {
|
|
14
24
|
const props = useThemeProps({
|
|
15
25
|
props: inProps,
|
|
@@ -377,6 +387,11 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
377
387
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
378
388
|
*/
|
|
379
389
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
390
|
+
/**
|
|
391
|
+
* Amount of time options below or at which the single column time renderer is used.
|
|
392
|
+
* @default 24
|
|
393
|
+
*/
|
|
394
|
+
thresholdToRenderTimeInASingleColumn: PropTypes.number,
|
|
380
395
|
/**
|
|
381
396
|
* The time steps between two time unit options.
|
|
382
397
|
* For example, if `timeStep.minutes = 8`, then the available minute options will be `[0, 8, 16, 24, 32, 40, 48, 56]`.
|
|
@@ -3,5 +3,15 @@ import { DesktopDateTimePickerProps } from './DesktopDateTimePicker.types';
|
|
|
3
3
|
type DesktopDateTimePickerComponent = (<TDate>(props: DesktopDateTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Demos:
|
|
8
|
+
*
|
|
9
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
10
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
11
|
+
*
|
|
12
|
+
* API:
|
|
13
|
+
*
|
|
14
|
+
* - [DesktopDateTimePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-picker/)
|
|
15
|
+
*/
|
|
6
16
|
declare const DesktopDateTimePicker: DesktopDateTimePickerComponent;
|
|
7
17
|
export { DesktopDateTimePicker };
|
|
@@ -13,7 +13,17 @@ import { validateDateTime } from '../internals/utils/validation/validateDateTime
|
|
|
13
13
|
import { CalendarIcon } from '../icons';
|
|
14
14
|
import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
15
15
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
16
|
-
import { resolveDateTimeFormat } from '../internals/utils/date-time-utils';
|
|
16
|
+
import { resolveDateTimeFormat, resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
21
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [DesktopDateTimePicker API](https://mui.com/x/api/date-pickers/desktop-date-time-picker/)
|
|
26
|
+
*/
|
|
17
27
|
const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDateTimePicker(inProps, ref) {
|
|
18
28
|
var _defaultizedProps$amp, _defaultizedProps$yea, _defaultizedProps$slo2, _defaultizedProps$slo3, _defaultizedProps$slo4, _props$localeText$ope, _props$localeText;
|
|
19
29
|
const localeText = useLocaleText();
|
|
@@ -21,11 +31,12 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
21
31
|
|
|
22
32
|
// Props with the default values common to all date time pickers
|
|
23
33
|
const defaultizedProps = useDateTimePickerDefaultizedProps(inProps, 'MuiDesktopDateTimePicker');
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
const {
|
|
35
|
+
shouldRenderTimeInASingleColumn,
|
|
36
|
+
thresholdToRenderTimeInASingleColumn,
|
|
37
|
+
views,
|
|
38
|
+
timeSteps
|
|
39
|
+
} = resolveTimeViewsResponse(defaultizedProps);
|
|
29
40
|
const shouldUseNewRenderer = !defaultizedProps.viewRenderers || Object.keys(defaultizedProps.viewRenderers).length === 0;
|
|
30
41
|
const viewRenderers =
|
|
31
42
|
// we can only ensure the expected two-column layout if none of the renderers are overridden
|
|
@@ -54,10 +65,12 @@ const DesktopDateTimePicker = /*#__PURE__*/React.forwardRef(function DesktopDate
|
|
|
54
65
|
const props = _extends({}, defaultizedProps, {
|
|
55
66
|
viewRenderers,
|
|
56
67
|
format: resolveDateTimeFormat(utils, defaultizedProps),
|
|
57
|
-
views
|
|
68
|
+
views,
|
|
58
69
|
yearsPerRow: (_defaultizedProps$yea = defaultizedProps.yearsPerRow) != null ? _defaultizedProps$yea : 4,
|
|
59
70
|
ampmInClock,
|
|
60
71
|
timeSteps,
|
|
72
|
+
thresholdToRenderTimeInASingleColumn,
|
|
73
|
+
shouldRenderTimeInASingleColumn,
|
|
61
74
|
slots: _extends({
|
|
62
75
|
field: DateTimeField,
|
|
63
76
|
openPickerIcon: CalendarIcon
|
|
@@ -431,6 +444,11 @@ DesktopDateTimePicker.propTypes = {
|
|
|
431
444
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
432
445
|
*/
|
|
433
446
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
447
|
+
/**
|
|
448
|
+
* Amount of time options below or at which the single column time renderer is used.
|
|
449
|
+
* @default 24
|
|
450
|
+
*/
|
|
451
|
+
thresholdToRenderTimeInASingleColumn: PropTypes.number,
|
|
434
452
|
/**
|
|
435
453
|
* The time steps between two time unit options.
|
|
436
454
|
* For example, if `timeStep.minutes = 8`, then the available minute options will be `[0, 8, 16, 24, 32, 40, 48, 56]`.
|
|
@@ -6,11 +6,12 @@ import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
|
|
|
6
6
|
import { DesktopOnlyTimePickerProps } from '../internals/models/props/clock';
|
|
7
7
|
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
8
8
|
import { MultiSectionDigitalClockSlotsComponent, MultiSectionDigitalClockSlotsComponentsProps } from '../MultiSectionDigitalClock';
|
|
9
|
-
|
|
9
|
+
import { DigitalClockSlotsComponent, DigitalClockSlotsComponentsProps } from '../DigitalClock';
|
|
10
|
+
export interface DesktopDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateOrTimeViewWithMeridiem>, 'Field' | 'OpenPickerIcon'>, DigitalClockSlotsComponent, MultiSectionDigitalClockSlotsComponent {
|
|
10
11
|
}
|
|
11
|
-
export interface DesktopDateTimePickerSlotsComponentsProps<TDate> extends BaseDateTimePickerSlotsComponentsProps<TDate>, ExportedUseDesktopPickerSlotsComponentsProps<TDate, DateOrTimeViewWithMeridiem>, MultiSectionDigitalClockSlotsComponentsProps {
|
|
12
|
+
export interface DesktopDateTimePickerSlotsComponentsProps<TDate> extends BaseDateTimePickerSlotsComponentsProps<TDate>, ExportedUseDesktopPickerSlotsComponentsProps<TDate, DateOrTimeViewWithMeridiem>, DigitalClockSlotsComponentsProps, MultiSectionDigitalClockSlotsComponentsProps {
|
|
12
13
|
}
|
|
13
|
-
export interface DesktopDateTimePickerProps<TDate> extends BaseDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem>, DesktopOnlyPickerProps<TDate>,
|
|
14
|
+
export interface DesktopDateTimePickerProps<TDate> extends BaseDateTimePickerProps<TDate, DateOrTimeViewWithMeridiem>, DesktopOnlyPickerProps<TDate>, DesktopOnlyTimePickerProps<TDate> {
|
|
14
15
|
/**
|
|
15
16
|
* Available views.
|
|
16
17
|
*/
|
|
@@ -3,5 +3,15 @@ import { DesktopTimePickerProps } from './DesktopTimePicker.types';
|
|
|
3
3
|
type DesktopTimePickerComponent = (<TDate>(props: DesktopTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Demos:
|
|
8
|
+
*
|
|
9
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
10
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
11
|
+
*
|
|
12
|
+
* API:
|
|
13
|
+
*
|
|
14
|
+
* - [DesktopTimePicker API](https://mui.com/x/api/date-pickers/desktop-time-picker/)
|
|
15
|
+
*/
|
|
6
16
|
declare const DesktopTimePicker: DesktopTimePickerComponent;
|
|
7
17
|
export { DesktopTimePicker };
|
|
@@ -13,20 +13,29 @@ import { useDesktopPicker } from '../internals/hooks/useDesktopPicker';
|
|
|
13
13
|
import { extractValidationProps } from '../internals/utils/validation/extractValidationProps';
|
|
14
14
|
import { renderDigitalClockTimeView, renderMultiSectionDigitalClockTimeView } from '../timeViewRenderers';
|
|
15
15
|
import { resolveTimeFormat } from '../internals/utils/time-utils';
|
|
16
|
+
import { resolveTimeViewsResponse } from '../internals/utils/date-time-utils';
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [TimePicker](https://mui.com/x/react-date-pickers/time-picker/)
|
|
21
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [DesktopTimePicker API](https://mui.com/x/api/date-pickers/desktop-time-picker/)
|
|
26
|
+
*/
|
|
16
27
|
const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePicker(inProps, ref) {
|
|
17
|
-
var _defaultizedProps$
|
|
28
|
+
var _defaultizedProps$amp, _viewRenderers$hours, _defaultizedProps$slo2, _defaultizedProps$slo3, _props$localeText$ope, _props$localeText;
|
|
18
29
|
const localeText = useLocaleText();
|
|
19
30
|
const utils = useUtils();
|
|
20
31
|
|
|
21
32
|
// Props with the default values common to all time pickers
|
|
22
33
|
const defaultizedProps = useTimePickerDefaultizedProps(inProps, 'MuiDesktopTimePicker');
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, defaultizedProps.timeSteps);
|
|
29
|
-
const shouldRenderTimeInASingleColumn = 24 * 60 / (timeSteps.hours * timeSteps.minutes) <= thresholdToRenderTimeInASingleColumn;
|
|
34
|
+
const {
|
|
35
|
+
shouldRenderTimeInASingleColumn,
|
|
36
|
+
views: resolvedViews,
|
|
37
|
+
timeSteps
|
|
38
|
+
} = resolveTimeViewsResponse(defaultizedProps);
|
|
30
39
|
const renderTimeView = shouldRenderTimeInASingleColumn ? renderDigitalClockTimeView : renderMultiSectionDigitalClockTimeView;
|
|
31
40
|
const viewRenderers = _extends({
|
|
32
41
|
hours: renderTimeView,
|
|
@@ -38,7 +47,7 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
|
|
|
38
47
|
const actionBarActions = shouldRenderTimeInASingleColumn ? [] : ['accept'];
|
|
39
48
|
// Need to avoid adding the `meridiem` view when unexpected renderer is specified
|
|
40
49
|
const shouldHoursRendererContainMeridiemView = ((_viewRenderers$hours = viewRenderers.hours) == null ? void 0 : _viewRenderers$hours.name) === renderMultiSectionDigitalClockTimeView.name;
|
|
41
|
-
const views =
|
|
50
|
+
const views = !shouldHoursRendererContainMeridiemView ? resolvedViews.filter(view => view !== 'meridiem') : resolvedViews;
|
|
42
51
|
|
|
43
52
|
// Props with the default values specific to the desktop variant
|
|
44
53
|
const props = _extends({}, defaultizedProps, {
|
|
@@ -153,7 +153,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
153
153
|
props,
|
|
154
154
|
timezone
|
|
155
155
|
});
|
|
156
|
-
const handleValueChange = useEventCallback(newValue => handleRawValueChange(newValue, 'finish'));
|
|
156
|
+
const handleValueChange = useEventCallback(newValue => handleRawValueChange(newValue, 'finish', 'hours'));
|
|
157
157
|
const {
|
|
158
158
|
setValueAndGoToNextView
|
|
159
159
|
} = useViews({
|
|
@@ -3,5 +3,15 @@ import { MobileDateTimePickerProps } from './MobileDateTimePicker.types';
|
|
|
3
3
|
type MobileDateTimePickerComponent = (<TDate>(props: MobileDateTimePickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => React.JSX.Element) & {
|
|
4
4
|
propTypes?: any;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Demos:
|
|
8
|
+
*
|
|
9
|
+
* - [DateTimePicker](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
10
|
+
* - [Validation](https://mui.com/x/react-date-pickers/validation/)
|
|
11
|
+
*
|
|
12
|
+
* API:
|
|
13
|
+
*
|
|
14
|
+
* - [MobileDateTimePicker API](https://mui.com/x/api/date-pickers/mobile-date-time-picker/)
|
|
15
|
+
*/
|
|
6
16
|
declare const MobileDateTimePicker: MobileDateTimePickerComponent;
|
|
7
17
|
export { MobileDateTimePicker };
|