@seafile/seafile-calendar 0.0.88887 → 0.0.88889
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/dist/rc-calendar.js +33 -44
- package/dist/rc-calendar.js.map +1 -1
- package/dist/rc-calendar.min.js +1 -1
- package/es/Calendar.js +5 -4
- package/es/date/DateInput.js +2 -8
- package/es/date/DateTBody.js +2 -2
- package/es/util/index.js +0 -5
- package/lib/Calendar.js +4 -3
- package/lib/date/DateInput.js +2 -8
- package/lib/date/DateTBody.js +1 -1
- package/lib/util/index.js +1 -6
- package/package.json +1 -1
package/dist/rc-calendar.js
CHANGED
@@ -316,27 +316,26 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
316
316
|
/* unused harmony export getCurrentYear */
|
317
317
|
/* unused harmony export getCurrentTime */
|
318
318
|
/* unused harmony export DATE_FORMATS */
|
319
|
-
/* harmony export (
|
320
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
321
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
322
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
323
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
324
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
325
|
-
/* harmony export (immutable) */ __webpack_exports__["d"] = getTimeConfig;
|
319
|
+
/* harmony export (immutable) */ __webpack_exports__["e"] = getTodayTime;
|
320
|
+
/* harmony export (immutable) */ __webpack_exports__["d"] = getTitleString;
|
321
|
+
/* harmony export (immutable) */ __webpack_exports__["f"] = getTodayTimeStr;
|
322
|
+
/* harmony export (immutable) */ __webpack_exports__["b"] = getMonthName;
|
323
|
+
/* harmony export (immutable) */ __webpack_exports__["i"] = syncTime;
|
324
|
+
/* harmony export (immutable) */ __webpack_exports__["c"] = getTimeConfig;
|
326
325
|
/* unused harmony export isTimeValidByConfig */
|
327
326
|
/* unused harmony export isTimeValid */
|
328
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
329
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
327
|
+
/* harmony export (immutable) */ __webpack_exports__["h"] = isAllowedDate;
|
328
|
+
/* harmony export (immutable) */ __webpack_exports__["a"] = formatDate;
|
330
329
|
/* unused harmony export isLeapYear */
|
331
330
|
/* unused harmony export validateCalendarDay */
|
332
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
331
|
+
/* harmony export (immutable) */ __webpack_exports__["j"] = tokenizeFormattedDate;
|
333
332
|
/* unused harmony export hasSpecialChar */
|
334
333
|
/* unused harmony export validateTime */
|
335
334
|
/* unused harmony export delimate */
|
336
335
|
/* unused harmony export validateCalendarYear */
|
337
336
|
/* unused harmony export validateAndNormalizeDate */
|
338
337
|
/* unused harmony export getDatePart */
|
339
|
-
/* harmony export (immutable) */ __webpack_exports__["
|
338
|
+
/* harmony export (immutable) */ __webpack_exports__["g"] = initializeStr;
|
340
339
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(26);
|
341
340
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
|
342
341
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dayjs__ = __webpack_require__(16);
|
@@ -372,11 +371,6 @@ var DATE_FORMATS = {
|
|
372
371
|
Germany_Russia_etcAndTime: 'DD.MM.YYYY HH:mm'
|
373
372
|
};
|
374
373
|
|
375
|
-
var CURRENTSTATUS = {
|
376
|
-
SELECTDATETIME: 'selectDateTime',
|
377
|
-
TODAYTIME: 'todayTime'
|
378
|
-
};
|
379
|
-
|
380
374
|
var defaultDisabledTime = {
|
381
375
|
disabledHours: function disabledHours() {
|
382
376
|
return [];
|
@@ -2767,7 +2761,7 @@ var Calendar = function (_React$Component) {
|
|
2767
2761
|
mode: _this.props.mode || 'date',
|
2768
2762
|
value: getMomentObjectIfValid(props.value) || getMomentObjectIfValid(props.defaultValue) || __WEBPACK_IMPORTED_MODULE_9_dayjs___default()(),
|
2769
2763
|
selectedValue: props.selectedValue || props.defaultSelectedValue,
|
2770
|
-
currentStatus:
|
2764
|
+
currentStatus: 'selectDateTime'
|
2771
2765
|
};
|
2772
2766
|
return _this;
|
2773
2767
|
}
|
@@ -2819,7 +2813,7 @@ var Calendar = function (_React$Component) {
|
|
2819
2813
|
currentStatus = state.currentStatus;
|
2820
2814
|
|
2821
2815
|
var showTimePicker = mode === 'time';
|
2822
|
-
var disabledTimeConfig = showTimePicker && disabledTime && timePicker ? Object(__WEBPACK_IMPORTED_MODULE_17__util__["
|
2816
|
+
var disabledTimeConfig = showTimePicker && disabledTime && timePicker ? Object(__WEBPACK_IMPORTED_MODULE_17__util__["c" /* getTimeConfig */])(selectedValue, disabledTime) : null;
|
2823
2817
|
|
2824
2818
|
var timePickerEle = null;
|
2825
2819
|
|
@@ -3022,6 +3016,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
3022
3016
|
return undefined;
|
3023
3017
|
}
|
3024
3018
|
var keyCode = event.keyCode;
|
3019
|
+
console.log('keyCode', keyCode);
|
3025
3020
|
// mac
|
3026
3021
|
var ctrlKey = event.ctrlKey || event.metaKey;
|
3027
3022
|
var disabledDate = _this2.props.disabledDate;
|
@@ -3085,7 +3080,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
3085
3080
|
this.onClear = function () {
|
3086
3081
|
_this2.onSelect(null);
|
3087
3082
|
_this2.props.onClear();
|
3088
|
-
_this2.setState({ currentStatus:
|
3083
|
+
_this2.setState({ currentStatus: 'todayTime' });
|
3089
3084
|
};
|
3090
3085
|
|
3091
3086
|
this.onOk = function () {
|
@@ -3112,11 +3107,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
3112
3107
|
var timePicker = _this2.props.timePicker;
|
3113
3108
|
var selectedValue = _this2.state.selectedValue;
|
3114
3109
|
|
3115
|
-
_this2.setState({ currentStatus:
|
3110
|
+
_this2.setState({ currentStatus: 'selectDateTime' });
|
3116
3111
|
if (!selectedValue && timePicker) {
|
3117
3112
|
var timePickerDefaultValue = timePicker.props.defaultValue;
|
3118
3113
|
if (timePickerDefaultValue) {
|
3119
|
-
Object(__WEBPACK_IMPORTED_MODULE_17__util__["
|
3114
|
+
Object(__WEBPACK_IMPORTED_MODULE_17__util__["i" /* syncTime */])(timePickerDefaultValue, value);
|
3120
3115
|
}
|
3121
3116
|
}
|
3122
3117
|
_this2.onSelect(value);
|
@@ -3125,7 +3120,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
3125
3120
|
this.onToday = function () {
|
3126
3121
|
var value = _this2.state.value;
|
3127
3122
|
|
3128
|
-
var now = Object(__WEBPACK_IMPORTED_MODULE_17__util__["
|
3123
|
+
var now = Object(__WEBPACK_IMPORTED_MODULE_17__util__["e" /* getTodayTime */])(value);
|
3129
3124
|
_this2.onSelect(now, {
|
3130
3125
|
source: 'todayButton'
|
3131
3126
|
});
|
@@ -5338,7 +5333,7 @@ var DateTBody = function (_React$Component) {
|
|
5338
5333
|
var jIndex = void 0;
|
5339
5334
|
var current = void 0;
|
5340
5335
|
var dateTable = [];
|
5341
|
-
var today = Object(__WEBPACK_IMPORTED_MODULE_7__util___["
|
5336
|
+
var today = Object(__WEBPACK_IMPORTED_MODULE_7__util___["e" /* getTodayTime */])(value);
|
5342
5337
|
var cellClass = prefixCls + '-cell';
|
5343
5338
|
var weekNumberCellClass = prefixCls + '-week-number-cell';
|
5344
5339
|
var dateClass = prefixCls + '-date';
|
@@ -5400,7 +5395,7 @@ var DateTBody = function (_React$Component) {
|
|
5400
5395
|
for (jIndex = 0; jIndex < DATE_ROW_COLUMN_COUNT.DATE_COL_COUNT; jIndex++) {
|
5401
5396
|
var next = null;
|
5402
5397
|
var last = null;
|
5403
|
-
if (currentStatus ===
|
5398
|
+
if (currentStatus === 'todayTime') {
|
5404
5399
|
current = dateTable[passed].hour(__WEBPACK_IMPORTED_MODULE_8_dayjs___default()().hour()).minute(__WEBPACK_IMPORTED_MODULE_8_dayjs___default()().minute()).second(__WEBPACK_IMPORTED_MODULE_8_dayjs___default()().second()); // eslint-disable-line max-len
|
5405
5400
|
} else {
|
5406
5401
|
current = dateTable[passed];
|
@@ -5517,7 +5512,7 @@ var DateTBody = function (_React$Component) {
|
|
5517
5512
|
onClick: disabled ? undefined : props.onSelect.bind(null, current),
|
5518
5513
|
onMouseEnter: disabled ? undefined : props.onDayHover && props.onDayHover.bind(null, current) || undefined,
|
5519
5514
|
role: 'gridcell',
|
5520
|
-
title: Object(__WEBPACK_IMPORTED_MODULE_7__util___["
|
5515
|
+
title: Object(__WEBPACK_IMPORTED_MODULE_7__util___["d" /* getTitleString */])(current),
|
5521
5516
|
className: cls
|
5522
5517
|
},
|
5523
5518
|
dateHtml
|
@@ -6088,7 +6083,7 @@ var MonthTable = function (_Component) {
|
|
6088
6083
|
months[rowIndex] = [];
|
6089
6084
|
for (var colIndex = 0; colIndex < COL; colIndex++) {
|
6090
6085
|
current = current.month(index);
|
6091
|
-
var content = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["
|
6086
|
+
var content = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["b" /* getMonthName */])(current);
|
6092
6087
|
months[rowIndex][colIndex] = {
|
6093
6088
|
value: index,
|
6094
6089
|
content: content,
|
@@ -6105,7 +6100,7 @@ var MonthTable = function (_Component) {
|
|
6105
6100
|
|
6106
6101
|
var props = this.props;
|
6107
6102
|
var value = this.state.value;
|
6108
|
-
var today = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["
|
6103
|
+
var today = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["e" /* getTodayTime */])(value);
|
6109
6104
|
var months = this.months();
|
6110
6105
|
var currentMonth = value.month();
|
6111
6106
|
var prefixCls = props.prefixCls,
|
@@ -6741,7 +6736,7 @@ function TodayButton(_ref) {
|
|
6741
6736
|
text = _ref.text;
|
6742
6737
|
|
6743
6738
|
var localeNow = (!text && timePicker ? locale.now : text) || locale.today;
|
6744
|
-
var disabledToday = disabledDate && !Object(__WEBPACK_IMPORTED_MODULE_1__util___["
|
6739
|
+
var disabledToday = disabledDate && !Object(__WEBPACK_IMPORTED_MODULE_1__util___["h" /* isAllowedDate */])(Object(__WEBPACK_IMPORTED_MODULE_1__util___["e" /* getTodayTime */])(value), disabledDate);
|
6745
6740
|
var isDisabled = disabledToday || disabled;
|
6746
6741
|
var disabledTodayClass = isDisabled ? prefixCls + '-today-btn-disabled' : '';
|
6747
6742
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
|
@@ -6750,7 +6745,7 @@ function TodayButton(_ref) {
|
|
6750
6745
|
className: prefixCls + '-today-btn ' + disabledTodayClass,
|
6751
6746
|
role: 'button',
|
6752
6747
|
onClick: isDisabled ? null : onToday,
|
6753
|
-
title: Object(__WEBPACK_IMPORTED_MODULE_1__util___["
|
6748
|
+
title: Object(__WEBPACK_IMPORTED_MODULE_1__util___["f" /* getTodayTimeStr */])(value)
|
6754
6749
|
},
|
6755
6750
|
localeNow
|
6756
6751
|
);
|
@@ -6934,7 +6929,7 @@ var CalendarRightPanel = function (_React$Component) {
|
|
6934
6929
|
'ul',
|
6935
6930
|
null,
|
6936
6931
|
this.times.map(function (time) {
|
6937
|
-
var parts = Object(__WEBPACK_IMPORTED_MODULE_6__util__["
|
6932
|
+
var parts = Object(__WEBPACK_IMPORTED_MODULE_6__util__["j" /* tokenizeFormattedDate */])(selectedDate, _this2.state.localeFormat);
|
6938
6933
|
var current = __WEBPACK_IMPORTED_MODULE_5_dayjs___default()(selectedDate + ' ' + time).year(parts[0]).month(parts[1] - 1).date(parts[2]); // eslint-disable-line max-len
|
6939
6934
|
current = isZhcn ? current.locale('zh-cn') : current.locale('en-gb');
|
6940
6935
|
return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
|
@@ -7009,7 +7004,7 @@ function noop() {}
|
|
7009
7004
|
function getNowByCurrentStateValue(value) {
|
7010
7005
|
var ret = void 0;
|
7011
7006
|
if (value) {
|
7012
|
-
ret = Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["
|
7007
|
+
ret = Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["e" /* getTodayTime */])(value);
|
7013
7008
|
} else {
|
7014
7009
|
ret = __WEBPACK_IMPORTED_MODULE_6_dayjs___default()();
|
7015
7010
|
}
|
@@ -7090,7 +7085,7 @@ var calendarMixinWrapper = function calendarMixinWrapper(ComposeComponent) {
|
|
7090
7085
|
}, _this.isAllowedDate = function (value) {
|
7091
7086
|
var disabledDate = _this.props.disabledDate;
|
7092
7087
|
var disabledTime = _this.props.disabledTime;
|
7093
|
-
return Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["
|
7088
|
+
return Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["h" /* isAllowedDate */])(value, disabledDate, disabledTime);
|
7094
7089
|
}, _temp), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
|
7095
7090
|
}
|
7096
7091
|
|
@@ -7309,9 +7304,8 @@ var DateInput = function (_React$Component) {
|
|
7309
7304
|
var selectedValue = props.selectedValue;
|
7310
7305
|
|
7311
7306
|
_this.state = {
|
7312
|
-
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7307
|
+
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(selectedValue, _this.props.format),
|
7313
7308
|
hasFocus: false,
|
7314
|
-
isEmpty: false,
|
7315
7309
|
localFormat: _this.props.format[0]
|
7316
7310
|
};
|
7317
7311
|
return _this;
|
@@ -7333,7 +7327,7 @@ var DateInput = function (_React$Component) {
|
|
7333
7327
|
// when popup show, click body will call this, bug!
|
7334
7328
|
var selectedValue = nextProps.selectedValue;
|
7335
7329
|
if (!state.hasFocus) {
|
7336
|
-
newState = { str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7330
|
+
newState = { str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(selectedValue, nextProps.format) };
|
7337
7331
|
}
|
7338
7332
|
|
7339
7333
|
return newState;
|
@@ -7413,7 +7407,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
7413
7407
|
|
7414
7408
|
this.onInputChange = function (event) {
|
7415
7409
|
var str = event.target.value;
|
7416
|
-
var calendarStr = Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7410
|
+
var calendarStr = Object(__WEBPACK_IMPORTED_MODULE_9__util__["g" /* initializeStr */])(str, _this2.state.localFormat) || '';
|
7417
7411
|
var _props = _this2.props,
|
7418
7412
|
disabledDate = _props.disabledDate,
|
7419
7413
|
format = _props.format,
|
@@ -7422,11 +7416,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
7422
7416
|
// 没有内容,合法并直接退出
|
7423
7417
|
|
7424
7418
|
if (!str || !calendarStr) {
|
7425
|
-
_this2.setState({ isEmpty: true });
|
7426
7419
|
_this2.onClear();
|
7427
7420
|
return;
|
7428
7421
|
}
|
7429
|
-
if (_this2.state.isEmpty) _this2.setState({ isEmpty: false });
|
7430
7422
|
var parsed = __WEBPACK_IMPORTED_MODULE_8_dayjs___default()(calendarStr, format[0]);
|
7431
7423
|
var value = _this2.props.value.clone();
|
7432
7424
|
value = value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
|
@@ -7450,7 +7442,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
7450
7442
|
_this2.setState(function (prevState, prevProps) {
|
7451
7443
|
return {
|
7452
7444
|
hasFocus: false,
|
7453
|
-
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7445
|
+
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(prevProps.value, prevProps.format)
|
7454
7446
|
};
|
7455
7447
|
});
|
7456
7448
|
};
|
@@ -7462,14 +7454,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
7462
7454
|
value = _props2.value,
|
7463
7455
|
disabledDate = _props2.disabledDate;
|
7464
7456
|
|
7457
|
+
console.log('keyCode', keyCode, value);
|
7465
7458
|
if (keyCode === __WEBPACK_IMPORTED_MODULE_6_rc_util_es_KeyCode__["a" /* default */].ENTER && onSelect) {
|
7466
7459
|
var validateDate = !disabledDate || !disabledDate(value);
|
7467
7460
|
if (validateDate) {
|
7468
|
-
|
7469
|
-
onSelect(null);
|
7470
|
-
} else {
|
7471
|
-
onSelect(value.clone());
|
7472
|
-
}
|
7461
|
+
onSelect(value.clone());
|
7473
7462
|
}
|
7474
7463
|
event.preventDefault();
|
7475
7464
|
}
|