@wangxinowo/vue-datepicker-next 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +510 -510
- package/dist/vue-datepicker-next.min.css +153 -461
- package/dist/vue-datepicker-next.min.js +1 -1
- package/package.json +88 -88
- package/src/components/date-picker/PresetPanel.jsx +148 -148
- package/src/components/date-picker/style/RangePicker.less +515 -515
- package/src/components/date-picker/style/presets.less +120 -120
- package/src/components/date-picker/wrapPicker.js +2 -2
- package/src/components/style/core/base.less +4 -505
- package/src/components/style/core/motion/fade.less +4 -3
- package/src/components/style/core/motion/move.less +4 -3
- package/src/components/style/core/motion/other.less +3 -1
- package/src/components/style/core/motion/slide.less +4 -3
- package/src/components/style/core/motion/swing.less +5 -4
- package/src/components/style/core/motion/zoom.less +4 -3
- package/src/components/style/mixins/motion.less +7 -6
- package/src/components/time-picker/index.jsx +1 -1
- package/src/components/tooltip/abstractTooltipProps.js +1 -1
- package/src/components/vc-calendar/src/RangeCalendar.jsx +1105 -1105
- package/src/components/vc-calendar/src/calendar/CalendarHeader.jsx +277 -277
- package/src/components/vc-calendar/src/month/MonthPanel.jsx +130 -130
- package/src/components/vc-calendar/src/month/MonthTable.jsx +252 -252
- package/src/components/vc-calendar/src/range-calendar/CalendarPart.jsx +180 -180
- package/src/components/vc-calendar/src/year/YearPanel.jsx +242 -242
- package/src/index.js +48 -48
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import PropTypes from '../../../_util/vue-types';
|
|
2
|
-
import BaseMixin from '../../../_util/BaseMixin';
|
|
3
|
-
import { hasProp, getListeners } from '../../../_util/props-util';
|
|
4
|
-
import MonthTable from './MonthTable';
|
|
5
|
-
|
|
6
|
-
function goYear(direction) {
|
|
7
|
-
this.changeYear(direction);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function noop() {}
|
|
11
|
-
|
|
12
|
-
const MonthPanel = {
|
|
13
|
-
name: 'MonthPanel',
|
|
14
|
-
mixins: [BaseMixin],
|
|
15
|
-
props: {
|
|
16
|
-
value: PropTypes.any,
|
|
17
|
-
defaultValue: PropTypes.any,
|
|
18
|
-
// 支持单个值或数组(范围选择)
|
|
19
|
-
selectedValue: PropTypes.oneOfType([PropTypes.any, PropTypes.array]),
|
|
20
|
-
// hover 值,用于范围选择时的预览效果
|
|
21
|
-
hoverValue: PropTypes.array.def([]),
|
|
22
|
-
cellRender: PropTypes.any,
|
|
23
|
-
contentRender: PropTypes.any,
|
|
24
|
-
locale: PropTypes.any,
|
|
25
|
-
rootPrefixCls: PropTypes.string,
|
|
26
|
-
// onChange: PropTypes.func,
|
|
27
|
-
disabledDate: PropTypes.func,
|
|
28
|
-
// onSelect: PropTypes.func,
|
|
29
|
-
renderFooter: PropTypes.func,
|
|
30
|
-
changeYear: PropTypes.func.def(noop),
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
data() {
|
|
34
|
-
const { value, defaultValue } = this;
|
|
35
|
-
// bind methods
|
|
36
|
-
this.nextYear = goYear.bind(this, 1);
|
|
37
|
-
this.previousYear = goYear.bind(this, -1);
|
|
38
|
-
return {
|
|
39
|
-
sValue: value || defaultValue,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
watch: {
|
|
43
|
-
value(val) {
|
|
44
|
-
this.setState({
|
|
45
|
-
sValue: val,
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
methods: {
|
|
50
|
-
setAndSelectValue(value) {
|
|
51
|
-
this.setValue(value);
|
|
52
|
-
this.__emit('select', value);
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
setValue(value) {
|
|
56
|
-
if (hasProp(this, 'value')) {
|
|
57
|
-
this.setState({
|
|
58
|
-
sValue: value,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
render() {
|
|
65
|
-
const {
|
|
66
|
-
sValue,
|
|
67
|
-
cellRender,
|
|
68
|
-
contentRender,
|
|
69
|
-
locale,
|
|
70
|
-
rootPrefixCls,
|
|
71
|
-
disabledDate,
|
|
72
|
-
renderFooter,
|
|
73
|
-
selectedValue,
|
|
74
|
-
hoverValue,
|
|
75
|
-
} = this;
|
|
76
|
-
const year = sValue.year();
|
|
77
|
-
const prefixCls = `${rootPrefixCls}-month-panel`;
|
|
78
|
-
const monthHover = getListeners(this).monthHover || noop;
|
|
79
|
-
|
|
80
|
-
const footer = renderFooter && renderFooter('month');
|
|
81
|
-
return (
|
|
82
|
-
<div class={prefixCls}>
|
|
83
|
-
<div>
|
|
84
|
-
<div class={`${prefixCls}-header`}>
|
|
85
|
-
<a
|
|
86
|
-
class={`${prefixCls}-prev-year-btn`}
|
|
87
|
-
role="button"
|
|
88
|
-
onClick={this.previousYear}
|
|
89
|
-
title={locale.previousYear}
|
|
90
|
-
/>
|
|
91
|
-
|
|
92
|
-
<a
|
|
93
|
-
class={`${prefixCls}-year-select`}
|
|
94
|
-
role="button"
|
|
95
|
-
onClick={getListeners(this).yearPanelShow || noop}
|
|
96
|
-
title={locale.yearSelect}
|
|
97
|
-
>
|
|
98
|
-
<span class={`${prefixCls}-year-select-content`}>{year}</span>
|
|
99
|
-
<span class={`${prefixCls}-year-select-arrow`}>x</span>
|
|
100
|
-
</a>
|
|
101
|
-
|
|
102
|
-
<a
|
|
103
|
-
class={`${prefixCls}-next-year-btn`}
|
|
104
|
-
role="button"
|
|
105
|
-
onClick={this.nextYear}
|
|
106
|
-
title={locale.nextYear}
|
|
107
|
-
/>
|
|
108
|
-
</div>
|
|
109
|
-
<div class={`${prefixCls}-body`}>
|
|
110
|
-
<MonthTable
|
|
111
|
-
disabledDate={disabledDate}
|
|
112
|
-
onSelect={this.setAndSelectValue}
|
|
113
|
-
onMonthHover={monthHover}
|
|
114
|
-
locale={locale}
|
|
115
|
-
value={sValue}
|
|
116
|
-
selectedValue={selectedValue}
|
|
117
|
-
hoverValue={hoverValue}
|
|
118
|
-
cellRender={cellRender}
|
|
119
|
-
contentRender={contentRender}
|
|
120
|
-
prefixCls={prefixCls}
|
|
121
|
-
/>
|
|
122
|
-
</div>
|
|
123
|
-
{footer && <div class={`${prefixCls}-footer`}>{footer}</div>}
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
);
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export default MonthPanel;
|
|
1
|
+
import PropTypes from '../../../_util/vue-types';
|
|
2
|
+
import BaseMixin from '../../../_util/BaseMixin';
|
|
3
|
+
import { hasProp, getListeners } from '../../../_util/props-util';
|
|
4
|
+
import MonthTable from './MonthTable';
|
|
5
|
+
|
|
6
|
+
function goYear(direction) {
|
|
7
|
+
this.changeYear(direction);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function noop() {}
|
|
11
|
+
|
|
12
|
+
const MonthPanel = {
|
|
13
|
+
name: 'MonthPanel',
|
|
14
|
+
mixins: [BaseMixin],
|
|
15
|
+
props: {
|
|
16
|
+
value: PropTypes.any,
|
|
17
|
+
defaultValue: PropTypes.any,
|
|
18
|
+
// 支持单个值或数组(范围选择)
|
|
19
|
+
selectedValue: PropTypes.oneOfType([PropTypes.any, PropTypes.array]),
|
|
20
|
+
// hover 值,用于范围选择时的预览效果
|
|
21
|
+
hoverValue: PropTypes.array.def([]),
|
|
22
|
+
cellRender: PropTypes.any,
|
|
23
|
+
contentRender: PropTypes.any,
|
|
24
|
+
locale: PropTypes.any,
|
|
25
|
+
rootPrefixCls: PropTypes.string,
|
|
26
|
+
// onChange: PropTypes.func,
|
|
27
|
+
disabledDate: PropTypes.func,
|
|
28
|
+
// onSelect: PropTypes.func,
|
|
29
|
+
renderFooter: PropTypes.func,
|
|
30
|
+
changeYear: PropTypes.func.def(noop),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
data() {
|
|
34
|
+
const { value, defaultValue } = this;
|
|
35
|
+
// bind methods
|
|
36
|
+
this.nextYear = goYear.bind(this, 1);
|
|
37
|
+
this.previousYear = goYear.bind(this, -1);
|
|
38
|
+
return {
|
|
39
|
+
sValue: value || defaultValue,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
watch: {
|
|
43
|
+
value(val) {
|
|
44
|
+
this.setState({
|
|
45
|
+
sValue: val,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
setAndSelectValue(value) {
|
|
51
|
+
this.setValue(value);
|
|
52
|
+
this.__emit('select', value);
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
setValue(value) {
|
|
56
|
+
if (hasProp(this, 'value')) {
|
|
57
|
+
this.setState({
|
|
58
|
+
sValue: value,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
render() {
|
|
65
|
+
const {
|
|
66
|
+
sValue,
|
|
67
|
+
cellRender,
|
|
68
|
+
contentRender,
|
|
69
|
+
locale,
|
|
70
|
+
rootPrefixCls,
|
|
71
|
+
disabledDate,
|
|
72
|
+
renderFooter,
|
|
73
|
+
selectedValue,
|
|
74
|
+
hoverValue,
|
|
75
|
+
} = this;
|
|
76
|
+
const year = sValue.year();
|
|
77
|
+
const prefixCls = `${rootPrefixCls}-month-panel`;
|
|
78
|
+
const monthHover = getListeners(this).monthHover || noop;
|
|
79
|
+
|
|
80
|
+
const footer = renderFooter && renderFooter('month');
|
|
81
|
+
return (
|
|
82
|
+
<div class={prefixCls}>
|
|
83
|
+
<div>
|
|
84
|
+
<div class={`${prefixCls}-header`}>
|
|
85
|
+
<a
|
|
86
|
+
class={`${prefixCls}-prev-year-btn`}
|
|
87
|
+
role="button"
|
|
88
|
+
onClick={this.previousYear}
|
|
89
|
+
title={locale.previousYear}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<a
|
|
93
|
+
class={`${prefixCls}-year-select`}
|
|
94
|
+
role="button"
|
|
95
|
+
onClick={getListeners(this).yearPanelShow || noop}
|
|
96
|
+
title={locale.yearSelect}
|
|
97
|
+
>
|
|
98
|
+
<span class={`${prefixCls}-year-select-content`}>{year}</span>
|
|
99
|
+
<span class={`${prefixCls}-year-select-arrow`}>x</span>
|
|
100
|
+
</a>
|
|
101
|
+
|
|
102
|
+
<a
|
|
103
|
+
class={`${prefixCls}-next-year-btn`}
|
|
104
|
+
role="button"
|
|
105
|
+
onClick={this.nextYear}
|
|
106
|
+
title={locale.nextYear}
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
<div class={`${prefixCls}-body`}>
|
|
110
|
+
<MonthTable
|
|
111
|
+
disabledDate={disabledDate}
|
|
112
|
+
onSelect={this.setAndSelectValue}
|
|
113
|
+
onMonthHover={monthHover}
|
|
114
|
+
locale={locale}
|
|
115
|
+
value={sValue}
|
|
116
|
+
selectedValue={selectedValue}
|
|
117
|
+
hoverValue={hoverValue}
|
|
118
|
+
cellRender={cellRender}
|
|
119
|
+
contentRender={contentRender}
|
|
120
|
+
prefixCls={prefixCls}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
{footer && <div class={`${prefixCls}-footer`}>{footer}</div>}
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export default MonthPanel;
|