UNPKG

3.05 kBTypeScriptView Raw
1import PropTypes from 'prop-types';
2import React from 'react';
3import { WidgetProps } from './Widget';
4export interface TimeInputProps extends Omit<WidgetProps, 'value' | 'onChange'> {
5 value?: Date | null;
6 onChange?: (date: Date | null, ctx?: any) => void;
7 datePart?: Date;
8 use12HourClock?: boolean;
9 padValues?: boolean;
10 emptyCharacter?: string;
11 noClearButton?: boolean;
12 disabled?: boolean;
13 readOnly?: boolean;
14 precision: 'minutes' | 'seconds' | 'milliseconds';
15 hoursAddon?: React.ReactNode;
16 minutesAddon?: React.ReactNode;
17 secondsAddon?: React.ReactNode;
18 millisecondsAddon?: React.ReactNode;
19}
20declare function TimeInput(uncontrolledProps: TimeInputProps): JSX.Element;
21declare namespace TimeInput {
22 var propTypes: {
23 /**
24 * @example ['valuePicker', [ ['new Date()'] ]]
25 */
26 value: PropTypes.Requireable<Date>;
27 /**
28 * @example ['onChangePicker', [ ['new Date()'] ]]
29 */
30 onChange: PropTypes.Requireable<(...args: any[]) => any>;
31 /**
32 * The default date used to construct a new time when the `value` is empty
33 *
34 * @default new Date()
35 **/
36 datePart: PropTypes.Requireable<Date>;
37 /**
38 * Use a 12 hour clock (with AM/PM) instead of 24 hour one.
39 * The configured localizer may provide a default value .
40 **/
41 use12HourClock: PropTypes.Requireable<boolean>;
42 /** Time part values will be padded by `0` */
43 padValues: PropTypes.Requireable<boolean>;
44 /** The string character used to pad empty, or cleared values */
45 emptyCharacter: PropTypes.Requireable<string>;
46 /** Hide the input clear button */
47 noClearButton: PropTypes.Requireable<boolean>;
48 /**
49 * @example ['disabled', ['new Date()']]
50 */
51 disabled: PropTypes.Requireable<boolean>;
52 /**
53 * @example ['readOnly', ['new Date()']]
54 */
55 readOnly: PropTypes.Requireable<boolean>;
56 /** Controls how precise of a time can be input **/
57 precision: PropTypes.Validator<string>;
58 /**
59 * The seperator between hours and minutes
60 * @default ':'
61 */
62 hoursAddon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
63 /**
64 * The seperator between hours and minutes
65 * @default ':'
66 */
67 minutesAddon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
68 /**
69 * The seperator between hours and minutes
70 * @default ':'
71 */
72 secondsAddon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
73 /**
74 * The seperator between hours and minutes
75 * @default '.'
76 */
77 millisecondsAddon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
78 };
79 var defaultProps: {
80 hoursAddon: string;
81 padValues: boolean;
82 precision: string;
83 emptyCharacter: string;
84 };
85}
86export default TimeInput;
87//# sourceMappingURL=TimeInput.d.ts.map
\No newline at end of file