UNPKG

react-calendar

Version:

Ultimate calendar for your React app.

56 lines (55 loc) 2.59 kB
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import type { ClassName, TileClassNameFunc, TileContentFunc, TileDisabledFunc, View } from './shared/types'; type TileProps = { activeStartDate: Date; children: React.ReactNode; classes?: ClassName; date: Date; formatAbbr?: (locale: string | undefined, date: Date) => string; locale?: string; maxDate?: Date; maxDateTransform: (date: Date) => Date; minDate?: Date; minDateTransform: (date: Date) => Date; onClick: (date: Date, event: React.MouseEvent) => void; onMouseOver: (date: Date) => void; style?: React.CSSProperties; tileClassName?: TileClassNameFunc | ClassName; tileContent?: TileContentFunc | React.ReactNode; tileDisabled?: TileDisabledFunc; view: View; }; type TileState = { activeStartDateProps?: TileProps['activeStartDate']; tileClassName?: ClassName; tileClassNameProps?: TileProps['tileClassName']; tileContent?: React.ReactNode; tileContentProps?: TileProps['tileContent']; }; export default class Tile extends Component<TileProps, TileState> { static propTypes: { children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>; formatAbbr: PropTypes.Requireable<(...args: any[]) => any>; maxDateTransform: PropTypes.Validator<(...args: any[]) => any>; minDateTransform: PropTypes.Validator<(...args: any[]) => any>; activeStartDate: PropTypes.Validator<Date>; classes: PropTypes.Validator<(string | null | undefined)[]>; date: PropTypes.Validator<Date>; locale: PropTypes.Requireable<string>; maxDate: typeof import("./shared/propTypes").isMaxDate; minDate: typeof import("./shared/propTypes").isMinDate; onClick: PropTypes.Requireable<(...args: any[]) => any>; onMouseOver: PropTypes.Requireable<(...args: any[]) => any>; style: PropTypes.Requireable<{ [x: string]: NonNullable<string | number | null | undefined> | null | undefined; }>; tileClassName: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | NonNullable<string | (string | null | undefined)[] | null | undefined> | null | undefined>>; tileContent: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>; tileDisabled: PropTypes.Requireable<(...args: any[]) => any>; }; static getDerivedStateFromProps(nextProps: TileProps, prevState: TileState): TileState; state: Readonly<TileState>; render(): JSX.Element; } export {};