ant-design-vue/types/date-picker/range-picker.d.ts

91 lines
2.3 KiB
TypeScript
Raw Normal View History

// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types
2020-08-20 13:23:43 +00:00
import { DatepickerMethod, DatepickerProps } from './common';
2019-01-12 03:33:27 +00:00
import { Moment } from 'moment';
2020-08-20 13:23:43 +00:00
import { VNodeChild } from 'vue';
2020-08-20 13:23:43 +00:00
declare class RangePickerProps extends DatepickerProps {
/**
* to set default date
* @type [Moment, Moment]
*/
2020-08-20 13:23:43 +00:00
defaultValue?: [Moment, Moment] | [string, string];
/**
* to set default picker date
* @type [Moment, Moment]
*/
2020-08-20 13:23:43 +00:00
defaultPickerValue?: [Moment, Moment] | [string, string];
/**
* to specify the time that cannot be selected
* @type Function
*/
2020-08-20 13:23:43 +00:00
disabledTime?: (dates: [Moment, Moment], partial: 'start' | 'end') => any;
/**
* to set the date format, refer to moment.js
* @default 'YYYY-MM-DD HH:mm:ss'
* @type string
* @see http://momentjs.com
*/
2020-08-20 13:23:43 +00:00
format?: string;
/**
* preseted ranges for quick selection
* @type object
*/
2020-08-20 13:23:43 +00:00
ranges?: { [range: string]: Moment[] } | { [range: string]: () => Moment[] };
/**
* render extra footer in panel by setting a scoped slot
* @type any (slot="renderExtraFooter")
*/
2020-08-20 13:23:43 +00:00
renderExtraFooter?: Function | VNodeChild | JSX.Element;
/**
* set separator between inputs
* @default '~'
* @version 1.5.0
*/
separator?: string;
/**
* to provide an additional time selection
* showTime.defaultValue to set default time of selected date - type Moment[]
* @default TimePicker Options
* @type object | boolean
*/
2020-08-20 13:23:43 +00:00
showTime?: object | boolean;
/**
* to set date
* @type [Moment, Moment]
*/
2020-08-20 13:23:43 +00:00
value?: [Moment, Moment] | [string, string];
/**
* a callback function, can be executed when the start time or the end time of the range is changing
*/
onCalendarChange?: (
dates?: [Moment, Moment] | [string, string],
dateStrings?: [string, string],
) => void;
/**
* a callback function, can be executed when the selected time is changing
*/
onChange?: (dates?: [Moment, Moment] | [string, string], dateStrings?: [string, string]) => void;
/**
* callback when click ok button
*/
onOk?: (dates?: [Moment, Moment] | [string, string]) => void;
}
export declare class RangePicker extends DatepickerMethod {
$props: RangePickerProps;
}