@docsvision/material-ui-pickers 3.2.0-beta.26 → 3.2.0-beta.28
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/{build/DatePicker → DatePicker}/DatePickerToolbar.js +3 -3
- package/{build/DateTimePicker → DateTimePicker}/DateTimePicker.d.ts +2 -2
- package/{build/DateTimePicker → DateTimePicker}/DateTimePicker.js +2 -2
- package/{build/DateTimePicker → DateTimePicker}/DateTimePickerToolbar.js +4 -4
- package/{build/MuiPickersUtilsProvider.d.ts → MuiPickersUtilsProvider.d.ts} +1 -1
- package/{build/Picker → Picker}/Picker.d.ts +3 -3
- package/{build/Picker → Picker}/Picker.js +1 -1
- package/{build/Picker → Picker}/WrappedPurePicker.js +2 -1
- package/{build/TimePicker → TimePicker}/TimePicker.d.ts +4 -2
- package/{build/TimePicker → TimePicker}/TimePicker.js +2 -2
- package/{build/TimePicker → TimePicker}/TimePickerToolbar.js +3 -3
- package/{build/_helpers → _helpers}/date-utils.d.ts +2 -2
- package/{build/_helpers → _helpers}/date-utils.js +3 -3
- package/_helpers/text-field-helper.d.ts +32 -0
- package/{build/_helpers → _helpers}/text-field-helper.js +1 -1
- package/{build/_helpers → _helpers}/time-utils.d.ts +2 -2
- package/{build/_shared → _shared}/WithUtils.d.ts +1 -1
- package/{build/_shared → _shared}/hooks/useKeyboardPickerState.js +1 -1
- package/{build/_shared → _shared}/hooks/useUtils.d.ts +2 -2
- package/{build/dist → dist}/material-ui-pickers.esm.js +1187 -834
- package/dist/material-ui-pickers.esm.js.map +1 -0
- package/{build/dist → dist}/material-ui-pickers.js +1187 -834
- package/dist/material-ui-pickers.js.map +1 -0
- package/{build/dist → dist}/material-ui-pickers.umd.js +1178 -825
- package/dist/material-ui-pickers.umd.min.js +1 -0
- package/{build/index.d.ts → index.d.ts} +11 -11
- package/package.json +62 -135
- package/{build/typings → typings}/BasePicker.d.ts +1 -1
- package/{build/views → views}/Calendar/Calendar.js +1 -1
- package/{build/views → views}/Calendar/CalendarHeader.js +1 -1
- package/{build/views → views}/Clock/Clock.js +1 -1
- package/{build/views → views}/Clock/ClockNumbers.d.ts +2 -2
- package/{build/views → views}/Clock/ClockView.js +1 -1
- package/{build/views → views}/Month/MonthView.js +1 -1
- package/{build/views → views}/Year/YearView.js +2 -2
- package/.size-snapshot.json +0 -26
- package/9db1cba1a61cb58db53f38425bbd1f95.7z +0 -0
- package/build/_helpers/text-field-helper.d.ts +0 -32
- package/build/dist/material-ui-pickers.esm.js.map +0 -1
- package/build/dist/material-ui-pickers.js.map +0 -1
- package/build/dist/material-ui-pickers.umd.min.js +0 -1
- package/build/package.json +0 -62
- package/copy.js +0 -58
- package/remove-prop-types.js +0 -37
- package/rollup.config.js +0 -145
- package/src/DatePicker/DatePicker.tsx +0 -91
- package/src/DatePicker/DatePickerToolbar.tsx +0 -75
- package/src/DatePicker/index.ts +0 -7
- package/src/DateTimePicker/DateTimePicker.tsx +0 -72
- package/src/DateTimePicker/DateTimePickerTabs.tsx +0 -86
- package/src/DateTimePicker/DateTimePickerToolbar.tsx +0 -123
- package/src/DateTimePicker/index.ts +0 -7
- package/src/MuiPickersUtilsProvider.tsx +0 -39
- package/src/Picker/Picker.tsx +0 -275
- package/src/Picker/WrappedKeyboardPicker.tsx +0 -136
- package/src/Picker/WrappedPurePicker.tsx +0 -128
- package/src/Rifm/Rifm.ts +0 -213
- package/src/TimePicker/TimePicker.tsx +0 -67
- package/src/TimePicker/TimePickerToolbar.tsx +0 -180
- package/src/TimePicker/index.tsx +0 -7
- package/src/__tests__/DatePicker/Calendar.test.tsx +0 -51
- package/src/__tests__/DatePicker/Month.test.tsx +0 -36
- package/src/__tests__/DatePicker/MonthSelection.test.tsx +0 -37
- package/src/__tests__/MuiPickersUtilsProvider.test.tsx +0 -21
- package/src/__tests__/TimePicker/Clock.test.tsx +0 -68
- package/src/__tests__/_helpers/date-utils.test.tsx +0 -197
- package/src/__tests__/_helpers/text-field-helper.test.tsx +0 -34
- package/src/__tests__/_shared/ModalDialog.test.tsx +0 -109
- package/src/__tests__/e2e/DatePicker.test.tsx +0 -233
- package/src/__tests__/e2e/DatePickerProps.test.tsx +0 -18
- package/src/__tests__/e2e/DatePickerRoot.test.tsx +0 -154
- package/src/__tests__/e2e/DateTimePicker.test.tsx +0 -86
- package/src/__tests__/e2e/DateTimePickerRoot.test.tsx +0 -72
- package/src/__tests__/e2e/KeyboardDatePicker.test.tsx +0 -140
- package/src/__tests__/e2e/KeyboardDateTimePicker.test.tsx +0 -48
- package/src/__tests__/e2e/Theme.test.tsx +0 -30
- package/src/__tests__/e2e/TimePicker.test.tsx +0 -121
- package/src/__tests__/e2e/commands.tsx +0 -8
- package/src/__tests__/setup.js +0 -26
- package/src/__tests__/test-utils.tsx +0 -45
- package/src/__tests__/tsconfig.json +0 -5
- package/src/_helpers/date-utils.ts +0 -92
- package/src/_helpers/text-field-helper.ts +0 -239
- package/src/_helpers/time-utils.ts +0 -83
- package/src/_helpers/utils.ts +0 -8
- package/src/_shared/KeyboardDateInput.tsx +0 -161
- package/src/_shared/ModalDialog.tsx +0 -114
- package/src/_shared/PickerToolbar.tsx +0 -52
- package/src/_shared/PureDateInput.tsx +0 -45
- package/src/_shared/ToolbarButton.tsx +0 -63
- package/src/_shared/ToolbarText.tsx +0 -49
- package/src/_shared/WithUtils.tsx +0 -19
- package/src/_shared/hooks/useIsLandscape.tsx +0 -27
- package/src/_shared/hooks/useKeyDown.ts +0 -34
- package/src/_shared/hooks/useKeyboardPickerState.ts +0 -72
- package/src/_shared/hooks/useOpenState.ts +0 -22
- package/src/_shared/hooks/usePickerState.ts +0 -134
- package/src/_shared/hooks/useUtils.ts +0 -20
- package/src/_shared/hooks/useViews.tsx +0 -31
- package/src/_shared/icons/ArrowLeftIcon.tsx +0 -11
- package/src/_shared/icons/ArrowRightIcon.tsx +0 -11
- package/src/_shared/icons/DateRangeIcon.tsx +0 -11
- package/src/_shared/icons/KeyboardIcon.tsx +0 -11
- package/src/_shared/icons/TimeIcon.tsx +0 -12
- package/src/constants/ClockType.ts +0 -11
- package/src/constants/dimensions.ts +0 -5
- package/src/constants/prop-types.ts +0 -37
- package/src/index.ts +0 -48
- package/src/typings/BasePicker.tsx +0 -60
- package/src/typings/date.ts +0 -3
- package/src/typings/extendMui.ts +0 -10
- package/src/typings/overrides.ts +0 -44
- package/src/views/Calendar/Calendar.tsx +0 -361
- package/src/views/Calendar/CalendarHeader.tsx +0 -141
- package/src/views/Calendar/Day.tsx +0 -97
- package/src/views/Calendar/DayWrapper.tsx +0 -33
- package/src/views/Calendar/SlideTransition.tsx +0 -100
- package/src/views/Clock/Clock.tsx +0 -172
- package/src/views/Clock/ClockNumber.tsx +0 -91
- package/src/views/Clock/ClockNumbers.tsx +0 -76
- package/src/views/Clock/ClockPointer.tsx +0 -104
- package/src/views/Clock/ClockView.tsx +0 -105
- package/src/views/Month/Month.tsx +0 -76
- package/src/views/Month/MonthView.tsx +0 -94
- package/src/views/Year/Year.tsx +0 -77
- package/src/views/Year/YearView.tsx +0 -91
- package/src/wrappers/InlineWrapper.tsx +0 -80
- package/src/wrappers/ModalWrapper.tsx +0 -113
- package/src/wrappers/StaticWrapper.tsx +0 -22
- package/src/wrappers/Wrapper.tsx +0 -75
- package/tsconfig.json +0 -21
- package/typings.d.ts +0 -6
- /package/{build/DatePicker → DatePicker}/DatePicker.d.ts +0 -0
- /package/{build/DatePicker → DatePicker}/DatePicker.js +0 -0
- /package/{build/DatePicker → DatePicker}/DatePickerToolbar.d.ts +0 -0
- /package/{build/DatePicker → DatePicker}/index.d.ts +0 -0
- /package/{build/DatePicker → DatePicker}/index.js +0 -0
- /package/{build/DateTimePicker → DateTimePicker}/DateTimePickerTabs.d.ts +0 -0
- /package/{build/DateTimePicker → DateTimePicker}/DateTimePickerTabs.js +0 -0
- /package/{build/DateTimePicker → DateTimePicker}/DateTimePickerToolbar.d.ts +0 -0
- /package/{build/DateTimePicker → DateTimePicker}/index.d.ts +0 -0
- /package/{build/DateTimePicker → DateTimePicker}/index.js +0 -0
- /package/{build/MuiPickersUtilsProvider.js → MuiPickersUtilsProvider.js} +0 -0
- /package/{build/Picker → Picker}/WrappedKeyboardPicker.d.ts +0 -0
- /package/{build/Picker → Picker}/WrappedKeyboardPicker.js +0 -0
- /package/{build/Picker → Picker}/WrappedPurePicker.d.ts +0 -0
- /package/{build/README.md → README.md} +0 -0
- /package/{build/Rifm → Rifm}/Rifm.d.ts +0 -0
- /package/{build/Rifm → Rifm}/Rifm.js +0 -0
- /package/{build/TimePicker → TimePicker}/TimePickerToolbar.d.ts +0 -0
- /package/{build/TimePicker → TimePicker}/index.d.ts +0 -0
- /package/{build/TimePicker → TimePicker}/index.js +0 -0
- /package/{build/_helpers → _helpers}/time-utils.js +0 -0
- /package/{build/_helpers → _helpers}/utils.d.ts +0 -0
- /package/{build/_helpers → _helpers}/utils.js +0 -0
- /package/{build/_shared → _shared}/KeyboardDateInput.d.ts +0 -0
- /package/{build/_shared → _shared}/KeyboardDateInput.js +0 -0
- /package/{build/_shared → _shared}/ModalDialog.d.ts +0 -0
- /package/{build/_shared → _shared}/ModalDialog.js +0 -0
- /package/{build/_shared → _shared}/PickerToolbar.d.ts +0 -0
- /package/{build/_shared → _shared}/PickerToolbar.js +0 -0
- /package/{build/_shared → _shared}/PureDateInput.d.ts +0 -0
- /package/{build/_shared → _shared}/PureDateInput.js +0 -0
- /package/{build/_shared → _shared}/ToolbarButton.d.ts +0 -0
- /package/{build/_shared → _shared}/ToolbarButton.js +0 -0
- /package/{build/_shared → _shared}/ToolbarText.d.ts +0 -0
- /package/{build/_shared → _shared}/ToolbarText.js +0 -0
- /package/{build/_shared → _shared}/WithUtils.js +0 -0
- /package/{build/_shared → _shared}/hooks/useIsLandscape.d.ts +0 -0
- /package/{build/_shared → _shared}/hooks/useIsLandscape.js +0 -0
- /package/{build/_shared → _shared}/hooks/useKeyDown.d.ts +0 -0
- /package/{build/_shared → _shared}/hooks/useKeyDown.js +0 -0
- /package/{build/_shared → _shared}/hooks/useKeyboardPickerState.d.ts +0 -0
- /package/{build/_shared → _shared}/hooks/useOpenState.d.ts +0 -0
- /package/{build/_shared → _shared}/hooks/useOpenState.js +0 -0
- /package/{build/_shared → _shared}/hooks/usePickerState.d.ts +0 -0
- /package/{build/_shared → _shared}/hooks/usePickerState.js +0 -0
- /package/{build/_shared → _shared}/hooks/useUtils.js +0 -0
- /package/{build/_shared → _shared}/hooks/useViews.d.ts +0 -0
- /package/{build/_shared → _shared}/hooks/useViews.js +0 -0
- /package/{build/_shared → _shared}/icons/ArrowLeftIcon.d.ts +0 -0
- /package/{build/_shared → _shared}/icons/ArrowLeftIcon.js +0 -0
- /package/{build/_shared → _shared}/icons/ArrowRightIcon.d.ts +0 -0
- /package/{build/_shared → _shared}/icons/ArrowRightIcon.js +0 -0
- /package/{build/_shared → _shared}/icons/DateRangeIcon.d.ts +0 -0
- /package/{build/_shared → _shared}/icons/DateRangeIcon.js +0 -0
- /package/{build/_shared → _shared}/icons/KeyboardIcon.d.ts +0 -0
- /package/{build/_shared → _shared}/icons/KeyboardIcon.js +0 -0
- /package/{build/_shared → _shared}/icons/TimeIcon.d.ts +0 -0
- /package/{build/_shared → _shared}/icons/TimeIcon.js +0 -0
- /package/{build/constants → constants}/ClockType.d.ts +0 -0
- /package/{build/constants → constants}/ClockType.js +0 -0
- /package/{build/constants → constants}/dimensions.d.ts +0 -0
- /package/{build/constants → constants}/dimensions.js +0 -0
- /package/{build/constants → constants}/prop-types.d.ts +0 -0
- /package/{build/constants → constants}/prop-types.js +0 -0
- /package/{build/index.js → index.js} +0 -0
- /package/{build/typings → typings}/BasePicker.js +0 -0
- /package/{build/typings → typings}/date.d.ts +0 -0
- /package/{build/typings → typings}/date.js +0 -0
- /package/{build/typings → typings}/extendMui.d.ts +0 -0
- /package/{build/typings → typings}/extendMui.js +0 -0
- /package/{build/typings → typings}/overrides.d.ts +0 -0
- /package/{build/typings → typings}/overrides.js +0 -0
- /package/{build/views → views}/Calendar/Calendar.d.ts +0 -0
- /package/{build/views → views}/Calendar/CalendarHeader.d.ts +0 -0
- /package/{build/views → views}/Calendar/Day.d.ts +0 -0
- /package/{build/views → views}/Calendar/Day.js +0 -0
- /package/{build/views → views}/Calendar/DayWrapper.d.ts +0 -0
- /package/{build/views → views}/Calendar/DayWrapper.js +0 -0
- /package/{build/views → views}/Calendar/SlideTransition.d.ts +0 -0
- /package/{build/views → views}/Calendar/SlideTransition.js +0 -0
- /package/{build/views → views}/Clock/Clock.d.ts +0 -0
- /package/{build/views → views}/Clock/ClockNumber.d.ts +0 -0
- /package/{build/views → views}/Clock/ClockNumber.js +0 -0
- /package/{build/views → views}/Clock/ClockNumbers.js +0 -0
- /package/{build/views → views}/Clock/ClockPointer.d.ts +0 -0
- /package/{build/views → views}/Clock/ClockPointer.js +0 -0
- /package/{build/views → views}/Clock/ClockView.d.ts +0 -0
- /package/{build/views → views}/Month/Month.d.ts +0 -0
- /package/{build/views → views}/Month/Month.js +0 -0
- /package/{build/views → views}/Month/MonthView.d.ts +0 -0
- /package/{build/views → views}/Year/Year.d.ts +0 -0
- /package/{build/views → views}/Year/Year.js +0 -0
- /package/{build/views → views}/Year/YearView.d.ts +0 -0
- /package/{build/wrappers → wrappers}/InlineWrapper.d.ts +0 -0
- /package/{build/wrappers → wrappers}/InlineWrapper.js +0 -0
- /package/{build/wrappers → wrappers}/ModalWrapper.d.ts +0 -0
- /package/{build/wrappers → wrappers}/ModalWrapper.js +0 -0
- /package/{build/wrappers → wrappers}/StaticWrapper.d.ts +0 -0
- /package/{build/wrappers → wrappers}/StaticWrapper.js +0 -0
- /package/{build/wrappers → wrappers}/Wrapper.d.ts +0 -0
- /package/{build/wrappers → wrappers}/Wrapper.js +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import ToolbarText from '../_shared/ToolbarText';
|
|
3
|
-
import PickerToolbar from '../_shared/PickerToolbar';
|
|
4
|
-
import ToolbarButton from '../_shared/ToolbarButton';
|
|
5
|
-
import DateTimePickerTabs from './DateTimePickerTabs';
|
|
6
|
-
import { Grid } from '@material-ui/core';
|
|
7
|
-
import { useUtils } from '../_shared/hooks/useUtils';
|
|
8
|
-
import { DateTimePickerView } from './DateTimePicker';
|
|
9
|
-
import { ToolbarComponentProps } from '../Picker/Picker';
|
|
10
|
-
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
11
|
-
import { useMeridiemMode } from '../TimePicker/TimePickerToolbar';
|
|
12
|
-
|
|
13
|
-
export const useStyles = makeStyles(
|
|
14
|
-
_ => ({
|
|
15
|
-
toolbar: {
|
|
16
|
-
paddingLeft: 16,
|
|
17
|
-
paddingRight: 16,
|
|
18
|
-
justifyContent: 'space-around',
|
|
19
|
-
},
|
|
20
|
-
separator: {
|
|
21
|
-
margin: '0 4px 0 2px',
|
|
22
|
-
cursor: 'default',
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
{ name: 'MuiPickerDTToolbar' }
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export const DateTimePickerToolbar: React.FC<ToolbarComponentProps> = ({
|
|
29
|
-
date,
|
|
30
|
-
openView,
|
|
31
|
-
setOpenView,
|
|
32
|
-
ampm,
|
|
33
|
-
hideTabs,
|
|
34
|
-
dateRangeIcon,
|
|
35
|
-
timeIcon,
|
|
36
|
-
onChange,
|
|
37
|
-
}) => {
|
|
38
|
-
const utils = useUtils();
|
|
39
|
-
const classes = useStyles();
|
|
40
|
-
const showTabs = !hideTabs && typeof window !== 'undefined' && window.innerHeight > 667;
|
|
41
|
-
const { meridiemMode, handleMeridiemChange } = useMeridiemMode(date, ampm, onChange);
|
|
42
|
-
const theme = useTheme();
|
|
43
|
-
const rtl = theme.direction === 'rtl';
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<>
|
|
47
|
-
<PickerToolbar isLandscape={false} className={classes.toolbar}>
|
|
48
|
-
<Grid container justify="center" wrap="nowrap">
|
|
49
|
-
<Grid item container xs={5} justify="flex-start" direction="column">
|
|
50
|
-
<div>
|
|
51
|
-
<ToolbarButton
|
|
52
|
-
variant="subtitle1"
|
|
53
|
-
onClick={() => setOpenView('year')}
|
|
54
|
-
selected={openView === 'year'}
|
|
55
|
-
label={utils.getYearText(date)}
|
|
56
|
-
/>
|
|
57
|
-
</div>
|
|
58
|
-
<div>
|
|
59
|
-
<ToolbarButton
|
|
60
|
-
variant="h4"
|
|
61
|
-
onClick={() => setOpenView('date')}
|
|
62
|
-
selected={openView === 'date'}
|
|
63
|
-
label={utils.getDateTimePickerHeaderText(date)}
|
|
64
|
-
/>
|
|
65
|
-
</div>
|
|
66
|
-
</Grid>
|
|
67
|
-
|
|
68
|
-
<Grid
|
|
69
|
-
item
|
|
70
|
-
container
|
|
71
|
-
xs={6}
|
|
72
|
-
justify="center"
|
|
73
|
-
alignItems="flex-end"
|
|
74
|
-
direction={rtl ? 'row-reverse' : 'row'}
|
|
75
|
-
>
|
|
76
|
-
<ToolbarButton
|
|
77
|
-
variant="h3"
|
|
78
|
-
onClick={() => setOpenView('hours')}
|
|
79
|
-
selected={openView === 'hours'}
|
|
80
|
-
label={utils.getHourText(date, ampm!)}
|
|
81
|
-
/>
|
|
82
|
-
|
|
83
|
-
<ToolbarText variant="h3" label=":" className={classes.separator} />
|
|
84
|
-
|
|
85
|
-
<ToolbarButton
|
|
86
|
-
variant="h3"
|
|
87
|
-
onClick={() => setOpenView('minutes')}
|
|
88
|
-
selected={openView === 'minutes'}
|
|
89
|
-
label={utils.getMinuteText(date)}
|
|
90
|
-
/>
|
|
91
|
-
</Grid>
|
|
92
|
-
|
|
93
|
-
{ampm && (
|
|
94
|
-
<Grid item container xs={1} direction="column" justify="flex-end">
|
|
95
|
-
<ToolbarButton
|
|
96
|
-
variant="subtitle1"
|
|
97
|
-
selected={meridiemMode === 'am'}
|
|
98
|
-
label={utils.getMeridiemText('am')}
|
|
99
|
-
onClick={() => handleMeridiemChange('am')}
|
|
100
|
-
/>
|
|
101
|
-
|
|
102
|
-
<ToolbarButton
|
|
103
|
-
variant="subtitle1"
|
|
104
|
-
selected={meridiemMode === 'pm'}
|
|
105
|
-
label={utils.getMeridiemText('pm')}
|
|
106
|
-
onClick={() => handleMeridiemChange('pm')}
|
|
107
|
-
/>
|
|
108
|
-
</Grid>
|
|
109
|
-
)}
|
|
110
|
-
</Grid>
|
|
111
|
-
</PickerToolbar>
|
|
112
|
-
|
|
113
|
-
{showTabs && (
|
|
114
|
-
<DateTimePickerTabs
|
|
115
|
-
dateRangeIcon={dateRangeIcon}
|
|
116
|
-
timeIcon={timeIcon}
|
|
117
|
-
view={openView as DateTimePickerView}
|
|
118
|
-
onChange={setOpenView}
|
|
119
|
-
/>
|
|
120
|
-
)}
|
|
121
|
-
</>
|
|
122
|
-
);
|
|
123
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DateTimePickerProps, KeyboardDateTimePickerProps } from './DateTimePicker';
|
|
2
|
-
|
|
3
|
-
export type DateTimePickerProps = DateTimePickerProps;
|
|
4
|
-
|
|
5
|
-
export type KeyboardDateTimePickerProps = KeyboardDateTimePickerProps;
|
|
6
|
-
|
|
7
|
-
export { KeyboardDateTimePicker, DateTimePicker } from './DateTimePicker';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { IUtils } from '@date-io/core/IUtils';
|
|
4
|
-
import { MaterialUiPickersDate } from './typings/date';
|
|
5
|
-
|
|
6
|
-
export const MuiPickersContext = React.createContext<IUtils<MaterialUiPickersDate> | null>(null);
|
|
7
|
-
|
|
8
|
-
export interface MuiPickersUtilsProviderProps {
|
|
9
|
-
utils: any;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
locale?: any;
|
|
12
|
-
libInstance?: any;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const MuiPickersUtilsProvider: React.FC<MuiPickersUtilsProviderProps> = ({
|
|
16
|
-
utils: Utils,
|
|
17
|
-
children,
|
|
18
|
-
locale,
|
|
19
|
-
libInstance,
|
|
20
|
-
}) => {
|
|
21
|
-
const utils = React.useMemo(() => new Utils({ locale, moment: libInstance }), [
|
|
22
|
-
Utils,
|
|
23
|
-
libInstance,
|
|
24
|
-
locale,
|
|
25
|
-
]);
|
|
26
|
-
|
|
27
|
-
return <MuiPickersContext.Provider value={utils} children={children} />;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
MuiPickersUtilsProvider.propTypes = {
|
|
31
|
-
utils: PropTypes.func.isRequired,
|
|
32
|
-
locale: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
33
|
-
children: PropTypes.oneOfType([
|
|
34
|
-
PropTypes.element.isRequired,
|
|
35
|
-
PropTypes.arrayOf(PropTypes.element.isRequired),
|
|
36
|
-
]).isRequired,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default MuiPickersUtilsProvider;
|
package/src/Picker/Picker.tsx
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import Calendar from '../views/Calendar/Calendar';
|
|
4
|
-
import { useUtils } from '../_shared/hooks/useUtils';
|
|
5
|
-
import { useViews } from '../_shared/hooks/useViews';
|
|
6
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
7
|
-
import { YearSelection } from '../views/Year/YearView';
|
|
8
|
-
import { MaterialUiPickersDate } from '../typings/date';
|
|
9
|
-
import { BasePickerProps } from '../typings/BasePicker';
|
|
10
|
-
import { TimePickerView } from '../views/Clock/ClockView';
|
|
11
|
-
import { MonthSelection } from '../views/Month/MonthView';
|
|
12
|
-
import { BaseTimePickerProps } from '../TimePicker/TimePicker';
|
|
13
|
-
import { BaseDatePickerProps } from '../DatePicker/DatePicker';
|
|
14
|
-
import { useIsLandscape } from '../_shared/hooks/useIsLandscape';
|
|
15
|
-
import { datePickerDefaultProps } from '../constants/prop-types';
|
|
16
|
-
import { DIALOG_WIDTH_WIDER, DIALOG_WIDTH, VIEW_HEIGHT } from '../constants/dimensions';
|
|
17
|
-
import { DialogActions, Button } from '@material-ui/core';
|
|
18
|
-
|
|
19
|
-
const viewsMap = {
|
|
20
|
-
year: YearSelection,
|
|
21
|
-
month: MonthSelection,
|
|
22
|
-
date: Calendar,
|
|
23
|
-
hours: TimePickerView,
|
|
24
|
-
minutes: TimePickerView,
|
|
25
|
-
seconds: TimePickerView,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type PickerView = keyof typeof viewsMap;
|
|
29
|
-
|
|
30
|
-
export type ToolbarComponentProps = BaseDatePickerProps &
|
|
31
|
-
BaseTimePickerProps & {
|
|
32
|
-
views: PickerView[];
|
|
33
|
-
openView: PickerView;
|
|
34
|
-
date: MaterialUiPickersDate;
|
|
35
|
-
setOpenView: (view: PickerView) => void;
|
|
36
|
-
onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;
|
|
37
|
-
// TODO move out, cause it is DateTimePickerOnly
|
|
38
|
-
hideTabs?: boolean;
|
|
39
|
-
dateRangeIcon?: React.ReactNode;
|
|
40
|
-
timeIcon?: React.ReactNode;
|
|
41
|
-
isLandscape: boolean;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export interface PickerViewProps extends BaseDatePickerProps, BaseTimePickerProps {
|
|
45
|
-
views: PickerView[];
|
|
46
|
-
openTo: PickerView;
|
|
47
|
-
disableToolbar?: boolean;
|
|
48
|
-
ToolbarComponent: React.ComponentType<ToolbarComponentProps>;
|
|
49
|
-
// TODO move out, cause it is DateTimePickerOnly
|
|
50
|
-
hideTabs?: boolean;
|
|
51
|
-
dateRangeIcon?: React.ReactNode;
|
|
52
|
-
timeIcon?: React.ReactNode;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
interface PickerProps extends PickerViewProps {
|
|
56
|
-
date: MaterialUiPickersDate;
|
|
57
|
-
orientation?: BasePickerProps['orientation'];
|
|
58
|
-
onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;
|
|
59
|
-
showActionsBar?: boolean;
|
|
60
|
-
showTodayButton?: boolean;
|
|
61
|
-
todayLabel?: string;
|
|
62
|
-
showShiftButtons?: boolean;
|
|
63
|
-
setShiftFunction?: (days: number) => Date;
|
|
64
|
-
shiftButtonValues?: Object;
|
|
65
|
-
onSetToday?: () => void;
|
|
66
|
-
onSetShift?: (shiftDate: Date) => void;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const useStyles = makeStyles(
|
|
70
|
-
{
|
|
71
|
-
container: {
|
|
72
|
-
display: 'flex',
|
|
73
|
-
flexDirection: 'column',
|
|
74
|
-
},
|
|
75
|
-
containerLandscape: {
|
|
76
|
-
flexDirection: 'row',
|
|
77
|
-
},
|
|
78
|
-
pickerView: {
|
|
79
|
-
overflowX: 'hidden',
|
|
80
|
-
minHeight: VIEW_HEIGHT,
|
|
81
|
-
minWidth: DIALOG_WIDTH,
|
|
82
|
-
maxWidth: DIALOG_WIDTH_WIDER,
|
|
83
|
-
display: 'flex',
|
|
84
|
-
flexDirection: 'column',
|
|
85
|
-
justifyContent: 'center',
|
|
86
|
-
},
|
|
87
|
-
pickerViewLandscape: {
|
|
88
|
-
padding: '0 8px',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
{ name: 'MuiPickersBasePicker' }
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const useButtonsStyles = makeStyles(
|
|
95
|
-
{
|
|
96
|
-
root: {
|
|
97
|
-
minWidth: 32,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{ name: 'MuiButtonBase' }
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
export const useDialogActionsStyles = makeStyles({
|
|
104
|
-
withAdditionalAction: {},
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
export const Picker: React.FunctionComponent<PickerProps> = props => {
|
|
108
|
-
const {
|
|
109
|
-
date,
|
|
110
|
-
ampm,
|
|
111
|
-
views,
|
|
112
|
-
disableToolbar,
|
|
113
|
-
disablePast,
|
|
114
|
-
disableFuture,
|
|
115
|
-
hideTabs,
|
|
116
|
-
onChange,
|
|
117
|
-
openTo,
|
|
118
|
-
minutesStep,
|
|
119
|
-
dateRangeIcon,
|
|
120
|
-
timeIcon,
|
|
121
|
-
minDate: unparsedMinDate,
|
|
122
|
-
maxDate: unparsedMaxDate,
|
|
123
|
-
animateYearScrolling,
|
|
124
|
-
leftArrowIcon,
|
|
125
|
-
rightArrowIcon,
|
|
126
|
-
renderDay,
|
|
127
|
-
shouldDisableDate,
|
|
128
|
-
allowKeyboardControl,
|
|
129
|
-
onMonthChange,
|
|
130
|
-
onYearChange,
|
|
131
|
-
leftArrowButtonProps,
|
|
132
|
-
rightArrowButtonProps,
|
|
133
|
-
ToolbarComponent,
|
|
134
|
-
loadingIndicator,
|
|
135
|
-
orientation,
|
|
136
|
-
showActionsBar,
|
|
137
|
-
onSetToday,
|
|
138
|
-
showTodayButton,
|
|
139
|
-
todayLabel,
|
|
140
|
-
onSetShift,
|
|
141
|
-
showShiftButtons,
|
|
142
|
-
setShiftFunction,
|
|
143
|
-
shiftButtonValues,
|
|
144
|
-
} = props;
|
|
145
|
-
|
|
146
|
-
const utils = useUtils();
|
|
147
|
-
const classes = useStyles();
|
|
148
|
-
const buttonClasses = useButtonsStyles();
|
|
149
|
-
const dialogActionsClasses = useDialogActionsStyles();
|
|
150
|
-
const isLandscape = useIsLandscape(orientation);
|
|
151
|
-
const { openView, setOpenView, handleChangeAndOpenNext } = useViews(views, openTo, onChange);
|
|
152
|
-
|
|
153
|
-
const minDate = React.useMemo(() => utils.date(unparsedMinDate)!, [unparsedMinDate, utils]);
|
|
154
|
-
const maxDate = React.useMemo(() => utils.date(unparsedMaxDate)!, [unparsedMaxDate, utils]);
|
|
155
|
-
|
|
156
|
-
let shiftButtons = new Array();
|
|
157
|
-
if (showShiftButtons && setShiftFunction && onSetShift && shiftButtonValues) {
|
|
158
|
-
for (let key in shiftButtonValues) {
|
|
159
|
-
shiftButtons.push(
|
|
160
|
-
<Button
|
|
161
|
-
color="primary"
|
|
162
|
-
onClick={() => onSetShift(setShiftFunction(parseInt(key)))}
|
|
163
|
-
key={shiftButtonValues[key]}
|
|
164
|
-
>
|
|
165
|
-
{parseInt(key) > 0 ? '+' : ''}
|
|
166
|
-
{shiftButtonValues[key]}
|
|
167
|
-
</Button>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return (
|
|
173
|
-
<div
|
|
174
|
-
className={clsx(classes.container, {
|
|
175
|
-
[classes.containerLandscape]: isLandscape,
|
|
176
|
-
})}
|
|
177
|
-
>
|
|
178
|
-
{!disableToolbar && (
|
|
179
|
-
<ToolbarComponent
|
|
180
|
-
date={date}
|
|
181
|
-
onChange={onChange}
|
|
182
|
-
setOpenView={setOpenView}
|
|
183
|
-
openView={openView}
|
|
184
|
-
hideTabs={hideTabs}
|
|
185
|
-
dateRangeIcon={dateRangeIcon}
|
|
186
|
-
timeIcon={timeIcon}
|
|
187
|
-
isLandscape={isLandscape}
|
|
188
|
-
{...props}
|
|
189
|
-
/>
|
|
190
|
-
)}
|
|
191
|
-
|
|
192
|
-
<div className={clsx(classes.pickerView, { [classes.pickerViewLandscape]: isLandscape })}>
|
|
193
|
-
{openView === 'year' && (
|
|
194
|
-
<YearSelection
|
|
195
|
-
date={date}
|
|
196
|
-
onChange={handleChangeAndOpenNext}
|
|
197
|
-
minDate={minDate}
|
|
198
|
-
maxDate={maxDate}
|
|
199
|
-
disablePast={disablePast}
|
|
200
|
-
disableFuture={disableFuture}
|
|
201
|
-
onYearChange={onYearChange}
|
|
202
|
-
animateYearScrolling={animateYearScrolling}
|
|
203
|
-
/>
|
|
204
|
-
)}
|
|
205
|
-
|
|
206
|
-
{openView === 'month' && (
|
|
207
|
-
<MonthSelection
|
|
208
|
-
date={date}
|
|
209
|
-
onChange={handleChangeAndOpenNext}
|
|
210
|
-
minDate={minDate}
|
|
211
|
-
maxDate={maxDate}
|
|
212
|
-
disablePast={disablePast}
|
|
213
|
-
disableFuture={disableFuture}
|
|
214
|
-
onMonthChange={onMonthChange}
|
|
215
|
-
/>
|
|
216
|
-
)}
|
|
217
|
-
|
|
218
|
-
{openView === 'date' && (
|
|
219
|
-
<Calendar
|
|
220
|
-
date={date}
|
|
221
|
-
onChange={handleChangeAndOpenNext}
|
|
222
|
-
onMonthChange={onMonthChange}
|
|
223
|
-
disablePast={disablePast}
|
|
224
|
-
disableFuture={disableFuture}
|
|
225
|
-
minDate={minDate}
|
|
226
|
-
maxDate={maxDate}
|
|
227
|
-
leftArrowIcon={leftArrowIcon}
|
|
228
|
-
leftArrowButtonProps={leftArrowButtonProps}
|
|
229
|
-
rightArrowIcon={rightArrowIcon}
|
|
230
|
-
rightArrowButtonProps={rightArrowButtonProps}
|
|
231
|
-
renderDay={renderDay}
|
|
232
|
-
shouldDisableDate={shouldDisableDate}
|
|
233
|
-
allowKeyboardControl={allowKeyboardControl}
|
|
234
|
-
loadingIndicator={loadingIndicator}
|
|
235
|
-
/>
|
|
236
|
-
)}
|
|
237
|
-
|
|
238
|
-
{(openView === 'hours' || openView === 'minutes' || openView === 'seconds') && (
|
|
239
|
-
<TimePickerView
|
|
240
|
-
date={date}
|
|
241
|
-
ampm={ampm}
|
|
242
|
-
type={openView}
|
|
243
|
-
minutesStep={minutesStep}
|
|
244
|
-
onHourChange={handleChangeAndOpenNext}
|
|
245
|
-
onMinutesChange={handleChangeAndOpenNext}
|
|
246
|
-
onSecondsChange={handleChangeAndOpenNext}
|
|
247
|
-
/>
|
|
248
|
-
)}
|
|
249
|
-
</div>
|
|
250
|
-
|
|
251
|
-
{showActionsBar && (
|
|
252
|
-
<DialogActions
|
|
253
|
-
classes={{
|
|
254
|
-
root: clsx({
|
|
255
|
-
[dialogActionsClasses.withAdditionalAction]: showTodayButton,
|
|
256
|
-
}),
|
|
257
|
-
}}
|
|
258
|
-
>
|
|
259
|
-
{showTodayButton && (
|
|
260
|
-
<Button color="primary" onClick={onSetToday} key="today">
|
|
261
|
-
{todayLabel}
|
|
262
|
-
</Button>
|
|
263
|
-
)}
|
|
264
|
-
|
|
265
|
-
{showShiftButtons && setShiftFunction && shiftButtons}
|
|
266
|
-
</DialogActions>
|
|
267
|
-
)}
|
|
268
|
-
</div>
|
|
269
|
-
);
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
Picker.defaultProps = {
|
|
273
|
-
...datePickerDefaultProps,
|
|
274
|
-
views: Object.keys(viewsMap),
|
|
275
|
-
} as any;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import KeyboardDateInput, { KeyboardDateInputProps } from '../_shared/KeyboardDateInput';
|
|
3
|
-
import { Picker, ToolbarComponentProps } from './Picker';
|
|
4
|
-
import { ExtendWrapper, Wrapper } from '../wrappers/Wrapper';
|
|
5
|
-
import { StateHookOptions } from '../_shared/hooks/usePickerState';
|
|
6
|
-
import { DateValidationProps } from '../_helpers/text-field-helper';
|
|
7
|
-
import {
|
|
8
|
-
BaseKeyboardPickerProps,
|
|
9
|
-
useKeyboardPickerState,
|
|
10
|
-
} from '../_shared/hooks/useKeyboardPickerState';
|
|
11
|
-
|
|
12
|
-
export type WrappedKeyboardPickerProps = DateValidationProps &
|
|
13
|
-
BaseKeyboardPickerProps &
|
|
14
|
-
ExtendWrapper<KeyboardDateInputProps>;
|
|
15
|
-
|
|
16
|
-
export interface MakePickerOptions<T> {
|
|
17
|
-
useOptions: (props: any) => StateHookOptions;
|
|
18
|
-
getCustomProps?: (props: T) => Partial<T>;
|
|
19
|
-
DefaultToolbarComponent: React.ComponentType<ToolbarComponentProps>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Mostly duplicate of ./WrappedPurePicker.tsx to enable tree-shaking of keyboard logic
|
|
23
|
-
// TODO investigate how to reduce duplications
|
|
24
|
-
export function makeKeyboardPicker<T extends any>({
|
|
25
|
-
useOptions,
|
|
26
|
-
getCustomProps,
|
|
27
|
-
DefaultToolbarComponent,
|
|
28
|
-
}: MakePickerOptions<WrappedKeyboardPickerProps & T>): React.FC<WrappedKeyboardPickerProps & T> {
|
|
29
|
-
function WrappedKeyboardPicker(props: WrappedKeyboardPickerProps & T) {
|
|
30
|
-
const {
|
|
31
|
-
allowKeyboardControl,
|
|
32
|
-
ampm,
|
|
33
|
-
hideTabs,
|
|
34
|
-
animateYearScrolling,
|
|
35
|
-
autoOk,
|
|
36
|
-
disableFuture,
|
|
37
|
-
disablePast,
|
|
38
|
-
format,
|
|
39
|
-
forwardedRef,
|
|
40
|
-
initialFocusedDate,
|
|
41
|
-
invalidDateMessage,
|
|
42
|
-
labelFunc,
|
|
43
|
-
leftArrowIcon,
|
|
44
|
-
leftArrowButtonProps,
|
|
45
|
-
maxDate,
|
|
46
|
-
maxDateMessage,
|
|
47
|
-
minDate,
|
|
48
|
-
onOpen,
|
|
49
|
-
onClose,
|
|
50
|
-
minDateMessage,
|
|
51
|
-
strictCompareDates,
|
|
52
|
-
minutesStep,
|
|
53
|
-
onAccept,
|
|
54
|
-
onChange,
|
|
55
|
-
onMonthChange,
|
|
56
|
-
onYearChange,
|
|
57
|
-
renderDay,
|
|
58
|
-
views,
|
|
59
|
-
openTo,
|
|
60
|
-
rightArrowIcon,
|
|
61
|
-
rightArrowButtonProps,
|
|
62
|
-
shouldDisableDate,
|
|
63
|
-
value,
|
|
64
|
-
dateRangeIcon,
|
|
65
|
-
emptyLabel,
|
|
66
|
-
invalidLabel,
|
|
67
|
-
timeIcon,
|
|
68
|
-
orientation,
|
|
69
|
-
variant,
|
|
70
|
-
disableToolbar,
|
|
71
|
-
loadingIndicator,
|
|
72
|
-
showActionsBar,
|
|
73
|
-
showTodayButton,
|
|
74
|
-
todayLabel,
|
|
75
|
-
ToolbarComponent = DefaultToolbarComponent,
|
|
76
|
-
showShiftButtons,
|
|
77
|
-
setShiftFunction,
|
|
78
|
-
shiftButtonValues,
|
|
79
|
-
...other
|
|
80
|
-
} = props;
|
|
81
|
-
|
|
82
|
-
const injectedProps = getCustomProps ? getCustomProps(props) : {};
|
|
83
|
-
|
|
84
|
-
const options = useOptions(props);
|
|
85
|
-
const { pickerProps, inputProps, wrapperProps } = useKeyboardPickerState(props, options);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<Wrapper
|
|
89
|
-
variant={variant}
|
|
90
|
-
InputComponent={KeyboardDateInput}
|
|
91
|
-
DateInputProps={inputProps}
|
|
92
|
-
{...injectedProps}
|
|
93
|
-
{...wrapperProps}
|
|
94
|
-
{...other}
|
|
95
|
-
>
|
|
96
|
-
<Picker
|
|
97
|
-
{...pickerProps}
|
|
98
|
-
ToolbarComponent={ToolbarComponent}
|
|
99
|
-
disableToolbar={disableToolbar}
|
|
100
|
-
hideTabs={hideTabs}
|
|
101
|
-
orientation={orientation}
|
|
102
|
-
showActionsBar={showActionsBar}
|
|
103
|
-
showTodayButton={showTodayButton}
|
|
104
|
-
todayLabel={todayLabel}
|
|
105
|
-
ampm={ampm}
|
|
106
|
-
views={views}
|
|
107
|
-
openTo={openTo}
|
|
108
|
-
allowKeyboardControl={allowKeyboardControl}
|
|
109
|
-
minutesStep={minutesStep}
|
|
110
|
-
animateYearScrolling={animateYearScrolling}
|
|
111
|
-
disableFuture={disableFuture}
|
|
112
|
-
disablePast={disablePast}
|
|
113
|
-
leftArrowIcon={leftArrowIcon}
|
|
114
|
-
leftArrowButtonProps={leftArrowButtonProps}
|
|
115
|
-
maxDate={maxDate}
|
|
116
|
-
minDate={minDate}
|
|
117
|
-
strictCompareDates={strictCompareDates}
|
|
118
|
-
onMonthChange={onMonthChange}
|
|
119
|
-
onYearChange={onYearChange}
|
|
120
|
-
renderDay={renderDay}
|
|
121
|
-
dateRangeIcon={dateRangeIcon}
|
|
122
|
-
timeIcon={timeIcon}
|
|
123
|
-
rightArrowIcon={rightArrowIcon}
|
|
124
|
-
rightArrowButtonProps={rightArrowButtonProps}
|
|
125
|
-
shouldDisableDate={shouldDisableDate}
|
|
126
|
-
loadingIndicator={loadingIndicator}
|
|
127
|
-
showShiftButtons={showShiftButtons}
|
|
128
|
-
setShiftFunction={setShiftFunction}
|
|
129
|
-
shiftButtonValues={shiftButtonValues}
|
|
130
|
-
/>
|
|
131
|
-
</Wrapper>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return WrappedKeyboardPicker;
|
|
136
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Picker } from './Picker';
|
|
3
|
-
import { BasePickerProps } from '../typings/BasePicker';
|
|
4
|
-
import { MakePickerOptions } from './WrappedKeyboardPicker';
|
|
5
|
-
import { ExtendWrapper, Wrapper } from '../wrappers/Wrapper';
|
|
6
|
-
import { usePickerState } from '../_shared/hooks/usePickerState';
|
|
7
|
-
import { DateValidationProps } from '../_helpers/text-field-helper';
|
|
8
|
-
import { PureDateInput, PureDateInputProps } from '../_shared/PureDateInput';
|
|
9
|
-
|
|
10
|
-
export type WrappedPurePickerProps = DateValidationProps &
|
|
11
|
-
BasePickerProps &
|
|
12
|
-
ExtendWrapper<PureDateInputProps>;
|
|
13
|
-
|
|
14
|
-
export function makePurePicker<T extends any>({
|
|
15
|
-
useOptions,
|
|
16
|
-
getCustomProps,
|
|
17
|
-
DefaultToolbarComponent,
|
|
18
|
-
}: MakePickerOptions<WrappedPurePickerProps & T>): React.FC<WrappedPurePickerProps & T> {
|
|
19
|
-
function WrappedPurePicker(props: WrappedPurePickerProps & T) {
|
|
20
|
-
const {
|
|
21
|
-
allowKeyboardControl,
|
|
22
|
-
ampm,
|
|
23
|
-
hideTabs,
|
|
24
|
-
animateYearScrolling,
|
|
25
|
-
autoOk,
|
|
26
|
-
disableFuture,
|
|
27
|
-
disablePast,
|
|
28
|
-
format,
|
|
29
|
-
forwardedRef,
|
|
30
|
-
initialFocusedDate,
|
|
31
|
-
invalidDateMessage,
|
|
32
|
-
labelFunc,
|
|
33
|
-
leftArrowIcon,
|
|
34
|
-
leftArrowButtonProps,
|
|
35
|
-
maxDate,
|
|
36
|
-
maxDateMessage,
|
|
37
|
-
minDate,
|
|
38
|
-
onOpen,
|
|
39
|
-
onClose,
|
|
40
|
-
minDateMessage,
|
|
41
|
-
strictCompareDates,
|
|
42
|
-
minutesStep,
|
|
43
|
-
onAccept,
|
|
44
|
-
onChange,
|
|
45
|
-
onMonthChange,
|
|
46
|
-
onYearChange,
|
|
47
|
-
renderDay,
|
|
48
|
-
views,
|
|
49
|
-
openTo,
|
|
50
|
-
rightArrowIcon,
|
|
51
|
-
rightArrowButtonProps,
|
|
52
|
-
shouldDisableDate,
|
|
53
|
-
dateRangeIcon,
|
|
54
|
-
emptyLabel,
|
|
55
|
-
invalidLabel,
|
|
56
|
-
timeIcon,
|
|
57
|
-
value,
|
|
58
|
-
variant,
|
|
59
|
-
orientation,
|
|
60
|
-
disableToolbar,
|
|
61
|
-
loadingIndicator,
|
|
62
|
-
ToolbarComponent = DefaultToolbarComponent,
|
|
63
|
-
showActionsBar,
|
|
64
|
-
showTodayButton,
|
|
65
|
-
todayLabel,
|
|
66
|
-
showShiftButtons,
|
|
67
|
-
setShiftFunction,
|
|
68
|
-
shiftButtonValues,
|
|
69
|
-
...other
|
|
70
|
-
} = props;
|
|
71
|
-
|
|
72
|
-
const injectedProps = getCustomProps ? getCustomProps(props) : {};
|
|
73
|
-
|
|
74
|
-
const options = useOptions(props);
|
|
75
|
-
const { pickerProps, inputProps, wrapperProps } = usePickerState(props, options);
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<Wrapper
|
|
79
|
-
variant={variant}
|
|
80
|
-
InputComponent={PureDateInput}
|
|
81
|
-
DateInputProps={inputProps}
|
|
82
|
-
showTodayButton={showTodayButton}
|
|
83
|
-
todayLabel={todayLabel}
|
|
84
|
-
{...wrapperProps}
|
|
85
|
-
{...injectedProps}
|
|
86
|
-
{...other}
|
|
87
|
-
>
|
|
88
|
-
<Picker
|
|
89
|
-
{...pickerProps}
|
|
90
|
-
orientation={orientation}
|
|
91
|
-
disableToolbar={disableToolbar}
|
|
92
|
-
ToolbarComponent={ToolbarComponent}
|
|
93
|
-
hideTabs={hideTabs}
|
|
94
|
-
ampm={ampm}
|
|
95
|
-
views={views}
|
|
96
|
-
openTo={openTo}
|
|
97
|
-
allowKeyboardControl={allowKeyboardControl}
|
|
98
|
-
minutesStep={minutesStep}
|
|
99
|
-
animateYearScrolling={animateYearScrolling}
|
|
100
|
-
disableFuture={disableFuture}
|
|
101
|
-
disablePast={disablePast}
|
|
102
|
-
leftArrowIcon={leftArrowIcon}
|
|
103
|
-
leftArrowButtonProps={leftArrowButtonProps}
|
|
104
|
-
maxDate={maxDate}
|
|
105
|
-
minDate={minDate}
|
|
106
|
-
strictCompareDates={strictCompareDates}
|
|
107
|
-
onMonthChange={onMonthChange}
|
|
108
|
-
onYearChange={onYearChange}
|
|
109
|
-
renderDay={renderDay}
|
|
110
|
-
dateRangeIcon={dateRangeIcon}
|
|
111
|
-
timeIcon={timeIcon}
|
|
112
|
-
rightArrowIcon={rightArrowIcon}
|
|
113
|
-
rightArrowButtonProps={rightArrowButtonProps}
|
|
114
|
-
shouldDisableDate={shouldDisableDate}
|
|
115
|
-
loadingIndicator={loadingIndicator}
|
|
116
|
-
showActionsBar={showActionsBar}
|
|
117
|
-
showTodayButton={showTodayButton}
|
|
118
|
-
todayLabel={todayLabel}
|
|
119
|
-
showShiftButtons={showShiftButtons}
|
|
120
|
-
setShiftFunction={setShiftFunction}
|
|
121
|
-
shiftButtonValues={shiftButtonValues}
|
|
122
|
-
/>
|
|
123
|
-
</Wrapper>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return WrappedPurePicker;
|
|
128
|
-
}
|