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';
|
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 */
|
2020-07-22 17:47:08 +08:00
|
|
|
DatePicker.install = function(app) {
|
|
|
|
app.component(DatePicker.name, DatePicker);
|
|
|
|
app.component(DatePicker.RangePicker.name, DatePicker.RangePicker);
|
|
|
|
app.component(DatePicker.MonthPicker.name, DatePicker.MonthPicker);
|
|
|
|
app.component(DatePicker.WeekPicker.name, DatePicker.WeekPicker);
|
2020-10-13 19:14:56 +08:00
|
|
|
return app;
|
2019-01-12 11:33:27 +08:00
|
|
|
};
|
2018-09-19 13:21:57 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
export default DatePicker;
|