@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
31 lines (30 loc) • 1.58 kB
TypeScript
import { ChangeEventHandler, FocusEventHandler } from 'react';
import { ParamsTypeInputHook, ReturnTypeInputHook } from '../../../hooks/useInput/types/inputHook';
import { SelectedDate } from '../types/inputDate';
type ParamsType = ParamsTypeInputHook & {
format: string;
minDate: Date;
maxDate?: Date;
initialDate?: Date;
initialSecondDate?: Date;
today?: string;
hasRange?: boolean;
dateSeparator?: string;
name?: string;
onSelectedDateChange?: (newDate: Date | SelectedDate) => void;
onClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
onDateError?: (hasError: boolean) => void;
onCalendarOpen?: (calendarOpen: boolean) => void;
onWrapperBlur?: FocusEventHandler<HTMLDivElement>;
};
type ReturnType = Omit<ReturnTypeInputHook, 'eventKeyPressRef'> & {
dateFormatted: Date[];
calendarOpen: boolean;
handleClickInput: React.MouseEventHandler<HTMLInputElement>;
handlePickCalendarDate: (newDate: Date[]) => void;
handleOpenCalendar: (open: boolean) => void;
handleChangeInternalValidate: ChangeEventHandler<HTMLInputElement>;
handleWrapperBlur: FocusEventHandler<HTMLDivElement>;
};
export declare const useInputDate: ({ ref, errorExecution, internalErrorExecution, keyValidation, max, min, maxLength, minLength, maxDate, mask, maskType, disabled, error, currentValue, today, type, truncate, informationAssociated, disabledCopyAndPaste, onWrapperBlur, onBlur, onChange, onFocus, onKeyDown, onError, onInternalErrors, onPaste, ...props }: ParamsType) => ReturnType;
export {};