@material-ui/lab
Version:
Material-UI Lab - Incubator for Material-UI React components.
31 lines (30 loc) • 1.44 kB
TypeScript
import * as React from 'react';
import { WithStyles } from '@material-ui/core/styles';
import { PickerOnChangeFn } from '../internal/pickers/hooks/useViews';
export interface ExportedYearPickerProps<TDate> {
/**
* Callback firing on year change @DateIOType.
*/
onYearChange?: (date: TDate) => void;
/**
* Disable specific years dynamically.
* Works like `shouldDisableDate` but for year selection view. @DateIOType.
*/
shouldDisableYear?: (day: TDate) => boolean;
}
export interface YearPickerProps<TDate> extends ExportedYearPickerProps<TDate> {
allowKeyboardControl?: boolean;
onFocusedDayChange?: (day: TDate) => void;
date: TDate | null;
disableFuture?: boolean | null;
disablePast?: boolean | null;
isDateDisabled: (day: TDate) => boolean;
maxDate: TDate;
minDate: TDate;
onChange: PickerOnChangeFn<TDate>;
className?: string;
}
export declare const styles: Record<"root", import("../../../material-ui-styles/src").CSSProperties | import("../../../material-ui-styles/src").CreateCSSProperties<{}> | import("../../../material-ui-styles/src").PropsFunc<{}, import("../../../material-ui-styles/src").CreateCSSProperties<{}>>>;
export declare type YearPickerClassKey = keyof WithStyles<typeof styles>['classes'];
declare const _default: <TDate>(props: YearPickerProps<TDate> & React.RefAttributes<HTMLDivElement>) => JSX.Element;
export default _default;