Fix ts definition of Table & RangePicker

close https://segmentfault.com/q/1010000008423156
This commit is contained in:
afc163 2017-02-23 12:51:40 +08:00
parent 0f46eed370
commit a7c6c027ce
2 changed files with 14 additions and 2 deletions

View File

@ -22,6 +22,7 @@ export interface PickerProps {
getCalendarContainer?: (trigger: any) => React.ReactNode;
open?: boolean;
onOpenChange?: (status: boolean) => void;
disabledDate?: (current: moment.Moment) => boolean;
}
export interface SinglePickerProps {
@ -36,14 +37,17 @@ export interface DatePickerProps extends PickerProps, SinglePickerProps {
showToday?: boolean;
open?: boolean;
toggleOpen?: (e: {open: boolean}) => void;
disabledDate?: (current: moment.Moment) => boolean;
disabledTime?: (current: moment.Moment) => {
disabledHours?: () => [number, number],
disabledMinutes?: () => [number, number],
disabledSeconds?: () => [number, number],
};
onOpenChange?: (status: boolean) => void;
placeholder?: string;
}
const DatePicker = wrapPicker(createPicker(RcCalendar)) as React.ClassicComponentClass<DatePickerProps>;
export interface MonthPickerProps extends PickerProps, SinglePickerProps {
disabledDate?: (current: moment.Moment) => boolean;
placeholder?: string;
}
const MonthPicker = wrapPicker(createPicker(MonthCalendar), 'YYYY-MM');
@ -57,6 +61,12 @@ export interface RangePickerProps extends PickerProps {
ranges?: {
[range: string]: moment.Moment[],
};
placeholder?: [string, string],
disabledTime?: (current: moment.Moment, type: string) => {
disabledHours?: () => [number, number],
disabledMinutes?: () => [number, number],
disabledSeconds?: () => [number, number],
};
}
assign(DatePicker, {

View File

@ -62,6 +62,8 @@ export interface TableProps<T> {
expandedRowKeys?: string[];
expandIconAsCell?: boolean;
expandIconColumnIndex?: number;
onExpandedRowsChange?: (expandedRowKeys: string[]) => void;
onExpand?: (expanded: boolean, record: T) => void;
onChange?: (pagination: PaginationProps | boolean, filters: string[], sorter: Object) => any;
loading?: boolean;
locale?: Object;