mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
Fix ts definition of Table & RangePicker
close https://segmentfault.com/q/1010000008423156
This commit is contained in:
parent
0f46eed370
commit
a7c6c027ce
@ -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, {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user