@mui/x-date-pickers 7.0.0-alpha.0 → 7.0.0-alpha.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/AdapterDateFns/AdapterDateFns.d.ts +6 -17
- package/AdapterDateFns/AdapterDateFns.js +9 -93
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +6 -17
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +9 -93
- package/AdapterDayjs/AdapterDayjs.d.ts +7 -19
- package/AdapterDayjs/AdapterDayjs.js +13 -67
- package/AdapterLuxon/AdapterLuxon.d.ts +6 -17
- package/AdapterLuxon/AdapterLuxon.js +5 -96
- package/AdapterMoment/AdapterMoment.d.ts +6 -22
- package/AdapterMoment/AdapterMoment.js +11 -75
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +2 -9
- package/AdapterMomentHijri/AdapterMomentHijri.js +1 -33
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +2 -11
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -43
- package/CHANGELOG.md +591 -5
- package/DateCalendar/DateCalendar.js +2 -9
- package/DateCalendar/DateCalendar.types.d.ts +0 -4
- package/DateCalendar/DayCalendar.d.ts +1 -2
- package/DateCalendar/DayCalendar.js +9 -16
- package/DateCalendar/dayCalendarClasses.d.ts +1 -1
- package/DateCalendar/dayCalendarClasses.js +1 -1
- package/DateCalendar/index.d.ts +1 -2
- package/DateCalendar/index.js +2 -4
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateCalendar/useCalendarState.js +1 -9
- package/DateField/DateField.js +1 -1
- package/DatePicker/DatePicker.js +1 -6
- package/DatePicker/shared.d.ts +1 -1
- package/DateTimeField/DateTimeField.js +1 -9
- package/DateTimePicker/DateTimePicker.js +1 -14
- package/DateTimePicker/shared.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +1 -6
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
- package/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/DigitalClock/DigitalClock.js +6 -17
- package/LocalizationProvider/LocalizationProvider.js +0 -6
- package/MobileDatePicker/MobileDatePicker.js +1 -6
- package/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
- package/MobileTimePicker/MobileTimePicker.js +1 -9
- package/MonthCalendar/MonthCalendar.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/PickersCalendarHeader/PickersCalendarHeader.js +11 -4
- package/PickersDay/PickersDay.js +1 -1
- package/StaticDatePicker/StaticDatePicker.js +1 -6
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
- package/StaticTimePicker/StaticTimePicker.js +1 -9
- package/TimeClock/Clock.js +1 -1
- package/TimeClock/TimeClock.js +3 -15
- package/TimeField/TimeField.js +1 -9
- package/TimePicker/TimePicker.js +1 -9
- package/TimePicker/shared.d.ts +1 -1
- package/YearCalendar/YearCalendar.js +2 -2
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -2
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +0 -2
- package/index.d.ts +1 -0
- package/index.js +4 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +5 -0
- package/internals/hooks/date-helpers-hooks.js +2 -2
- package/internals/hooks/useField/useField.utils.js +8 -9
- package/internals/hooks/useField/useFieldState.js +2 -2
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +1 -1
- package/internals/hooks/useUtils.js +1 -1
- package/internals/hooks/useViews.js +2 -2
- package/internals/models/validation.d.ts +0 -8
- package/internals/utils/date-utils.js +2 -2
- package/internals/utils/getDefaultReferenceDate.d.ts +1 -2
- package/internals/utils/getDefaultReferenceDate.js +0 -4
- package/internals/utils/validation/extractValidationProps.d.ts +1 -1
- package/internals/utils/validation/extractValidationProps.js +1 -1
- package/internals/utils/validation/validateDate.js +1 -1
- package/internals/utils/validation/validateTime.js +1 -8
- package/legacy/AdapterDateFns/AdapterDateFns.js +13 -94
- package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -94
- package/legacy/AdapterDayjs/AdapterDayjs.js +19 -69
- package/legacy/AdapterLuxon/AdapterLuxon.js +10 -97
- package/legacy/AdapterMoment/AdapterMoment.js +16 -78
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -33
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -43
- package/legacy/DateCalendar/DateCalendar.js +2 -9
- package/legacy/DateCalendar/DayCalendar.js +7 -11
- package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
- package/legacy/DateCalendar/dayCalendarClasses.js +1 -1
- package/legacy/DateCalendar/index.js +2 -4
- package/legacy/DateCalendar/useCalendarState.js +1 -9
- package/legacy/DateField/DateField.js +1 -1
- package/legacy/DatePicker/DatePicker.js +1 -6
- package/legacy/DateTimeField/DateTimeField.js +1 -9
- package/legacy/DateTimePicker/DateTimePicker.js +1 -14
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +1 -6
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/legacy/DigitalClock/DigitalClock.js +6 -17
- package/legacy/LocalizationProvider/LocalizationProvider.js +0 -6
- package/legacy/MobileDatePicker/MobileDatePicker.js +1 -6
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
- package/legacy/MobileTimePicker/MobileTimePicker.js +1 -9
- package/legacy/MonthCalendar/MonthCalendar.js +1 -1
- package/legacy/MonthCalendar/PickersMonth.js +4 -5
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +11 -3
- package/legacy/PickersDay/PickersDay.js +6 -7
- package/legacy/PickersLayout/PickersLayout.js +5 -6
- package/legacy/StaticDatePicker/StaticDatePicker.js +1 -6
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
- package/legacy/StaticTimePicker/StaticTimePicker.js +1 -9
- package/legacy/TimeClock/Clock.js +1 -1
- package/legacy/TimeClock/ClockNumber.js +4 -5
- package/legacy/TimeClock/TimeClock.js +3 -15
- package/legacy/TimeField/TimeField.js +1 -9
- package/legacy/TimePicker/TimePicker.js +1 -9
- package/legacy/TimePicker/TimePickerToolbar.js +1 -2
- package/legacy/YearCalendar/PickersYear.js +4 -5
- package/legacy/YearCalendar/YearCalendar.js +2 -2
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/legacy/dateViewRenderers/dateViewRenderers.js +0 -2
- package/legacy/index.js +4 -1
- package/legacy/internals/components/PickersModalDialog.js +3 -4
- package/legacy/internals/hooks/date-helpers-hooks.js +2 -2
- package/legacy/internals/hooks/useField/useField.utils.js +8 -9
- package/legacy/internals/hooks/useField/useFieldState.js +2 -2
- package/legacy/internals/hooks/useUtils.js +1 -1
- package/legacy/internals/hooks/useViews.js +2 -2
- package/legacy/internals/utils/date-utils.js +2 -2
- package/legacy/internals/utils/getDefaultReferenceDate.js +0 -6
- package/legacy/internals/utils/validation/extractValidationProps.js +1 -1
- package/legacy/internals/utils/validation/validateDate.js +1 -1
- package/legacy/internals/utils/validation/validateTime.js +1 -8
- package/legacy/locales/deDE.js +4 -3
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/mk.js +91 -0
- package/legacy/timeViewRenderers/timeViewRenderers.js +0 -6
- package/locales/deDE.js +2 -3
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/mk.d.ts +53 -0
- package/locales/mk.js +55 -0
- package/models/adapters.d.ts +16 -145
- package/models/fields.d.ts +0 -6
- package/models/timezone.d.ts +1 -1
- package/models/validation.d.ts +1 -1
- package/modern/AdapterDateFns/AdapterDateFns.js +9 -93
- package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +9 -93
- package/modern/AdapterDayjs/AdapterDayjs.js +13 -66
- package/modern/AdapterLuxon/AdapterLuxon.js +5 -96
- package/modern/AdapterMoment/AdapterMoment.js +11 -74
- package/modern/AdapterMomentHijri/AdapterMomentHijri.js +1 -33
- package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -43
- package/modern/DateCalendar/DateCalendar.js +2 -9
- package/modern/DateCalendar/DayCalendar.js +9 -15
- package/modern/DateCalendar/dayCalendarClasses.js +1 -1
- package/modern/DateCalendar/index.js +2 -4
- package/modern/DateCalendar/useCalendarState.js +1 -9
- package/modern/DateField/DateField.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -6
- package/modern/DateTimeField/DateTimeField.js +1 -9
- package/modern/DateTimePicker/DateTimePicker.js +1 -14
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -6
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
- package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/modern/DigitalClock/DigitalClock.js +6 -17
- package/modern/LocalizationProvider/LocalizationProvider.js +0 -6
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -6
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
- package/modern/MobileTimePicker/MobileTimePicker.js +1 -9
- package/modern/MonthCalendar/MonthCalendar.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +11 -4
- package/modern/PickersDay/PickersDay.js +1 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -6
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
- package/modern/StaticTimePicker/StaticTimePicker.js +1 -9
- package/modern/TimeClock/Clock.js +1 -1
- package/modern/TimeClock/TimeClock.js +3 -15
- package/modern/TimeField/TimeField.js +1 -9
- package/modern/TimePicker/TimePicker.js +1 -9
- package/modern/YearCalendar/YearCalendar.js +2 -2
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/modern/dateViewRenderers/dateViewRenderers.js +0 -2
- package/modern/index.js +4 -1
- package/modern/internals/hooks/date-helpers-hooks.js +2 -2
- package/modern/internals/hooks/useField/useField.utils.js +8 -9
- package/modern/internals/hooks/useField/useFieldState.js +2 -2
- package/modern/internals/hooks/useUtils.js +1 -1
- package/modern/internals/hooks/useViews.js +2 -2
- package/modern/internals/utils/date-utils.js +2 -2
- package/modern/internals/utils/getDefaultReferenceDate.js +0 -1
- package/modern/internals/utils/validation/extractValidationProps.js +1 -1
- package/modern/internals/utils/validation/validateDate.js +1 -1
- package/modern/internals/utils/validation/validateTime.js +1 -8
- package/modern/locales/deDE.js +2 -3
- package/modern/locales/index.js +1 -0
- package/modern/locales/mk.js +55 -0
- package/modern/timeViewRenderers/timeViewRenderers.js +0 -6
- package/node/AdapterDateFns/AdapterDateFns.js +9 -93
- package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +9 -93
- package/node/AdapterDayjs/AdapterDayjs.js +13 -66
- package/node/AdapterLuxon/AdapterLuxon.js +5 -96
- package/node/AdapterMoment/AdapterMoment.js +11 -74
- package/node/AdapterMomentHijri/AdapterMomentHijri.js +1 -33
- package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -43
- package/node/DateCalendar/DateCalendar.js +2 -9
- package/node/DateCalendar/DayCalendar.js +9 -15
- package/node/DateCalendar/dayCalendarClasses.js +2 -2
- package/node/DateCalendar/index.js +3 -23
- package/node/DateCalendar/useCalendarState.js +1 -9
- package/node/DateField/DateField.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -6
- package/node/DateTimeField/DateTimeField.js +1 -9
- package/node/DateTimePicker/DateTimePicker.js +1 -14
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -6
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -14
- package/node/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/node/DigitalClock/DigitalClock.js +6 -17
- package/node/LocalizationProvider/LocalizationProvider.js +0 -6
- package/node/MobileDatePicker/MobileDatePicker.js +1 -6
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -14
- package/node/MobileTimePicker/MobileTimePicker.js +1 -9
- package/node/MonthCalendar/MonthCalendar.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +11 -4
- package/node/PickersDay/PickersDay.js +1 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -6
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -14
- package/node/StaticTimePicker/StaticTimePicker.js +1 -9
- package/node/TimeClock/Clock.js +1 -1
- package/node/TimeClock/TimeClock.js +3 -15
- package/node/TimeField/TimeField.js +1 -9
- package/node/TimePicker/TimePicker.js +1 -9
- package/node/YearCalendar/YearCalendar.js +2 -2
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/node/dateViewRenderers/dateViewRenderers.js +0 -2
- package/node/index.js +13 -1
- package/node/internals/hooks/date-helpers-hooks.js +2 -2
- package/node/internals/hooks/useField/useField.utils.js +8 -9
- package/node/internals/hooks/useField/useFieldState.js +2 -2
- package/node/internals/hooks/useUtils.js +1 -1
- package/node/internals/hooks/useViews.js +2 -2
- package/node/internals/utils/date-utils.js +2 -2
- package/node/internals/utils/getDefaultReferenceDate.js +1 -3
- package/node/internals/utils/validation/extractValidationProps.js +1 -1
- package/node/internals/utils/validation/validateDate.js +1 -1
- package/node/internals/utils/validation/validateTime.js +1 -8
- package/node/locales/deDE.js +2 -3
- package/node/locales/index.js +11 -0
- package/node/locales/mk.js +60 -0
- package/node/timeViewRenderers/timeViewRenderers.js +0 -6
- package/package.json +7 -6
- package/themeAugmentation/overrides.d.ts +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
- package/timeViewRenderers/timeViewRenderers.js +0 -6
|
@@ -94,16 +94,11 @@ StaticDateTimePicker.propTypes = {
|
|
|
94
94
|
className: _propTypes.default.string,
|
|
95
95
|
/**
|
|
96
96
|
* Formats the day of week displayed in the calendar header.
|
|
97
|
-
* @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
|
|
98
97
|
* @param {TDate} date The date of the day of week provided by the adapter.
|
|
99
98
|
* @returns {string} The name to display.
|
|
100
99
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
101
100
|
*/
|
|
102
101
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
103
|
-
/**
|
|
104
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
105
|
-
*/
|
|
106
|
-
defaultCalendarMonth: _propTypes.default.any,
|
|
107
102
|
/**
|
|
108
103
|
* The default value.
|
|
109
104
|
* Used when the component is not controlled.
|
|
@@ -271,14 +266,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
271
266
|
* @default () => <span data-mui-test="loading-progress">...</span>
|
|
272
267
|
*/
|
|
273
268
|
renderLoading: _propTypes.default.func,
|
|
274
|
-
/**
|
|
275
|
-
* Disable specific clock time.
|
|
276
|
-
* @param {number} clockValue The value to check.
|
|
277
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
278
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
279
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
280
|
-
*/
|
|
281
|
-
shouldDisableClock: _propTypes.default.func,
|
|
282
269
|
/**
|
|
283
270
|
* Disable specific date.
|
|
284
271
|
*
|
|
@@ -340,7 +327,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
340
327
|
* Choose which timezone to use for the value.
|
|
341
328
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
342
329
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
343
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
330
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
344
331
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
345
332
|
*/
|
|
346
333
|
timezone: _propTypes.default.string,
|
|
@@ -191,14 +191,6 @@ StaticTimePicker.propTypes = {
|
|
|
191
191
|
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
192
192
|
*/
|
|
193
193
|
referenceDate: _propTypes.default.any,
|
|
194
|
-
/**
|
|
195
|
-
* Disable specific clock time.
|
|
196
|
-
* @param {number} clockValue The value to check.
|
|
197
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
198
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
199
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
200
|
-
*/
|
|
201
|
-
shouldDisableClock: _propTypes.default.func,
|
|
202
194
|
/**
|
|
203
195
|
* Disable specific time.
|
|
204
196
|
* @template TDate
|
|
@@ -225,7 +217,7 @@ StaticTimePicker.propTypes = {
|
|
|
225
217
|
* Choose which timezone to use for the value.
|
|
226
218
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
227
219
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
228
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
220
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
229
221
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
230
222
|
*/
|
|
231
223
|
timezone: _propTypes.default.string,
|
package/node/TimeClock/Clock.js
CHANGED
|
@@ -25,7 +25,7 @@ var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
|
25
25
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
26
26
|
var _useClockReferenceDate = require("../internals/hooks/useClockReferenceDate");
|
|
27
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "
|
|
28
|
+
const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "showViewSwitcher", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "timezone"];
|
|
29
29
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
30
30
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
31
31
|
const useUtilityClasses = ownerState => {
|
|
@@ -89,7 +89,6 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
89
89
|
disableFuture,
|
|
90
90
|
disablePast,
|
|
91
91
|
minutesStep = 1,
|
|
92
|
-
shouldDisableClock,
|
|
93
92
|
shouldDisableTime,
|
|
94
93
|
showViewSwitcher,
|
|
95
94
|
onChange,
|
|
@@ -170,9 +169,6 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
170
169
|
if (timeValue % step !== 0) {
|
|
171
170
|
return false;
|
|
172
171
|
}
|
|
173
|
-
if (shouldDisableClock?.(timeValue, viewType)) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
172
|
if (shouldDisableTime) {
|
|
177
173
|
switch (viewType) {
|
|
178
174
|
case 'hours':
|
|
@@ -222,7 +218,7 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
222
218
|
default:
|
|
223
219
|
throw new Error('not supported');
|
|
224
220
|
}
|
|
225
|
-
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep,
|
|
221
|
+
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, utils, disableFuture, disablePast, now, views]);
|
|
226
222
|
const selectedId = (0, _utils.unstable_useId)();
|
|
227
223
|
const viewProps = React.useMemo(() => {
|
|
228
224
|
switch (view) {
|
|
@@ -430,14 +426,6 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
430
426
|
* @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
|
|
431
427
|
*/
|
|
432
428
|
referenceDate: _propTypes.default.any,
|
|
433
|
-
/**
|
|
434
|
-
* Disable specific clock time.
|
|
435
|
-
* @param {number} clockValue The value to check.
|
|
436
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
437
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
438
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
439
|
-
*/
|
|
440
|
-
shouldDisableClock: _propTypes.default.func,
|
|
441
429
|
/**
|
|
442
430
|
* Disable specific time.
|
|
443
431
|
* @template TDate
|
|
@@ -465,7 +453,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
465
453
|
* Choose which timezone to use for the value.
|
|
466
454
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
467
455
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
468
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
456
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
469
457
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
470
458
|
*/
|
|
471
459
|
timezone: _propTypes.default.string,
|
|
@@ -295,14 +295,6 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
295
295
|
endIndex: _propTypes.default.number.isRequired,
|
|
296
296
|
startIndex: _propTypes.default.number.isRequired
|
|
297
297
|
})]),
|
|
298
|
-
/**
|
|
299
|
-
* Disable specific clock time.
|
|
300
|
-
* @param {number} clockValue The value to check.
|
|
301
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
302
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
303
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
304
|
-
*/
|
|
305
|
-
shouldDisableClock: _propTypes.default.func,
|
|
306
298
|
/**
|
|
307
299
|
* Disable specific time.
|
|
308
300
|
* @template TDate
|
|
@@ -349,7 +341,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
349
341
|
* Choose which timezone to use for the value.
|
|
350
342
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
351
343
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
352
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
344
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
353
345
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
354
346
|
*/
|
|
355
347
|
timezone: _propTypes.default.string,
|
|
@@ -242,14 +242,6 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
242
242
|
endIndex: _propTypes.default.number.isRequired,
|
|
243
243
|
startIndex: _propTypes.default.number.isRequired
|
|
244
244
|
})]),
|
|
245
|
-
/**
|
|
246
|
-
* Disable specific clock time.
|
|
247
|
-
* @param {number} clockValue The value to check.
|
|
248
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
249
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
250
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
251
|
-
*/
|
|
252
|
-
shouldDisableClock: _propTypes.default.func,
|
|
253
245
|
/**
|
|
254
246
|
* Disable specific time.
|
|
255
247
|
* @template TDate
|
|
@@ -297,7 +289,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
297
289
|
* Choose which timezone to use for the value.
|
|
298
290
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
299
291
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
300
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
292
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
301
293
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
302
294
|
*/
|
|
303
295
|
timezone: _propTypes.default.string,
|
|
@@ -243,7 +243,7 @@ const YearCalendar = exports.YearCalendar = /*#__PURE__*/React.forwardRef(functi
|
|
|
243
243
|
role: "radiogroup",
|
|
244
244
|
"aria-labelledby": gridLabelId
|
|
245
245
|
}, other, {
|
|
246
|
-
children: utils.getYearRange(minDate, maxDate).map(year => {
|
|
246
|
+
children: utils.getYearRange([minDate, maxDate]).map(year => {
|
|
247
247
|
const yearNumber = utils.getYear(year);
|
|
248
248
|
const isSelected = yearNumber === selectedYear;
|
|
249
249
|
const isDisabled = disabled || isYearDisabled(year);
|
|
@@ -344,7 +344,7 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
344
344
|
* Choose which timezone to use for the value.
|
|
345
345
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
346
346
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
347
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
347
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
348
348
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
349
349
|
*/
|
|
350
350
|
timezone: _propTypes.default.string,
|
|
@@ -42,7 +42,6 @@ const renderDesktopDateTimeView = ({
|
|
|
42
42
|
shouldDisableMonth,
|
|
43
43
|
shouldDisableYear,
|
|
44
44
|
shouldDisableTime,
|
|
45
|
-
shouldDisableClock,
|
|
46
45
|
reduceAnimations,
|
|
47
46
|
minutesStep,
|
|
48
47
|
ampm,
|
|
@@ -50,7 +49,6 @@ const renderDesktopDateTimeView = ({
|
|
|
50
49
|
monthsPerRow,
|
|
51
50
|
onYearChange,
|
|
52
51
|
yearsPerRow,
|
|
53
|
-
defaultCalendarMonth,
|
|
54
52
|
slots,
|
|
55
53
|
slotProps,
|
|
56
54
|
loading,
|
|
@@ -89,7 +87,6 @@ const renderDesktopDateTimeView = ({
|
|
|
89
87
|
minTime,
|
|
90
88
|
maxTime,
|
|
91
89
|
shouldDisableTime,
|
|
92
|
-
shouldDisableClock,
|
|
93
90
|
minutesStep,
|
|
94
91
|
ampm,
|
|
95
92
|
slots,
|
|
@@ -128,7 +125,6 @@ const renderDesktopDateTimeView = ({
|
|
|
128
125
|
monthsPerRow: monthsPerRow,
|
|
129
126
|
onYearChange: onYearChange,
|
|
130
127
|
yearsPerRow: yearsPerRow,
|
|
131
|
-
defaultCalendarMonth: defaultCalendarMonth,
|
|
132
128
|
slots: slots,
|
|
133
129
|
slotProps: slotProps,
|
|
134
130
|
loading: loading,
|
|
@@ -34,7 +34,6 @@ const renderDateViewCalendar = ({
|
|
|
34
34
|
monthsPerRow,
|
|
35
35
|
onYearChange,
|
|
36
36
|
yearsPerRow,
|
|
37
|
-
defaultCalendarMonth,
|
|
38
37
|
slots,
|
|
39
38
|
slotProps,
|
|
40
39
|
loading,
|
|
@@ -73,7 +72,6 @@ const renderDateViewCalendar = ({
|
|
|
73
72
|
monthsPerRow: monthsPerRow,
|
|
74
73
|
onYearChange: onYearChange,
|
|
75
74
|
yearsPerRow: yearsPerRow,
|
|
76
|
-
defaultCalendarMonth: defaultCalendarMonth,
|
|
77
75
|
slots: slots,
|
|
78
76
|
slotProps: slotProps,
|
|
79
77
|
loading: loading,
|
package/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers v7.0.0-alpha.
|
|
2
|
+
* @mui/x-date-pickers v7.0.0-alpha.2
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -379,6 +379,18 @@ Object.keys(_PickersShortcuts).forEach(function (key) {
|
|
|
379
379
|
}
|
|
380
380
|
});
|
|
381
381
|
});
|
|
382
|
+
var _PickersCalendarHeader = require("./PickersCalendarHeader");
|
|
383
|
+
Object.keys(_PickersCalendarHeader).forEach(function (key) {
|
|
384
|
+
if (key === "default" || key === "__esModule") return;
|
|
385
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
386
|
+
if (key in exports && exports[key] === _PickersCalendarHeader[key]) return;
|
|
387
|
+
Object.defineProperty(exports, key, {
|
|
388
|
+
enumerable: true,
|
|
389
|
+
get: function () {
|
|
390
|
+
return _PickersCalendarHeader[key];
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
});
|
|
382
394
|
var _utils = require("./internals/utils/utils");
|
|
383
395
|
var _models = require("./models");
|
|
384
396
|
Object.keys(_models).forEach(function (key) {
|
|
@@ -18,7 +18,7 @@ function useNextMonthDisabled(month, {
|
|
|
18
18
|
}) {
|
|
19
19
|
const utils = (0, _useUtils.useUtils)();
|
|
20
20
|
return React.useMemo(() => {
|
|
21
|
-
const now = utils.
|
|
21
|
+
const now = utils.date(undefined, timezone);
|
|
22
22
|
const lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);
|
|
23
23
|
return !utils.isAfter(lastEnabledMonth, month);
|
|
24
24
|
}, [disableFuture, maxDate, month, utils, timezone]);
|
|
@@ -30,7 +30,7 @@ function usePreviousMonthDisabled(month, {
|
|
|
30
30
|
}) {
|
|
31
31
|
const utils = (0, _useUtils.useUtils)();
|
|
32
32
|
return React.useMemo(() => {
|
|
33
|
-
const now = utils.
|
|
33
|
+
const now = utils.date(undefined, timezone);
|
|
34
34
|
const firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);
|
|
35
35
|
return !utils.isBefore(firstEnabledMonth, month);
|
|
36
36
|
}, [disablePast, minDate, month, utils, timezone]);
|
|
@@ -42,7 +42,7 @@ const getDeltaFromKeyCode = keyCode => {
|
|
|
42
42
|
};
|
|
43
43
|
const getDaysInWeekStr = (utils, timezone, format) => {
|
|
44
44
|
const elements = [];
|
|
45
|
-
const now = utils.
|
|
45
|
+
const now = utils.date(undefined, timezone);
|
|
46
46
|
const startDate = utils.startOfWeek(now);
|
|
47
47
|
const endDate = utils.endOfWeek(now);
|
|
48
48
|
let current = startDate;
|
|
@@ -57,7 +57,7 @@ const getLetterEditingOptions = (utils, timezone, sectionType, format) => {
|
|
|
57
57
|
switch (sectionType) {
|
|
58
58
|
case 'month':
|
|
59
59
|
{
|
|
60
|
-
return (0, _dateUtils.getMonthsInYear)(utils, utils.
|
|
60
|
+
return (0, _dateUtils.getMonthsInYear)(utils, utils.date(undefined, timezone)).map(month => utils.formatByString(month, format));
|
|
61
61
|
}
|
|
62
62
|
case 'weekDay':
|
|
63
63
|
{
|
|
@@ -65,7 +65,7 @@ const getLetterEditingOptions = (utils, timezone, sectionType, format) => {
|
|
|
65
65
|
}
|
|
66
66
|
case 'meridiem':
|
|
67
67
|
{
|
|
68
|
-
const now = utils.
|
|
68
|
+
const now = utils.date(undefined, timezone);
|
|
69
69
|
return [utils.startOfDay(now), utils.endOfDay(now)].map(date => utils.formatByString(date, format));
|
|
70
70
|
}
|
|
71
71
|
default:
|
|
@@ -125,7 +125,7 @@ const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoun
|
|
|
125
125
|
let newSectionValueNumber = currentSectionValue + delta * step;
|
|
126
126
|
if (shouldSetAbsolute) {
|
|
127
127
|
if (section.type === 'year' && !isEnd && !isStart) {
|
|
128
|
-
return utils.formatByString(utils.
|
|
128
|
+
return utils.formatByString(utils.date(undefined, timezone), section.format);
|
|
129
129
|
}
|
|
130
130
|
if (delta > 0 || isStart) {
|
|
131
131
|
newSectionValueNumber = sectionBoundaries.minimum;
|
|
@@ -228,7 +228,7 @@ const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, curre
|
|
|
228
228
|
case 'year':
|
|
229
229
|
{
|
|
230
230
|
return localeText.fieldYearPlaceholder({
|
|
231
|
-
digitAmount: utils.formatByString(utils.
|
|
231
|
+
digitAmount: utils.formatByString(utils.date(undefined, timezone), currentTokenValue).length
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
case 'month':
|
|
@@ -278,12 +278,12 @@ const changeSectionValueFormat = (utils, valueStr, currentFormat, newFormat) =>
|
|
|
278
278
|
return utils.formatByString(utils.parse(valueStr, currentFormat), newFormat);
|
|
279
279
|
};
|
|
280
280
|
exports.changeSectionValueFormat = changeSectionValueFormat;
|
|
281
|
-
const isFourDigitYearFormat = (utils, timezone, format) => utils.formatByString(utils.
|
|
281
|
+
const isFourDigitYearFormat = (utils, timezone, format) => utils.formatByString(utils.date(undefined, timezone), format).length === 4;
|
|
282
282
|
const doesSectionFormatHaveLeadingZeros = (utils, timezone, contentType, sectionType, format) => {
|
|
283
283
|
if (contentType !== 'digit') {
|
|
284
284
|
return false;
|
|
285
285
|
}
|
|
286
|
-
const now = utils.
|
|
286
|
+
const now = utils.date(undefined, timezone);
|
|
287
287
|
switch (sectionType) {
|
|
288
288
|
// We can't use `changeSectionValueFormat`, because `utils.parse('1', 'YYYY')` returns `1971` instead of `1`.
|
|
289
289
|
case 'year':
|
|
@@ -375,7 +375,6 @@ const splitFormatIntoSections = (utils, timezone, localeText, format, date, form
|
|
|
375
375
|
maxLength,
|
|
376
376
|
value: sectionValue,
|
|
377
377
|
placeholder: getSectionPlaceholder(utils, timezone, localeText, sectionConfig, token),
|
|
378
|
-
hasLeadingZeros: hasLeadingZerosInFormat,
|
|
379
378
|
hasLeadingZerosInFormat,
|
|
380
379
|
hasLeadingZerosInInput,
|
|
381
380
|
startSeparator: sections.length === 0 ? startSeparator : '',
|
|
@@ -494,7 +493,7 @@ const createDateStrForInputFromSections = (sections, isRTL) => {
|
|
|
494
493
|
};
|
|
495
494
|
exports.createDateStrForInputFromSections = createDateStrForInputFromSections;
|
|
496
495
|
const getSectionsBoundaries = (utils, timezone) => {
|
|
497
|
-
const today = utils.
|
|
496
|
+
const today = utils.date(undefined, timezone);
|
|
498
497
|
const endOfYear = utils.endOfYear(today);
|
|
499
498
|
const endOfDay = utils.endOfDay(today);
|
|
500
499
|
const {
|
|
@@ -165,7 +165,7 @@ const useFieldState = params => {
|
|
|
165
165
|
const nonEmptySectionCountBefore = activeDateManager.getSections(state.sections).filter(section => section.value !== '').length;
|
|
166
166
|
const hasNoOtherNonEmptySections = nonEmptySectionCountBefore === (activeSection.value === '' ? 0 : 1);
|
|
167
167
|
const newSections = setSectionValue(selectedSectionIndexes.startIndex, '');
|
|
168
|
-
const newActiveDate = hasNoOtherNonEmptySections ? null : utils.
|
|
168
|
+
const newActiveDate = hasNoOtherNonEmptySections ? null : utils.getInvalidDate();
|
|
169
169
|
const newValues = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);
|
|
170
170
|
if ((newActiveDate != null && !utils.isValid(newActiveDate)) !== (activeDateManager.date != null && !utils.isValid(activeDateManager.date))) {
|
|
171
171
|
publishValue((0, _extends2.default)({}, newValues, {
|
|
@@ -258,7 +258,7 @@ const useFieldState = params => {
|
|
|
258
258
|
}, [format, utils.locale]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
259
259
|
|
|
260
260
|
React.useEffect(() => {
|
|
261
|
-
let shouldUpdate
|
|
261
|
+
let shouldUpdate;
|
|
262
262
|
if (!valueManager.areValuesEqual(utils, state.value, valueFromTheOutside)) {
|
|
263
263
|
shouldUpdate = true;
|
|
264
264
|
} else {
|
|
@@ -35,7 +35,7 @@ const useNow = timezone => {
|
|
|
35
35
|
const utils = useUtils();
|
|
36
36
|
const now = React.useRef();
|
|
37
37
|
if (now.current === undefined) {
|
|
38
|
-
now.current = utils.
|
|
38
|
+
now.current = utils.date(undefined, timezone);
|
|
39
39
|
}
|
|
40
40
|
return now.current;
|
|
41
41
|
};
|
|
@@ -92,7 +92,7 @@ function useViews({
|
|
|
92
92
|
const isSelectionFinishedOnCurrentView = currentViewSelectionState === 'finish';
|
|
93
93
|
const hasMoreViews = selectedView ?
|
|
94
94
|
// handles case like `DateTimePicker`, where a view might return a `finish` selection state
|
|
95
|
-
// but
|
|
95
|
+
// but when it's not the final view given all `views` -> overall selection state should be `partial`.
|
|
96
96
|
views.indexOf(selectedView) < views.length - 1 : Boolean(nextView);
|
|
97
97
|
const globalSelectionState = isSelectionFinishedOnCurrentView && hasMoreViews ? 'partial' : currentViewSelectionState;
|
|
98
98
|
onChange(value, globalSelectionState);
|
|
@@ -114,7 +114,7 @@ function useViews({
|
|
|
114
114
|
setFocusedView: handleFocusedViewChange,
|
|
115
115
|
nextView,
|
|
116
116
|
previousView,
|
|
117
|
-
// Always return up
|
|
117
|
+
// Always return up-to-date default view instead of the initial one (i.e. defaultView.current)
|
|
118
118
|
defaultView: views.includes(openTo) ? openTo : views[0],
|
|
119
119
|
goToNextView,
|
|
120
120
|
setValueAndGoToNextView,
|
|
@@ -15,7 +15,7 @@ const findClosestEnabledDate = ({
|
|
|
15
15
|
utils,
|
|
16
16
|
timezone
|
|
17
17
|
}) => {
|
|
18
|
-
const today = utils.startOfDay(utils.
|
|
18
|
+
const today = utils.startOfDay(utils.date(undefined, timezone));
|
|
19
19
|
if (disablePast && utils.isBefore(minDate, today)) {
|
|
20
20
|
minDate = today;
|
|
21
21
|
}
|
|
@@ -91,7 +91,7 @@ const mergeDateAndTime = (utils, dateParam, timeParam) => {
|
|
|
91
91
|
return mergedDate;
|
|
92
92
|
};
|
|
93
93
|
exports.mergeDateAndTime = mergeDateAndTime;
|
|
94
|
-
const getTodayDate = (utils, timezone, valueType) => valueType === 'date' ? utils.startOfDay(utils.
|
|
94
|
+
const getTodayDate = (utils, timezone, valueType) => valueType === 'date' ? utils.startOfDay(utils.date(undefined, timezone)) : utils.date(undefined, timezone);
|
|
95
95
|
exports.getTodayDate = getTodayDate;
|
|
96
96
|
const formatMeridiem = (utils, meridiem) => {
|
|
97
97
|
const date = utils.setHours(utils.date(), meridiem === 'am' ? 2 : 14);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getSectionTypeGranularity = exports.getDefaultReferenceDate = exports.SECTION_TYPE_GRANULARITY = void 0;
|
|
7
7
|
var _timeUtils = require("./time-utils");
|
|
8
8
|
var _dateUtils = require("./date-utils");
|
|
9
9
|
const SECTION_TYPE_GRANULARITY = exports.SECTION_TYPE_GRANULARITY = {
|
|
@@ -17,8 +17,6 @@ const SECTION_TYPE_GRANULARITY = exports.SECTION_TYPE_GRANULARITY = {
|
|
|
17
17
|
};
|
|
18
18
|
const getSectionTypeGranularity = sections => Math.max(...sections.map(section => SECTION_TYPE_GRANULARITY[section.type] ?? 1));
|
|
19
19
|
exports.getSectionTypeGranularity = getSectionTypeGranularity;
|
|
20
|
-
const getViewsGranularity = views => Math.max(...views.map(view => SECTION_TYPE_GRANULARITY[view] ?? 1));
|
|
21
|
-
exports.getViewsGranularity = getViewsGranularity;
|
|
22
20
|
const roundDate = (utils, granularity, date) => {
|
|
23
21
|
if (granularity === SECTION_TYPE_GRANULARITY.year) {
|
|
24
22
|
return utils.startOfYear(date);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractValidationProps = exports.TIME_VALIDATION_PROP_NAMES = exports.DATE_VALIDATION_PROP_NAMES = exports.DATE_TIME_VALIDATION_PROP_NAMES = void 0;
|
|
7
7
|
const DATE_VALIDATION_PROP_NAMES = exports.DATE_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minDate', 'maxDate', 'shouldDisableDate', 'shouldDisableMonth', 'shouldDisableYear'];
|
|
8
|
-
const TIME_VALIDATION_PROP_NAMES = exports.TIME_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minTime', 'maxTime', '
|
|
8
|
+
const TIME_VALIDATION_PROP_NAMES = exports.TIME_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minTime', 'maxTime', 'shouldDisableTime', 'minutesStep', 'ampm', 'disableIgnoringDatePartForTimeValidation'];
|
|
9
9
|
const DATE_TIME_VALIDATION_PROP_NAMES = exports.DATE_TIME_VALIDATION_PROP_NAMES = ['minDateTime', 'maxDateTime'];
|
|
10
10
|
const VALIDATION_PROP_NAMES = [...DATE_VALIDATION_PROP_NAMES, ...TIME_VALIDATION_PROP_NAMES, ...DATE_TIME_VALIDATION_PROP_NAMES];
|
|
11
11
|
/**
|
|
@@ -21,7 +21,7 @@ const validateDate = ({
|
|
|
21
21
|
disableFuture,
|
|
22
22
|
timezone
|
|
23
23
|
} = props;
|
|
24
|
-
const now = adapter.utils.
|
|
24
|
+
const now = adapter.utils.date(undefined, timezone);
|
|
25
25
|
const minDate = (0, _dateUtils.applyDefaultDate)(adapter.utils, props.minDate, adapter.defaultDates.minDate);
|
|
26
26
|
const maxDate = (0, _dateUtils.applyDefaultDate)(adapter.utils, props.maxDate, adapter.defaultDates.maxDate);
|
|
27
27
|
switch (true) {
|
|
@@ -17,14 +17,13 @@ const validateTime = ({
|
|
|
17
17
|
minTime,
|
|
18
18
|
maxTime,
|
|
19
19
|
minutesStep,
|
|
20
|
-
shouldDisableClock,
|
|
21
20
|
shouldDisableTime,
|
|
22
21
|
disableIgnoringDatePartForTimeValidation = false,
|
|
23
22
|
disablePast,
|
|
24
23
|
disableFuture,
|
|
25
24
|
timezone
|
|
26
25
|
} = props;
|
|
27
|
-
const now = adapter.utils.
|
|
26
|
+
const now = adapter.utils.date(undefined, timezone);
|
|
28
27
|
const isAfter = (0, _timeUtils.createIsAfterIgnoreDatePart)(disableIgnoringDatePartForTimeValidation, adapter.utils);
|
|
29
28
|
switch (true) {
|
|
30
29
|
case !adapter.utils.isValid(value):
|
|
@@ -43,12 +42,6 @@ const validateTime = ({
|
|
|
43
42
|
return 'shouldDisableTime-minutes';
|
|
44
43
|
case Boolean(shouldDisableTime && shouldDisableTime(value, 'seconds')):
|
|
45
44
|
return 'shouldDisableTime-seconds';
|
|
46
|
-
case Boolean(shouldDisableClock && shouldDisableClock(adapter.utils.getHours(value), 'hours')):
|
|
47
|
-
return 'shouldDisableClock-hours';
|
|
48
|
-
case Boolean(shouldDisableClock && shouldDisableClock(adapter.utils.getMinutes(value), 'minutes')):
|
|
49
|
-
return 'shouldDisableClock-minutes';
|
|
50
|
-
case Boolean(shouldDisableClock && shouldDisableClock(adapter.utils.getSeconds(value), 'seconds')):
|
|
51
|
-
return 'shouldDisableClock-seconds';
|
|
52
45
|
case Boolean(minutesStep && adapter.utils.getMinutes(value) % minutesStep !== 0):
|
|
53
46
|
return 'minutesStep';
|
|
54
47
|
default:
|
package/node/locales/deDE.js
CHANGED
|
@@ -48,8 +48,7 @@ const deDEPickers = {
|
|
|
48
48
|
// Open picker labels
|
|
49
49
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Datum auswählen, gewähltes Datum ist ${utils.format(value, 'fullDate')}` : 'Datum auswählen',
|
|
50
50
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Uhrzeit auswählen, gewählte Uhrzeit ist ${utils.format(value, 'fullTime')}` : 'Uhrzeit auswählen',
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
fieldClearLabel: 'Wert leeren',
|
|
53
52
|
// Table labels
|
|
54
53
|
timeTableLabel: 'Uhrzeit auswählen',
|
|
55
54
|
dateTableLabel: 'Datum auswählen',
|
|
@@ -57,7 +56,7 @@ const deDEPickers = {
|
|
|
57
56
|
fieldYearPlaceholder: params => 'J'.repeat(params.digitAmount),
|
|
58
57
|
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
59
58
|
fieldDayPlaceholder: () => 'TT',
|
|
60
|
-
|
|
59
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
61
60
|
fieldHoursPlaceholder: () => 'hh',
|
|
62
61
|
fieldMinutesPlaceholder: () => 'mm',
|
|
63
62
|
fieldSecondsPlaceholder: () => 'ss',
|
package/node/locales/index.js
CHANGED
|
@@ -201,6 +201,17 @@ Object.keys(_kzKZ).forEach(function (key) {
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
});
|
|
204
|
+
var _mk = require("./mk");
|
|
205
|
+
Object.keys(_mk).forEach(function (key) {
|
|
206
|
+
if (key === "default" || key === "__esModule") return;
|
|
207
|
+
if (key in exports && exports[key] === _mk[key]) return;
|
|
208
|
+
Object.defineProperty(exports, key, {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return _mk[key];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
204
215
|
var _nbNO = require("./nbNO");
|
|
205
216
|
Object.keys(_nbNO).forEach(function (key) {
|
|
206
217
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mk = void 0;
|
|
7
|
+
var _getPickersLocalization = require("./utils/getPickersLocalization");
|
|
8
|
+
// This object is not Partial<PickersLocaleText> because it is the default values
|
|
9
|
+
|
|
10
|
+
const mkPickers = {
|
|
11
|
+
// Calendar navigation
|
|
12
|
+
previousMonth: 'Предходен месец',
|
|
13
|
+
nextMonth: 'Следен месец',
|
|
14
|
+
// View navigation
|
|
15
|
+
openPreviousView: 'отвори претходен приказ',
|
|
16
|
+
openNextView: 'отвори следен приказ',
|
|
17
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'годишен приказ, отвори календарски приказ' : 'календарски приказ, отвори годишен приказ',
|
|
18
|
+
// DateRange placeholders
|
|
19
|
+
start: 'Почеток',
|
|
20
|
+
end: 'Крај',
|
|
21
|
+
// Action bar
|
|
22
|
+
cancelButtonLabel: 'Откажи',
|
|
23
|
+
clearButtonLabel: 'Избриши',
|
|
24
|
+
okButtonLabel: 'OK',
|
|
25
|
+
todayButtonLabel: 'Денес',
|
|
26
|
+
// Toolbar titles
|
|
27
|
+
datePickerToolbarTitle: 'Избери датум',
|
|
28
|
+
dateTimePickerToolbarTitle: 'Избери датум и време',
|
|
29
|
+
timePickerToolbarTitle: 'Избери време',
|
|
30
|
+
dateRangePickerToolbarTitle: 'Избери временски опсег',
|
|
31
|
+
// Clock labels
|
|
32
|
+
clockLabelText: (view, time, adapter) => `Select ${view}. ${time === null ? 'Нема избрано време' : `Избраното време е ${adapter.format(time, 'fullTime')}`}`,
|
|
33
|
+
hoursClockNumberText: hours => `${hours} часа`,
|
|
34
|
+
minutesClockNumberText: minutes => `${minutes} минути`,
|
|
35
|
+
secondsClockNumberText: seconds => `${seconds} секунди`,
|
|
36
|
+
// Digital clock labels
|
|
37
|
+
selectViewText: view => `Избери ${view}`,
|
|
38
|
+
// Calendar labels
|
|
39
|
+
calendarWeekNumberHeaderLabel: 'Недела број',
|
|
40
|
+
calendarWeekNumberHeaderText: '#',
|
|
41
|
+
calendarWeekNumberAriaLabelText: weekNumber => `Недела ${weekNumber}`,
|
|
42
|
+
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
43
|
+
// Open picker labels
|
|
44
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Избери датум, избраниот датум е ${utils.format(value, 'fullDate')}` : 'Избери датум',
|
|
45
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Избери време, избраното време е ${utils.format(value, 'fullTime')}` : 'Избери време',
|
|
46
|
+
fieldClearLabel: 'Избриши',
|
|
47
|
+
// Table labels
|
|
48
|
+
timeTableLabel: 'одбери време',
|
|
49
|
+
dateTableLabel: 'одбери датум',
|
|
50
|
+
// Field section placeholders
|
|
51
|
+
fieldYearPlaceholder: params => 'Г'.repeat(params.digitAmount),
|
|
52
|
+
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
53
|
+
fieldDayPlaceholder: () => 'ДД',
|
|
54
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
55
|
+
fieldHoursPlaceholder: () => 'чч',
|
|
56
|
+
fieldMinutesPlaceholder: () => 'мм',
|
|
57
|
+
fieldSecondsPlaceholder: () => 'сс',
|
|
58
|
+
fieldMeridiemPlaceholder: () => 'aa'
|
|
59
|
+
};
|
|
60
|
+
const mk = exports.mk = (0, _getPickersLocalization.getPickersLocalization)(mkPickers);
|