UNPKG

rsuite

Version:

A suite of react components

65 lines (64 loc) 2.81 kB
import React from 'react'; import { RangeType } from './Toolbar'; import { DatePickerLocale } from '../locales'; import { PickerToggleProps } from '../Picker'; import { FormControlBaseProps, PickerBaseProps, RsRefForwardingComponent } from '../@types/common'; export type { RangeType } from './Toolbar'; export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, FormControlBaseProps<Date | null>, Pick<PickerToggleProps, 'caretAs' | 'readOnly' | 'plaintext'> { /** Configure shortcut options */ ranges?: RangeType<Date>[]; /** Calendar panel default presentation date and time */ calendarDefaultDate?: Date; /** Format date */ format?: string; /** * Display date panel when component initial * * @deprecated use <Calendar> instead **/ inline?: boolean; /** ISO 8601 standard, each calendar week begins on Monday and Sunday on the seventh day */ isoWeek?: boolean; /** Set the lower limit of the available year relative to the current selection date */ limitEndYear?: number; /** Whether to show week numbers */ showWeekNumbers?: boolean; /** Meridian format */ showMeridian?: boolean; /** one tap to select */ oneTap?: boolean; /** Disabled date */ disabledDate?: (date?: Date) => boolean; /** Disabled hours */ disabledHours?: (hour: number, date: Date) => boolean; /** Disabled minutes */ disabledMinutes?: (minute: number, date: Date) => boolean; /** Disabled seconds */ disabledSeconds?: (second: number, date: Date) => boolean; /** Hidden hours */ hideHours?: (hour: number, date: Date) => boolean; /** Hidden minutes */ hideMinutes?: (minute: number, date: Date) => boolean; /** Hidden seconds */ hideSeconds?: (second: number, date: Date) => boolean; /** Called when the calendar panel date changes */ onChangeCalendarDate?: (date: Date, event?: React.SyntheticEvent) => void; /** Called when opening the month view */ onToggleMonthDropdown?: (toggle: boolean) => void; /** Called when opening the time view */ onToggleTimeDropdown?: (toggle: boolean) => void; /** Called when the option is selected */ onSelect?: (date: Date, event?: React.SyntheticEvent) => void; /** Called after the prev month */ onPrevMonth?: (date: Date) => void; /** Called after the next month */ onNextMonth?: (date: Date) => void; /** Called after clicking the OK button */ onOk?: (date: Date, event: React.SyntheticEvent) => void; /** Called when clean */ onClean?: (event: React.MouseEvent) => void; /** Custom render value */ renderValue?: (value: Date, format: string) => string; } declare const DatePicker: RsRefForwardingComponent<'div', DatePickerProps>; export default DatePicker;