@mui/x-date-pickers 6.19.0 → 6.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdapterDateFns/AdapterDateFns.d.ts +1 -0
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +1 -0
- package/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -0
- package/AdapterLuxon/AdapterLuxon.js +0 -1
- package/CHANGELOG.md +113 -0
- package/DateCalendar/useCalendarState.js +0 -1
- package/DatePicker/DatePickerToolbar.d.ts +2 -2
- package/DatePicker/DatePickerToolbar.js +2 -7
- package/DateTimePicker/DateTimePickerTabs.js +6 -3
- package/DigitalClock/DigitalClock.js +1 -0
- package/DigitalClock/DigitalClock.types.d.ts +5 -0
- package/MonthCalendar/MonthCalendar.js +0 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +5 -0
- package/PickersLayout/pickersLayoutClasses.js +3 -2
- package/PickersLayout/usePickerLayout.js +2 -1
- package/TimeClock/Clock.js +0 -1
- package/TimeClock/ClockPointer.js +0 -1
- package/TimeClock/TimeClock.js +1 -0
- package/TimeClock/TimeClock.types.d.ts +5 -0
- package/TimePicker/timePickerToolbarClasses.d.ts +8 -0
- package/YearCalendar/YearCalendar.js +0 -1
- package/index.js +1 -1
- package/internals/hooks/useClockReferenceDate.js +0 -1
- package/internals/hooks/useField/useField.utils.js +0 -2
- package/internals/hooks/useViews.js +0 -1
- package/internals/models/props/tabs.d.ts +1 -0
- package/legacy/AdapterDateFns/AdapterDateFns.js +5 -6
- package/legacy/AdapterDateFnsV3/AdapterDateFnsV3.js +6 -6
- package/legacy/AdapterLuxon/AdapterLuxon.js +0 -1
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -6
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -6
- package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
- package/legacy/DateCalendar/useCalendarState.js +0 -1
- package/legacy/DatePicker/DatePickerToolbar.js +2 -7
- package/legacy/DateTimePicker/DateTimePickerTabs.js +6 -3
- package/legacy/DigitalClock/DigitalClock.js +1 -0
- package/legacy/MonthCalendar/MonthCalendar.js +0 -1
- package/legacy/MonthCalendar/PickersMonth.js +4 -5
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/legacy/PickersDay/PickersDay.js +5 -6
- package/legacy/PickersLayout/PickersLayout.js +5 -6
- package/legacy/PickersLayout/pickersLayoutClasses.js +3 -2
- package/legacy/PickersLayout/usePickerLayout.js +2 -1
- package/legacy/TimeClock/Clock.js +0 -1
- package/legacy/TimeClock/ClockNumber.js +4 -5
- package/legacy/TimeClock/ClockPointer.js +0 -1
- package/legacy/TimeClock/TimeClock.js +1 -0
- package/legacy/TimePicker/TimePickerToolbar.js +1 -2
- package/legacy/YearCalendar/PickersYear.js +4 -5
- package/legacy/YearCalendar/YearCalendar.js +0 -1
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersModalDialog.js +3 -4
- package/legacy/internals/hooks/useClockReferenceDate.js +0 -1
- package/legacy/internals/hooks/useField/useField.utils.js +0 -2
- package/legacy/internals/hooks/useViews.js +0 -1
- package/legacy/locales/plPL.js +0 -1
- package/legacy/locales/svSE.js +0 -1
- package/legacy/locales/urPK.js +0 -1
- package/locales/plPL.js +0 -1
- package/locales/svSE.js +0 -1
- package/locales/urPK.js +0 -1
- package/modern/AdapterDateFnsV3/AdapterDateFnsV3.js +1 -0
- package/modern/AdapterLuxon/AdapterLuxon.js +0 -1
- package/modern/DateCalendar/useCalendarState.js +0 -1
- package/modern/DatePicker/DatePickerToolbar.js +2 -7
- package/modern/DateTimePicker/DateTimePickerTabs.js +6 -3
- package/modern/DigitalClock/DigitalClock.js +1 -0
- package/modern/MonthCalendar/MonthCalendar.js +0 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/modern/PickersLayout/pickersLayoutClasses.js +3 -2
- package/modern/PickersLayout/usePickerLayout.js +2 -1
- package/modern/TimeClock/Clock.js +0 -1
- package/modern/TimeClock/ClockPointer.js +0 -1
- package/modern/TimeClock/TimeClock.js +1 -0
- package/modern/YearCalendar/YearCalendar.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useClockReferenceDate.js +0 -1
- package/modern/internals/hooks/useField/useField.utils.js +0 -2
- package/modern/internals/hooks/useViews.js +0 -1
- package/modern/locales/plPL.js +0 -1
- package/modern/locales/svSE.js +0 -1
- package/modern/locales/urPK.js +0 -1
- package/node/AdapterLuxon/AdapterLuxon.js +0 -1
- package/node/DateCalendar/useCalendarState.js +0 -1
- package/node/DatePicker/DatePickerToolbar.js +0 -4
- package/node/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/node/DigitalClock/DigitalClock.js +1 -0
- package/node/MonthCalendar/MonthCalendar.js +0 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +1 -0
- package/node/PickersLayout/pickersLayoutClasses.js +5 -3
- package/node/PickersLayout/usePickerLayout.js +2 -1
- package/node/TimeClock/Clock.js +0 -1
- package/node/TimeClock/ClockPointer.js +0 -1
- package/node/TimeClock/TimeClock.js +1 -0
- package/node/YearCalendar/YearCalendar.js +0 -1
- package/node/index.js +1 -1
- package/node/internals/hooks/useClockReferenceDate.js +0 -1
- package/node/internals/hooks/useField/useField.utils.js +0 -2
- package/node/internals/hooks/useViews.js +0 -1
- package/node/locales/plPL.js +0 -1
- package/node/locales/svSE.js +0 -1
- package/node/locales/urPK.js +0 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="date-fns-jalali" />
|
|
1
2
|
import defaultLocale from 'date-fns-jalali/locale/fa-IR';
|
|
2
3
|
import { AdapterFormats, AdapterOptions, AdapterUnits, DateBuilderReturnType, FieldFormatTokenMap, MuiPickersAdapter } from '../models';
|
|
3
4
|
type DateFnsLocale = typeof defaultLocale;
|
|
@@ -59,6 +59,7 @@ import { isWithinInterval } from 'date-fns/isWithinInterval';
|
|
|
59
59
|
import { enUS } from 'date-fns/locale/en-US';
|
|
60
60
|
// date-fns v2 does not export types
|
|
61
61
|
// @ts-ignore TODO remove when date-fns-v3 is the default
|
|
62
|
+
|
|
62
63
|
import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
|
|
63
64
|
|
|
64
65
|
/**
|
|
@@ -266,7 +266,6 @@ export class AdapterLuxon {
|
|
|
266
266
|
if (typeof Intl === 'undefined' || typeof Intl.DateTimeFormat === 'undefined') {
|
|
267
267
|
return true; // Luxon defaults to en-US if Intl not found
|
|
268
268
|
}
|
|
269
|
-
|
|
270
269
|
return Boolean((_Intl$DateTimeFormat = new Intl.DateTimeFormat(this.locale, {
|
|
271
270
|
hour: 'numeric'
|
|
272
271
|
})) == null || (_Intl$DateTimeFormat = _Intl$DateTimeFormat.resolvedOptions()) == null ? void 0 : _Intl$DateTimeFormat.hour12);
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,119 @@
|
|
|
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.19.3
|
|
7
|
+
|
|
8
|
+
_Feb 1, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 4 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🌍 Improve Hebrew (he-IL) locale (#11831) @danielmishan85
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### Data Grid
|
|
17
|
+
|
|
18
|
+
#### `@mui/x-data-grid@6.19.3`
|
|
19
|
+
|
|
20
|
+
- [l10n] Improve Hebrew (he-IL) locale (@danielmishan85) (#11831)
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid-pro@6.19.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
23
|
+
|
|
24
|
+
Same changes as in `@mui/x-data-grid@6.19.3`.
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-premium@6.19.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.3`.
|
|
29
|
+
|
|
30
|
+
### Date Pickers
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-date-pickers@6.19.3`
|
|
33
|
+
|
|
34
|
+
- [TimePicker] Add missing toolbar classes descriptions (#11862) @LukasTy
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-date-pickers-pro@6.19.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-date-pickers@6.19.3`.
|
|
39
|
+
|
|
40
|
+
### Charts / `@mui/x-charts@6.19.3`
|
|
41
|
+
|
|
42
|
+
- [charts] Document how to modify color according to values (#11854) @alexfauquette
|
|
43
|
+
|
|
44
|
+
### Docs
|
|
45
|
+
|
|
46
|
+
- [docs] Add a general uplift to the whats new page (#11883) @danilo-leal
|
|
47
|
+
- [docs] Fix 404 (#11852) @alexfauquette
|
|
48
|
+
- [docs] Fix <title> generation (#11825) @alexfauquette
|
|
49
|
+
- [docs] Fix docs:api when typo in slots typing (#11861) @alexfauquette
|
|
50
|
+
- [docs] Improve Support page (#11556) @oliviertassinari
|
|
51
|
+
- [docs] Sync support page with core @oliviertassinari
|
|
52
|
+
- [docs] These API don't exist in MUI X v6 @oliviertassinari
|
|
53
|
+
- [docs] Update whats new page with v7 Beta blogpost content (#11886) @joserodolfofreitas
|
|
54
|
+
|
|
55
|
+
## 6.19.2
|
|
56
|
+
|
|
57
|
+
_Jan 25, 2024_
|
|
58
|
+
|
|
59
|
+
We'd like to offer a big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
60
|
+
|
|
61
|
+
- 🚀 Apply the `layout.tabs` class to `Tabs` slot (@LukasTy) (#11782)
|
|
62
|
+
- 🐞 Bugfixes
|
|
63
|
+
|
|
64
|
+
### Date Pickers
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-date-pickers@6.19.2`
|
|
67
|
+
|
|
68
|
+
- [pickers] Apply the `layout.tabs` class to `Tabs` slot (@LukasTy) (#11782)
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-date-pickers-pro@6.19.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
71
|
+
|
|
72
|
+
Same changes as in `@mui/x-date-pickers@6.19.2`, plus:
|
|
73
|
+
|
|
74
|
+
- [DateRangePicker] Remove `calendars` prop on `Mobile` (@LukasTy) (#11771)
|
|
75
|
+
|
|
76
|
+
### Data Grid
|
|
77
|
+
|
|
78
|
+
#### `@mui/x-data-grid@6.19.2`
|
|
79
|
+
|
|
80
|
+
- [DataGrid] Fix support for tree with more than 50,000 children (@zenazn) (#11808)
|
|
81
|
+
|
|
82
|
+
#### `@mui/x-data-grid-pro@6.19.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
83
|
+
|
|
84
|
+
Same changes as in `@mui/x-data-grid@6.19.2`.
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-data-grid-premium@6.19.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
87
|
+
|
|
88
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.2`.
|
|
89
|
+
|
|
90
|
+
## 6.19.1
|
|
91
|
+
|
|
92
|
+
_Jan 19, 2024_
|
|
93
|
+
|
|
94
|
+
We'd like to offer a big thanks to the 1 contributors who made this release possible. Here are some highlights ✨:
|
|
95
|
+
|
|
96
|
+
- 🌍 Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11717) @BCaspari
|
|
97
|
+
- 🐞 Bugfixes
|
|
98
|
+
|
|
99
|
+
### Data Grid
|
|
100
|
+
|
|
101
|
+
#### `@mui/x-data-grid@6.19.1`
|
|
102
|
+
|
|
103
|
+
- [l10n] Add Croatian (hr-HR), Portuguese (pt-PT), and Chinese (Hong Kong) (zh-HK) locales (#11717) @BCaspari
|
|
104
|
+
|
|
105
|
+
#### `@mui/x-data-grid-pro@6.19.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
106
|
+
|
|
107
|
+
Same changes as in `@mui/x-data-grid@6.19.1`.
|
|
108
|
+
|
|
109
|
+
#### `@mui/x-data-grid-premium@6.19.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
110
|
+
|
|
111
|
+
Same changes as in `@mui/x-data-grid-pro@6.19.1`.
|
|
112
|
+
|
|
113
|
+
### Charts / `@mui/x-charts@6.19.1`
|
|
114
|
+
|
|
115
|
+
- [charts] Add `arcLabelRadius` property (#11563) @alexfauquette
|
|
116
|
+
- [charts] Do not propagate `innerRadius` and `outerRadius` to the DOM (#11719) @alexfauquette
|
|
117
|
+
- [charts] Fix default `stackOffset` for `LineChart` (#11703) @alexfauquette
|
|
118
|
+
|
|
6
119
|
## 6.19.0
|
|
7
120
|
|
|
8
121
|
_Jan 11, 2024_
|
|
@@ -70,7 +70,6 @@ export const useCalendarState = params => {
|
|
|
70
70
|
});
|
|
71
71
|
}, [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
72
72
|
);
|
|
73
|
-
|
|
74
73
|
const [calendarState, dispatch] = React.useReducer(reducerFn, {
|
|
75
74
|
isMonthSwitchingAnimating: false,
|
|
76
75
|
focusedDay: utils.isValid(value) ? value : now,
|
|
@@ -22,5 +22,5 @@ type DatePickerToolbarComponent = (<TDate>(props: DatePickerToolbarProps<TDate>
|
|
|
22
22
|
*
|
|
23
23
|
* - [DatePickerToolbar API](https://mui.com/x/api/date-pickers/date-picker-toolbar/)
|
|
24
24
|
*/
|
|
25
|
-
declare const DatePickerToolbar: DatePickerToolbarComponent;
|
|
26
|
-
export {
|
|
25
|
+
export declare const DatePickerToolbar: DatePickerToolbarComponent;
|
|
26
|
+
export {};
|
|
@@ -26,10 +26,6 @@ const DatePickerToolbarRoot = styled(PickersToolbar, {
|
|
|
26
26
|
slot: 'Root',
|
|
27
27
|
overridesResolver: (_, styles) => styles.root
|
|
28
28
|
})({});
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @ignore - do not document.
|
|
32
|
-
*/
|
|
33
29
|
const DatePickerToolbarTitle = styled(Typography, {
|
|
34
30
|
name: 'MuiDatePickerToolbar',
|
|
35
31
|
slot: 'Title',
|
|
@@ -49,7 +45,7 @@ const DatePickerToolbarTitle = styled(Typography, {
|
|
|
49
45
|
*
|
|
50
46
|
* - [DatePickerToolbar API](https://mui.com/x/api/date-pickers/date-picker-toolbar/)
|
|
51
47
|
*/
|
|
52
|
-
const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePickerToolbar(inProps, ref) {
|
|
48
|
+
export const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePickerToolbar(inProps, ref) {
|
|
53
49
|
const props = useThemeProps({
|
|
54
50
|
props: inProps,
|
|
55
51
|
name: 'MuiDatePickerToolbar'
|
|
@@ -133,5 +129,4 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
|
|
|
133
129
|
*/
|
|
134
130
|
view: PropTypes.oneOf(['day', 'month', 'year']).isRequired,
|
|
135
131
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired).isRequired
|
|
136
|
-
} : void 0;
|
|
137
|
-
export { DatePickerToolbar };
|
|
132
|
+
} : void 0;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import Tab from '@mui/material/Tab';
|
|
4
5
|
import Tabs, { tabsClasses } from '@mui/material/Tabs';
|
|
5
6
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
6
|
-
import
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
7
8
|
import { TimeIcon, DateRangeIcon } from '../icons';
|
|
8
9
|
import { useLocaleText } from '../internals/hooks/useUtils';
|
|
9
10
|
import { getDateTimePickerTabsUtilityClass } from './dateTimePickerTabsClasses';
|
|
@@ -68,7 +69,8 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
68
69
|
onViewChange,
|
|
69
70
|
timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
|
|
70
71
|
view,
|
|
71
|
-
hidden = typeof window === 'undefined' || window.innerHeight < 667
|
|
72
|
+
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
73
|
+
className
|
|
72
74
|
} = props;
|
|
73
75
|
const localeText = useLocaleText();
|
|
74
76
|
const classes = useUtilityClasses(props);
|
|
@@ -83,7 +85,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
83
85
|
variant: "fullWidth",
|
|
84
86
|
value: viewToTab(view),
|
|
85
87
|
onChange: handleChange,
|
|
86
|
-
className: classes.root,
|
|
88
|
+
className: clsx(className, classes.root),
|
|
87
89
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
88
90
|
value: "date",
|
|
89
91
|
"aria-label": localeText.dateTableLabel,
|
|
@@ -108,6 +110,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
108
110
|
* Override or extend the styles applied to the component.
|
|
109
111
|
*/
|
|
110
112
|
classes: PropTypes.object,
|
|
113
|
+
className: PropTypes.string,
|
|
111
114
|
/**
|
|
112
115
|
* Date tab icon.
|
|
113
116
|
* @default DateRange
|
|
@@ -18,6 +18,11 @@ export interface DigitalClockSlotsComponentsProps {
|
|
|
18
18
|
digitalClockItem?: SlotComponentProps<typeof MenuItem, {}, Record<string, any>>;
|
|
19
19
|
}
|
|
20
20
|
export interface DigitalClockProps<TDate> extends ExportedDigitalClockProps<TDate>, BaseClockProps<TDate, Extract<TimeView, 'hours'>> {
|
|
21
|
+
/**
|
|
22
|
+
* Available views.
|
|
23
|
+
* @default ['hours']
|
|
24
|
+
*/
|
|
25
|
+
views?: readonly 'hours'[];
|
|
21
26
|
/**
|
|
22
27
|
* Override or extend the styles applied to the component.
|
|
23
28
|
*/
|
|
@@ -111,7 +111,6 @@ export const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalenda
|
|
|
111
111
|
granularity: SECTION_TYPE_GRANULARITY.month
|
|
112
112
|
}), [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
113
113
|
);
|
|
114
|
-
|
|
115
114
|
const ownerState = props;
|
|
116
115
|
const classes = useUtilityClasses(ownerState);
|
|
117
116
|
const todayMonth = React.useMemo(() => utils.getMonth(now), [utils, now]);
|
|
@@ -509,6 +509,7 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
509
509
|
view: PropTypes.oneOf(['hours', 'meridiem', 'minutes', 'seconds']),
|
|
510
510
|
/**
|
|
511
511
|
* Available views.
|
|
512
|
+
* @default ['hours', 'minutes']
|
|
512
513
|
*/
|
|
513
514
|
views: PropTypes.arrayOf(PropTypes.oneOf(['hours', 'meridiem', 'minutes', 'seconds']).isRequired)
|
|
514
515
|
} : void 0;
|
|
@@ -28,6 +28,11 @@ export interface MultiSectionDigitalClockSlotsComponentsProps {
|
|
|
28
28
|
digitalClockSectionItem?: SlotComponentProps<typeof MenuItem, {}, Record<string, any>>;
|
|
29
29
|
}
|
|
30
30
|
export interface MultiSectionDigitalClockProps<TDate> extends ExportedMultiSectionDigitalClockProps<TDate>, BaseClockProps<TDate, TimeViewWithMeridiem> {
|
|
31
|
+
/**
|
|
32
|
+
* Available views.
|
|
33
|
+
* @default ['hours', 'minutes']
|
|
34
|
+
*/
|
|
35
|
+
views?: readonly TimeViewWithMeridiem[];
|
|
31
36
|
/**
|
|
32
37
|
* Override or extend the styles applied to the component.
|
|
33
38
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
3
|
export function getPickersLayoutUtilityClass(slot) {
|
|
3
4
|
return generateUtilityClass('MuiPickersLayout', slot);
|
|
4
5
|
}
|
|
5
|
-
export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'shortcuts']);
|
|
6
|
+
export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'tabs', 'shortcuts']);
|
|
@@ -110,7 +110,8 @@ const usePickerLayout = props => {
|
|
|
110
110
|
const Tabs = slots == null ? void 0 : slots.tabs;
|
|
111
111
|
const tabs = view && Tabs ? /*#__PURE__*/_jsx(Tabs, _extends({
|
|
112
112
|
view: view,
|
|
113
|
-
onViewChange: onViewChange
|
|
113
|
+
onViewChange: onViewChange,
|
|
114
|
+
className: classes.tabs
|
|
114
115
|
}, slotProps == null ? void 0 : slotProps.tabs)) : null;
|
|
115
116
|
|
|
116
117
|
// Shortcuts
|
package/TimeClock/Clock.js
CHANGED
package/TimeClock/TimeClock.js
CHANGED
|
@@ -492,6 +492,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
492
492
|
view: PropTypes.oneOf(['hours', 'minutes', 'seconds']),
|
|
493
493
|
/**
|
|
494
494
|
* Available views.
|
|
495
|
+
* @default ['hours', 'minutes']
|
|
495
496
|
*/
|
|
496
497
|
views: PropTypes.arrayOf(PropTypes.oneOf(['hours', 'minutes', 'seconds']).isRequired)
|
|
497
498
|
} : void 0;
|
|
@@ -16,6 +16,11 @@ export interface TimeClockSlotsComponent extends PickersArrowSwitcherSlotsCompon
|
|
|
16
16
|
export interface TimeClockSlotsComponentsProps extends PickersArrowSwitcherSlotsComponentsProps {
|
|
17
17
|
}
|
|
18
18
|
export interface TimeClockProps<TDate, TView extends TimeViewWithMeridiem = TimeView> extends ExportedTimeClockProps<TDate>, BaseClockProps<TDate, TView> {
|
|
19
|
+
/**
|
|
20
|
+
* Available views.
|
|
21
|
+
* @default ['hours', 'minutes']
|
|
22
|
+
*/
|
|
23
|
+
views?: readonly TView[];
|
|
19
24
|
/**
|
|
20
25
|
* Override or extend the styles applied to the component.
|
|
21
26
|
*/
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
export interface TimePickerToolbarClasses {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
2
3
|
root: string;
|
|
4
|
+
/** Styles applied to the separator element. */
|
|
3
5
|
separator: string;
|
|
6
|
+
/** Styles applied to the time sections element. */
|
|
4
7
|
hourMinuteLabel: string;
|
|
8
|
+
/** Styles applied to the time sections element in landscape mode. */
|
|
5
9
|
hourMinuteLabelLandscape: string;
|
|
10
|
+
/** Styles applied to the time sections element in "rtl" theme mode. */
|
|
6
11
|
hourMinuteLabelReverse: string;
|
|
12
|
+
/** Styles applied to the meridiem selection element. */
|
|
7
13
|
ampmSelection: string;
|
|
14
|
+
/** Styles applied to the meridiem selection element in landscape mode. */
|
|
8
15
|
ampmLandscape: string;
|
|
16
|
+
/** Styles applied to the meridiem label element. */
|
|
9
17
|
ampmLabel: string;
|
|
10
18
|
}
|
|
11
19
|
export type TimePickerToolbarClassKey = keyof TimePickerToolbarClasses;
|
|
@@ -117,7 +117,6 @@ export const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(
|
|
|
117
117
|
granularity: SECTION_TYPE_GRANULARITY.year
|
|
118
118
|
}), [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
119
119
|
);
|
|
120
|
-
|
|
121
120
|
const ownerState = props;
|
|
122
121
|
const classes = useUtilityClasses(ownerState);
|
|
123
122
|
const todayYear = React.useMemo(() => utils.getYear(now), [utils, now]);
|
package/index.js
CHANGED
|
@@ -125,7 +125,6 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
|
|
|
125
125
|
if (delta < 0 || isStart) {
|
|
126
126
|
newSectionValueNumber += step - (step + newSectionValueNumber) % step; // for JS -3 % 5 = -3 (should be 2)
|
|
127
127
|
}
|
|
128
|
-
|
|
129
128
|
if (delta > 0 || isEnd) {
|
|
130
129
|
newSectionValueNumber -= newSectionValueNumber % step;
|
|
131
130
|
}
|
|
@@ -401,7 +400,6 @@ export const splitFormatIntoSections = (utils, timezone, localeText, format, dat
|
|
|
401
400
|
const isTokenStartRegExp = new RegExp(`^(${Object.keys(utils.formatTokenMap).sort((a, b) => b.length - a.length) // Sort to put longest word first
|
|
402
401
|
.join('|')})`, 'g') // used to get access to lastIndex state
|
|
403
402
|
;
|
|
404
|
-
|
|
405
403
|
let currentTokenValue = '';
|
|
406
404
|
for (let i = 0; i < expandedFormat.length; i += 1) {
|
|
407
405
|
const escapedPartOfCurrentChar = escapedParts.find(escapeIndex => escapeIndex.start <= i && escapeIndex.end >= i);
|
|
@@ -61,7 +61,6 @@ export function useViews({
|
|
|
61
61
|
setFocusedView(prevFocusedView => viewToFocus === prevFocusedView ? null : prevFocusedView // If false the blur is due to view switching
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
|
|
65
64
|
onFocusedViewChange == null || onFocusedViewChange(viewToFocus, hasFocus);
|
|
66
65
|
});
|
|
67
66
|
const handleChangeView = useEventCallback(newView => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
-
|
|
8
|
-
function
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/* eslint-disable class-methods-use-this */
|
|
10
10
|
import addDays from 'date-fns/addDays';
|
|
11
11
|
import addSeconds from 'date-fns/addSeconds';
|
|
@@ -92,7 +92,6 @@ import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
|
|
|
92
92
|
*/
|
|
93
93
|
export var AdapterDateFns = /*#__PURE__*/function (_ref) {
|
|
94
94
|
_inherits(AdapterDateFns, _ref);
|
|
95
|
-
var _super = _createSuper(AdapterDateFns);
|
|
96
95
|
function AdapterDateFns() {
|
|
97
96
|
var _this;
|
|
98
97
|
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -102,11 +101,11 @@ export var AdapterDateFns = /*#__PURE__*/function (_ref) {
|
|
|
102
101
|
if (typeof addDays !== 'function') {
|
|
103
102
|
throw new Error(['MUI: The `date-fns` package v3.x is not compatible with this adapter.', 'Please, install v2.x of the package or use the `AdapterDateFnsV3` instead.'].join('\n'));
|
|
104
103
|
}
|
|
105
|
-
_this =
|
|
104
|
+
_this = _callSuper(this, AdapterDateFns, [{
|
|
106
105
|
locale: locale != null ? locale : defaultLocale,
|
|
107
106
|
formats: formats,
|
|
108
107
|
longFormatters: longFormatters
|
|
109
|
-
});
|
|
108
|
+
}]);
|
|
110
109
|
_this.parseISO = function (isoString) {
|
|
111
110
|
return parseISO(isoString);
|
|
112
111
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
-
|
|
8
|
-
function
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/* eslint-disable class-methods-use-this */
|
|
10
10
|
// TODO remove when date-fns-v3 is the default
|
|
11
11
|
// @ts-nocheck
|
|
@@ -67,6 +67,7 @@ import { isWithinInterval } from 'date-fns/isWithinInterval';
|
|
|
67
67
|
import { enUS } from 'date-fns/locale/en-US';
|
|
68
68
|
// date-fns v2 does not export types
|
|
69
69
|
// @ts-ignore TODO remove when date-fns-v3 is the default
|
|
70
|
+
|
|
70
71
|
import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
|
|
71
72
|
|
|
72
73
|
/**
|
|
@@ -96,7 +97,6 @@ import { AdapterDateFnsBase } from '../AdapterDateFnsBase';
|
|
|
96
97
|
*/
|
|
97
98
|
export var AdapterDateFns = /*#__PURE__*/function (_ref) {
|
|
98
99
|
_inherits(AdapterDateFns, _ref);
|
|
99
|
-
var _super = _createSuper(AdapterDateFns);
|
|
100
100
|
function AdapterDateFns() {
|
|
101
101
|
var _this;
|
|
102
102
|
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -109,11 +109,11 @@ export var AdapterDateFns = /*#__PURE__*/function (_ref) {
|
|
|
109
109
|
if (!longFormatters) {
|
|
110
110
|
throw new Error('MUI: The minimum supported `date-fns` package version compatible with this adapter is `3.2.x`.');
|
|
111
111
|
}
|
|
112
|
-
_this =
|
|
112
|
+
_this = _callSuper(this, AdapterDateFns, [{
|
|
113
113
|
locale: locale != null ? locale : enUS,
|
|
114
114
|
formats: formats,
|
|
115
115
|
longFormatters: longFormatters
|
|
116
|
-
});
|
|
116
|
+
}]);
|
|
117
117
|
_this.parseISO = function (isoString) {
|
|
118
118
|
return parseISO(isoString);
|
|
119
119
|
};
|
|
@@ -270,7 +270,6 @@ export var AdapterLuxon = /*#__PURE__*/_createClass(function AdapterLuxon() {
|
|
|
270
270
|
if (typeof Intl === 'undefined' || typeof Intl.DateTimeFormat === 'undefined') {
|
|
271
271
|
return true; // Luxon defaults to en-US if Intl not found
|
|
272
272
|
}
|
|
273
|
-
|
|
274
273
|
return Boolean((_Intl$DateTimeFormat = new Intl.DateTimeFormat(_this.locale, {
|
|
275
274
|
hour: 'numeric'
|
|
276
275
|
})) == null || (_Intl$DateTimeFormat = _Intl$DateTimeFormat.resolvedOptions()) == null ? void 0 : _Intl$DateTimeFormat.hour12);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
-
|
|
8
|
-
function
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/* eslint-disable class-methods-use-this */
|
|
10
10
|
import defaultHMoment from 'moment-hijri';
|
|
11
11
|
import { AdapterMoment } from '../AdapterMoment';
|
|
@@ -143,17 +143,16 @@ var NUMBER_SYMBOL_MAP = {
|
|
|
143
143
|
*/
|
|
144
144
|
export var AdapterMomentHijri = /*#__PURE__*/function (_AdapterMoment) {
|
|
145
145
|
_inherits(AdapterMomentHijri, _AdapterMoment);
|
|
146
|
-
var _super = _createSuper(AdapterMomentHijri);
|
|
147
146
|
function AdapterMomentHijri() {
|
|
148
147
|
var _this;
|
|
149
148
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
150
149
|
formats = _ref.formats,
|
|
151
150
|
instance = _ref.instance;
|
|
152
151
|
_classCallCheck(this, AdapterMomentHijri);
|
|
153
|
-
_this =
|
|
152
|
+
_this = _callSuper(this, AdapterMomentHijri, [{
|
|
154
153
|
locale: 'ar-SA',
|
|
155
154
|
instance: instance
|
|
156
|
-
});
|
|
155
|
+
}]);
|
|
157
156
|
_this.lib = 'moment-hijri';
|
|
158
157
|
_this.moment = void 0;
|
|
159
158
|
_this.isTimezoneCompatible = false;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
-
|
|
8
|
-
function
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/* eslint-disable class-methods-use-this */
|
|
10
10
|
import defaultJMoment from 'moment-jalaali';
|
|
11
11
|
import { AdapterMoment } from '../AdapterMoment';
|
|
@@ -141,17 +141,16 @@ var NUMBER_SYMBOL_MAP = {
|
|
|
141
141
|
*/
|
|
142
142
|
export var AdapterMomentJalaali = /*#__PURE__*/function (_AdapterMoment) {
|
|
143
143
|
_inherits(AdapterMomentJalaali, _AdapterMoment);
|
|
144
|
-
var _super = _createSuper(AdapterMomentJalaali);
|
|
145
144
|
function AdapterMomentJalaali() {
|
|
146
145
|
var _this;
|
|
147
146
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
148
147
|
formats = _ref.formats,
|
|
149
148
|
instance = _ref.instance;
|
|
150
149
|
_classCallCheck(this, AdapterMomentJalaali);
|
|
151
|
-
_this =
|
|
150
|
+
_this = _callSuper(this, AdapterMomentJalaali, [{
|
|
152
151
|
locale: 'fa',
|
|
153
152
|
instance: instance
|
|
154
|
-
});
|
|
153
|
+
}]);
|
|
155
154
|
_this.isTimezoneCompatible = false;
|
|
156
155
|
_this.lib = 'moment-jalaali';
|
|
157
156
|
_this.moment = void 0;
|