@navinc/base-react-components
Version:
Nav's Pattern Library
21 lines (20 loc) • 1.37 kB
TypeScript
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 {};