@wangxinowo/vue-datepicker-next 1.0.2 → 1.0.5
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 -104
- package/dist/vue-datepicker-next.min.css +156 -7
- package/dist/vue-datepicker-next.min.js +3 -3
- package/package.json +88 -88
- package/src/components/calendar/locale/zh_CN.js +2 -0
- package/src/components/date-picker/PresetPanel.jsx +148 -102
- package/src/components/date-picker/style/MonthPanel.less +15 -0
- package/src/components/date-picker/style/RangePicker.less +515 -407
- package/src/components/date-picker/style/YearPanel.less +15 -0
- package/src/components/date-picker/style/presets.less +120 -69
- package/src/components/date-picker/wrapPicker.js +2 -2
- package/src/components/locale/default.js +35 -34
- package/src/components/time-picker/index.jsx +2 -2
- package/src/components/vc-calendar/src/Calendar.jsx +2 -2
- package/src/components/vc-calendar/src/FullCalendar.jsx +2 -2
- package/src/components/vc-calendar/src/MonthCalendar.jsx +2 -2
- package/src/components/vc-calendar/src/RangeCalendar.jsx +1105 -1031
- package/src/components/vc-calendar/src/calendar/CalendarHeader.jsx +277 -264
- package/src/components/vc-calendar/src/month/MonthPanel.jsx +130 -123
- package/src/components/vc-calendar/src/month/MonthTable.jsx +252 -138
- package/src/components/vc-calendar/src/range-calendar/CalendarPart.jsx +180 -171
- package/src/components/vc-calendar/src/year/YearPanel.jsx +242 -167
- package/src/components/vc-pagination/locale/zh_CN.js +15 -0
- package/src/index.js +48 -44
|
@@ -91,3 +91,18 @@
|
|
|
91
91
|
user-select: none;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
|
|
95
|
+
// 范围选择的起始/结束单元格样式
|
|
96
|
+
.@{calendar-prefix-cls}-year-panel-selected-start-cell,
|
|
97
|
+
.@{calendar-prefix-cls}-year-panel-selected-end-cell {
|
|
98
|
+
.@{calendar-prefix-cls}-year-panel-year {
|
|
99
|
+
color: @text-color-inverse;
|
|
100
|
+
background: @primary-color;
|
|
101
|
+
border-radius: @border-radius-sm;
|
|
102
|
+
|
|
103
|
+
&:hover {
|
|
104
|
+
color: @text-color-inverse;
|
|
105
|
+
background: @primary-5;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -1,69 +1,120 @@
|
|
|
1
|
-
// Presets Panel Styles for RangePicker
|
|
2
|
-
// 预设日期范围面板样式
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
// Presets Panel Styles for RangePicker
|
|
2
|
+
// 预设日期范围面板样式
|
|
3
|
+
|
|
4
|
+
// 左侧面板模式样式
|
|
5
|
+
.@{calendar-prefix-cls}-presets {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
min-width: 120px;
|
|
9
|
+
max-height: 240px;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
padding: @padding-xs 0;
|
|
12
|
+
border-right: @border-width-base @border-style-base @border-color-split;
|
|
13
|
+
background: @component-background;
|
|
14
|
+
|
|
15
|
+
&-list {
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
list-style: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-item {
|
|
22
|
+
padding: @padding-xs @padding-sm;
|
|
23
|
+
color: @text-color;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
transition: all 0.3s;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
color: @primary-color;
|
|
29
|
+
background: @item-hover-bg;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-selected {
|
|
33
|
+
color: @primary-color;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
background: @primary-1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 底部按钮模式样式
|
|
40
|
+
&-footer {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-wrap: wrap;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: @padding-xs;
|
|
45
|
+
padding: @padding-sm @padding-md;
|
|
46
|
+
border-top: @border-width-base @border-style-base @border-color-split;
|
|
47
|
+
background: @component-background;
|
|
48
|
+
|
|
49
|
+
&-btn {
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
height: 24px;
|
|
54
|
+
padding: 0 @padding-sm;
|
|
55
|
+
font-size: @font-size-sm;
|
|
56
|
+
color: @text-color;
|
|
57
|
+
background: @background-color-light;
|
|
58
|
+
border: @border-width-base @border-style-base @border-color-base;
|
|
59
|
+
border-radius: @border-radius-sm;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
transition: all 0.2s ease-in-out;
|
|
62
|
+
user-select: none;
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
color: @primary-color;
|
|
66
|
+
border-color: @primary-color;
|
|
67
|
+
background: @primary-1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:active {
|
|
71
|
+
color: @primary-7;
|
|
72
|
+
border-color: @primary-7;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-selected {
|
|
76
|
+
color: #fff;
|
|
77
|
+
background: @primary-color;
|
|
78
|
+
border-color: @primary-color;
|
|
79
|
+
|
|
80
|
+
&:hover {
|
|
81
|
+
color: #fff;
|
|
82
|
+
background: @primary-5;
|
|
83
|
+
border-color: @primary-5;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Range picker with presets layout
|
|
91
|
+
// 带预设的日期范围选择器布局
|
|
92
|
+
.@{calendar-prefix-cls}-range-with-presets {
|
|
93
|
+
.@{calendar-prefix-cls}-range-part {
|
|
94
|
+
display: flex;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Range picker popup with presets
|
|
99
|
+
// 带预设的弹出层布局
|
|
100
|
+
.@{calendar-prefix-cls}-picker-container {
|
|
101
|
+
.@{calendar-prefix-cls}-range-with-presets {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: stretch;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Footer quick selector (legacy support for ranges prop)
|
|
108
|
+
// 底部快捷选择器(兼容旧的 ranges 属性)
|
|
109
|
+
.@{calendar-prefix-cls}-range-quick-selector {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-wrap: wrap;
|
|
112
|
+
gap: @padding-xs;
|
|
113
|
+
padding: @padding-xs @padding-sm;
|
|
114
|
+
border-top: @border-width-base @border-style-base @border-color-split;
|
|
115
|
+
|
|
116
|
+
a,
|
|
117
|
+
.@{ant-prefix}-tag {
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -2,7 +2,7 @@ import TimePickerPanel from '../vc-time-picker/Panel';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
|
4
4
|
import { generateShowHourMinuteSecond } from '../time-picker';
|
|
5
|
-
import
|
|
5
|
+
import zhCN from './locale/zh_CN';
|
|
6
6
|
import { getOptionProps, initDefaultProps, getListeners } from '../_util/props-util';
|
|
7
7
|
import { ConfigConsumerProps } from '../config-provider/configConsumerProps';
|
|
8
8
|
import { checkValidate, stringToMoment, momentToString } from '../_util/moment-util';
|
|
@@ -77,7 +77,7 @@ export default function wrapPicker(Picker, props, pickerType) {
|
|
|
77
77
|
methods: {
|
|
78
78
|
getDefaultLocale() {
|
|
79
79
|
const result = {
|
|
80
|
-
...
|
|
80
|
+
...zhCN,
|
|
81
81
|
...this.locale,
|
|
82
82
|
};
|
|
83
83
|
result.lang = {
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import Pagination from '../vc-pagination/locale/
|
|
2
|
-
import DatePicker from '../date-picker/locale/
|
|
3
|
-
import TimePicker from '../time-picker/locale/
|
|
4
|
-
import Calendar from '../calendar/locale/
|
|
1
|
+
import Pagination from '../vc-pagination/locale/zh_CN';
|
|
2
|
+
import DatePicker from '../date-picker/locale/zh_CN';
|
|
3
|
+
import TimePicker from '../time-picker/locale/zh_CN';
|
|
4
|
+
import Calendar from '../calendar/locale/zh_CN';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
locale: '
|
|
7
|
+
locale: 'zh-cn',
|
|
8
8
|
Pagination,
|
|
9
9
|
DatePicker,
|
|
10
10
|
TimePicker,
|
|
11
11
|
Calendar,
|
|
12
|
+
// 所有组件的本地化配置
|
|
12
13
|
global: {
|
|
13
|
-
placeholder: '
|
|
14
|
+
placeholder: '请选择',
|
|
14
15
|
},
|
|
15
16
|
Table: {
|
|
16
|
-
filterTitle: '
|
|
17
|
-
filterConfirm: '
|
|
18
|
-
filterReset: '
|
|
19
|
-
selectAll: '
|
|
20
|
-
selectInvert: '
|
|
21
|
-
sortTitle: '
|
|
22
|
-
expand: '
|
|
23
|
-
collapse: '
|
|
17
|
+
filterTitle: '筛选',
|
|
18
|
+
filterConfirm: '确定',
|
|
19
|
+
filterReset: '重置',
|
|
20
|
+
selectAll: '全选当页',
|
|
21
|
+
selectInvert: '反选当页',
|
|
22
|
+
sortTitle: '排序',
|
|
23
|
+
expand: '展开行',
|
|
24
|
+
collapse: '关闭行',
|
|
24
25
|
},
|
|
25
26
|
Modal: {
|
|
26
|
-
okText: '
|
|
27
|
-
cancelText: '
|
|
28
|
-
justOkText: '
|
|
27
|
+
okText: '确定',
|
|
28
|
+
cancelText: '取消',
|
|
29
|
+
justOkText: '知道了',
|
|
29
30
|
},
|
|
30
31
|
Popconfirm: {
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
cancelText: '取消',
|
|
33
|
+
okText: '确定',
|
|
33
34
|
},
|
|
34
35
|
Transfer: {
|
|
35
36
|
titles: ['', ''],
|
|
36
|
-
searchPlaceholder: '
|
|
37
|
-
itemUnit: '
|
|
38
|
-
itemsUnit: '
|
|
37
|
+
searchPlaceholder: '请输入搜索内容',
|
|
38
|
+
itemUnit: '项',
|
|
39
|
+
itemsUnit: '项',
|
|
39
40
|
},
|
|
40
41
|
Upload: {
|
|
41
|
-
uploading: '
|
|
42
|
-
removeFile: '
|
|
43
|
-
uploadError: '
|
|
44
|
-
previewFile: '
|
|
45
|
-
downloadFile: '
|
|
42
|
+
uploading: '文件上传中',
|
|
43
|
+
removeFile: '删除文件',
|
|
44
|
+
uploadError: '上传错误',
|
|
45
|
+
previewFile: '预览文件',
|
|
46
|
+
downloadFile: '下载文件',
|
|
46
47
|
},
|
|
47
48
|
Empty: {
|
|
48
|
-
description: '
|
|
49
|
+
description: '暂无数据',
|
|
49
50
|
},
|
|
50
51
|
Icon: {
|
|
51
|
-
icon: '
|
|
52
|
+
icon: '图标',
|
|
52
53
|
},
|
|
53
54
|
Text: {
|
|
54
|
-
edit: '
|
|
55
|
-
copy: '
|
|
56
|
-
copied: '
|
|
57
|
-
expand: '
|
|
55
|
+
edit: '编辑',
|
|
56
|
+
copy: '复制',
|
|
57
|
+
copied: '复制成功',
|
|
58
|
+
expand: '展开',
|
|
58
59
|
},
|
|
59
60
|
PageHeader: {
|
|
60
|
-
back: '
|
|
61
|
+
back: '返回',
|
|
61
62
|
},
|
|
62
63
|
};
|
|
@@ -5,7 +5,7 @@ import BaseMixin from '../_util/BaseMixin';
|
|
|
5
5
|
import PropTypes from '../_util/vue-types';
|
|
6
6
|
import warning from '../_util/warning';
|
|
7
7
|
import Icon from '../icon';
|
|
8
|
-
import
|
|
8
|
+
import zhCN from './locale/zh_CN';
|
|
9
9
|
import {
|
|
10
10
|
initDefaultProps,
|
|
11
11
|
hasProp,
|
|
@@ -139,7 +139,7 @@ const TimePicker = {
|
|
|
139
139
|
},
|
|
140
140
|
getDefaultLocale() {
|
|
141
141
|
const defaultLocale = {
|
|
142
|
-
...
|
|
142
|
+
...zhCN,
|
|
143
143
|
...this.$props.locale,
|
|
144
144
|
};
|
|
145
145
|
return defaultLocale;
|
|
@@ -10,7 +10,7 @@ import CalendarFooter from './calendar/CalendarFooter';
|
|
|
10
10
|
import CalendarMixin, { getNowByCurrentStateValue } from './mixin/CalendarMixin';
|
|
11
11
|
import CommonMixin from './mixin/CommonMixin';
|
|
12
12
|
import DateInput from './date/DateInput';
|
|
13
|
-
import
|
|
13
|
+
import zhCn from './locale/zh_CN';
|
|
14
14
|
import { getTimeConfig, getTodayTime, syncTime } from './util';
|
|
15
15
|
import { goStartMonth, goEndMonth, goTime } from './util/toTime';
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ const getMomentObjectIfValid = date => {
|
|
|
24
24
|
const Calendar = {
|
|
25
25
|
name: 'Calendar',
|
|
26
26
|
props: {
|
|
27
|
-
locale: PropTypes.object.def(
|
|
27
|
+
locale: PropTypes.object.def(zhCn),
|
|
28
28
|
format: PropTypes.oneOfType([
|
|
29
29
|
PropTypes.string,
|
|
30
30
|
PropTypes.arrayOf(PropTypes.string),
|
|
@@ -7,11 +7,11 @@ import MonthTable from './month/MonthTable';
|
|
|
7
7
|
import CalendarMixin, { getNowByCurrentStateValue } from './mixin/CalendarMixin';
|
|
8
8
|
import CommonMixin from './mixin/CommonMixin';
|
|
9
9
|
import CalendarHeader from './full-calendar/CalendarHeader';
|
|
10
|
-
import
|
|
10
|
+
import zhCn from './locale/zh_CN';
|
|
11
11
|
const FullCalendar = {
|
|
12
12
|
name: 'FullCalendar',
|
|
13
13
|
props: {
|
|
14
|
-
locale: PropTypes.object.def(
|
|
14
|
+
locale: PropTypes.object.def(zhCn),
|
|
15
15
|
format: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.func]),
|
|
16
16
|
visible: PropTypes.bool.def(true),
|
|
17
17
|
prefixCls: PropTypes.string.def('rc-calendar'),
|
|
@@ -6,11 +6,11 @@ import CalendarHeader from './calendar/CalendarHeader';
|
|
|
6
6
|
import CalendarFooter from './calendar/CalendarFooter';
|
|
7
7
|
import CalendarMixin from './mixin/CalendarMixin';
|
|
8
8
|
import CommonMixin from './mixin/CommonMixin';
|
|
9
|
-
import
|
|
9
|
+
import zhCn from './locale/zh_CN';
|
|
10
10
|
const MonthCalendar = {
|
|
11
11
|
name: 'MonthCalendar',
|
|
12
12
|
props: {
|
|
13
|
-
locale: PropTypes.object.def(
|
|
13
|
+
locale: PropTypes.object.def(zhCn),
|
|
14
14
|
format: PropTypes.string,
|
|
15
15
|
visible: PropTypes.bool.def(true),
|
|
16
16
|
prefixCls: PropTypes.string.def('rc-calendar'),
|