1 | import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
2 | import 'react';
|
3 | import 'prop-types';
|
4 | import { u as useUtils } from './useUtils-cfb96ac9.js';
|
5 | import 'clsx';
|
6 | import '@babel/runtime/helpers/esm/extends';
|
7 | import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
8 | import '@material-ui/core/Typography';
|
9 | import '@material-ui/core/styles';
|
10 | import { m as makePickerWithState, a as PureDateInput, u as usePickerState, K as KeyboardDateInput, b as useKeyboardPickerState, p as pick12hOr24hFormat } from './makePickerWithState-5a79cb8a.js';
|
11 | import '@material-ui/core/Button';
|
12 | import '@material-ui/core/Toolbar';
|
13 | import './Wrapper-241966d7.js';
|
14 | import './Calendar-11ae61f6.js';
|
15 | import '@material-ui/core/TextField';
|
16 | import '@material-ui/core/IconButton';
|
17 | import '@material-ui/core/InputAdornment';
|
18 | import 'rifm';
|
19 | import '@material-ui/core/SvgIcon';
|
20 | import '@babel/runtime/helpers/esm/slicedToArray';
|
21 | import { t as timePickerDefaultProps } from './Picker-ccd9ba90.js';
|
22 | import '@babel/runtime/helpers/esm/classCallCheck';
|
23 | import '@babel/runtime/helpers/esm/createClass';
|
24 | import '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
25 | import '@babel/runtime/helpers/esm/getPrototypeOf';
|
26 | import '@babel/runtime/helpers/esm/inherits';
|
27 | import './Day.js';
|
28 | import 'react-transition-group';
|
29 | import '@material-ui/core/CircularProgress';
|
30 | import '@material-ui/core/DialogActions';
|
31 | import '@material-ui/core/DialogContent';
|
32 | import '@material-ui/core/Dialog';
|
33 | import '@material-ui/core/Popover';
|
34 | import './Clock-48fde975.js';
|
35 | import './ClockView.js';
|
36 | import { T as TimePickerToolbar } from './TimePickerToolbar-81100fab.js';
|
37 |
|
38 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
39 |
|
40 | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
41 |
|
42 | var defaultProps = _objectSpread({}, timePickerDefaultProps, {
|
43 | openTo: 'hours',
|
44 | views: ['hours', 'minutes']
|
45 | });
|
46 |
|
47 | function useOptions(props) {
|
48 | var utils = useUtils();
|
49 | return {
|
50 | getDefaultFormat: function getDefaultFormat() {
|
51 | return pick12hOr24hFormat(props.format, props.ampm, {
|
52 | '12h': utils.time12hFormat,
|
53 | '24h': utils.time24hFormat
|
54 | });
|
55 | }
|
56 | };
|
57 | }
|
58 |
|
59 | var TimePicker = makePickerWithState({
|
60 | useOptions: useOptions,
|
61 | Input: PureDateInput,
|
62 | useState: usePickerState,
|
63 | DefaultToolbarComponent: TimePickerToolbar
|
64 | });
|
65 | var KeyboardTimePicker = makePickerWithState({
|
66 | useOptions: useOptions,
|
67 | Input: KeyboardDateInput,
|
68 | useState: useKeyboardPickerState,
|
69 | DefaultToolbarComponent: TimePickerToolbar,
|
70 | getCustomProps: function getCustomProps(props) {
|
71 | return {
|
72 | refuse: props.ampm ? /[^\dap]+/gi : /[^\d]+/gi
|
73 | };
|
74 | }
|
75 | });
|
76 | TimePicker.defaultProps = defaultProps;
|
77 | KeyboardTimePicker.defaultProps = defaultProps;
|
78 |
|
79 | export { KeyboardTimePicker, TimePicker };
|
80 |
|