UNPKG

@navinc/base-react-components

Version:
21 lines (20 loc) 1.37 kB
import { ChangeEventHandler, InputHTMLAttributes } from 'react'; import { TargetValue } from '../shared.js'; type UpdatedHTMLInputElement = TargetValue<HTMLInputElement, Date>; export type BaseDateInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'type' | 'onChange' | 'checked'> & { onChange?: ChangeEventHandler<UpdatedHTMLInputElement>; value?: Date; /** For the rare case that an uncontrolled input is needed. Otherwise the input is always controlled, even if value is * `undefined`. This is to allow initial values for input fields to be `undefined` without getting warnings from React * that an input switched from uncontrolled to controlled */ uncontrolled?: boolean; }; export declare const BaseDateInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange" | "value" | "checked"> & { onChange?: ChangeEventHandler<UpdatedHTMLInputElement>; value?: Date; /** For the rare case that an uncontrolled input is needed. Otherwise the input is always controlled, even if value is * `undefined`. This is to allow initial values for input fields to be `undefined` without getting warnings from React * that an input switched from uncontrolled to controlled */ uncontrolled?: boolean; } & import("react").RefAttributes<HTMLInputElement>>; export {};