@seafile/seafile-calendar 0.0.28 → 0.0.29-alpha.1
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 +1 -1
- package/package.json +1 -1
- package/assets/index.css +0 -1177
- package/dist/rc-calendar.css +0 -1179
- package/dist/rc-calendar.css.map +0 -1
- package/dist/rc-calendar.js +0 -7043
- package/dist/rc-calendar.js.map +0 -1
- package/dist/rc-calendar.min.css +0 -1179
- package/dist/rc-calendar.min.css.map +0 -1
- package/dist/rc-calendar.min.js +0 -1
- package/es/Calendar.js +0 -436
- package/es/FullCalendar.js +0 -182
- package/es/MonthCalendar.js +0 -135
- package/es/Picker.js +0 -245
- package/es/RangeCalendar.js +0 -876
- package/es/calendar/CalendarFooter.js +0 -93
- package/es/calendar/CalendarHeader.js +0 -257
- package/es/calendar/CalendarRightPanel.js +0 -121
- package/es/calendar/OkButton.js +0 -22
- package/es/calendar/TimePickerButton.js +0 -28
- package/es/calendar/TodayButton.js +0 -28
- package/es/date/DateConstants.js +0 -4
- package/es/date/DateInput.js +0 -233
- package/es/date/DateTBody.js +0 -275
- package/es/date/DateTHead.js +0 -78
- package/es/date/DateTable.js +0 -32
- package/es/decade/DecadePanel.js +0 -181
- package/es/full-calendar/CalendarHeader.js +0 -180
- package/es/index.js +0 -3
- package/es/locale/ar_EG.js +0 -27
- package/es/locale/bg_BG.js +0 -27
- package/es/locale/ca_ES.js +0 -27
- package/es/locale/cs_CZ.js +0 -27
- package/es/locale/da_DK.js +0 -27
- package/es/locale/de_DE.js +0 -27
- package/es/locale/el_GR.js +0 -27
- package/es/locale/en_GB.js +0 -27
- package/es/locale/en_US.js +0 -28
- package/es/locale/es_ES.js +0 -27
- package/es/locale/et_EE.js +0 -27
- package/es/locale/fa_IR.js +0 -27
- package/es/locale/fi_FI.js +0 -27
- package/es/locale/fr_BE.js +0 -27
- package/es/locale/fr_FR.js +0 -27
- package/es/locale/he_IL.js +0 -28
- package/es/locale/hi_IN.js +0 -28
- package/es/locale/hr_HR.js +0 -28
- package/es/locale/hu_HU.js +0 -27
- package/es/locale/id_ID.js +0 -28
- package/es/locale/is_IS.js +0 -27
- package/es/locale/it_IT.js +0 -27
- package/es/locale/ja_JP.js +0 -26
- package/es/locale/kn_IN.js +0 -28
- package/es/locale/ko_KR.js +0 -27
- package/es/locale/ku_IQ.js +0 -27
- package/es/locale/lv_LV.js +0 -27
- package/es/locale/mm_MM.js +0 -28
- package/es/locale/mn_MN.js +0 -28
- package/es/locale/ms_MY.js +0 -27
- package/es/locale/nb_NO.js +0 -27
- package/es/locale/nl_BE.js +0 -27
- package/es/locale/nl_NL.js +0 -27
- package/es/locale/pl_PL.js +0 -27
- package/es/locale/pt_BR.js +0 -27
- package/es/locale/pt_PT.js +0 -27
- package/es/locale/ro_RO.js +0 -28
- package/es/locale/ru_RU.js +0 -27
- package/es/locale/sk_SK.js +0 -27
- package/es/locale/sl_SI.js +0 -27
- package/es/locale/sr_RS.js +0 -27
- package/es/locale/sv_SE.js +0 -27
- package/es/locale/ta_IN.js +0 -28
- package/es/locale/th_TH.js +0 -27
- package/es/locale/tr_TR.js +0 -27
- package/es/locale/ug_CN.js +0 -26
- package/es/locale/uk_UA.js +0 -27
- package/es/locale/vi_VN.js +0 -28
- package/es/locale/zh_CN.js +0 -27
- package/es/locale/zh_TW.js +0 -26
- package/es/mixin/CalendarMixin.js +0 -123
- package/es/mixin/CommonMixin.js +0 -85
- package/es/month/MonthPanel.js +0 -154
- package/es/month/MonthTable.js +0 -156
- package/es/picker/placements.js +0 -35
- package/es/range-calendar/CalendarPart.js +0 -151
- package/es/util/dayjs.js +0 -17
- package/es/util/index.js +0 -105
- package/es/util/toTime.js +0 -21
- package/es/year/YearPanel.js +0 -194
- package/lib/Calendar.js +0 -499
- package/lib/FullCalendar.js +0 -221
- package/lib/MonthCalendar.js +0 -172
- package/lib/Picker.js +0 -282
- package/lib/RangeCalendar.js +0 -925
- package/lib/calendar/CalendarFooter.js +0 -134
- package/lib/calendar/CalendarHeader.js +0 -290
- package/lib/calendar/CalendarRightPanel.js +0 -145
- package/lib/calendar/OkButton.js +0 -32
- package/lib/calendar/TimePickerButton.js +0 -41
- package/lib/calendar/TodayButton.js +0 -39
- package/lib/date/DateConstants.js +0 -8
- package/lib/date/DateInput.js +0 -265
- package/lib/date/DateTBody.js +0 -302
- package/lib/date/DateTHead.js +0 -95
- package/lib/date/DateTable.js +0 -54
- package/lib/decade/DecadePanel.js +0 -207
- package/lib/full-calendar/CalendarHeader.js +0 -201
- package/lib/index.js +0 -12
- package/lib/locale/ar_EG.js +0 -31
- package/lib/locale/bg_BG.js +0 -31
- package/lib/locale/ca_ES.js +0 -31
- package/lib/locale/cs_CZ.js +0 -31
- package/lib/locale/da_DK.js +0 -31
- package/lib/locale/de_DE.js +0 -31
- package/lib/locale/el_GR.js +0 -31
- package/lib/locale/en_GB.js +0 -31
- package/lib/locale/en_US.js +0 -32
- package/lib/locale/es_ES.js +0 -31
- package/lib/locale/et_EE.js +0 -31
- package/lib/locale/fa_IR.js +0 -31
- package/lib/locale/fi_FI.js +0 -31
- package/lib/locale/fr_BE.js +0 -31
- package/lib/locale/fr_FR.js +0 -31
- package/lib/locale/he_IL.js +0 -32
- package/lib/locale/hi_IN.js +0 -32
- package/lib/locale/hr_HR.js +0 -32
- package/lib/locale/hu_HU.js +0 -31
- package/lib/locale/id_ID.js +0 -32
- package/lib/locale/is_IS.js +0 -31
- package/lib/locale/it_IT.js +0 -31
- package/lib/locale/ja_JP.js +0 -30
- package/lib/locale/kn_IN.js +0 -32
- package/lib/locale/ko_KR.js +0 -31
- package/lib/locale/ku_IQ.js +0 -31
- package/lib/locale/lv_LV.js +0 -31
- package/lib/locale/mm_MM.js +0 -32
- package/lib/locale/mn_MN.js +0 -32
- package/lib/locale/ms_MY.js +0 -31
- package/lib/locale/nb_NO.js +0 -31
- package/lib/locale/nl_BE.js +0 -31
- package/lib/locale/nl_NL.js +0 -31
- package/lib/locale/pl_PL.js +0 -31
- package/lib/locale/pt_BR.js +0 -31
- package/lib/locale/pt_PT.js +0 -31
- package/lib/locale/ro_RO.js +0 -32
- package/lib/locale/ru_RU.js +0 -31
- package/lib/locale/sk_SK.js +0 -31
- package/lib/locale/sl_SI.js +0 -31
- package/lib/locale/sr_RS.js +0 -31
- package/lib/locale/sv_SE.js +0 -31
- package/lib/locale/ta_IN.js +0 -32
- package/lib/locale/th_TH.js +0 -31
- package/lib/locale/tr_TR.js +0 -31
- package/lib/locale/ug_CN.js +0 -30
- package/lib/locale/uk_UA.js +0 -31
- package/lib/locale/vi_VN.js +0 -32
- package/lib/locale/zh_CN.js +0 -31
- package/lib/locale/zh_TW.js +0 -30
- package/lib/mixin/CalendarMixin.js +0 -153
- package/lib/mixin/CommonMixin.js +0 -106
- package/lib/month/MonthPanel.js +0 -179
- package/lib/month/MonthTable.js +0 -181
- package/lib/picker/placements.js +0 -39
- package/lib/range-calendar/CalendarPart.js +0 -184
- package/lib/util/dayjs.js +0 -46
- package/lib/util/index.js +0 -130
- package/lib/util/toTime.js +0 -28
- package/lib/year/YearPanel.js +0 -219
package/lib/locale/uk_UA.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports['default'] = {
|
5
|
-
today: 'Сьогодні',
|
6
|
-
now: 'Зараз',
|
7
|
-
backToToday: 'Поточна дата',
|
8
|
-
ok: 'Ok',
|
9
|
-
clear: 'Очистити',
|
10
|
-
month: 'Місяць',
|
11
|
-
year: 'Рік',
|
12
|
-
timeSelect: 'Обрати час',
|
13
|
-
dateSelect: 'Обрати дату',
|
14
|
-
monthSelect: 'Обрати місяць',
|
15
|
-
yearSelect: 'Обрати рік',
|
16
|
-
decadeSelect: 'Обрати десятиріччя',
|
17
|
-
yearFormat: 'YYYY',
|
18
|
-
dateFormat: 'D-M-YYYY',
|
19
|
-
dayFormat: 'D',
|
20
|
-
dateTimeFormat: 'D-M-YYYY HH:mm:ss',
|
21
|
-
monthBeforeYear: true,
|
22
|
-
previousMonth: 'Попередній місяць (PageUp)',
|
23
|
-
nextMonth: 'Наступний місяць (PageDown)',
|
24
|
-
previousYear: 'Попередній рік (Control + left)',
|
25
|
-
nextYear: 'Наступний рік (Control + right)',
|
26
|
-
previousDecade: 'Попереднє десятиріччя',
|
27
|
-
nextDecade: 'Наступне десятиріччя',
|
28
|
-
previousCentury: 'Попереднє століття',
|
29
|
-
nextCentury: 'Наступне століття'
|
30
|
-
};
|
31
|
-
module.exports = exports['default'];
|
package/lib/locale/vi_VN.js
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports['default'] = {
|
5
|
-
today: 'Hôm nay',
|
6
|
-
now: 'Bây giờ',
|
7
|
-
backToToday: 'Trở về hôm nay',
|
8
|
-
ok: 'Ok',
|
9
|
-
clear: 'Xóa',
|
10
|
-
month: 'Tháng',
|
11
|
-
year: 'Năm',
|
12
|
-
timeSelect: 'Chọn thời gian',
|
13
|
-
dateSelect: 'Chọn ngày',
|
14
|
-
weekSelect: 'Chọn tuần',
|
15
|
-
monthSelect: 'Chọn tháng',
|
16
|
-
yearSelect: 'Chọn năm',
|
17
|
-
decadeSelect: 'Chọn thập kỷ',
|
18
|
-
yearFormat: 'YYYY',
|
19
|
-
dateFormat: 'D/M/YYYY',
|
20
|
-
dayFormat: 'D',
|
21
|
-
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
|
22
|
-
monthBeforeYear: true,
|
23
|
-
previousMonth: 'Tháng trước (PageUp)',
|
24
|
-
nextMonth: 'Tháng sau (PageDown)',
|
25
|
-
previousYear: 'Năm trước (Control + left)',
|
26
|
-
nextYear: 'Năm sau (Control + right)',
|
27
|
-
previousDecade: 'Thập kỷ trước',
|
28
|
-
nextDecade: 'Thập kỷ sau',
|
29
|
-
previousCentury: 'Thế kỷ trước',
|
30
|
-
nextCentury: 'Thế kỷ sau'
|
31
|
-
};
|
32
|
-
module.exports = exports['default'];
|
package/lib/locale/zh_CN.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports['default'] = {
|
5
|
-
today: '今天',
|
6
|
-
now: '此刻',
|
7
|
-
backToToday: '返回今天',
|
8
|
-
ok: '确定',
|
9
|
-
timeSelect: '选择时间',
|
10
|
-
dateSelect: '选择日期',
|
11
|
-
weekSelect: '选择周',
|
12
|
-
clear: '清除',
|
13
|
-
month: '月',
|
14
|
-
year: '年',
|
15
|
-
previousMonth: '上个月 (翻页上键)',
|
16
|
-
nextMonth: '下个月 (翻页下键)',
|
17
|
-
monthSelect: '选择月份',
|
18
|
-
yearSelect: '选择年份',
|
19
|
-
decadeSelect: '选择年代',
|
20
|
-
yearFormat: 'YYYY年',
|
21
|
-
dayFormat: 'D日',
|
22
|
-
dateFormat: 'YYYY年M月D日',
|
23
|
-
dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
|
24
|
-
previousYear: '上一年 (Control键加左方向键)',
|
25
|
-
nextYear: '下一年 (Control键加右方向键)',
|
26
|
-
previousDecade: '上一年代',
|
27
|
-
nextDecade: '下一年代',
|
28
|
-
previousCentury: '上一世纪',
|
29
|
-
nextCentury: '下一世纪'
|
30
|
-
};
|
31
|
-
module.exports = exports['default'];
|
package/lib/locale/zh_TW.js
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports['default'] = {
|
5
|
-
today: '今天',
|
6
|
-
now: '此刻',
|
7
|
-
backToToday: '返回今天',
|
8
|
-
ok: '確定',
|
9
|
-
timeSelect: '選擇時間',
|
10
|
-
dateSelect: '選擇日期',
|
11
|
-
clear: '清除',
|
12
|
-
month: '月',
|
13
|
-
year: '年',
|
14
|
-
previousMonth: '上個月 (翻頁上鍵)',
|
15
|
-
nextMonth: '下個月 (翻頁下鍵)',
|
16
|
-
monthSelect: '選擇月份',
|
17
|
-
yearSelect: '選擇年份',
|
18
|
-
decadeSelect: '選擇年代',
|
19
|
-
yearFormat: 'YYYY年',
|
20
|
-
dayFormat: 'D日',
|
21
|
-
dateFormat: 'YYYY年M月D日',
|
22
|
-
dateTimeFormat: 'YYYY年M月D日 HH時mm分ss秒',
|
23
|
-
previousYear: '上一年 (Control鍵加左方向鍵)',
|
24
|
-
nextYear: '下一年 (Control鍵加右方向鍵)',
|
25
|
-
previousDecade: '上一年代',
|
26
|
-
nextDecade: '下一年代',
|
27
|
-
previousCentury: '上一世紀',
|
28
|
-
nextCentury: '下一世紀'
|
29
|
-
};
|
30
|
-
module.exports = exports['default'];
|
@@ -1,153 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.calendarMixinWrapper = exports.calendarMixinDefaultProps = exports.calendarMixinPropTypes = undefined;
|
5
|
-
|
6
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
7
|
-
|
8
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
9
|
-
|
10
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
11
|
-
|
12
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
13
|
-
|
14
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
15
|
-
|
16
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
17
|
-
|
18
|
-
exports.getNowByCurrentStateValue = getNowByCurrentStateValue;
|
19
|
-
|
20
|
-
var _react = require('react');
|
21
|
-
|
22
|
-
var _react2 = _interopRequireDefault(_react);
|
23
|
-
|
24
|
-
var _propTypes = require('prop-types');
|
25
|
-
|
26
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
27
|
-
|
28
|
-
var _classnames = require('classnames');
|
29
|
-
|
30
|
-
var _classnames2 = _interopRequireDefault(_classnames);
|
31
|
-
|
32
|
-
var _dayjs = require('dayjs');
|
33
|
-
|
34
|
-
var _dayjs2 = _interopRequireDefault(_dayjs);
|
35
|
-
|
36
|
-
var _index = require('../util/index');
|
37
|
-
|
38
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
39
|
-
|
40
|
-
function noop() {}
|
41
|
-
|
42
|
-
function getNowByCurrentStateValue(value) {
|
43
|
-
var ret = void 0;
|
44
|
-
if (value) {
|
45
|
-
ret = (0, _index.getTodayTime)(value);
|
46
|
-
} else {
|
47
|
-
ret = (0, _dayjs2['default'])();
|
48
|
-
}
|
49
|
-
return ret;
|
50
|
-
}
|
51
|
-
|
52
|
-
var calendarMixinPropTypes = exports.calendarMixinPropTypes = {
|
53
|
-
value: _propTypes2['default'].object,
|
54
|
-
defaultValue: _propTypes2['default'].object,
|
55
|
-
onKeyDown: _propTypes2['default'].func
|
56
|
-
};
|
57
|
-
|
58
|
-
var calendarMixinDefaultProps = exports.calendarMixinDefaultProps = {
|
59
|
-
onKeyDown: noop
|
60
|
-
};
|
61
|
-
|
62
|
-
var calendarMixinWrapper = exports.calendarMixinWrapper = function calendarMixinWrapper(ComposeComponent) {
|
63
|
-
var _class, _temp2;
|
64
|
-
|
65
|
-
return _temp2 = _class = function (_ComposeComponent) {
|
66
|
-
(0, _inherits3['default'])(_class, _ComposeComponent);
|
67
|
-
|
68
|
-
function _class() {
|
69
|
-
var _temp, _this, _ret;
|
70
|
-
|
71
|
-
(0, _classCallCheck3['default'])(this, _class);
|
72
|
-
|
73
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
74
|
-
args[_key] = arguments[_key];
|
75
|
-
}
|
76
|
-
|
77
|
-
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _ComposeComponent.call.apply(_ComposeComponent, [this].concat(args))), _this), _this.onSelect = function (value, cause) {
|
78
|
-
if (value) {
|
79
|
-
_this.setValue(value);
|
80
|
-
}
|
81
|
-
_this.setSelectedValue(value, cause);
|
82
|
-
}, _this.renderRoot = function (newProps) {
|
83
|
-
var _className;
|
84
|
-
|
85
|
-
var props = _this.props;
|
86
|
-
var prefixCls = props.prefixCls;
|
87
|
-
|
88
|
-
var className = (_className = {}, _className[prefixCls] = 1, _className[prefixCls + '-hidden'] = !props.visible, _className[props.className] = !!props.className, _className[newProps.className] = !!newProps.className, _className);
|
89
|
-
|
90
|
-
return _react2['default'].createElement(
|
91
|
-
'div',
|
92
|
-
{
|
93
|
-
ref: _this.saveRoot,
|
94
|
-
className: '' + (0, _classnames2['default'])(className),
|
95
|
-
style: _this.props.style,
|
96
|
-
tabIndex: '0',
|
97
|
-
onKeyDown: _this.onKeyDown,
|
98
|
-
onBlur: _this.onBlur
|
99
|
-
},
|
100
|
-
newProps.children
|
101
|
-
);
|
102
|
-
}, _this.setSelectedValue = function (selectedValue, cause) {
|
103
|
-
// if (this.isAllowedDate(selectedValue)) {
|
104
|
-
if (!('selectedValue' in _this.props)) {
|
105
|
-
_this.setState({
|
106
|
-
selectedValue: selectedValue
|
107
|
-
});
|
108
|
-
}
|
109
|
-
if (_this.props.onSelect) {
|
110
|
-
_this.props.onSelect(selectedValue, cause);
|
111
|
-
}
|
112
|
-
// }
|
113
|
-
}, _this.setValue = function (value) {
|
114
|
-
var originalValue = _this.state.value;
|
115
|
-
if (!('value' in _this.props)) {
|
116
|
-
_this.setState({
|
117
|
-
value: value
|
118
|
-
});
|
119
|
-
}
|
120
|
-
if (originalValue && value && !originalValue.isSame(value) || !originalValue && value || originalValue && !value) {
|
121
|
-
_this.props.onChange(value);
|
122
|
-
}
|
123
|
-
}, _this.isAllowedDate = function (value) {
|
124
|
-
var disabledDate = _this.props.disabledDate;
|
125
|
-
var disabledTime = _this.props.disabledTime;
|
126
|
-
return (0, _index.isAllowedDate)(value, disabledDate, disabledTime);
|
127
|
-
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
|
128
|
-
}
|
129
|
-
|
130
|
-
_class.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
|
131
|
-
// Use origin function if provided
|
132
|
-
if (ComposeComponent.getDerivedStateFromProps) {
|
133
|
-
return ComposeComponent.getDerivedStateFromProps(nextProps, prevState);
|
134
|
-
}
|
135
|
-
|
136
|
-
var value = nextProps.value,
|
137
|
-
selectedValue = nextProps.selectedValue;
|
138
|
-
|
139
|
-
var newState = {};
|
140
|
-
|
141
|
-
if ('value' in nextProps) {
|
142
|
-
newState.value = value || nextProps.defaultValue || getNowByCurrentStateValue(prevState.value);
|
143
|
-
}
|
144
|
-
if ('selectedValue' in nextProps) {
|
145
|
-
newState.selectedValue = selectedValue;
|
146
|
-
}
|
147
|
-
|
148
|
-
return newState;
|
149
|
-
};
|
150
|
-
|
151
|
-
return _class;
|
152
|
-
}(ComposeComponent), _class.displayName = 'CalendarMixinWrapper', _class.defaultProps = ComposeComponent.defaultProps, _temp2;
|
153
|
-
};
|
package/lib/mixin/CommonMixin.js
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.commonMixinWrapper = exports.defaultProp = exports.propType = undefined;
|
5
|
-
|
6
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
7
|
-
|
8
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
9
|
-
|
10
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
11
|
-
|
12
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
13
|
-
|
14
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
15
|
-
|
16
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
17
|
-
|
18
|
-
var _propTypes = require('prop-types');
|
19
|
-
|
20
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
21
|
-
|
22
|
-
var _en_US = require('../locale/en_US');
|
23
|
-
|
24
|
-
var _en_US2 = _interopRequireDefault(_en_US);
|
25
|
-
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
27
|
-
|
28
|
-
function noop() {}
|
29
|
-
|
30
|
-
var propType = exports.propType = {
|
31
|
-
className: _propTypes2['default'].string,
|
32
|
-
locale: _propTypes2['default'].object,
|
33
|
-
style: _propTypes2['default'].object,
|
34
|
-
visible: _propTypes2['default'].bool,
|
35
|
-
onSelect: _propTypes2['default'].func,
|
36
|
-
prefixCls: _propTypes2['default'].string,
|
37
|
-
onChange: _propTypes2['default'].func,
|
38
|
-
onOk: _propTypes2['default'].func
|
39
|
-
};
|
40
|
-
|
41
|
-
var defaultProp = exports.defaultProp = {
|
42
|
-
locale: _en_US2['default'],
|
43
|
-
style: {},
|
44
|
-
visible: true,
|
45
|
-
prefixCls: 'rc-calendar',
|
46
|
-
className: '',
|
47
|
-
onSelect: noop,
|
48
|
-
onChange: noop,
|
49
|
-
onClear: noop,
|
50
|
-
renderFooter: function renderFooter() {
|
51
|
-
return null;
|
52
|
-
},
|
53
|
-
renderSidebar: function renderSidebar() {
|
54
|
-
return null;
|
55
|
-
}
|
56
|
-
};
|
57
|
-
|
58
|
-
var commonMixinWrapper = exports.commonMixinWrapper = function commonMixinWrapper(ComposeComponent) {
|
59
|
-
var _class, _temp2;
|
60
|
-
|
61
|
-
return _temp2 = _class = function (_ComposeComponent) {
|
62
|
-
(0, _inherits3['default'])(_class, _ComposeComponent);
|
63
|
-
|
64
|
-
function _class() {
|
65
|
-
var _temp, _this, _ret;
|
66
|
-
|
67
|
-
(0, _classCallCheck3['default'])(this, _class);
|
68
|
-
|
69
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
70
|
-
args[_key] = arguments[_key];
|
71
|
-
}
|
72
|
-
|
73
|
-
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _ComposeComponent.call.apply(_ComposeComponent, [this].concat(args))), _this), _this.getFormat = function () {
|
74
|
-
var format = _this.props.format;
|
75
|
-
var _this$props = _this.props,
|
76
|
-
locale = _this$props.locale,
|
77
|
-
timePicker = _this$props.timePicker;
|
78
|
-
|
79
|
-
if (!format) {
|
80
|
-
if (timePicker) {
|
81
|
-
format = locale.dateTimeFormat;
|
82
|
-
} else {
|
83
|
-
format = locale.dateFormat;
|
84
|
-
}
|
85
|
-
}
|
86
|
-
return format;
|
87
|
-
}, _this.focus = function () {
|
88
|
-
if (_this.focusElement) {
|
89
|
-
_this.focusElement.focus();
|
90
|
-
} else if (_this.rootInstance) {
|
91
|
-
_this.rootInstance.focus();
|
92
|
-
}
|
93
|
-
}, _this.saveFocusElement = function (focusElement) {
|
94
|
-
_this.focusElement = focusElement;
|
95
|
-
}, _this.saveRoot = function (root) {
|
96
|
-
_this.rootInstance = root;
|
97
|
-
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
|
98
|
-
}
|
99
|
-
|
100
|
-
_class.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
|
101
|
-
return this.props.visible || nextProps.visible;
|
102
|
-
};
|
103
|
-
|
104
|
-
return _class;
|
105
|
-
}(ComposeComponent), _class.displayName = 'CommonMixinWrapper', _class.defaultProps = ComposeComponent.defaultProps, _class.getDerivedStateFromProps = ComposeComponent.getDerivedStateFromProps, _temp2;
|
106
|
-
};
|
package/lib/month/MonthPanel.js
DELETED
@@ -1,179 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
|
5
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
6
|
-
|
7
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
8
|
-
|
9
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
10
|
-
|
11
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
12
|
-
|
13
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
14
|
-
|
15
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
16
|
-
|
17
|
-
var _react = require('react');
|
18
|
-
|
19
|
-
var _react2 = _interopRequireDefault(_react);
|
20
|
-
|
21
|
-
var _propTypes = require('prop-types');
|
22
|
-
|
23
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
24
|
-
|
25
|
-
var _reactLifecyclesCompat = require('react-lifecycles-compat');
|
26
|
-
|
27
|
-
var _MonthTable = require('./MonthTable');
|
28
|
-
|
29
|
-
var _MonthTable2 = _interopRequireDefault(_MonthTable);
|
30
|
-
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
32
|
-
|
33
|
-
function goYear(direction) {
|
34
|
-
this.props.changeYear(direction);
|
35
|
-
}
|
36
|
-
|
37
|
-
function noop() {}
|
38
|
-
|
39
|
-
var MonthPanel = function (_React$Component) {
|
40
|
-
(0, _inherits3['default'])(MonthPanel, _React$Component);
|
41
|
-
|
42
|
-
function MonthPanel(props) {
|
43
|
-
(0, _classCallCheck3['default'])(this, MonthPanel);
|
44
|
-
|
45
|
-
var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));
|
46
|
-
|
47
|
-
_this.setAndSelectValue = function (value) {
|
48
|
-
_this.setValue(value);
|
49
|
-
_this.props.onSelect(value);
|
50
|
-
};
|
51
|
-
|
52
|
-
_this.setValue = function (value) {
|
53
|
-
if ('value' in _this.props) {
|
54
|
-
_this.setState({
|
55
|
-
value: value
|
56
|
-
});
|
57
|
-
}
|
58
|
-
};
|
59
|
-
|
60
|
-
_this.nextYear = goYear.bind(_this, 1);
|
61
|
-
_this.previousYear = goYear.bind(_this, -1);
|
62
|
-
_this.prefixCls = props.rootPrefixCls + '-month-panel';
|
63
|
-
|
64
|
-
_this.state = {
|
65
|
-
value: props.value || props.defaultValue
|
66
|
-
};
|
67
|
-
return _this;
|
68
|
-
}
|
69
|
-
|
70
|
-
MonthPanel.getDerivedStateFromProps = function getDerivedStateFromProps(props) {
|
71
|
-
var newState = {};
|
72
|
-
|
73
|
-
if ('value' in props) {
|
74
|
-
newState = {
|
75
|
-
value: props.value
|
76
|
-
};
|
77
|
-
}
|
78
|
-
|
79
|
-
return newState;
|
80
|
-
};
|
81
|
-
|
82
|
-
MonthPanel.prototype.render = function render() {
|
83
|
-
var props = this.props;
|
84
|
-
var value = this.state.value;
|
85
|
-
var locale = props.locale,
|
86
|
-
cellRender = props.cellRender,
|
87
|
-
contentRender = props.contentRender,
|
88
|
-
renderFooter = props.renderFooter;
|
89
|
-
|
90
|
-
var year = value.year();
|
91
|
-
var prefixCls = this.prefixCls;
|
92
|
-
|
93
|
-
var footer = renderFooter && renderFooter('month');
|
94
|
-
|
95
|
-
return _react2['default'].createElement(
|
96
|
-
'div',
|
97
|
-
{ className: prefixCls, style: props.style },
|
98
|
-
_react2['default'].createElement(
|
99
|
-
'div',
|
100
|
-
null,
|
101
|
-
_react2['default'].createElement(
|
102
|
-
'div',
|
103
|
-
{ className: prefixCls + '-header' },
|
104
|
-
_react2['default'].createElement('a', {
|
105
|
-
className: prefixCls + '-prev-year-btn',
|
106
|
-
role: 'button',
|
107
|
-
onClick: this.previousYear,
|
108
|
-
title: locale.previousYear
|
109
|
-
}),
|
110
|
-
_react2['default'].createElement(
|
111
|
-
'a',
|
112
|
-
{
|
113
|
-
className: prefixCls + '-year-select',
|
114
|
-
role: 'button',
|
115
|
-
onClick: props.onYearPanelShow,
|
116
|
-
title: locale.yearSelect
|
117
|
-
},
|
118
|
-
_react2['default'].createElement(
|
119
|
-
'span',
|
120
|
-
{ className: prefixCls + '-year-select-content' },
|
121
|
-
year
|
122
|
-
),
|
123
|
-
_react2['default'].createElement(
|
124
|
-
'span',
|
125
|
-
{ className: prefixCls + '-year-select-arrow' },
|
126
|
-
'x'
|
127
|
-
)
|
128
|
-
),
|
129
|
-
_react2['default'].createElement('a', {
|
130
|
-
className: prefixCls + '-next-year-btn',
|
131
|
-
role: 'button',
|
132
|
-
onClick: this.nextYear,
|
133
|
-
title: locale.nextYear
|
134
|
-
})
|
135
|
-
),
|
136
|
-
_react2['default'].createElement(
|
137
|
-
'div',
|
138
|
-
{ className: prefixCls + '-body' },
|
139
|
-
_react2['default'].createElement(_MonthTable2['default'], {
|
140
|
-
disabledDate: props.disabledDate,
|
141
|
-
onSelect: this.setAndSelectValue,
|
142
|
-
locale: locale,
|
143
|
-
value: value,
|
144
|
-
cellRender: cellRender,
|
145
|
-
contentRender: contentRender,
|
146
|
-
prefixCls: prefixCls
|
147
|
-
})
|
148
|
-
),
|
149
|
-
footer && _react2['default'].createElement(
|
150
|
-
'div',
|
151
|
-
{ className: prefixCls + '-footer' },
|
152
|
-
footer
|
153
|
-
)
|
154
|
-
)
|
155
|
-
);
|
156
|
-
};
|
157
|
-
|
158
|
-
return MonthPanel;
|
159
|
-
}(_react2['default'].Component);
|
160
|
-
|
161
|
-
MonthPanel.propTypes = {
|
162
|
-
onChange: _propTypes2['default'].func,
|
163
|
-
disabledDate: _propTypes2['default'].func,
|
164
|
-
onSelect: _propTypes2['default'].func,
|
165
|
-
renderFooter: _propTypes2['default'].func,
|
166
|
-
rootPrefixCls: _propTypes2['default'].string,
|
167
|
-
value: _propTypes2['default'].object,
|
168
|
-
defaultValue: _propTypes2['default'].object
|
169
|
-
};
|
170
|
-
MonthPanel.defaultProps = {
|
171
|
-
onChange: noop,
|
172
|
-
onSelect: noop
|
173
|
-
};
|
174
|
-
|
175
|
-
|
176
|
-
(0, _reactLifecyclesCompat.polyfill)(MonthPanel);
|
177
|
-
|
178
|
-
exports['default'] = MonthPanel;
|
179
|
-
module.exports = exports['default'];
|