{ "version": 3, "sources": ["../../../node_modules/@material-ui/src/MuiPickersUtilsProvider.tsx", "../../../node_modules/@material-ui/src/_shared/hooks/useUtils.ts", "../../../node_modules/@material-ui/src/_helpers/utils.ts", "../../../node_modules/@material-ui/src/constants/dimensions.ts", "../../../node_modules/@material-ui/src/wrappers/StaticWrapper.tsx", "../../../node_modules/@material-ui/src/_shared/ModalDialog.tsx", "../../../node_modules/@material-ui/src/_shared/hooks/useKeyDown.ts", "../../../node_modules/@material-ui/src/wrappers/ModalWrapper.tsx", "../../../node_modules/@material-ui/src/wrappers/InlineWrapper.tsx", "../../../node_modules/@material-ui/src/wrappers/Wrapper.tsx", "../../../node_modules/rifm/dist/rifm.esm.js", "../../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js", "../../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js", "../../../node_modules/@babel/runtime/helpers/esm/inherits.js", "../../../node_modules/@material-ui/src/views/Calendar/Day.tsx", "../../../node_modules/@material-ui/src/_helpers/date-utils.ts", "../../../node_modules/@material-ui/src/views/Calendar/DayWrapper.tsx", "../../../node_modules/@material-ui/src/views/Calendar/SlideTransition.tsx", "../../../node_modules/@material-ui/src/_shared/icons/ArrowLeftIcon.tsx", "../../../node_modules/@material-ui/src/_shared/icons/ArrowRightIcon.tsx", "../../../node_modules/@material-ui/src/views/Calendar/CalendarHeader.tsx", "../../../node_modules/@material-ui/src/_shared/WithUtils.tsx", "../../../node_modules/@material-ui/src/views/Calendar/Calendar.tsx", "../../../node_modules/@material-ui/src/constants/ClockType.ts", "../../../node_modules/@material-ui/src/views/Clock/ClockPointer.tsx", "../../../node_modules/@material-ui/src/_helpers/time-utils.ts", "../../../node_modules/@material-ui/src/views/Clock/Clock.tsx", "../../../node_modules/@material-ui/src/views/Clock/ClockNumber.tsx", "../../../node_modules/@material-ui/src/views/Clock/ClockNumbers.tsx", "../../../node_modules/@material-ui/src/views/Clock/ClockView.tsx", "../../../node_modules/@material-ui/src/constants/prop-types.ts", "../../../node_modules/@material-ui/src/_shared/hooks/useViews.tsx", "../../../node_modules/@material-ui/src/views/Year/Year.tsx", "../../../node_modules/@material-ui/src/views/Year/YearView.tsx", "../../../node_modules/@material-ui/src/views/Month/Month.tsx", "../../../node_modules/@material-ui/src/views/Month/MonthView.tsx", "../../../node_modules/@material-ui/src/_shared/hooks/useIsLandscape.tsx", "../../../node_modules/@material-ui/src/Picker/Picker.tsx", "../../../node_modules/@material-ui/src/_shared/ToolbarText.tsx", "../../../node_modules/@material-ui/src/_shared/ToolbarButton.tsx", "../../../node_modules/@material-ui/src/_shared/PickerToolbar.tsx", "../../../node_modules/@material-ui/src/_shared/PureDateInput.tsx", "../../../node_modules/@material-ui/src/_shared/icons/KeyboardIcon.tsx", "../../../node_modules/@material-ui/src/_helpers/text-field-helper.ts", "../../../node_modules/@material-ui/src/_shared/KeyboardDateInput.tsx", "../../../node_modules/@material-ui/src/_shared/hooks/useOpenState.ts", "../../../node_modules/@material-ui/src/_shared/hooks/usePickerState.ts", "../../../node_modules/@material-ui/src/_shared/hooks/useKeyboardPickerState.ts", "../../../node_modules/@material-ui/src/Picker/makePickerWithState.tsx", "../../../node_modules/@material-ui/src/DatePicker/DatePickerToolbar.tsx", "../../../node_modules/@material-ui/src/DatePicker/DatePicker.tsx", "../../../node_modules/@material-ui/src/TimePicker/TimePickerToolbar.tsx", "../../../node_modules/@material-ui/src/TimePicker/TimePicker.tsx"], "sourcesContent": ["import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from './typings/date';\n\nexport const MuiPickersContext = React.createContext | null>(null);\n\nexport interface MuiPickersUtilsProviderProps {\n utils: any;\n children: React.ReactNode;\n locale?: any;\n libInstance?: any;\n}\n\nexport const MuiPickersUtilsProvider: React.FC = ({\n utils: Utils,\n children,\n locale,\n libInstance,\n}) => {\n const utils = React.useMemo(() => new Utils({ locale, instance: libInstance }), [\n Utils,\n libInstance,\n locale,\n ]);\n\n return ;\n};\n\nMuiPickersUtilsProvider.propTypes = {\n utils: PropTypes.func.isRequired,\n locale: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n children: PropTypes.oneOfType([\n PropTypes.element.isRequired,\n PropTypes.arrayOf(PropTypes.element.isRequired),\n ]).isRequired,\n};\n\nexport default MuiPickersUtilsProvider;\n", "import { useContext } from 'react';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { MuiPickersContext } from '../../MuiPickersUtilsProvider';\n\nexport const checkUtils = (utils: IUtils | null | undefined) => {\n if (!utils) {\n // tslint:disable-next-line\n throw new Error(\n 'Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.'\n );\n }\n};\n\nexport function useUtils() {\n const utils = useContext(MuiPickersContext);\n checkUtils(utils);\n\n return utils!;\n}\n", "/** Use it instead of .includes method for IE support */\nexport function arrayIncludes(array: T[], itemOrItems: T | T[]) {\n if (Array.isArray(itemOrItems)) {\n return itemOrItems.every(item => array.indexOf(item) !== -1);\n }\n\n return array.indexOf(itemOrItems) !== -1;\n}\n\nexport type Omit = Pick>;\n", "export const DIALOG_WIDTH = 310;\n\nexport const DIALOG_WIDTH_WIDER = 325;\n\nexport const VIEW_HEIGHT = 305;\n", "import * as React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { DIALOG_WIDTH } from '../constants/dimensions';\n\nconst useStyles = makeStyles(\n theme => ({\n staticWrapperRoot: {\n overflow: 'hidden',\n minWidth: DIALOG_WIDTH,\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.palette.background.paper,\n },\n }),\n { name: 'MuiPickersStaticWrapper' }\n);\n\nexport const StaticWrapper: React.FC = ({ children }) => {\n const classes = useStyles();\n\n return
;\n};\n", "import * as React from 'react';\nimport clsx from 'clsx';\nimport Button from '@material-ui/core/Button';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Dialog, { DialogProps } from '@material-ui/core/Dialog';\nimport { DIALOG_WIDTH, DIALOG_WIDTH_WIDER } from '../constants/dimensions';\nimport { createStyles, WithStyles, withStyles } from '@material-ui/core/styles';\n\nexport interface ModalDialogProps extends DialogProps {\n onAccept: () => void;\n onDismiss: () => void;\n onClear: () => void;\n onSetToday: () => void;\n okLabel?: React.ReactNode;\n cancelLabel?: React.ReactNode;\n clearLabel?: React.ReactNode;\n todayLabel?: React.ReactNode;\n clearable?: boolean;\n showTodayButton?: boolean;\n showTabs?: boolean;\n wider?: boolean;\n}\n\nexport const ModalDialog: React.SFC> = ({\n children,\n classes,\n onAccept,\n onDismiss,\n onClear,\n onSetToday,\n okLabel,\n cancelLabel,\n clearLabel,\n todayLabel,\n clearable,\n showTodayButton,\n showTabs,\n wider,\n ...other\n}) => (\n \n \n\n \n {clearable && (\n \n )}\n\n {showTodayButton && (\n \n )}\n\n {cancelLabel && (\n \n )}\n\n {okLabel && (\n \n )}\n \n \n);\n\nModalDialog.displayName = 'ModalDialog';\n\nexport const styles = createStyles({\n dialogRoot: {\n minWidth: DIALOG_WIDTH,\n },\n dialogRootWider: {\n minWidth: DIALOG_WIDTH_WIDER,\n },\n dialog: {\n '&:first-child': {\n padding: 0,\n },\n },\n withAdditionalAction: {\n // set justifyContent to default value to fix IE11 layout bug\n // see https://github.com/dmtrKovalenko/material-ui-pickers/pull/267\n justifyContent: 'flex-start',\n\n '& > *:first-child': {\n marginRight: 'auto',\n },\n },\n});\n\nexport default withStyles(styles, { name: 'MuiPickersModal' })(ModalDialog);\n", "import * as React from 'react';\n\nexport const useIsomorphicEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n\ntype KeyHandlers = Record void>;\n\nexport function runKeyHandler(e: KeyboardEvent, keyHandlers: KeyHandlers) {\n const handler = keyHandlers[e.key];\n if (handler) {\n handler();\n // if event was handled prevent other side effects (e.g. page scroll)\n e.preventDefault();\n }\n}\n\nexport function useKeyDown(active: boolean, keyHandlers: KeyHandlers) {\n const keyHandlersRef = React.useRef(keyHandlers);\n keyHandlersRef.current = keyHandlers;\n\n useIsomorphicEffect(() => {\n if (active) {\n const handleKeyDown = (event: KeyboardEvent) => {\n runKeyHandler(event, keyHandlersRef.current);\n };\n window.addEventListener('keydown', handleKeyDown);\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [active]);\n}\n", "import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport ModalDialog from '../_shared/ModalDialog';\nimport { WrapperProps } from './Wrapper';\nimport { Omit } from '../_helpers/utils';\nimport { useKeyDown } from '../_shared/hooks/useKeyDown';\nimport { DialogProps as MuiDialogProps } from '@material-ui/core/Dialog';\n\nexport interface ModalWrapperProps extends WrapperProps {\n /**\n * \"OK\" label message\n * @default \"OK\"\n */\n okLabel?: React.ReactNode;\n /**\n * \"CANCEL\" label message\n * @default \"CANCEL\"\n */\n cancelLabel?: React.ReactNode;\n /**\n * \"CLEAR\" label message\n * @default \"CLEAR\"\n */\n clearLabel?: React.ReactNode;\n /**\n * \"TODAY\" label message\n * @default \"TODAY\"\n */\n todayLabel?: React.ReactNode;\n /**\n * If true today button will be displayed Note* that clear button has higher priority\n * @default false\n */\n showTodayButton?: boolean;\n /**\n * Show clear action in picker dialog\n * @default false\n */\n clearable?: boolean;\n /**\n * Props to be passed directly to material-ui Dialog\n * @type {Partial}\n */\n DialogProps?: Partial>;\n}\n\nexport const ModalWrapper: React.FC> = ({\n open,\n children,\n okLabel,\n cancelLabel,\n clearLabel,\n todayLabel,\n showTodayButton,\n clearable,\n DialogProps,\n showTabs,\n wider,\n InputComponent,\n DateInputProps,\n onClear,\n onAccept,\n onDismiss,\n onSetToday,\n ...other\n}) => {\n useKeyDown(open, {\n Enter: onAccept,\n });\n\n return (\n \n \n\n \n \n );\n};\n\nModalWrapper.propTypes = {\n okLabel: PropTypes.node,\n cancelLabel: PropTypes.node,\n clearLabel: PropTypes.node,\n clearable: PropTypes.bool,\n todayLabel: PropTypes.node,\n showTodayButton: PropTypes.bool,\n DialogProps: PropTypes.object,\n} as any;\n\nModalWrapper.defaultProps = {\n okLabel: 'OK',\n cancelLabel: 'Cancel',\n clearLabel: 'Clear',\n todayLabel: 'Today',\n clearable: false,\n showTodayButton: false,\n};\n", "import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Popover, { PopoverProps as PopoverPropsType } from '@material-ui/core/Popover';\nimport { WrapperProps } from './Wrapper';\nimport { useKeyDown } from '../_shared/hooks/useKeyDown';\nimport { TextFieldProps } from '@material-ui/core/TextField';\n\nexport interface InlineWrapperProps extends WrapperProps {\n /** Popover props passed to material-ui Popover (with variant=\"inline\") */\n PopoverProps?: Partial;\n}\n\nexport const InlineWrapper: React.FC = ({\n open,\n wider,\n children,\n PopoverProps,\n onClear,\n onDismiss,\n onSetToday,\n onAccept,\n showTabs,\n DateInputProps,\n InputComponent,\n ...other\n}) => {\n const ref = React.useRef();\n\n useKeyDown(open, {\n Enter: onAccept,\n });\n\n return (\n \n \n\n \n \n );\n};\n\nInlineWrapper.propTypes = {\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n PopoverProps: PropTypes.object,\n} as any;\n", "import * as React from 'react';\nimport { Omit } from '../_helpers/utils';\nimport { StaticWrapper } from './StaticWrapper';\nimport { ModalWrapper, ModalWrapperProps } from './ModalWrapper';\nimport { InlineWrapper, InlineWrapperProps } from './InlineWrapper';\nimport { KeyboardDateInputProps } from '../_shared/KeyboardDateInput';\nimport { PureDateInputProps, NotOverridableProps } from '../_shared/PureDateInput';\n\nexport type WrapperVariant = 'dialog' | 'inline' | 'static';\n\nexport interface WrapperProps {\n open: boolean;\n onAccept: () => void;\n onDismiss: () => void;\n onClear: () => void;\n onSetToday: () => void;\n InputComponent: React.FC;\n DateInputProps: T;\n wider?: boolean;\n showTabs?: boolean;\n}\n\ntype OmitInnerWrapperProps> = Omit<\n T,\n keyof WrapperProps | 'showTabs'\n>;\n\nexport type ModalRoot = OmitInnerWrapperProps;\n\nexport type InlineRoot = OmitInnerWrapperProps;\n\n// prettier-ignore\nexport type ExtendWrapper = {\n /**\n * Picker container option\n * @default 'dialog'\n */\n variant?: WrapperVariant\n} & ModalRoot\n & InlineRoot\n & Omit\n\nexport function getWrapperFromVariant(\n variant?: WrapperVariant\n): React.ComponentType | ModalWrapperProps> {\n switch (variant) {\n case 'inline':\n return InlineWrapper as any;\n\n case 'static':\n return StaticWrapper as any;\n\n default:\n return ModalWrapper as any;\n }\n}\n\ntype Props = {\n variant?: WrapperVariant;\n children?: React.ReactChild;\n} & (ModalWrapperProps | InlineWrapperProps);\n\nexport const VariantContext = React.createContext(null);\n\nexport const Wrapper: (\n p: Props\n) => React.ReactElement> = ({ variant, ...props }) => {\n const Component = getWrapperFromVariant(variant);\n\n return (\n \n \n \n );\n};\n", "import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport { Component } from 'react';\n\nvar Rifm =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Rifm, _React$Component);\n\n function Rifm(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this._state = null;\n _this._del = false;\n\n _this._handleChange = function (evt) {\n if (process.env.NODE_ENV !== 'production') {\n if (evt.target.type === 'number') {\n console.error('Rifm does not support input type=number, use type=tel instead.');\n return;\n }\n } // FUTURE: use evt.nativeEvent.inputType for del event, see comments at onkeydown\n\n\n var stateValue = _this.state.value;\n var value = evt.target.value;\n var input = evt.target;\n var op = value.length > stateValue.length;\n var del = _this._del;\n\n var noOp = stateValue === _this.props.format(value);\n\n _this.setState({\n value: value,\n local: true\n }, function () {\n var selectionStart = input.selectionStart;\n var refuse = _this.props.refuse || /[^\\d]+/g;\n var before = value.substr(0, selectionStart).replace(refuse, '');\n _this._state = {\n input: input,\n before: before,\n op: op,\n di: del && noOp,\n del: del\n };\n\n if (_this.props.replace && _this.props.replace(stateValue) && op && !noOp) {\n var start = -1;\n\n for (var i = 0; i !== before.length; ++i) {\n start = Math.max(start, value.toLowerCase().indexOf(before[i].toLowerCase(), start + 1));\n }\n\n var c = value.substr(start + 1).replace(refuse, '')[0];\n start = value.indexOf(c, start + 1);\n value = \"\" + value.substr(0, start) + value.substr(start + 1);\n }\n\n var fv = _this.props.format(value);\n\n if (stateValue === fv) {\n _this.setState({\n value: value\n });\n } else {\n _this.props.onChange(fv);\n }\n });\n };\n\n _this._hKD = function (evt) {\n if (evt.code === 'Delete') {\n _this._del = true;\n }\n };\n\n _this._hKU = function (evt) {\n if (evt.code === 'Delete') {\n _this._del = false;\n }\n };\n\n _this.state = {\n value: props.value,\n local: true\n };\n return _this;\n }\n\n Rifm.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n return {\n value: state.local ? state.value : props.value,\n local: false\n };\n };\n\n var _proto = Rifm.prototype;\n\n _proto.render = function render() {\n var _handleChange = this._handleChange,\n value = this.state.value,\n children = this.props.children;\n return children({\n value: value,\n onChange: _handleChange\n });\n } // delete when https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType will be supported by all major browsers\n ;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n document.removeEventListener('keydown', this._hKD);\n document.removeEventListener('keyup', this._hKU);\n } // delete when https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType will be supported by all major browsers\n ;\n\n _proto.componentDidMount = function componentDidMount() {\n document.addEventListener('keydown', this._hKD);\n document.addEventListener('keyup', this._hKU);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n var _state = this._state;\n\n if (_state) {\n var value = this.state.value;\n var start = -1;\n\n for (var i = 0; i !== _state.before.length; ++i) {\n start = Math.max(start, value.toLowerCase().indexOf(_state.before[i].toLowerCase(), start + 1));\n } // format usually looks better without this\n\n\n if (this.props.replace && (_state.op || _state.del && !_state.di)) {\n while (value[start + 1] && (this.props.refuse || /[^\\d]+/).test(value[start + 1])) {\n start += 1;\n }\n }\n\n _state.input.selectionStart = _state.input.selectionEnd = start + 1 + (_state.di ? 1 : 0);\n }\n\n this._state = null;\n };\n\n return Rifm;\n}(Component);\n\nexport { Rifm };\n", "import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}", "export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}", "import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}", "import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles(\n theme => ({\n day: {\n width: 36,\n height: 36,\n fontSize: theme.typography.caption.fontSize,\n margin: '0 2px',\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightMedium,\n padding: 0,\n },\n hidden: {\n opacity: 0,\n pointerEvents: 'none',\n },\n current: {\n color: theme.palette.primary.main,\n fontWeight: 600,\n },\n daySelected: {\n color: theme.palette.primary.contrastText,\n backgroundColor: theme.palette.primary.main,\n fontWeight: theme.typography.fontWeightMedium,\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n },\n },\n dayDisabled: {\n pointerEvents: 'none',\n color: theme.palette.text.hint,\n },\n }),\n { name: 'MuiPickersDay' }\n);\n\nexport interface DayProps {\n /** Day text */\n children: React.ReactNode;\n /** Is today */\n current?: boolean;\n /** Disabled? */\n disabled?: boolean;\n /** Hidden? */\n hidden?: boolean;\n /** Selected? */\n selected?: boolean;\n}\n\nexport const Day: React.FC = ({\n children,\n disabled,\n hidden,\n current,\n selected,\n ...other\n}) => {\n const classes = useStyles();\n const className = clsx(classes.day, {\n [classes.hidden]: hidden,\n [classes.current]: current,\n [classes.daySelected]: selected,\n [classes.dayDisabled]: disabled,\n });\n\n return (\n \n \n {children}\n \n \n );\n};\n\nDay.displayName = 'Day';\n\nDay.propTypes = {\n current: PropTypes.bool,\n disabled: PropTypes.bool,\n hidden: PropTypes.bool,\n selected: PropTypes.bool,\n};\n\nDay.defaultProps = {\n disabled: false,\n hidden: false,\n current: false,\n selected: false,\n};\n\nexport default Day;\n", "import { arrayIncludes } from './utils';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../typings/date';\nimport { DatePickerView } from '../DatePicker/DatePicker';\n\ninterface FindClosestDateParams {\n date: MaterialUiPickersDate;\n utils: IUtils;\n minDate: MaterialUiPickersDate;\n maxDate: MaterialUiPickersDate;\n disableFuture: boolean;\n disablePast: boolean;\n shouldDisableDate: (date: MaterialUiPickersDate) => boolean;\n}\n\nexport const findClosestEnabledDate = ({\n date,\n utils,\n minDate,\n maxDate,\n disableFuture,\n disablePast,\n shouldDisableDate,\n}: FindClosestDateParams) => {\n const today = utils.startOfDay(utils.date());\n\n if (disablePast && utils.isBefore(minDate!, today)) {\n minDate = today;\n }\n\n if (disableFuture && utils.isAfter(maxDate, today)) {\n maxDate = today;\n }\n\n let forward = date;\n let backward = date;\n if (utils.isBefore(date, minDate)) {\n forward = utils.date(minDate);\n backward = null;\n }\n\n if (utils.isAfter(date, maxDate)) {\n if (backward) {\n backward = utils.date(maxDate);\n }\n\n forward = null;\n }\n\n while (forward || backward) {\n if (forward && utils.isAfter(forward, maxDate)) {\n forward = null;\n }\n if (backward && utils.isBefore(backward, minDate)) {\n backward = null;\n }\n\n if (forward) {\n if (!shouldDisableDate(forward)) {\n return forward;\n }\n forward = utils.addDays(forward, 1);\n }\n\n if (backward) {\n if (!shouldDisableDate(backward)) {\n return backward;\n }\n backward = utils.addDays(backward, -1);\n }\n }\n\n // fallback to today if no enabled days\n return utils.date();\n};\n\nexport const isYearOnlyView = (views: DatePickerView[]) =>\n views.length === 1 && views[0] === 'year';\n\nexport const isYearAndMonthViews = (views: DatePickerView[]) =>\n views.length === 2 && arrayIncludes(views, 'month') && arrayIncludes(views, 'year');\n\nexport const getFormatByViews = (views: DatePickerView[], utils: IUtils) => {\n if (isYearOnlyView(views)) {\n return utils.yearFormat;\n }\n\n if (isYearAndMonthViews(views)) {\n return utils.yearMonthFormat;\n }\n\n return utils.dateFormat;\n};\n", "import * as React from 'react';\n\nexport interface DayWrapperProps {\n value: any;\n children: React.ReactNode;\n dayInCurrentMonth?: boolean;\n disabled?: boolean;\n onSelect: (value: any) => void;\n}\n\nconst DayWrapper: React.FC = ({\n children,\n value,\n disabled,\n onSelect,\n dayInCurrentMonth,\n ...other\n}) => {\n const handleClick = React.useCallback(() => onSelect(value), [onSelect, value]);\n\n return (\n \n {children}\n
\n );\n};\n\nexport default DayWrapper;\n", "import * as React from 'react';\nimport clsx from 'clsx';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\n\nexport type SlideDirection = 'right' | 'left';\ninterface SlideTransitionProps {\n transKey: React.Key;\n className?: string;\n slideDirection: SlideDirection;\n children: React.ReactChild;\n}\n\nconst animationDuration = 350;\nexport const useStyles = makeStyles(\n theme => {\n const slideTransition = theme.transitions.create('transform', {\n duration: animationDuration,\n easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)',\n });\n\n return {\n transitionContainer: {\n display: 'block',\n position: 'relative',\n '& > *': {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0,\n },\n },\n 'slideEnter-left': {\n willChange: 'transform',\n transform: 'translate(100%)',\n },\n 'slideEnter-right': {\n willChange: 'transform',\n transform: 'translate(-100%)',\n },\n slideEnterActive: {\n transform: 'translate(0%)',\n transition: slideTransition,\n },\n slideExit: {\n transform: 'translate(0%)',\n },\n 'slideExitActiveLeft-left': {\n willChange: 'transform',\n transform: 'translate(-200%)',\n transition: slideTransition,\n },\n 'slideExitActiveLeft-right': {\n willChange: 'transform',\n transform: 'translate(200%)',\n transition: slideTransition,\n },\n };\n },\n { name: 'MuiPickersSlideTransition' }\n);\n\nconst SlideTransition: React.SFC = ({\n children,\n transKey,\n slideDirection,\n className = null,\n}) => {\n const classes = useStyles();\n const transitionClasses = {\n exit: classes.slideExit,\n enterActive: classes.slideEnterActive,\n // @ts-ignore\n enter: classes['slideEnter-' + slideDirection],\n // @ts-ignore\n exitActive: classes['slideExitActiveLeft-' + slideDirection],\n };\n\n return (\n \n React.cloneElement(element, {\n classNames: transitionClasses,\n })\n }\n >\n \n \n );\n};\n\nexport default SlideTransition;\n", "import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\n\nexport const ArrowLeftIcon: React.SFC = props => {\n return (\n \n \n \n \n );\n};\n", "import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\n\nexport const ArrowRightIcon: React.SFC = props => {\n return (\n \n \n \n \n );\n};\n", "import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport SlideTransition, { SlideDirection } from './SlideTransition';\nimport IconButton, { IconButtonProps } from '@material-ui/core/IconButton';\nimport { DateType } from '@date-io/type';\nimport { useUtils } from '../../_shared/hooks/useUtils';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\nimport { ArrowLeftIcon } from '../../_shared/icons/ArrowLeftIcon';\nimport { ArrowRightIcon } from '../../_shared/icons/ArrowRightIcon';\n\nexport interface CalendarHeaderProps {\n currentMonth: DateType;\n leftArrowIcon?: React.ReactNode;\n rightArrowIcon?: React.ReactNode;\n leftArrowButtonProps?: Partial;\n rightArrowButtonProps?: Partial;\n disablePrevMonth?: boolean;\n disableNextMonth?: boolean;\n slideDirection: SlideDirection;\n onMonthChange: (date: MaterialUiPickersDate, direction: SlideDirection) => void | Promise;\n}\n\nexport const useStyles = makeStyles(\n theme => ({\n switchHeader: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginTop: theme.spacing(0.5),\n marginBottom: theme.spacing(1),\n },\n transitionContainer: {\n width: '100%',\n overflow: 'hidden',\n height: 23,\n },\n iconButton: {\n zIndex: 1,\n backgroundColor: theme.palette.background.paper,\n },\n daysHeader: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n maxHeight: 16,\n },\n dayLabel: {\n width: 36,\n margin: '0 2px',\n textAlign: 'center',\n color: theme.palette.text.hint,\n },\n }),\n { name: 'MuiPickersCalendarHeader' }\n);\n\nexport const CalendarHeader: React.SFC = ({\n currentMonth,\n onMonthChange,\n leftArrowIcon,\n rightArrowIcon,\n leftArrowButtonProps,\n rightArrowButtonProps,\n disablePrevMonth,\n disableNextMonth,\n slideDirection,\n}) => {\n const utils = useUtils();\n const classes = useStyles();\n const theme = useTheme();\n const rtl = theme.direction === 'rtl';\n\n const selectNextMonth = () => onMonthChange(utils.getNextMonth(currentMonth), 'left');\n const selectPreviousMonth = () => onMonthChange(utils.getPreviousMonth(currentMonth), 'right');\n\n return (\n
\n
\n \n {rtl ? rightArrowIcon : leftArrowIcon}\n \n\n \n \n {utils.getCalendarHeaderText(currentMonth)}\n \n \n\n \n {rtl ? leftArrowIcon : rightArrowIcon}\n \n
\n\n
\n {utils.getWeekdays().map((day, index) => (\n \n {day}\n \n ))}\n
\n
\n );\n};\n\nCalendarHeader.displayName = 'CalendarHeader';\n\nCalendarHeader.propTypes = {\n leftArrowIcon: PropTypes.node,\n rightArrowIcon: PropTypes.node,\n disablePrevMonth: PropTypes.bool,\n disableNextMonth: PropTypes.bool,\n};\n\nCalendarHeader.defaultProps = {\n leftArrowIcon: ,\n rightArrowIcon: ,\n disablePrevMonth: false,\n disableNextMonth: false,\n};\n\nexport default CalendarHeader;\n", "import * as React from 'react';\nimport { Omit } from '../_helpers/utils';\nimport { useUtils } from './hooks/useUtils';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../typings/date';\n\nexport interface WithUtilsProps {\n utils: IUtils;\n}\n\nexport const withUtils = () =>

(Component: React.ComponentType

) => {\n const WithUtils: React.SFC> = props => {\n const utils = useUtils();\n return ;\n };\n\n WithUtils.displayName = `WithUtils(${Component.displayName || Component.name})`;\n return WithUtils;\n};\n", "import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Day from './Day';\nimport DayWrapper from './DayWrapper';\nimport CalendarHeader from './CalendarHeader';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport SlideTransition, { SlideDirection } from './SlideTransition';\nimport { Theme } from '@material-ui/core/styles';\nimport { VariantContext } from '../../wrappers/Wrapper';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { runKeyHandler } from '../../_shared/hooks/useKeyDown';\nimport { IconButtonProps } from '@material-ui/core/IconButton';\nimport { withStyles, WithStyles } from '@material-ui/core/styles';\nimport { findClosestEnabledDate } from '../../_helpers/date-utils';\nimport { withUtils, WithUtilsProps } from '../../_shared/WithUtils';\n\nexport interface OutterCalendarProps {\n /** Left arrow icon */\n leftArrowIcon?: React.ReactNode;\n /** Right arrow icon */\n rightArrowIcon?: React.ReactNode;\n /** Custom renderer for day @DateIOType */\n renderDay?: (\n day: MaterialUiPickersDate,\n selectedDate: MaterialUiPickersDate,\n dayInCurrentMonth: boolean,\n dayComponent: JSX.Element\n ) => JSX.Element;\n /**\n * Enables keyboard listener for moving between days in calendar\n * @default true\n */\n allowKeyboardControl?: boolean;\n /**\n * Props to pass to left arrow button\n * @type {Partial}\n */\n leftArrowButtonProps?: Partial;\n /**\n * Props to pass to right arrow button\n * @type {Partial}\n */\n rightArrowButtonProps?: Partial;\n /** Disable specific date @DateIOType */\n shouldDisableDate?: (day: MaterialUiPickersDate) => boolean;\n /** Callback firing on month change. Return promise to render spinner till it will not be resolved @DateIOType */\n onMonthChange?: (date: MaterialUiPickersDate) => void | Promise;\n /** Custom loading indicator */\n loadingIndicator?: JSX.Element;\n}\n\nexport interface CalendarProps\n extends OutterCalendarProps,\n WithUtilsProps,\n WithStyles {\n /** Calendar Date @DateIOType */\n date: MaterialUiPickersDate;\n /** Calendar onChange */\n onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;\n /** Min date @DateIOType */\n minDate?: MaterialUiPickersDate;\n /** Max date @DateIOType */\n maxDate?: MaterialUiPickersDate;\n /** Disable past dates */\n disablePast?: boolean;\n /** Disable future dates */\n disableFuture?: boolean;\n}\n\nexport interface CalendarState {\n slideDirection: SlideDirection;\n currentMonth: MaterialUiPickersDate;\n lastDate?: MaterialUiPickersDate;\n loadingQueue: number;\n}\n\nconst KeyDownListener = ({ onKeyDown }: { onKeyDown: (e: KeyboardEvent) => void }) => {\n React.useEffect(() => {\n window.addEventListener('keydown', onKeyDown);\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [onKeyDown]);\n\n return null;\n};\n\nexport class Calendar extends React.Component {\n static contextType = VariantContext;\n static propTypes: any = {\n renderDay: PropTypes.func,\n shouldDisableDate: PropTypes.func,\n allowKeyboardControl: PropTypes.bool,\n };\n\n static defaultProps: Partial = {\n minDate: new Date('1900-01-01'),\n maxDate: new Date('2100-01-01'),\n disablePast: false,\n disableFuture: false,\n allowKeyboardControl: true,\n };\n\n static getDerivedStateFromProps(nextProps: CalendarProps, state: CalendarState) {\n const { utils, date: nextDate } = nextProps;\n\n if (!utils.isEqual(nextDate, state.lastDate)) {\n const nextMonth = utils.getMonth(nextDate);\n const lastDate = state.lastDate || nextDate;\n const lastMonth = utils.getMonth(lastDate);\n\n return {\n lastDate: nextDate,\n currentMonth: nextProps.utils.startOfMonth(nextDate),\n // prettier-ignore\n slideDirection: nextMonth === lastMonth\n ? state.slideDirection\n : utils.isAfterDay(nextDate, lastDate)\n ? 'left'\n : 'right'\n };\n }\n\n return null;\n }\n\n state: CalendarState = {\n slideDirection: 'left',\n currentMonth: this.props.utils.startOfMonth(this.props.date),\n loadingQueue: 0,\n };\n\n componentDidMount() {\n const { date, minDate, maxDate, utils, disablePast, disableFuture } = this.props;\n\n if (this.shouldDisableDate(date)) {\n const closestEnabledDate = findClosestEnabledDate({\n date,\n utils,\n minDate: utils.date(minDate),\n maxDate: utils.date(maxDate),\n disablePast: Boolean(disablePast),\n disableFuture: Boolean(disableFuture),\n shouldDisableDate: this.shouldDisableDate,\n });\n\n this.handleDaySelect(closestEnabledDate, false);\n }\n }\n\n private pushToLoadingQueue = () => {\n const loadingQueue = this.state.loadingQueue + 1;\n this.setState({ loadingQueue });\n };\n\n private popFromLoadingQueue = () => {\n let loadingQueue = this.state.loadingQueue;\n loadingQueue = loadingQueue <= 0 ? 0 : loadingQueue - 1;\n this.setState({ loadingQueue });\n };\n\n handleChangeMonth = (newMonth: MaterialUiPickersDate, slideDirection: SlideDirection) => {\n this.setState({ currentMonth: newMonth, slideDirection });\n\n if (this.props.onMonthChange) {\n const returnVal = this.props.onMonthChange(newMonth);\n if (returnVal) {\n this.pushToLoadingQueue();\n returnVal.then(() => {\n this.popFromLoadingQueue();\n });\n }\n }\n };\n\n validateMinMaxDate = (day: MaterialUiPickersDate) => {\n const { minDate, maxDate, utils, disableFuture, disablePast } = this.props;\n const now = utils.date();\n\n return Boolean(\n (disableFuture && utils.isAfterDay(day, now)) ||\n (disablePast && utils.isBeforeDay(day, now)) ||\n (minDate && utils.isBeforeDay(day, utils.date(minDate))) ||\n (maxDate && utils.isAfterDay(day, utils.date(maxDate)))\n );\n };\n\n shouldDisablePrevMonth = () => {\n const { utils, disablePast, minDate } = this.props;\n\n const now = utils.date();\n const firstEnabledMonth = utils.startOfMonth(\n disablePast && utils.isAfter(now, utils.date(minDate)) ? now : utils.date(minDate)\n );\n\n return !utils.isBefore(firstEnabledMonth, this.state.currentMonth);\n };\n\n shouldDisableNextMonth = () => {\n const { utils, disableFuture, maxDate } = this.props;\n\n const now = utils.date();\n const lastEnabledMonth = utils.startOfMonth(\n disableFuture && utils.isBefore(now, utils.date(maxDate)) ? now : utils.date(maxDate)\n );\n\n return !utils.isAfter(lastEnabledMonth, this.state.currentMonth);\n };\n\n shouldDisableDate = (day: MaterialUiPickersDate) => {\n const { shouldDisableDate } = this.props;\n\n return this.validateMinMaxDate(day) || Boolean(shouldDisableDate && shouldDisableDate(day));\n };\n\n handleDaySelect = (day: MaterialUiPickersDate, isFinish = true) => {\n const { date, utils } = this.props;\n\n this.props.onChange(utils.mergeDateAndTime(day, date), isFinish);\n };\n\n moveToDay = (day: MaterialUiPickersDate) => {\n const { utils } = this.props;\n\n if (day && !this.shouldDisableDate(day)) {\n if (utils.getMonth(day) !== utils.getMonth(this.state.currentMonth)) {\n this.handleChangeMonth(utils.startOfMonth(day), 'left');\n }\n\n this.handleDaySelect(day, false);\n }\n };\n\n handleKeyDown = (event: KeyboardEvent) => {\n const { theme, date, utils } = this.props;\n\n runKeyHandler(event, {\n ArrowUp: () => this.moveToDay(utils.addDays(date, -7)),\n ArrowDown: () => this.moveToDay(utils.addDays(date, 7)),\n ArrowLeft: () => this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? -1 : 1)),\n ArrowRight: () => this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? 1 : -1)),\n });\n };\n\n private renderWeeks = () => {\n const { utils, classes } = this.props;\n const weeks = utils.getWeekArray(this.state.currentMonth);\n\n return weeks.map(week => (\n

\n {this.renderDays(week)}\n
\n ));\n };\n\n private renderDays = (week: MaterialUiPickersDate[]) => {\n const { date, renderDay, utils } = this.props;\n\n const now = utils.date();\n const selectedDate = utils.startOfDay(date);\n const currentMonthNumber = utils.getMonth(this.state.currentMonth);\n\n return week.map(day => {\n const disabled = this.shouldDisableDate(day);\n const isDayInCurrentMonth = utils.getMonth(day) === currentMonthNumber;\n\n let dayComponent = (\n