UNPKG

@navinc/base-react-components

Version:
21 lines (20 loc) 974 B
import { FocusEventHandler, ChangeEventHandler } from 'react'; import { Input } from '../input.js'; import { InferComponentProps } from '../types.js'; type PatternInputProps = InferComponentProps<typeof Input> & { name: string; /** pattern - A Vanilla Masker pattern that will be passed into `toPattern` */ pattern: string; onBlur?: FocusEventHandler<HTMLInputElement>; onChange?: ChangeEventHandler<HTMLInputElement>; invalidOnTouched?: boolean; }; /** * PatternInput - A generic text input that works with Vanilla Masker's `toPattern` * * `<PatternInput pattern="99-99-99" value="123456" />` the value will be reformatted and displayed as "12-34-56" * * @deprecated This component is deprecated and will be removed in a future release. Avoid using it in new code. */ export declare const PatternInput: ({ name, pattern, onBlur, onChange, invalidOnTouched, ...props }: PatternInputProps) => import("react/jsx-runtime").JSX.Element; export {};