2019-01-12 11:33:27 +08:00
|
|
|
import VcCalendar from '../vc-calendar';
|
|
|
|
import MonthCalendar from '../vc-calendar/src/MonthCalendar';
|
|
|
|
import createPicker from './createPicker';
|
|
|
|
import wrapPicker from './wrapPicker';
|
|
|
|
import RangePicker from './RangePicker';
|
|
|
|
import WeekPicker from './WeekPicker';
|
|
|
|
import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface';
|
2019-08-28 10:50:19 +08:00
|
|
|
import Base from '../base';
|
2018-03-15 21:40:34 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
const DatePicker = wrapPicker(
|
|
|
|
{ ...createPicker(VcCalendar, DatePickerProps()), name: 'ADatePicker' },
|
|
|
|
DatePickerProps(),
|
2019-05-28 11:37:38 +08:00
|
|
|
'date',
|
2019-01-12 11:33:27 +08:00
|
|
|
);
|
2018-03-15 21:40:34 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
const MonthPicker = wrapPicker(
|
|
|
|
{ ...createPicker(MonthCalendar, MonthPickerProps()), name: 'AMonthPicker' },
|
|
|
|
MonthPickerProps(),
|
2019-04-20 12:34:24 +08:00
|
|
|
'month',
|
2019-01-12 11:33:27 +08:00
|
|
|
);
|
2018-03-15 21:40:34 +08:00
|
|
|
|
|
|
|
Object.assign(DatePicker, {
|
2019-04-20 12:34:24 +08:00
|
|
|
RangePicker: wrapPicker(RangePicker, RangePickerProps(), 'date'),
|
2018-03-15 21:40:34 +08:00
|
|
|
MonthPicker,
|
2019-04-20 12:34:24 +08:00
|
|
|
WeekPicker: wrapPicker(WeekPicker, WeekPickerProps(), 'week'),
|
2019-01-12 11:33:27 +08:00
|
|
|
});
|
2018-03-15 21:40:34 +08:00
|
|
|
|
2018-09-19 13:21:57 +08:00
|
|
|
/* istanbul ignore next */
|
2019-01-12 11:33:27 +08:00
|
|
|
DatePicker.install = function(Vue) {
|
2019-08-28 10:50:19 +08:00
|
|
|
Vue.use(Base);
|
2019-01-12 11:33:27 +08:00
|
|
|
Vue.component(DatePicker.name, DatePicker);
|
|
|
|
Vue.component(DatePicker.RangePicker.name, DatePicker.RangePicker);
|
|
|
|
Vue.component(DatePicker.MonthPicker.name, DatePicker.MonthPicker);
|
|
|
|
Vue.component(DatePicker.WeekPicker.name, DatePicker.WeekPicker);
|
|
|
|
};
|
2018-09-19 13:21:57 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
export default DatePicker;
|