@mui/x-date-pickers 5.0.2 → 6.0.0-alpha.0
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 +212 -3
- package/CalendarPicker/CalendarPicker.d.ts +8 -2
- package/CalendarPicker/CalendarPicker.js +54 -71
- package/CalendarPicker/DayPicker.d.ts +2 -2
- package/CalendarPicker/DayPicker.js +6 -2
- package/CalendarPicker/PickersCalendarHeader.d.ts +3 -10
- package/CalendarPicker/PickersCalendarHeader.js +7 -20
- package/CalendarPicker/useCalendarState.d.ts +2 -2
- package/CalendarPicker/useCalendarState.js +7 -7
- package/ClockPicker/Clock.d.ts +9 -4
- package/ClockPicker/Clock.js +13 -13
- package/ClockPicker/ClockNumbers.d.ts +3 -3
- package/ClockPicker/ClockNumbers.js +2 -2
- package/ClockPicker/ClockPicker.d.ts +8 -58
- package/ClockPicker/ClockPicker.js +52 -128
- package/ClockPicker/ClockPointer.d.ts +1 -1
- package/ClockPicker/ClockPointer.js +4 -4
- package/DateField/useDateField.d.ts +1 -1
- package/DateField/useDateField.js +5 -1
- package/DatePicker/DatePicker.js +10 -20
- package/DateTimePicker/DateTimePicker.js +10 -39
- package/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +14 -22
- package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
- package/DesktopTimePicker/DesktopTimePicker.js +9 -21
- package/LocalizationProvider/LocalizationProvider.d.ts +10 -11
- package/LocalizationProvider/LocalizationProvider.js +31 -24
- package/MobileDatePicker/MobileDatePicker.d.ts +1 -1
- package/MobileDatePicker/MobileDatePicker.js +14 -22
- package/MobileDateTimePicker/MobileDateTimePicker.d.ts +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/MobileTimePicker/MobileTimePicker.d.ts +1 -1
- package/MobileTimePicker/MobileTimePicker.js +9 -21
- package/MonthPicker/MonthPicker.d.ts +12 -9
- package/MonthPicker/MonthPicker.js +60 -57
- package/MonthPicker/PickersMonth.d.ts +10 -7
- package/MonthPicker/PickersMonth.js +76 -44
- package/MonthPicker/pickersMonthClasses.d.ts +9 -1
- package/MonthPicker/pickersMonthClasses.js +1 -1
- package/PickersDay/PickersDay.d.ts +0 -6
- package/PickersDay/PickersDay.js +0 -5
- package/StaticDatePicker/StaticDatePicker.d.ts +1 -1
- package/StaticDatePicker/StaticDatePicker.js +17 -23
- package/StaticDateTimePicker/StaticDateTimePicker.d.ts +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
- package/StaticTimePicker/StaticTimePicker.d.ts +1 -1
- package/StaticTimePicker/StaticTimePicker.js +17 -22
- package/TimePicker/TimePicker.js +5 -19
- package/YearPicker/PickersYear.d.ts +7 -6
- package/YearPicker/PickersYear.js +34 -23
- package/YearPicker/YearPicker.d.ts +21 -4
- package/YearPicker/YearPicker.js +109 -49
- package/YearPicker/pickersYearClasses.d.ts +1 -1
- package/index.js +1 -1
- package/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/internals/components/PickerStaticWrapper/PickerStaticWrapper.d.ts +20 -6
- package/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
- package/internals/components/PickerStaticWrapper/index.d.ts +1 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.d.ts +3 -0
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +166 -0
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +63 -0
- package/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/internals/components/PickersArrowSwitcher/index.d.ts +2 -0
- package/internals/components/PickersArrowSwitcher/index.js +1 -0
- package/internals/components/{pickersArrowSwitcherClasses.d.ts → PickersArrowSwitcher/pickersArrowSwitcherClasses.d.ts} +0 -0
- package/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/internals/components/PickersPopper.d.ts +2 -6
- package/internals/components/PickersPopper.js +5 -5
- package/internals/components/PickersToolbar.d.ts +1 -1
- package/internals/components/PickersToolbar.js +1 -2
- package/internals/components/PickersToolbarText.d.ts +1 -1
- package/internals/components/wrappers/DesktopTooltipWrapper.d.ts +1 -1
- package/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
- package/internals/components/wrappers/DesktopWrapper.d.ts +8 -3
- package/internals/components/wrappers/DesktopWrapper.js +26 -21
- package/internals/components/wrappers/MobileWrapper.d.ts +8 -3
- package/internals/components/wrappers/MobileWrapper.js +23 -18
- package/internals/hooks/useField/useField.interfaces.d.ts +0 -1
- package/internals/hooks/useField/useField.js +19 -23
- package/internals/hooks/useField/useField.utils.js +10 -2
- package/internals/hooks/useUtils.d.ts +5 -2
- package/internals/hooks/useUtils.js +11 -2
- package/internals/hooks/validation/useDateValidation.d.ts +4 -4
- package/internals/hooks/validation/useDateValidation.js +12 -2
- package/internals/index.d.ts +5 -5
- package/internals/index.js +3 -3
- package/internals/models/muiPickersAdapter.d.ts +12 -7
- package/internals/models/props/baseToolbarProps.d.ts +0 -8
- package/internals/models/props/staticPickerProps.d.ts +2 -8
- package/legacy/CalendarPicker/CalendarPicker.js +52 -69
- package/legacy/CalendarPicker/DayPicker.js +6 -2
- package/legacy/CalendarPicker/PickersCalendarHeader.js +7 -20
- package/legacy/CalendarPicker/useCalendarState.js +7 -7
- package/legacy/ClockPicker/Clock.js +13 -13
- package/legacy/ClockPicker/ClockNumbers.js +2 -2
- package/legacy/ClockPicker/ClockPicker.js +57 -133
- package/legacy/ClockPicker/ClockPointer.js +4 -4
- package/legacy/DateField/useDateField.js +5 -1
- package/legacy/DatePicker/DatePicker.js +10 -20
- package/legacy/DateTimePicker/DateTimePicker.js +10 -39
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +13 -21
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +8 -20
- package/legacy/LocalizationProvider/LocalizationProvider.js +28 -23
- package/legacy/MobileDatePicker/MobileDatePicker.js +13 -21
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/legacy/MobileTimePicker/MobileTimePicker.js +8 -20
- package/legacy/MonthPicker/MonthPicker.js +67 -62
- package/legacy/MonthPicker/PickersMonth.js +89 -57
- package/legacy/MonthPicker/pickersMonthClasses.js +1 -1
- package/legacy/PickersDay/PickersDay.js +0 -5
- package/legacy/StaticDatePicker/StaticDatePicker.js +17 -24
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +17 -43
- package/legacy/StaticTimePicker/StaticTimePicker.js +17 -23
- package/legacy/TimePicker/TimePicker.js +5 -19
- package/legacy/YearPicker/PickersYear.js +35 -25
- package/legacy/YearPicker/YearPicker.js +111 -51
- package/legacy/index.js +1 -1
- package/legacy/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/legacy/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +41 -24
- package/legacy/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +180 -0
- package/legacy/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/legacy/internals/components/PickersArrowSwitcher/index.js +1 -0
- package/legacy/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/legacy/internals/components/PickersPopper.js +5 -5
- package/legacy/internals/components/PickersToolbar.js +1 -2
- package/legacy/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
- package/legacy/internals/components/wrappers/DesktopWrapper.js +26 -21
- package/legacy/internals/components/wrappers/MobileWrapper.js +22 -17
- package/legacy/internals/hooks/useField/useField.js +21 -23
- package/legacy/internals/hooks/useField/useField.utils.js +10 -2
- package/legacy/internals/hooks/useUtils.js +13 -2
- package/legacy/internals/hooks/validation/useDateValidation.js +12 -2
- package/legacy/internals/index.js +3 -3
- package/legacy/locales/faIR.js +52 -0
- package/legacy/locales/fiFI.js +61 -0
- package/legacy/locales/index.js +2 -0
- package/legacy/locales/isIS.js +0 -1
- package/locales/faIR.d.ts +35 -0
- package/locales/faIR.js +36 -0
- package/locales/fiFI.d.ts +35 -0
- package/locales/fiFI.js +45 -0
- package/locales/index.d.ts +2 -0
- package/locales/index.js +2 -0
- package/locales/isIS.js +0 -1
- package/locales/utils/pickersLocaleTextApi.d.ts +1 -0
- package/modern/CalendarPicker/CalendarPicker.js +54 -71
- package/modern/CalendarPicker/DayPicker.js +6 -2
- package/modern/CalendarPicker/PickersCalendarHeader.js +7 -20
- package/modern/CalendarPicker/useCalendarState.js +7 -7
- package/modern/ClockPicker/Clock.js +13 -13
- package/modern/ClockPicker/ClockNumbers.js +2 -2
- package/modern/ClockPicker/ClockPicker.js +52 -128
- package/modern/ClockPicker/ClockPointer.js +4 -4
- package/modern/DateField/useDateField.js +5 -1
- package/modern/DatePicker/DatePicker.js +10 -20
- package/modern/DateTimePicker/DateTimePicker.js +10 -39
- package/modern/DesktopDatePicker/DesktopDatePicker.js +14 -22
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/modern/DesktopTimePicker/DesktopTimePicker.js +9 -21
- package/modern/LocalizationProvider/LocalizationProvider.js +29 -24
- package/modern/MobileDatePicker/MobileDatePicker.js +14 -22
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/modern/MobileTimePicker/MobileTimePicker.js +9 -21
- package/modern/MonthPicker/MonthPicker.js +60 -57
- package/modern/MonthPicker/PickersMonth.js +76 -44
- package/modern/MonthPicker/pickersMonthClasses.js +1 -1
- package/modern/PickersDay/PickersDay.js +0 -5
- package/modern/StaticDatePicker/StaticDatePicker.js +17 -23
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
- package/modern/StaticTimePicker/StaticTimePicker.js +17 -22
- package/modern/TimePicker/TimePicker.js +5 -19
- package/modern/YearPicker/PickersYear.js +34 -23
- package/modern/YearPicker/YearPicker.js +109 -49
- package/modern/index.js +1 -1
- package/modern/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/modern/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +38 -22
- package/modern/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js +164 -0
- package/modern/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/modern/internals/components/PickersArrowSwitcher/index.js +1 -0
- package/modern/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/modern/internals/components/PickersPopper.js +5 -5
- package/modern/internals/components/PickersToolbar.js +1 -2
- package/modern/internals/components/wrappers/DesktopTooltipWrapper.js +29 -24
- package/modern/internals/components/wrappers/DesktopWrapper.js +26 -21
- package/modern/internals/components/wrappers/MobileWrapper.js +23 -18
- package/modern/internals/hooks/useField/useField.js +19 -21
- package/modern/internals/hooks/useField/useField.utils.js +10 -2
- package/modern/internals/hooks/useUtils.js +11 -2
- package/modern/internals/hooks/validation/useDateValidation.js +12 -2
- package/modern/internals/index.js +3 -3
- package/modern/locales/faIR.js +36 -0
- package/modern/locales/fiFI.js +45 -0
- package/modern/locales/index.js +2 -0
- package/modern/locales/isIS.js +0 -1
- package/node/CalendarPicker/CalendarPicker.js +54 -71
- package/node/CalendarPicker/DayPicker.js +5 -1
- package/node/CalendarPicker/PickersCalendarHeader.js +7 -21
- package/node/CalendarPicker/useCalendarState.js +6 -6
- package/node/ClockPicker/Clock.js +12 -12
- package/node/ClockPicker/ClockNumbers.js +2 -2
- package/node/ClockPicker/ClockPicker.js +52 -129
- package/node/ClockPicker/ClockPointer.js +4 -4
- package/node/DateField/useDateField.js +5 -1
- package/node/DatePicker/DatePicker.js +10 -20
- package/node/DateTimePicker/DateTimePicker.js +10 -39
- package/node/DesktopDatePicker/DesktopDatePicker.js +14 -22
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +13 -40
- package/node/DesktopTimePicker/DesktopTimePicker.js +9 -21
- package/node/LocalizationProvider/LocalizationProvider.js +31 -25
- package/node/MobileDatePicker/MobileDatePicker.js +14 -22
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +13 -40
- package/node/MobileTimePicker/MobileTimePicker.js +9 -21
- package/node/MonthPicker/MonthPicker.js +61 -58
- package/node/MonthPicker/PickersMonth.js +71 -43
- package/node/MonthPicker/pickersMonthClasses.js +1 -1
- package/node/PickersDay/PickersDay.js +0 -5
- package/node/StaticDatePicker/StaticDatePicker.js +17 -23
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +17 -42
- package/node/StaticTimePicker/StaticTimePicker.js +17 -22
- package/node/TimePicker/TimePicker.js +5 -19
- package/node/YearPicker/PickersYear.js +33 -22
- package/node/YearPicker/YearPicker.js +111 -49
- package/node/index.js +1 -1
- package/node/internals/components/CalendarOrClockPicker/CalendarOrClockPicker.js +2 -2
- package/node/internals/components/PickerStaticWrapper/PickerStaticWrapper.js +39 -22
- package/node/internals/components/{PickersArrowSwitcher.js → PickersArrowSwitcher/PickersArrowSwitcher.js} +102 -58
- package/node/internals/{models/muiPickersAdapter.js → components/PickersArrowSwitcher/PickersArrowSwitcher.types.js} +0 -0
- package/node/internals/components/PickersArrowSwitcher/index.js +13 -0
- package/node/internals/components/{pickersArrowSwitcherClasses.js → PickersArrowSwitcher/pickersArrowSwitcherClasses.js} +0 -0
- package/node/internals/components/PickersPopper.js +5 -5
- package/node/internals/components/PickersToolbar.js +1 -2
- package/node/internals/components/wrappers/DesktopTooltipWrapper.js +30 -24
- package/node/internals/components/wrappers/DesktopWrapper.js +27 -21
- package/node/internals/components/wrappers/MobileWrapper.js +24 -18
- package/node/internals/hooks/useField/useField.js +19 -23
- package/node/internals/hooks/useField/useField.utils.js +10 -2
- package/node/internals/hooks/useUtils.js +15 -2
- package/node/internals/hooks/validation/useDateValidation.js +14 -4
- package/node/internals/index.js +8 -2
- package/node/locales/faIR.js +45 -0
- package/node/locales/fiFI.js +54 -0
- package/node/locales/index.js +26 -0
- package/node/locales/isIS.js +0 -1
- package/package.json +4 -4
- package/themeAugmentation/props.d.ts +3 -3
- package/internals/components/PickersArrowSwitcher.d.ts +0 -62
- package/internals/components/PickersArrowSwitcher.js +0 -124
- package/legacy/internals/components/PickersArrowSwitcher.js +0 -128
- package/modern/internals/components/PickersArrowSwitcher.js +0 -124
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["ToolbarComponent", "value", "onChange", "displayStaticWrapperAs", "components", "componentsProps", "className"];
|
|
3
|
+
const _excluded = ["ToolbarComponent", "value", "onChange", "displayStaticWrapperAs", "components", "componentsProps", "localeText", "sx", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useDatePickerDefaultizedProps, datePickerValueManager } from '../DatePicker/shared';
|
|
@@ -27,9 +27,11 @@ export const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDat
|
|
|
27
27
|
|
|
28
28
|
const {
|
|
29
29
|
ToolbarComponent = DatePickerToolbar,
|
|
30
|
-
displayStaticWrapperAs
|
|
30
|
+
displayStaticWrapperAs,
|
|
31
31
|
components,
|
|
32
32
|
componentsProps,
|
|
33
|
+
localeText,
|
|
34
|
+
sx,
|
|
33
35
|
className
|
|
34
36
|
} = props,
|
|
35
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -51,6 +53,8 @@ export const StaticDatePicker = /*#__PURE__*/React.forwardRef(function StaticDat
|
|
|
51
53
|
displayStaticWrapperAs: displayStaticWrapperAs,
|
|
52
54
|
components: components,
|
|
53
55
|
componentsProps: componentsProps,
|
|
56
|
+
localeText: localeText,
|
|
57
|
+
sx: sx,
|
|
54
58
|
className: className
|
|
55
59
|
}, wrapperProps, {
|
|
56
60
|
children: /*#__PURE__*/_jsx(CalendarOrClockPicker, _extends({}, pickerProps, {
|
|
@@ -149,7 +153,7 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes = {
|
|
|
149
153
|
|
|
150
154
|
/**
|
|
151
155
|
* Force static wrapper inner components to be rendered in mobile or desktop mode.
|
|
152
|
-
* @default
|
|
156
|
+
* @default "mobile"
|
|
153
157
|
*/
|
|
154
158
|
displayStaticWrapperAs: PropTypes.oneOf(['desktop', 'mobile']),
|
|
155
159
|
|
|
@@ -162,14 +166,6 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes = {
|
|
|
162
166
|
* @default (date, utils) => `Choose date, selected date is ${utils.format(utils.date(date), 'fullDate')}`
|
|
163
167
|
*/
|
|
164
168
|
getOpenDialogAriaText: PropTypes.func,
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Get aria-label text for switching between views button.
|
|
168
|
-
* @param {CalendarPickerView} currentView The view from which we want to get the button text.
|
|
169
|
-
* @returns {string} The label of the view.
|
|
170
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
171
|
-
*/
|
|
172
|
-
getViewSwitchingButtonText: PropTypes.func,
|
|
173
169
|
ignoreInvalidInputs: PropTypes.bool,
|
|
174
170
|
|
|
175
171
|
/**
|
|
@@ -191,12 +187,6 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes = {
|
|
|
191
187
|
})]),
|
|
192
188
|
label: PropTypes.node,
|
|
193
189
|
|
|
194
|
-
/**
|
|
195
|
-
* Left arrow icon aria-label text.
|
|
196
|
-
* @deprecated
|
|
197
|
-
*/
|
|
198
|
-
leftArrowButtonText: PropTypes.string,
|
|
199
|
-
|
|
200
190
|
/**
|
|
201
191
|
* If `true` renders `LoadingComponent` in calendar instead of calendar view.
|
|
202
192
|
* Can be used to preload information and show it in calendar.
|
|
@@ -204,6 +194,11 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes = {
|
|
|
204
194
|
*/
|
|
205
195
|
loading: PropTypes.bool,
|
|
206
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Locale for components texts
|
|
199
|
+
*/
|
|
200
|
+
localeText: PropTypes.object,
|
|
201
|
+
|
|
207
202
|
/**
|
|
208
203
|
* Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
|
|
209
204
|
*/
|
|
@@ -334,12 +329,6 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes = {
|
|
|
334
329
|
*/
|
|
335
330
|
rifmFormatter: PropTypes.func,
|
|
336
331
|
|
|
337
|
-
/**
|
|
338
|
-
* Right arrow icon aria-label text.
|
|
339
|
-
* @deprecated
|
|
340
|
-
*/
|
|
341
|
-
rightArrowButtonText: PropTypes.string,
|
|
342
|
-
|
|
343
332
|
/**
|
|
344
333
|
* Disable specific date. @DateIOType
|
|
345
334
|
* @template TDate
|
|
@@ -377,6 +366,11 @@ process.env.NODE_ENV !== "production" ? StaticDatePicker.propTypes = {
|
|
|
377
366
|
*/
|
|
378
367
|
showToolbar: PropTypes.bool,
|
|
379
368
|
|
|
369
|
+
/**
|
|
370
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
371
|
+
*/
|
|
372
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
373
|
+
|
|
380
374
|
/**
|
|
381
375
|
* Component that will replace default toolbar renderer.
|
|
382
376
|
* @default DatePickerToolbar
|
|
@@ -8,7 +8,7 @@ export interface StaticDateTimePickerSlotsComponent extends PickersStaticWrapper
|
|
|
8
8
|
}
|
|
9
9
|
export interface StaticDateTimePickerSlotsComponentsProps extends PickersStaticWrapperSlotsComponentsProps, CalendarOrClockPickerSlotsComponentsProps {
|
|
10
10
|
}
|
|
11
|
-
export interface StaticDateTimePickerProps<TInputDate, TDate> extends StaticPickerProps<BaseDateTimePickerProps<TInputDate, TDate>> {
|
|
11
|
+
export interface StaticDateTimePickerProps<TInputDate, TDate> extends StaticPickerProps<TDate, BaseDateTimePickerProps<TInputDate, TDate>> {
|
|
12
12
|
/**
|
|
13
13
|
* Overrideable components.
|
|
14
14
|
* @default {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["displayStaticWrapperAs", "onChange", "ToolbarComponent", "value", "components", "componentsProps", "hideTabs", "className"];
|
|
3
|
+
const _excluded = ["displayStaticWrapperAs", "onChange", "ToolbarComponent", "value", "components", "componentsProps", "localeText", "sx", "hideTabs", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useDateTimePickerDefaultizedProps, dateTimePickerValueManager } from '../DateTimePicker/shared';
|
|
@@ -27,10 +27,12 @@ export const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function Stati
|
|
|
27
27
|
// It saves us >1kb gzip and make any prop available automatically on any level down.
|
|
28
28
|
|
|
29
29
|
const {
|
|
30
|
-
displayStaticWrapperAs
|
|
30
|
+
displayStaticWrapperAs,
|
|
31
31
|
ToolbarComponent = DateTimePickerToolbar,
|
|
32
32
|
components: providedComponents,
|
|
33
33
|
componentsProps,
|
|
34
|
+
localeText,
|
|
35
|
+
sx,
|
|
34
36
|
hideTabs = displayStaticWrapperAs === 'desktop',
|
|
35
37
|
className
|
|
36
38
|
} = props,
|
|
@@ -57,6 +59,8 @@ export const StaticDateTimePicker = /*#__PURE__*/React.forwardRef(function Stati
|
|
|
57
59
|
displayStaticWrapperAs: displayStaticWrapperAs,
|
|
58
60
|
components: components,
|
|
59
61
|
componentsProps: componentsProps,
|
|
62
|
+
localeText: localeText,
|
|
63
|
+
sx: sx,
|
|
60
64
|
className: className
|
|
61
65
|
}, wrapperProps, {
|
|
62
66
|
children: /*#__PURE__*/_jsx(CalendarOrClockPicker, _extends({}, pickerProps, {
|
|
@@ -179,29 +183,10 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
|
|
|
179
183
|
|
|
180
184
|
/**
|
|
181
185
|
* Force static wrapper inner components to be rendered in mobile or desktop mode.
|
|
182
|
-
* @default
|
|
186
|
+
* @default "mobile"
|
|
183
187
|
*/
|
|
184
188
|
displayStaticWrapperAs: PropTypes.oneOf(['desktop', 'mobile']),
|
|
185
189
|
|
|
186
|
-
/**
|
|
187
|
-
* Accessible text that helps user to understand which time and view is selected.
|
|
188
|
-
* @template TDate
|
|
189
|
-
* @param {ClockPickerView} view The current view rendered.
|
|
190
|
-
* @param {TDate | null} time The current time.
|
|
191
|
-
* @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
|
|
192
|
-
* @returns {string} The clock label.
|
|
193
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
194
|
-
* @default <TDate extends any>(
|
|
195
|
-
* view: ClockView,
|
|
196
|
-
* time: TDate | null,
|
|
197
|
-
* adapter: MuiPickersAdapter<TDate>,
|
|
198
|
-
* ) =>
|
|
199
|
-
* `Select ${view}. ${
|
|
200
|
-
* time === null ? 'No time selected' : `Selected time is ${adapter.format(time, 'fullTime')}`
|
|
201
|
-
* }`
|
|
202
|
-
*/
|
|
203
|
-
getClockLabelText: PropTypes.func,
|
|
204
|
-
|
|
205
190
|
/**
|
|
206
191
|
* Get aria-label text for control that opens picker dialog. Aria-label text must include selected date. @DateIOType
|
|
207
192
|
* @template TInputDate, TDate
|
|
@@ -212,14 +197,6 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
|
|
|
212
197
|
*/
|
|
213
198
|
getOpenDialogAriaText: PropTypes.func,
|
|
214
199
|
|
|
215
|
-
/**
|
|
216
|
-
* Get aria-label text for switching between views button.
|
|
217
|
-
* @param {CalendarPickerView} currentView The view from which we want to get the button text.
|
|
218
|
-
* @returns {string} The label of the view.
|
|
219
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
220
|
-
*/
|
|
221
|
-
getViewSwitchingButtonText: PropTypes.func,
|
|
222
|
-
|
|
223
200
|
/**
|
|
224
201
|
* Toggles visibility of date time switching tabs
|
|
225
202
|
* @default false for mobile, true for desktop
|
|
@@ -246,12 +223,6 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
|
|
|
246
223
|
})]),
|
|
247
224
|
label: PropTypes.node,
|
|
248
225
|
|
|
249
|
-
/**
|
|
250
|
-
* Left arrow icon aria-label text.
|
|
251
|
-
* @deprecated
|
|
252
|
-
*/
|
|
253
|
-
leftArrowButtonText: PropTypes.string,
|
|
254
|
-
|
|
255
226
|
/**
|
|
256
227
|
* If `true` renders `LoadingComponent` in calendar instead of calendar view.
|
|
257
228
|
* Can be used to preload information and show it in calendar.
|
|
@@ -259,6 +230,11 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
|
|
|
259
230
|
*/
|
|
260
231
|
loading: PropTypes.bool,
|
|
261
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Locale for components texts
|
|
235
|
+
*/
|
|
236
|
+
localeText: PropTypes.object,
|
|
237
|
+
|
|
262
238
|
/**
|
|
263
239
|
* Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
|
|
264
240
|
*/
|
|
@@ -417,12 +393,6 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
|
|
|
417
393
|
*/
|
|
418
394
|
rifmFormatter: PropTypes.func,
|
|
419
395
|
|
|
420
|
-
/**
|
|
421
|
-
* Right arrow icon aria-label text.
|
|
422
|
-
* @deprecated
|
|
423
|
-
*/
|
|
424
|
-
rightArrowButtonText: PropTypes.string,
|
|
425
|
-
|
|
426
396
|
/**
|
|
427
397
|
* Disable specific date. @DateIOType
|
|
428
398
|
* @template TDate
|
|
@@ -469,6 +439,11 @@ process.env.NODE_ENV !== "production" ? StaticDateTimePicker.propTypes = {
|
|
|
469
439
|
*/
|
|
470
440
|
showToolbar: PropTypes.bool,
|
|
471
441
|
|
|
442
|
+
/**
|
|
443
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
444
|
+
*/
|
|
445
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
446
|
+
|
|
472
447
|
/**
|
|
473
448
|
* Time tab icon.
|
|
474
449
|
*/
|
|
@@ -8,7 +8,7 @@ export interface StaticTimePickerSlotsComponents extends PickersStaticWrapperSlo
|
|
|
8
8
|
}
|
|
9
9
|
export interface StaticTimePickerSlotsComponentsProps extends PickersStaticWrapperSlotsComponentsProps, ClockPickerSlotsComponentsProps {
|
|
10
10
|
}
|
|
11
|
-
export interface StaticTimePickerProps<TInputDate, TDate> extends StaticPickerProps<BaseTimePickerProps<TInputDate, TDate>> {
|
|
11
|
+
export interface StaticTimePickerProps<TInputDate, TDate> extends StaticPickerProps<TDate, BaseTimePickerProps<TInputDate, TDate>> {
|
|
12
12
|
/**
|
|
13
13
|
* Overrideable components.
|
|
14
14
|
* @default {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["displayStaticWrapperAs", "onChange", "ToolbarComponent", "value", "components", "componentsProps", "className"];
|
|
3
|
+
const _excluded = ["displayStaticWrapperAs", "onChange", "ToolbarComponent", "value", "components", "componentsProps", "localeText", "sx", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useTimePickerDefaultizedProps, timePickerValueManager } from '../TimePicker/shared';
|
|
@@ -25,10 +25,12 @@ export const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTim
|
|
|
25
25
|
const props = useTimePickerDefaultizedProps(inProps, 'MuiStaticTimePicker');
|
|
26
26
|
|
|
27
27
|
const {
|
|
28
|
-
displayStaticWrapperAs
|
|
28
|
+
displayStaticWrapperAs,
|
|
29
29
|
ToolbarComponent = TimePickerToolbar,
|
|
30
30
|
components,
|
|
31
31
|
componentsProps,
|
|
32
|
+
localeText,
|
|
33
|
+
sx,
|
|
32
34
|
className
|
|
33
35
|
} = props,
|
|
34
36
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -51,6 +53,8 @@ export const StaticTimePicker = /*#__PURE__*/React.forwardRef(function StaticTim
|
|
|
51
53
|
displayStaticWrapperAs: displayStaticWrapperAs,
|
|
52
54
|
components: components,
|
|
53
55
|
componentsProps: componentsProps,
|
|
56
|
+
localeText: localeText,
|
|
57
|
+
sx: sx,
|
|
54
58
|
className: className
|
|
55
59
|
}, wrapperProps, {
|
|
56
60
|
children: /*#__PURE__*/_jsx(CalendarOrClockPicker, _extends({}, pickerProps, {
|
|
@@ -135,29 +139,10 @@ process.env.NODE_ENV !== "production" ? StaticTimePicker.propTypes = {
|
|
|
135
139
|
|
|
136
140
|
/**
|
|
137
141
|
* Force static wrapper inner components to be rendered in mobile or desktop mode.
|
|
138
|
-
* @default
|
|
142
|
+
* @default "mobile"
|
|
139
143
|
*/
|
|
140
144
|
displayStaticWrapperAs: PropTypes.oneOf(['desktop', 'mobile']),
|
|
141
145
|
|
|
142
|
-
/**
|
|
143
|
-
* Accessible text that helps user to understand which time and view is selected.
|
|
144
|
-
* @template TDate
|
|
145
|
-
* @param {ClockPickerView} view The current view rendered.
|
|
146
|
-
* @param {TDate | null} time The current time.
|
|
147
|
-
* @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
|
|
148
|
-
* @returns {string} The clock label.
|
|
149
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
150
|
-
* @default <TDate extends any>(
|
|
151
|
-
* view: ClockView,
|
|
152
|
-
* time: TDate | null,
|
|
153
|
-
* adapter: MuiPickersAdapter<TDate>,
|
|
154
|
-
* ) =>
|
|
155
|
-
* `Select ${view}. ${
|
|
156
|
-
* time === null ? 'No time selected' : `Selected time is ${adapter.format(time, 'fullTime')}`
|
|
157
|
-
* }`
|
|
158
|
-
*/
|
|
159
|
-
getClockLabelText: PropTypes.func,
|
|
160
|
-
|
|
161
146
|
/**
|
|
162
147
|
* Get aria-label text for control that opens picker dialog. Aria-label text must include selected date. @DateIOType
|
|
163
148
|
* @template TInputDate, TDate
|
|
@@ -188,6 +173,11 @@ process.env.NODE_ENV !== "production" ? StaticTimePicker.propTypes = {
|
|
|
188
173
|
})]),
|
|
189
174
|
label: PropTypes.node,
|
|
190
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Locale for components texts
|
|
178
|
+
*/
|
|
179
|
+
localeText: PropTypes.object,
|
|
180
|
+
|
|
191
181
|
/**
|
|
192
182
|
* Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
|
|
193
183
|
*/
|
|
@@ -302,6 +292,11 @@ process.env.NODE_ENV !== "production" ? StaticTimePicker.propTypes = {
|
|
|
302
292
|
*/
|
|
303
293
|
showToolbar: PropTypes.bool,
|
|
304
294
|
|
|
295
|
+
/**
|
|
296
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
297
|
+
*/
|
|
298
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
299
|
+
|
|
305
300
|
/**
|
|
306
301
|
* Component that will replace default toolbar renderer.
|
|
307
302
|
* @default TimePickerToolbar
|
package/TimePicker/TimePicker.js
CHANGED
|
@@ -136,25 +136,6 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
136
136
|
*/
|
|
137
137
|
disableOpenPicker: PropTypes.bool,
|
|
138
138
|
|
|
139
|
-
/**
|
|
140
|
-
* Accessible text that helps user to understand which time and view is selected.
|
|
141
|
-
* @template TDate
|
|
142
|
-
* @param {ClockPickerView} view The current view rendered.
|
|
143
|
-
* @param {TDate | null} time The current time.
|
|
144
|
-
* @param {MuiPickersAdapter<TDate>} adapter The current date adapter.
|
|
145
|
-
* @returns {string} The clock label.
|
|
146
|
-
* @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization
|
|
147
|
-
* @default <TDate extends any>(
|
|
148
|
-
* view: ClockView,
|
|
149
|
-
* time: TDate | null,
|
|
150
|
-
* adapter: MuiPickersAdapter<TDate>,
|
|
151
|
-
* ) =>
|
|
152
|
-
* `Select ${view}. ${
|
|
153
|
-
* time === null ? 'No time selected' : `Selected time is ${adapter.format(time, 'fullTime')}`
|
|
154
|
-
* }`
|
|
155
|
-
*/
|
|
156
|
-
getClockLabelText: PropTypes.func,
|
|
157
|
-
|
|
158
139
|
/**
|
|
159
140
|
* Get aria-label text for control that opens picker dialog. Aria-label text must include selected date. @DateIOType
|
|
160
141
|
* @template TInputDate, TDate
|
|
@@ -185,6 +166,11 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
185
166
|
})]),
|
|
186
167
|
label: PropTypes.node,
|
|
187
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Locale for components texts
|
|
171
|
+
*/
|
|
172
|
+
localeText: PropTypes.object,
|
|
173
|
+
|
|
188
174
|
/**
|
|
189
175
|
* Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
|
|
190
176
|
*/
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PickersYearClasses } from './pickersYearClasses';
|
|
3
3
|
export interface PickersYearProps {
|
|
4
|
+
'aria-current'?: React.AriaAttributes['aria-current'];
|
|
4
5
|
autoFocus?: boolean;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
classes?: Partial<PickersYearClasses>;
|
|
7
8
|
className?: string;
|
|
8
9
|
disabled?: boolean;
|
|
9
|
-
onClick: (event: React.MouseEvent,
|
|
10
|
-
onKeyDown: (event: React.KeyboardEvent,
|
|
10
|
+
onClick: (event: React.MouseEvent, year: number) => void;
|
|
11
|
+
onKeyDown: (event: React.KeyboardEvent, year: number) => void;
|
|
12
|
+
onFocus: (event: React.FocusEvent, year: number) => void;
|
|
13
|
+
onBlur: (event: React.FocusEvent, year: number) => void;
|
|
11
14
|
selected: boolean;
|
|
12
15
|
value: number;
|
|
13
16
|
tabIndex: number;
|
|
14
|
-
onFocus: (event: React.FocusEvent, year: number) => void;
|
|
15
|
-
onBlur: (event: React.FocusEvent, year: number) => void;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
* @ignore -
|
|
19
|
+
* @ignore - do not document.
|
|
19
20
|
*/
|
|
20
|
-
export declare const PickersYear: React.
|
|
21
|
+
export declare const PickersYear: React.MemoExoticComponent<(props: PickersYearProps) => JSX.Element>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["autoFocus", "className", "children", "disabled", "
|
|
3
|
+
const _excluded = ["autoFocus", "className", "children", "disabled", "selected", "value", "tabIndex", "onClick", "onKeyDown", "onFocus", "onBlur", "aria-current"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import {
|
|
6
|
+
import { capitalize } from '@mui/material/utils';
|
|
7
7
|
import { alpha, styled } from '@mui/material/styles';
|
|
8
8
|
import { unstable_composeClasses as composeClasses } from '@mui/material';
|
|
9
9
|
import { WrapperVariantContext } from '../internals/components/wrappers/WrapperVariantContext';
|
|
@@ -63,9 +63,16 @@ const PickersYearButton = styled('button', {
|
|
|
63
63
|
width: 72,
|
|
64
64
|
borderRadius: 18,
|
|
65
65
|
cursor: 'pointer',
|
|
66
|
-
'&:focus
|
|
66
|
+
'&:focus': {
|
|
67
|
+
backgroundColor: alpha(theme.palette.action.active, theme.palette.action.focusOpacity)
|
|
68
|
+
},
|
|
69
|
+
'&:hover': {
|
|
67
70
|
backgroundColor: alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)
|
|
68
71
|
},
|
|
72
|
+
'&:disabled': {
|
|
73
|
+
cursor: 'auto',
|
|
74
|
+
pointerEvents: 'none'
|
|
75
|
+
},
|
|
69
76
|
[`&.${pickersYearClasses.disabled}`]: {
|
|
70
77
|
color: theme.palette.text.secondary
|
|
71
78
|
},
|
|
@@ -77,61 +84,65 @@ const PickersYearButton = styled('button', {
|
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
}));
|
|
80
|
-
|
|
81
|
-
const noop = () => {};
|
|
82
87
|
/**
|
|
83
88
|
* @ignore - internal component.
|
|
84
89
|
*/
|
|
85
90
|
|
|
86
|
-
|
|
87
|
-
export const PickersYear = /*#__PURE__*/React.forwardRef(function PickersYear(props, forwardedRef) {
|
|
91
|
+
const PickersYearRaw = props => {
|
|
88
92
|
// TODO v6: add 'useThemeProps' once the component class names are aligned
|
|
89
93
|
const {
|
|
90
94
|
autoFocus,
|
|
91
95
|
className,
|
|
92
96
|
children,
|
|
93
97
|
disabled,
|
|
94
|
-
onClick,
|
|
95
|
-
onKeyDown,
|
|
96
98
|
value,
|
|
97
99
|
tabIndex,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
onClick,
|
|
101
|
+
onKeyDown,
|
|
102
|
+
onFocus,
|
|
103
|
+
onBlur,
|
|
104
|
+
'aria-current': ariaCurrent
|
|
100
105
|
} = props,
|
|
101
106
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
102
107
|
|
|
103
108
|
const ref = React.useRef(null);
|
|
104
|
-
const refHandle = useForkRef(ref, forwardedRef);
|
|
105
109
|
const wrapperVariant = React.useContext(WrapperVariantContext);
|
|
106
110
|
|
|
107
111
|
const ownerState = _extends({}, props, {
|
|
108
112
|
wrapperVariant
|
|
109
113
|
});
|
|
110
114
|
|
|
111
|
-
const classes = useUtilityClasses(ownerState); //
|
|
115
|
+
const classes = useUtilityClasses(ownerState); // We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button
|
|
112
116
|
|
|
113
117
|
React.useEffect(() => {
|
|
114
118
|
if (autoFocus) {
|
|
115
|
-
// `ref.current` being `null` would be a bug in
|
|
119
|
+
// `ref.current` being `null` would be a bug in MUI.
|
|
116
120
|
ref.current.focus();
|
|
117
121
|
}
|
|
118
122
|
}, [autoFocus]);
|
|
119
|
-
return /*#__PURE__*/_jsx(PickersYearRoot, {
|
|
123
|
+
return /*#__PURE__*/_jsx(PickersYearRoot, _extends({
|
|
120
124
|
className: clsx(classes.root, className),
|
|
121
|
-
ownerState: ownerState
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
ownerState: ownerState
|
|
126
|
+
}, other, {
|
|
127
|
+
children: /*#__PURE__*/_jsx(PickersYearButton, {
|
|
128
|
+
ref: ref,
|
|
124
129
|
disabled: disabled,
|
|
125
130
|
type: "button",
|
|
126
131
|
tabIndex: disabled ? -1 : tabIndex,
|
|
132
|
+
"aria-current": ariaCurrent,
|
|
127
133
|
onClick: event => onClick(event, value),
|
|
128
134
|
onKeyDown: event => onKeyDown(event, value),
|
|
129
135
|
onFocus: event => onFocus(event, value),
|
|
130
136
|
onBlur: event => onBlur(event, value),
|
|
131
137
|
className: classes.yearButton,
|
|
132
|
-
ownerState: ownerState
|
|
133
|
-
}, other, {
|
|
138
|
+
ownerState: ownerState,
|
|
134
139
|
children: children
|
|
135
|
-
})
|
|
136
|
-
});
|
|
137
|
-
}
|
|
140
|
+
})
|
|
141
|
+
}));
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* @ignore - do not document.
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
export const PickersYear = /*#__PURE__*/React.memo(PickersYearRaw);
|
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { SxProps } from '@mui/system';
|
|
3
|
+
import { Theme } from '@mui/material/styles';
|
|
3
4
|
import { YearPickerClasses } from './yearPickerClasses';
|
|
4
5
|
import { BaseDateValidationProps, YearValidationProps } from '../internals/hooks/validation/models';
|
|
5
6
|
export interface YearPickerProps<TDate> extends YearValidationProps<TDate>, BaseDateValidationProps<TDate> {
|
|
6
7
|
autoFocus?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* className applied to the root element.
|
|
10
|
+
*/
|
|
7
11
|
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Override or extend the styles applied to the component.
|
|
14
|
+
*/
|
|
8
15
|
classes?: Partial<YearPickerClasses>;
|
|
9
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
18
|
+
*/
|
|
19
|
+
sx?: SxProps<Theme>;
|
|
20
|
+
value: TDate | null;
|
|
21
|
+
/** If `true` picker is disabled */
|
|
10
22
|
disabled?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Callback fired when the value (the selected year) changes.
|
|
25
|
+
* @template TValue
|
|
26
|
+
* @param {TValue} value The new parsed value.
|
|
27
|
+
*/
|
|
28
|
+
onChange: (value: TDate) => void;
|
|
29
|
+
/** If `true` picker is readonly */
|
|
13
30
|
readOnly?: boolean;
|
|
14
31
|
/**
|
|
15
32
|
* If `true`, today's date is rendering without highlighting with circle.
|