@docsvision/material-ui-pickers 3.2.0-beta.25 → 3.2.0-beta.26
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/.size-snapshot.json +26 -0
- package/9db1cba1a61cb58db53f38425bbd1f95.7z +0 -0
- package/{DatePicker → build/DatePicker}/DatePicker.d.ts +2 -2
- package/{DatePicker → build/DatePicker}/DatePicker.js +1 -1
- package/{DateTimePicker → build/DateTimePicker}/DateTimePicker.js +1 -1
- package/{Picker → build/Picker}/Picker.js +1 -1
- package/{TimePicker → build/TimePicker}/TimePicker.js +1 -1
- package/{_helpers → build/_helpers}/text-field-helper.d.ts +1 -1
- package/{_shared → build/_shared}/KeyboardDateInput.js +1 -1
- package/{_shared → build/_shared}/ModalDialog.d.ts +2 -2
- package/{_shared → build/_shared}/PureDateInput.js +1 -1
- package/{_shared → build/_shared}/ToolbarButton.d.ts +2 -2
- package/{_shared → build/_shared}/hooks/useKeyboardPickerState.js +2 -2
- package/{constants → build/constants}/prop-types.js +2 -2
- package/{dist → build/dist}/material-ui-pickers.esm.js +12 -12
- package/build/dist/material-ui-pickers.esm.js.map +1 -0
- package/{dist → build/dist}/material-ui-pickers.js +62 -62
- package/build/dist/material-ui-pickers.js.map +1 -0
- package/{dist → build/dist}/material-ui-pickers.umd.js +5790 -4511
- package/build/dist/material-ui-pickers.umd.min.js +1 -0
- package/build/package.json +62 -0
- package/{views → build/views}/Calendar/Calendar.js +2 -2
- package/{views → build/views}/Clock/Clock.d.ts +1 -1
- package/{views → build/views}/Clock/ClockPointer.d.ts +1 -1
- package/copy.js +58 -0
- package/package.json +135 -62
- package/remove-prop-types.js +37 -0
- package/rollup.config.js +145 -0
- package/src/DatePicker/DatePicker.tsx +91 -0
- package/src/DatePicker/DatePickerToolbar.tsx +75 -0
- package/src/DatePicker/index.ts +7 -0
- package/src/DateTimePicker/DateTimePicker.tsx +72 -0
- package/src/DateTimePicker/DateTimePickerTabs.tsx +86 -0
- package/src/DateTimePicker/DateTimePickerToolbar.tsx +123 -0
- package/src/DateTimePicker/index.ts +7 -0
- package/src/MuiPickersUtilsProvider.tsx +39 -0
- package/src/Picker/Picker.tsx +275 -0
- package/src/Picker/WrappedKeyboardPicker.tsx +136 -0
- package/src/Picker/WrappedPurePicker.tsx +128 -0
- package/src/Rifm/Rifm.ts +213 -0
- package/src/TimePicker/TimePicker.tsx +67 -0
- package/src/TimePicker/TimePickerToolbar.tsx +180 -0
- package/src/TimePicker/index.tsx +7 -0
- package/src/__tests__/DatePicker/Calendar.test.tsx +51 -0
- package/src/__tests__/DatePicker/Month.test.tsx +36 -0
- package/src/__tests__/DatePicker/MonthSelection.test.tsx +37 -0
- package/src/__tests__/MuiPickersUtilsProvider.test.tsx +21 -0
- package/src/__tests__/TimePicker/Clock.test.tsx +68 -0
- package/src/__tests__/_helpers/date-utils.test.tsx +197 -0
- package/src/__tests__/_helpers/text-field-helper.test.tsx +34 -0
- package/src/__tests__/_shared/ModalDialog.test.tsx +109 -0
- package/src/__tests__/e2e/DatePicker.test.tsx +233 -0
- package/src/__tests__/e2e/DatePickerProps.test.tsx +18 -0
- package/src/__tests__/e2e/DatePickerRoot.test.tsx +154 -0
- package/src/__tests__/e2e/DateTimePicker.test.tsx +86 -0
- package/src/__tests__/e2e/DateTimePickerRoot.test.tsx +72 -0
- package/src/__tests__/e2e/KeyboardDatePicker.test.tsx +140 -0
- package/src/__tests__/e2e/KeyboardDateTimePicker.test.tsx +48 -0
- package/src/__tests__/e2e/Theme.test.tsx +30 -0
- package/src/__tests__/e2e/TimePicker.test.tsx +121 -0
- package/src/__tests__/e2e/commands.tsx +8 -0
- package/src/__tests__/setup.js +26 -0
- package/src/__tests__/test-utils.tsx +45 -0
- package/src/__tests__/tsconfig.json +5 -0
- package/src/_helpers/date-utils.ts +92 -0
- package/src/_helpers/text-field-helper.ts +239 -0
- package/src/_helpers/time-utils.ts +83 -0
- package/src/_helpers/utils.ts +8 -0
- package/src/_shared/KeyboardDateInput.tsx +161 -0
- package/src/_shared/ModalDialog.tsx +114 -0
- package/src/_shared/PickerToolbar.tsx +52 -0
- package/src/_shared/PureDateInput.tsx +45 -0
- package/src/_shared/ToolbarButton.tsx +63 -0
- package/src/_shared/ToolbarText.tsx +49 -0
- package/src/_shared/WithUtils.tsx +19 -0
- package/src/_shared/hooks/useIsLandscape.tsx +27 -0
- package/src/_shared/hooks/useKeyDown.ts +34 -0
- package/src/_shared/hooks/useKeyboardPickerState.ts +72 -0
- package/src/_shared/hooks/useOpenState.ts +22 -0
- package/src/_shared/hooks/usePickerState.ts +134 -0
- package/src/_shared/hooks/useUtils.ts +20 -0
- package/src/_shared/hooks/useViews.tsx +31 -0
- package/src/_shared/icons/ArrowLeftIcon.tsx +11 -0
- package/src/_shared/icons/ArrowRightIcon.tsx +11 -0
- package/src/_shared/icons/DateRangeIcon.tsx +11 -0
- package/src/_shared/icons/KeyboardIcon.tsx +11 -0
- package/src/_shared/icons/TimeIcon.tsx +12 -0
- package/src/constants/ClockType.ts +11 -0
- package/src/constants/dimensions.ts +5 -0
- package/src/constants/prop-types.ts +37 -0
- package/src/index.ts +48 -0
- package/src/typings/BasePicker.tsx +60 -0
- package/src/typings/date.ts +3 -0
- package/src/typings/extendMui.ts +10 -0
- package/src/typings/overrides.ts +44 -0
- package/src/views/Calendar/Calendar.tsx +361 -0
- package/src/views/Calendar/CalendarHeader.tsx +141 -0
- package/src/views/Calendar/Day.tsx +97 -0
- package/src/views/Calendar/DayWrapper.tsx +33 -0
- package/src/views/Calendar/SlideTransition.tsx +100 -0
- package/src/views/Clock/Clock.tsx +172 -0
- package/src/views/Clock/ClockNumber.tsx +91 -0
- package/src/views/Clock/ClockNumbers.tsx +76 -0
- package/src/views/Clock/ClockPointer.tsx +104 -0
- package/src/views/Clock/ClockView.tsx +105 -0
- package/src/views/Month/Month.tsx +76 -0
- package/src/views/Month/MonthView.tsx +94 -0
- package/src/views/Year/Year.tsx +77 -0
- package/src/views/Year/YearView.tsx +91 -0
- package/src/wrappers/InlineWrapper.tsx +80 -0
- package/src/wrappers/ModalWrapper.tsx +113 -0
- package/src/wrappers/StaticWrapper.tsx +22 -0
- package/src/wrappers/Wrapper.tsx +75 -0
- package/tsconfig.json +21 -0
- package/typings.d.ts +6 -0
- package/dist/material-ui-pickers.esm.js.map +0 -1
- package/dist/material-ui-pickers.js.map +0 -1
- package/dist/material-ui-pickers.umd.min.js +0 -1
- /package/{DatePicker → build/DatePicker}/DatePickerToolbar.d.ts +0 -0
- /package/{DatePicker → build/DatePicker}/DatePickerToolbar.js +0 -0
- /package/{DatePicker → build/DatePicker}/index.d.ts +0 -0
- /package/{DatePicker → build/DatePicker}/index.js +0 -0
- /package/{DateTimePicker → build/DateTimePicker}/DateTimePicker.d.ts +0 -0
- /package/{DateTimePicker → build/DateTimePicker}/DateTimePickerTabs.d.ts +0 -0
- /package/{DateTimePicker → build/DateTimePicker}/DateTimePickerTabs.js +0 -0
- /package/{DateTimePicker → build/DateTimePicker}/DateTimePickerToolbar.d.ts +0 -0
- /package/{DateTimePicker → build/DateTimePicker}/DateTimePickerToolbar.js +0 -0
- /package/{DateTimePicker → build/DateTimePicker}/index.d.ts +0 -0
- /package/{DateTimePicker → build/DateTimePicker}/index.js +0 -0
- /package/{MuiPickersUtilsProvider.d.ts → build/MuiPickersUtilsProvider.d.ts} +0 -0
- /package/{MuiPickersUtilsProvider.js → build/MuiPickersUtilsProvider.js} +0 -0
- /package/{Picker → build/Picker}/Picker.d.ts +0 -0
- /package/{Picker → build/Picker}/WrappedKeyboardPicker.d.ts +0 -0
- /package/{Picker → build/Picker}/WrappedKeyboardPicker.js +0 -0
- /package/{Picker → build/Picker}/WrappedPurePicker.d.ts +0 -0
- /package/{Picker → build/Picker}/WrappedPurePicker.js +0 -0
- /package/{README.md → build/README.md} +0 -0
- /package/{Rifm → build/Rifm}/Rifm.d.ts +0 -0
- /package/{Rifm → build/Rifm}/Rifm.js +0 -0
- /package/{TimePicker → build/TimePicker}/TimePicker.d.ts +0 -0
- /package/{TimePicker → build/TimePicker}/TimePickerToolbar.d.ts +0 -0
- /package/{TimePicker → build/TimePicker}/TimePickerToolbar.js +0 -0
- /package/{TimePicker → build/TimePicker}/index.d.ts +0 -0
- /package/{TimePicker → build/TimePicker}/index.js +0 -0
- /package/{_helpers → build/_helpers}/date-utils.d.ts +0 -0
- /package/{_helpers → build/_helpers}/date-utils.js +0 -0
- /package/{_helpers → build/_helpers}/text-field-helper.js +0 -0
- /package/{_helpers → build/_helpers}/time-utils.d.ts +0 -0
- /package/{_helpers → build/_helpers}/time-utils.js +0 -0
- /package/{_helpers → build/_helpers}/utils.d.ts +0 -0
- /package/{_helpers → build/_helpers}/utils.js +0 -0
- /package/{_shared → build/_shared}/KeyboardDateInput.d.ts +0 -0
- /package/{_shared → build/_shared}/ModalDialog.js +0 -0
- /package/{_shared → build/_shared}/PickerToolbar.d.ts +0 -0
- /package/{_shared → build/_shared}/PickerToolbar.js +0 -0
- /package/{_shared → build/_shared}/PureDateInput.d.ts +0 -0
- /package/{_shared → build/_shared}/ToolbarButton.js +0 -0
- /package/{_shared → build/_shared}/ToolbarText.d.ts +0 -0
- /package/{_shared → build/_shared}/ToolbarText.js +0 -0
- /package/{_shared → build/_shared}/WithUtils.d.ts +0 -0
- /package/{_shared → build/_shared}/WithUtils.js +0 -0
- /package/{_shared → build/_shared}/hooks/useIsLandscape.d.ts +0 -0
- /package/{_shared → build/_shared}/hooks/useIsLandscape.js +0 -0
- /package/{_shared → build/_shared}/hooks/useKeyDown.d.ts +0 -0
- /package/{_shared → build/_shared}/hooks/useKeyDown.js +0 -0
- /package/{_shared → build/_shared}/hooks/useKeyboardPickerState.d.ts +0 -0
- /package/{_shared → build/_shared}/hooks/useOpenState.d.ts +0 -0
- /package/{_shared → build/_shared}/hooks/useOpenState.js +0 -0
- /package/{_shared → build/_shared}/hooks/usePickerState.d.ts +0 -0
- /package/{_shared → build/_shared}/hooks/usePickerState.js +0 -0
- /package/{_shared → build/_shared}/hooks/useUtils.d.ts +0 -0
- /package/{_shared → build/_shared}/hooks/useUtils.js +0 -0
- /package/{_shared → build/_shared}/hooks/useViews.d.ts +0 -0
- /package/{_shared → build/_shared}/hooks/useViews.js +0 -0
- /package/{_shared → build/_shared}/icons/ArrowLeftIcon.d.ts +0 -0
- /package/{_shared → build/_shared}/icons/ArrowLeftIcon.js +0 -0
- /package/{_shared → build/_shared}/icons/ArrowRightIcon.d.ts +0 -0
- /package/{_shared → build/_shared}/icons/ArrowRightIcon.js +0 -0
- /package/{_shared → build/_shared}/icons/DateRangeIcon.d.ts +0 -0
- /package/{_shared → build/_shared}/icons/DateRangeIcon.js +0 -0
- /package/{_shared → build/_shared}/icons/KeyboardIcon.d.ts +0 -0
- /package/{_shared → build/_shared}/icons/KeyboardIcon.js +0 -0
- /package/{_shared → build/_shared}/icons/TimeIcon.d.ts +0 -0
- /package/{_shared → build/_shared}/icons/TimeIcon.js +0 -0
- /package/{constants → build/constants}/ClockType.d.ts +0 -0
- /package/{constants → build/constants}/ClockType.js +0 -0
- /package/{constants → build/constants}/dimensions.d.ts +0 -0
- /package/{constants → build/constants}/dimensions.js +0 -0
- /package/{constants → build/constants}/prop-types.d.ts +0 -0
- /package/{index.d.ts → build/index.d.ts} +0 -0
- /package/{index.js → build/index.js} +0 -0
- /package/{typings → build/typings}/BasePicker.d.ts +0 -0
- /package/{typings → build/typings}/BasePicker.js +0 -0
- /package/{typings → build/typings}/date.d.ts +0 -0
- /package/{typings → build/typings}/date.js +0 -0
- /package/{typings → build/typings}/extendMui.d.ts +0 -0
- /package/{typings → build/typings}/extendMui.js +0 -0
- /package/{typings → build/typings}/overrides.d.ts +0 -0
- /package/{typings → build/typings}/overrides.js +0 -0
- /package/{views → build/views}/Calendar/Calendar.d.ts +0 -0
- /package/{views → build/views}/Calendar/CalendarHeader.d.ts +0 -0
- /package/{views → build/views}/Calendar/CalendarHeader.js +0 -0
- /package/{views → build/views}/Calendar/Day.d.ts +0 -0
- /package/{views → build/views}/Calendar/Day.js +0 -0
- /package/{views → build/views}/Calendar/DayWrapper.d.ts +0 -0
- /package/{views → build/views}/Calendar/DayWrapper.js +0 -0
- /package/{views → build/views}/Calendar/SlideTransition.d.ts +0 -0
- /package/{views → build/views}/Calendar/SlideTransition.js +0 -0
- /package/{views → build/views}/Clock/Clock.js +0 -0
- /package/{views → build/views}/Clock/ClockNumber.d.ts +0 -0
- /package/{views → build/views}/Clock/ClockNumber.js +0 -0
- /package/{views → build/views}/Clock/ClockNumbers.d.ts +0 -0
- /package/{views → build/views}/Clock/ClockNumbers.js +0 -0
- /package/{views → build/views}/Clock/ClockPointer.js +0 -0
- /package/{views → build/views}/Clock/ClockView.d.ts +0 -0
- /package/{views → build/views}/Clock/ClockView.js +0 -0
- /package/{views → build/views}/Month/Month.d.ts +0 -0
- /package/{views → build/views}/Month/Month.js +0 -0
- /package/{views → build/views}/Month/MonthView.d.ts +0 -0
- /package/{views → build/views}/Month/MonthView.js +0 -0
- /package/{views → build/views}/Year/Year.d.ts +0 -0
- /package/{views → build/views}/Year/Year.js +0 -0
- /package/{views → build/views}/Year/YearView.d.ts +0 -0
- /package/{views → build/views}/Year/YearView.js +0 -0
- /package/{wrappers → build/wrappers}/InlineWrapper.d.ts +0 -0
- /package/{wrappers → build/wrappers}/InlineWrapper.js +0 -0
- /package/{wrappers → build/wrappers}/ModalWrapper.d.ts +0 -0
- /package/{wrappers → build/wrappers}/ModalWrapper.js +0 -0
- /package/{wrappers → build/wrappers}/StaticWrapper.d.ts +0 -0
- /package/{wrappers → build/wrappers}/StaticWrapper.js +0 -0
- /package/{wrappers → build/wrappers}/Wrapper.d.ts +0 -0
- /package/{wrappers → build/wrappers}/Wrapper.js +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import Clock from './Clock';
|
|
4
|
+
import ClockType, { ClockViewType } from '../../constants/ClockType';
|
|
5
|
+
import { useUtils } from '../../_shared/hooks/useUtils';
|
|
6
|
+
import { MaterialUiPickersDate } from '../../typings/date';
|
|
7
|
+
import { getHourNumbers, getMinutesNumbers } from './ClockNumbers';
|
|
8
|
+
import { convertToMeridiem, getMeridiem } from '../../_helpers/time-utils';
|
|
9
|
+
|
|
10
|
+
export interface TimePickerViewProps {
|
|
11
|
+
/** TimePicker value */
|
|
12
|
+
date: MaterialUiPickersDate;
|
|
13
|
+
/** Clock type */
|
|
14
|
+
type: ClockViewType;
|
|
15
|
+
/** 12h/24h clock mode */
|
|
16
|
+
ampm?: boolean;
|
|
17
|
+
/** Minutes step */
|
|
18
|
+
minutesStep?: number;
|
|
19
|
+
/** On hour change */
|
|
20
|
+
onHourChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;
|
|
21
|
+
/** On minutes change */
|
|
22
|
+
onMinutesChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;
|
|
23
|
+
/** On seconds change */
|
|
24
|
+
onSecondsChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const TimePickerView: React.FC<TimePickerViewProps> = ({
|
|
28
|
+
type,
|
|
29
|
+
onHourChange,
|
|
30
|
+
onMinutesChange,
|
|
31
|
+
onSecondsChange,
|
|
32
|
+
ampm,
|
|
33
|
+
date,
|
|
34
|
+
minutesStep,
|
|
35
|
+
}) => {
|
|
36
|
+
const utils = useUtils();
|
|
37
|
+
const viewProps = React.useMemo(() => {
|
|
38
|
+
switch (type) {
|
|
39
|
+
case ClockType.HOURS:
|
|
40
|
+
return {
|
|
41
|
+
value: utils.getHours(date),
|
|
42
|
+
children: getHourNumbers({ date, utils, ampm: Boolean(ampm) }),
|
|
43
|
+
onChange: (value: number, isFinish?: boolean) => {
|
|
44
|
+
const currentMeridiem = getMeridiem(date, utils);
|
|
45
|
+
const updatedTimeWithMeridiem = convertToMeridiem(
|
|
46
|
+
utils.setHours(date, value),
|
|
47
|
+
currentMeridiem,
|
|
48
|
+
Boolean(ampm),
|
|
49
|
+
utils
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
onHourChange(updatedTimeWithMeridiem, isFinish);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
case ClockType.MINUTES:
|
|
57
|
+
const minutesValue = utils.getMinutes(date);
|
|
58
|
+
return {
|
|
59
|
+
value: minutesValue,
|
|
60
|
+
children: getMinutesNumbers({ value: minutesValue, utils }),
|
|
61
|
+
onChange: (value: number, isFinish?: boolean) => {
|
|
62
|
+
const updatedTime = utils.setMinutes(date, value);
|
|
63
|
+
|
|
64
|
+
onMinutesChange(updatedTime, isFinish);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
case ClockType.SECONDS:
|
|
69
|
+
const secondsValue = utils.getSeconds(date);
|
|
70
|
+
return {
|
|
71
|
+
value: secondsValue,
|
|
72
|
+
children: getMinutesNumbers({ value: secondsValue, utils }),
|
|
73
|
+
onChange: (value: number, isFinish?: boolean) => {
|
|
74
|
+
const updatedTime = utils.setSeconds(date, value);
|
|
75
|
+
|
|
76
|
+
onSecondsChange(updatedTime, isFinish);
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
default:
|
|
81
|
+
throw new Error('You must provide the type for TimePickerView');
|
|
82
|
+
}
|
|
83
|
+
}, [ampm, date, onHourChange, onMinutesChange, onSecondsChange, type, utils]);
|
|
84
|
+
|
|
85
|
+
return <Clock type={type} ampm={ampm} minutesStep={minutesStep} {...viewProps} />;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
TimePickerView.displayName = 'TimePickerView';
|
|
89
|
+
|
|
90
|
+
TimePickerView.propTypes = {
|
|
91
|
+
date: PropTypes.object.isRequired,
|
|
92
|
+
onHourChange: PropTypes.func.isRequired,
|
|
93
|
+
onMinutesChange: PropTypes.func.isRequired,
|
|
94
|
+
onSecondsChange: PropTypes.func.isRequired,
|
|
95
|
+
ampm: PropTypes.bool,
|
|
96
|
+
minutesStep: PropTypes.number,
|
|
97
|
+
type: PropTypes.oneOf(Object.keys(ClockType).map(key => ClockType[key as any])).isRequired,
|
|
98
|
+
} as any;
|
|
99
|
+
|
|
100
|
+
TimePickerView.defaultProps = {
|
|
101
|
+
ampm: true,
|
|
102
|
+
minutesStep: 1,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default React.memo(TimePickerView);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Typography from '@material-ui/core/Typography';
|
|
4
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
+
|
|
6
|
+
export interface MonthProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onSelect: (value: any) => void;
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
value: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const useStyles = makeStyles(
|
|
15
|
+
theme => ({
|
|
16
|
+
root: {
|
|
17
|
+
flex: '1 0 33.33%',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
outline: 'none',
|
|
23
|
+
height: 75,
|
|
24
|
+
transition: theme.transitions.create('font-size', { duration: '100ms' }),
|
|
25
|
+
'&:focus': {
|
|
26
|
+
color: theme.palette.primary.main,
|
|
27
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
monthSelected: {
|
|
31
|
+
color: theme.palette.primary.main,
|
|
32
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
33
|
+
},
|
|
34
|
+
monthDisabled: {
|
|
35
|
+
pointerEvents: 'none',
|
|
36
|
+
color: theme.palette.text.hint,
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
{ name: 'MuiPickersMonth' }
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const Month: React.FC<MonthProps> = ({
|
|
43
|
+
selected,
|
|
44
|
+
onSelect,
|
|
45
|
+
disabled,
|
|
46
|
+
value,
|
|
47
|
+
children,
|
|
48
|
+
...other
|
|
49
|
+
}) => {
|
|
50
|
+
const classes = useStyles();
|
|
51
|
+
const handleSelection = React.useCallback(() => {
|
|
52
|
+
onSelect(value);
|
|
53
|
+
}, [onSelect, value]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Typography
|
|
57
|
+
role="button"
|
|
58
|
+
component="div"
|
|
59
|
+
className={clsx(classes.root, {
|
|
60
|
+
[classes.monthSelected]: selected,
|
|
61
|
+
[classes.monthDisabled]: disabled,
|
|
62
|
+
})}
|
|
63
|
+
tabIndex={disabled ? -1 : 0}
|
|
64
|
+
onClick={handleSelection}
|
|
65
|
+
onKeyPress={handleSelection}
|
|
66
|
+
color={selected ? 'primary' : undefined}
|
|
67
|
+
variant={selected ? 'h5' : 'subtitle1'}
|
|
68
|
+
children={children}
|
|
69
|
+
{...other}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
Month.displayName = 'Month';
|
|
75
|
+
|
|
76
|
+
export default Month;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Month from './Month';
|
|
3
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { useUtils } from '../../_shared/hooks/useUtils';
|
|
5
|
+
import { ParsableDate } from '../../constants/prop-types';
|
|
6
|
+
import { MaterialUiPickersDate } from '../../typings/date';
|
|
7
|
+
|
|
8
|
+
export interface MonthSelectionProps {
|
|
9
|
+
date: MaterialUiPickersDate;
|
|
10
|
+
minDate?: ParsableDate;
|
|
11
|
+
maxDate?: ParsableDate;
|
|
12
|
+
onChange: (date: MaterialUiPickersDate, isFinish: boolean) => void;
|
|
13
|
+
disablePast?: boolean | null | undefined;
|
|
14
|
+
disableFuture?: boolean | null | undefined;
|
|
15
|
+
onMonthChange?: (date: MaterialUiPickersDate) => void | Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const useStyles = makeStyles(
|
|
19
|
+
{
|
|
20
|
+
container: {
|
|
21
|
+
width: 310,
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexWrap: 'wrap',
|
|
24
|
+
alignContent: 'stretch',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{ name: 'MuiPickersMonthSelection' }
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const MonthSelection: React.FC<MonthSelectionProps> = ({
|
|
31
|
+
disablePast,
|
|
32
|
+
disableFuture,
|
|
33
|
+
minDate,
|
|
34
|
+
maxDate,
|
|
35
|
+
date,
|
|
36
|
+
onMonthChange,
|
|
37
|
+
onChange,
|
|
38
|
+
}) => {
|
|
39
|
+
const utils = useUtils();
|
|
40
|
+
const classes = useStyles();
|
|
41
|
+
const currentMonth = utils.getMonth(date);
|
|
42
|
+
|
|
43
|
+
const shouldDisableMonth = (month: MaterialUiPickersDate) => {
|
|
44
|
+
const now = utils.date();
|
|
45
|
+
const utilMinDate = utils.date(minDate);
|
|
46
|
+
const utilMaxDate = utils.date(maxDate);
|
|
47
|
+
|
|
48
|
+
const firstEnabledMonth = utils.startOfMonth(
|
|
49
|
+
disablePast && utils.isAfter(now, utilMinDate) ? now : utilMinDate
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const lastEnabledMonth = utils.startOfMonth(
|
|
53
|
+
disableFuture && utils.isBefore(now, utilMaxDate) ? now : utilMaxDate
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const isBeforeFirstEnabled = utils.isBefore(month, firstEnabledMonth);
|
|
57
|
+
const isAfterLastEnabled = utils.isAfter(month, lastEnabledMonth);
|
|
58
|
+
|
|
59
|
+
return isBeforeFirstEnabled || isAfterLastEnabled;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const onMonthSelect = React.useCallback(
|
|
63
|
+
(month: number) => {
|
|
64
|
+
const newDate = utils.setMonth(date, month);
|
|
65
|
+
|
|
66
|
+
onChange(newDate, true);
|
|
67
|
+
if (onMonthChange) {
|
|
68
|
+
onMonthChange(newDate);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
[date, onChange, onMonthChange, utils]
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div className={classes.container}>
|
|
76
|
+
{utils.getMonthArray(date).map(month => {
|
|
77
|
+
const monthNumber = utils.getMonth(month);
|
|
78
|
+
const monthText = utils.format(month, 'MMM');
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<Month
|
|
82
|
+
key={monthText}
|
|
83
|
+
value={monthNumber}
|
|
84
|
+
selected={monthNumber === currentMonth}
|
|
85
|
+
onSelect={onMonthSelect}
|
|
86
|
+
disabled={shouldDisableMonth(month)}
|
|
87
|
+
>
|
|
88
|
+
{monthText}
|
|
89
|
+
</Month>
|
|
90
|
+
);
|
|
91
|
+
})}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Typography from '@material-ui/core/Typography';
|
|
4
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
+
|
|
6
|
+
export interface YearProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onSelect: (value: any) => void;
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
value: any;
|
|
12
|
+
forwardedRef?: React.Ref<HTMLElement | null>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const useStyles = makeStyles(
|
|
16
|
+
theme => ({
|
|
17
|
+
root: {
|
|
18
|
+
height: 40,
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
outline: 'none',
|
|
24
|
+
'&:focus': {
|
|
25
|
+
color: theme.palette.primary.main,
|
|
26
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
yearSelected: {
|
|
30
|
+
margin: '10px 0',
|
|
31
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
32
|
+
},
|
|
33
|
+
yearDisabled: {
|
|
34
|
+
pointerEvents: 'none',
|
|
35
|
+
color: theme.palette.text.hint,
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
{ name: 'MuiPickersYear' }
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const Year: React.FC<YearProps> = ({
|
|
42
|
+
onSelect,
|
|
43
|
+
forwardedRef,
|
|
44
|
+
value,
|
|
45
|
+
selected,
|
|
46
|
+
disabled,
|
|
47
|
+
children,
|
|
48
|
+
...other
|
|
49
|
+
}) => {
|
|
50
|
+
const classes = useStyles();
|
|
51
|
+
const handleClick = React.useCallback(() => onSelect(value), [onSelect, value]);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Typography
|
|
55
|
+
role="button"
|
|
56
|
+
component="div"
|
|
57
|
+
tabIndex={disabled ? -1 : 0}
|
|
58
|
+
onClick={handleClick}
|
|
59
|
+
onKeyPress={handleClick}
|
|
60
|
+
color={selected ? 'primary' : undefined}
|
|
61
|
+
variant={selected ? 'h5' : 'subtitle1'}
|
|
62
|
+
children={children}
|
|
63
|
+
ref={forwardedRef}
|
|
64
|
+
className={clsx(classes.root, {
|
|
65
|
+
[classes.yearSelected]: selected,
|
|
66
|
+
[classes.yearDisabled]: disabled,
|
|
67
|
+
})}
|
|
68
|
+
{...other}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
Year.displayName = 'Year';
|
|
74
|
+
|
|
75
|
+
export default React.forwardRef<HTMLElement, YearProps>((props, ref) => (
|
|
76
|
+
<Year {...props} forwardedRef={ref} />
|
|
77
|
+
));
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Year from './Year';
|
|
3
|
+
import { DateType } from '@date-io/type';
|
|
4
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
+
import { useUtils } from '../../_shared/hooks/useUtils';
|
|
6
|
+
import { VariantContext } from '../../wrappers/Wrapper';
|
|
7
|
+
import { MaterialUiPickersDate } from '../../typings/date';
|
|
8
|
+
|
|
9
|
+
export interface YearSelectionProps {
|
|
10
|
+
date: MaterialUiPickersDate;
|
|
11
|
+
minDate: DateType;
|
|
12
|
+
maxDate: DateType;
|
|
13
|
+
onChange: (date: MaterialUiPickersDate, isFinish: boolean) => void;
|
|
14
|
+
disablePast?: boolean | null | undefined;
|
|
15
|
+
disableFuture?: boolean | null | undefined;
|
|
16
|
+
animateYearScrolling?: boolean | null | undefined;
|
|
17
|
+
onYearChange?: (date: MaterialUiPickersDate) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const useStyles = makeStyles(
|
|
21
|
+
{
|
|
22
|
+
container: {
|
|
23
|
+
height: 300,
|
|
24
|
+
overflowY: 'auto',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{ name: 'MuiPickersYearSelection' }
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const YearSelection: React.FC<YearSelectionProps> = ({
|
|
31
|
+
date,
|
|
32
|
+
onChange,
|
|
33
|
+
onYearChange,
|
|
34
|
+
minDate,
|
|
35
|
+
maxDate,
|
|
36
|
+
disablePast,
|
|
37
|
+
disableFuture,
|
|
38
|
+
animateYearScrolling,
|
|
39
|
+
}) => {
|
|
40
|
+
const utils = useUtils();
|
|
41
|
+
const classes = useStyles();
|
|
42
|
+
const currentVariant = React.useContext(VariantContext);
|
|
43
|
+
const selectedYearRef = React.useRef<HTMLElement>(null);
|
|
44
|
+
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (selectedYearRef.current && selectedYearRef.current.scrollIntoView) {
|
|
47
|
+
selectedYearRef.current.scrollIntoView({
|
|
48
|
+
block: currentVariant === 'static' ? 'nearest' : 'center',
|
|
49
|
+
behavior: animateYearScrolling ? 'smooth' : 'auto',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, []); // eslint-disable-line
|
|
53
|
+
|
|
54
|
+
const currentYear = utils.getYear(date);
|
|
55
|
+
const onYearSelect = React.useCallback(
|
|
56
|
+
(year: number) => {
|
|
57
|
+
const newDate = utils.setYear(date, year);
|
|
58
|
+
if (onYearChange) {
|
|
59
|
+
onYearChange(newDate);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
onChange(newDate, true);
|
|
63
|
+
},
|
|
64
|
+
[date, onChange, onYearChange, utils]
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div className={classes.container}>
|
|
69
|
+
{utils.getYearRange(minDate, maxDate).map(year => {
|
|
70
|
+
const yearNumber = utils.getYear(year);
|
|
71
|
+
const selected = yearNumber === currentYear;
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<Year
|
|
75
|
+
key={utils.getYearText(year)}
|
|
76
|
+
selected={selected}
|
|
77
|
+
value={yearNumber}
|
|
78
|
+
onSelect={onYearSelect}
|
|
79
|
+
ref={selected ? selectedYearRef : undefined}
|
|
80
|
+
disabled={Boolean(
|
|
81
|
+
(disablePast && utils.isBeforeYear(year, utils.date())) ||
|
|
82
|
+
(disableFuture && utils.isAfterYear(year, utils.date()))
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
85
|
+
{utils.getYearText(year)}
|
|
86
|
+
</Year>
|
|
87
|
+
);
|
|
88
|
+
})}
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import Popover, { PopoverProps as PopoverPropsType } from '@material-ui/core/Popover';
|
|
5
|
+
import { WrapperProps } from './Wrapper';
|
|
6
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
7
|
+
import { useKeyDown } from '../_shared/hooks/useKeyDown';
|
|
8
|
+
import { TextFieldProps } from '@material-ui/core/TextField';
|
|
9
|
+
import { DIALOG_WIDTH, DIALOG_WIDTH_WIDER } from '../constants/dimensions';
|
|
10
|
+
|
|
11
|
+
export const useStyles = makeStyles(
|
|
12
|
+
{
|
|
13
|
+
popoverPaper: {
|
|
14
|
+
width: DIALOG_WIDTH,
|
|
15
|
+
paddingBottom: 8,
|
|
16
|
+
},
|
|
17
|
+
popoverPaperWider: {
|
|
18
|
+
width: DIALOG_WIDTH_WIDER,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{ name: 'MuiPickersInlineWrapper' }
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export interface InlineWrapperProps<T = TextFieldProps> extends WrapperProps<T> {
|
|
25
|
+
/** Popover props passed to material-ui Popover (with variant="inline") */
|
|
26
|
+
PopoverProps?: Partial<PopoverPropsType>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const InlineWrapper: React.FC<InlineWrapperProps> = ({
|
|
30
|
+
open,
|
|
31
|
+
wider,
|
|
32
|
+
children,
|
|
33
|
+
PopoverProps,
|
|
34
|
+
onClear,
|
|
35
|
+
onDismiss,
|
|
36
|
+
onSetToday,
|
|
37
|
+
onAccept,
|
|
38
|
+
showTabs,
|
|
39
|
+
DateInputProps,
|
|
40
|
+
InputComponent,
|
|
41
|
+
...other
|
|
42
|
+
}) => {
|
|
43
|
+
const ref = React.useRef();
|
|
44
|
+
const classes = useStyles();
|
|
45
|
+
|
|
46
|
+
useKeyDown(open, {
|
|
47
|
+
Enter: onAccept,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<React.Fragment>
|
|
52
|
+
<InputComponent {...other} {...DateInputProps} inputRef={ref} />
|
|
53
|
+
|
|
54
|
+
<Popover
|
|
55
|
+
open={open}
|
|
56
|
+
onClose={onDismiss}
|
|
57
|
+
anchorEl={ref.current}
|
|
58
|
+
classes={{
|
|
59
|
+
paper: clsx(classes.popoverPaper, { [classes.popoverPaperWider]: wider }),
|
|
60
|
+
}}
|
|
61
|
+
anchorOrigin={{
|
|
62
|
+
vertical: 'bottom',
|
|
63
|
+
horizontal: 'center',
|
|
64
|
+
}}
|
|
65
|
+
transformOrigin={{
|
|
66
|
+
vertical: 'top',
|
|
67
|
+
horizontal: 'center',
|
|
68
|
+
}}
|
|
69
|
+
children={children}
|
|
70
|
+
{...PopoverProps}
|
|
71
|
+
/>
|
|
72
|
+
</React.Fragment>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
InlineWrapper.propTypes = {
|
|
77
|
+
onOpen: PropTypes.func,
|
|
78
|
+
onClose: PropTypes.func,
|
|
79
|
+
PopoverProps: PropTypes.object,
|
|
80
|
+
} as any;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PropTypes from 'prop-types';
|
|
3
|
+
import ModalDialog from '../_shared/ModalDialog';
|
|
4
|
+
import { Omit } from '@material-ui/core';
|
|
5
|
+
import { WrapperProps } from './Wrapper';
|
|
6
|
+
import { useKeyDown } from '../_shared/hooks/useKeyDown';
|
|
7
|
+
import { DialogProps as MuiDialogProps } from '@material-ui/core/Dialog';
|
|
8
|
+
|
|
9
|
+
export interface ModalWrapperProps<T = {}> extends WrapperProps<T> {
|
|
10
|
+
/**
|
|
11
|
+
* "OK" label message
|
|
12
|
+
* @default "OK"
|
|
13
|
+
*/
|
|
14
|
+
okLabel?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* "CANCEL" label message
|
|
17
|
+
* @default "CANCEL"
|
|
18
|
+
*/
|
|
19
|
+
cancelLabel?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* "CLEAR" label message
|
|
22
|
+
* @default "CLEAR"
|
|
23
|
+
*/
|
|
24
|
+
clearLabel?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* "TODAY" label message
|
|
27
|
+
* @default "TODAY"
|
|
28
|
+
*/
|
|
29
|
+
todayLabel?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* If true today button will be displayed <b>Note*</b> that clear button has higher priority
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
showTodayButton?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Show clear action in picker dialog
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
clearable?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Props to be passed directly to material-ui Dialog
|
|
42
|
+
* @type {Partial<MuiDialogProps>}
|
|
43
|
+
*/
|
|
44
|
+
DialogProps?: Partial<Omit<MuiDialogProps, 'classes'>>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const ModalWrapper: React.FC<ModalWrapperProps<any>> = ({
|
|
48
|
+
open,
|
|
49
|
+
children,
|
|
50
|
+
okLabel,
|
|
51
|
+
cancelLabel,
|
|
52
|
+
clearLabel,
|
|
53
|
+
todayLabel,
|
|
54
|
+
showTodayButton,
|
|
55
|
+
clearable,
|
|
56
|
+
DialogProps,
|
|
57
|
+
showTabs,
|
|
58
|
+
wider,
|
|
59
|
+
InputComponent,
|
|
60
|
+
DateInputProps,
|
|
61
|
+
onClear,
|
|
62
|
+
onAccept,
|
|
63
|
+
onDismiss,
|
|
64
|
+
onSetToday,
|
|
65
|
+
...other
|
|
66
|
+
}) => {
|
|
67
|
+
useKeyDown(open, {
|
|
68
|
+
Enter: onAccept,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<React.Fragment>
|
|
73
|
+
<InputComponent {...other} {...DateInputProps} />
|
|
74
|
+
|
|
75
|
+
<ModalDialog
|
|
76
|
+
wider={wider}
|
|
77
|
+
showTabs={showTabs}
|
|
78
|
+
open={open}
|
|
79
|
+
onClear={onClear}
|
|
80
|
+
onAccept={onAccept}
|
|
81
|
+
onDismiss={onDismiss}
|
|
82
|
+
onSetToday={onSetToday}
|
|
83
|
+
clearLabel={clearLabel}
|
|
84
|
+
todayLabel={todayLabel}
|
|
85
|
+
okLabel={okLabel}
|
|
86
|
+
cancelLabel={cancelLabel}
|
|
87
|
+
clearable={clearable}
|
|
88
|
+
showTodayButton={showTodayButton}
|
|
89
|
+
children={children}
|
|
90
|
+
{...DialogProps}
|
|
91
|
+
/>
|
|
92
|
+
</React.Fragment>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
ModalWrapper.propTypes = {
|
|
97
|
+
okLabel: PropTypes.node,
|
|
98
|
+
cancelLabel: PropTypes.node,
|
|
99
|
+
clearLabel: PropTypes.node,
|
|
100
|
+
clearable: PropTypes.bool,
|
|
101
|
+
todayLabel: PropTypes.node,
|
|
102
|
+
showTodayButton: PropTypes.bool,
|
|
103
|
+
DialogProps: PropTypes.object,
|
|
104
|
+
} as any;
|
|
105
|
+
|
|
106
|
+
ModalWrapper.defaultProps = {
|
|
107
|
+
okLabel: 'OK',
|
|
108
|
+
cancelLabel: 'Cancel',
|
|
109
|
+
clearLabel: 'Clear',
|
|
110
|
+
todayLabel: 'Today',
|
|
111
|
+
clearable: false,
|
|
112
|
+
showTodayButton: false,
|
|
113
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { makeStyles } from '@material-ui/core';
|
|
3
|
+
import { DIALOG_WIDTH } from '../constants/dimensions';
|
|
4
|
+
|
|
5
|
+
const useStyles = makeStyles(
|
|
6
|
+
theme => ({
|
|
7
|
+
staticWrapperRoot: {
|
|
8
|
+
overflow: 'hidden',
|
|
9
|
+
minWidth: DIALOG_WIDTH,
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
backgroundColor: theme.palette.background.paper,
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
{ name: 'MuiPickersStaticWrapper' }
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const StaticWrapper: React.FC = ({ children }) => {
|
|
19
|
+
const classes = useStyles();
|
|
20
|
+
|
|
21
|
+
return <div className={classes.staticWrapperRoot} children={children} />;
|
|
22
|
+
};
|