UNPKG

react-day-picker

Version:

Customizable Date Picker for React

27 lines (26 loc) 1.44 kB
import { HTMLProps } from 'react'; import { ActiveModifiers } from '../../types/Modifiers'; export declare type EventName = 'onClick' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'onMouseEnter' | 'onMouseLeave' | 'onTouchCancel' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart'; export declare type DayEventName = 'onDayClick' | 'onDayFocus' | 'onDayBlur' | 'onDayKeyDown' | 'onDayKeyUp' | 'onDayMouseEnter' | 'onDayMouseLeave' | 'onDayTouchCancel' | 'onDayTouchEnd' | 'onDayTouchMove' | 'onDayTouchStart'; export declare type DayEventHandlers = Pick<HTMLProps<HTMLButtonElement>, EventName>; /** * This hook returns details about the content to render in the day cell. * * * When a day cell is rendered in the table, DayPicker can either: * * - render nothing: when the day is outside the month or has matched the * "hidden" modifier. * - render a button when `onDayClick` or a selection mode is set. * - render a non-interactive element: when no selection mode is set, the day * cell shouldn’t respond to any interaction. DayPicker should render a `div` * or a `span`. * * ### Usage * * Use this hook to customize the behavior of the [[Day]] component. Create a * new `Day` component using this hook and pass it to the `components` prop. * The source of [[Day]] can be a good starting point. * */ export declare function useDayEventHandlers(date: Date, activeModifiers: ActiveModifiers): DayEventHandlers;