@seafile/seafile-calendar 0.0.88887 → 0.0.88891
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 +31 -44
- package/dist/rc-calendar.js.map +1 -1
- package/dist/rc-calendar.min.js +1 -1
- package/es/Calendar.js +4 -4
- package/es/date/DateInput.js +1 -8
- package/es/date/DateTBody.js +2 -2
- package/es/util/index.js +0 -5
- package/lib/Calendar.js +3 -3
- package/lib/date/DateInput.js +1 -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
|
|
@@ -3085,7 +3079,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
3085
3079
|
this.onClear = function () {
|
3086
3080
|
_this2.onSelect(null);
|
3087
3081
|
_this2.props.onClear();
|
3088
|
-
_this2.setState({ currentStatus:
|
3082
|
+
_this2.setState({ currentStatus: 'todayTime' });
|
3089
3083
|
};
|
3090
3084
|
|
3091
3085
|
this.onOk = function () {
|
@@ -3112,11 +3106,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
3112
3106
|
var timePicker = _this2.props.timePicker;
|
3113
3107
|
var selectedValue = _this2.state.selectedValue;
|
3114
3108
|
|
3115
|
-
_this2.setState({ currentStatus:
|
3109
|
+
_this2.setState({ currentStatus: 'selectDateTime' });
|
3116
3110
|
if (!selectedValue && timePicker) {
|
3117
3111
|
var timePickerDefaultValue = timePicker.props.defaultValue;
|
3118
3112
|
if (timePickerDefaultValue) {
|
3119
|
-
Object(__WEBPACK_IMPORTED_MODULE_17__util__["
|
3113
|
+
Object(__WEBPACK_IMPORTED_MODULE_17__util__["i" /* syncTime */])(timePickerDefaultValue, value);
|
3120
3114
|
}
|
3121
3115
|
}
|
3122
3116
|
_this2.onSelect(value);
|
@@ -3125,7 +3119,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
3125
3119
|
this.onToday = function () {
|
3126
3120
|
var value = _this2.state.value;
|
3127
3121
|
|
3128
|
-
var now = Object(__WEBPACK_IMPORTED_MODULE_17__util__["
|
3122
|
+
var now = Object(__WEBPACK_IMPORTED_MODULE_17__util__["e" /* getTodayTime */])(value);
|
3129
3123
|
_this2.onSelect(now, {
|
3130
3124
|
source: 'todayButton'
|
3131
3125
|
});
|
@@ -5338,7 +5332,7 @@ var DateTBody = function (_React$Component) {
|
|
5338
5332
|
var jIndex = void 0;
|
5339
5333
|
var current = void 0;
|
5340
5334
|
var dateTable = [];
|
5341
|
-
var today = Object(__WEBPACK_IMPORTED_MODULE_7__util___["
|
5335
|
+
var today = Object(__WEBPACK_IMPORTED_MODULE_7__util___["e" /* getTodayTime */])(value);
|
5342
5336
|
var cellClass = prefixCls + '-cell';
|
5343
5337
|
var weekNumberCellClass = prefixCls + '-week-number-cell';
|
5344
5338
|
var dateClass = prefixCls + '-date';
|
@@ -5400,7 +5394,7 @@ var DateTBody = function (_React$Component) {
|
|
5400
5394
|
for (jIndex = 0; jIndex < DATE_ROW_COLUMN_COUNT.DATE_COL_COUNT; jIndex++) {
|
5401
5395
|
var next = null;
|
5402
5396
|
var last = null;
|
5403
|
-
if (currentStatus ===
|
5397
|
+
if (currentStatus === 'todayTime') {
|
5404
5398
|
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
5399
|
} else {
|
5406
5400
|
current = dateTable[passed];
|
@@ -5517,7 +5511,7 @@ var DateTBody = function (_React$Component) {
|
|
5517
5511
|
onClick: disabled ? undefined : props.onSelect.bind(null, current),
|
5518
5512
|
onMouseEnter: disabled ? undefined : props.onDayHover && props.onDayHover.bind(null, current) || undefined,
|
5519
5513
|
role: 'gridcell',
|
5520
|
-
title: Object(__WEBPACK_IMPORTED_MODULE_7__util___["
|
5514
|
+
title: Object(__WEBPACK_IMPORTED_MODULE_7__util___["d" /* getTitleString */])(current),
|
5521
5515
|
className: cls
|
5522
5516
|
},
|
5523
5517
|
dateHtml
|
@@ -6088,7 +6082,7 @@ var MonthTable = function (_Component) {
|
|
6088
6082
|
months[rowIndex] = [];
|
6089
6083
|
for (var colIndex = 0; colIndex < COL; colIndex++) {
|
6090
6084
|
current = current.month(index);
|
6091
|
-
var content = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["
|
6085
|
+
var content = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["b" /* getMonthName */])(current);
|
6092
6086
|
months[rowIndex][colIndex] = {
|
6093
6087
|
value: index,
|
6094
6088
|
content: content,
|
@@ -6105,7 +6099,7 @@ var MonthTable = function (_Component) {
|
|
6105
6099
|
|
6106
6100
|
var props = this.props;
|
6107
6101
|
var value = this.state.value;
|
6108
|
-
var today = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["
|
6102
|
+
var today = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["e" /* getTodayTime */])(value);
|
6109
6103
|
var months = this.months();
|
6110
6104
|
var currentMonth = value.month();
|
6111
6105
|
var prefixCls = props.prefixCls,
|
@@ -6741,7 +6735,7 @@ function TodayButton(_ref) {
|
|
6741
6735
|
text = _ref.text;
|
6742
6736
|
|
6743
6737
|
var localeNow = (!text && timePicker ? locale.now : text) || locale.today;
|
6744
|
-
var disabledToday = disabledDate && !Object(__WEBPACK_IMPORTED_MODULE_1__util___["
|
6738
|
+
var disabledToday = disabledDate && !Object(__WEBPACK_IMPORTED_MODULE_1__util___["h" /* isAllowedDate */])(Object(__WEBPACK_IMPORTED_MODULE_1__util___["e" /* getTodayTime */])(value), disabledDate);
|
6745
6739
|
var isDisabled = disabledToday || disabled;
|
6746
6740
|
var disabledTodayClass = isDisabled ? prefixCls + '-today-btn-disabled' : '';
|
6747
6741
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
|
@@ -6750,7 +6744,7 @@ function TodayButton(_ref) {
|
|
6750
6744
|
className: prefixCls + '-today-btn ' + disabledTodayClass,
|
6751
6745
|
role: 'button',
|
6752
6746
|
onClick: isDisabled ? null : onToday,
|
6753
|
-
title: Object(__WEBPACK_IMPORTED_MODULE_1__util___["
|
6747
|
+
title: Object(__WEBPACK_IMPORTED_MODULE_1__util___["f" /* getTodayTimeStr */])(value)
|
6754
6748
|
},
|
6755
6749
|
localeNow
|
6756
6750
|
);
|
@@ -6934,7 +6928,7 @@ var CalendarRightPanel = function (_React$Component) {
|
|
6934
6928
|
'ul',
|
6935
6929
|
null,
|
6936
6930
|
this.times.map(function (time) {
|
6937
|
-
var parts = Object(__WEBPACK_IMPORTED_MODULE_6__util__["
|
6931
|
+
var parts = Object(__WEBPACK_IMPORTED_MODULE_6__util__["j" /* tokenizeFormattedDate */])(selectedDate, _this2.state.localeFormat);
|
6938
6932
|
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
6933
|
current = isZhcn ? current.locale('zh-cn') : current.locale('en-gb');
|
6940
6934
|
return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
|
@@ -7009,7 +7003,7 @@ function noop() {}
|
|
7009
7003
|
function getNowByCurrentStateValue(value) {
|
7010
7004
|
var ret = void 0;
|
7011
7005
|
if (value) {
|
7012
|
-
ret = Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["
|
7006
|
+
ret = Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["e" /* getTodayTime */])(value);
|
7013
7007
|
} else {
|
7014
7008
|
ret = __WEBPACK_IMPORTED_MODULE_6_dayjs___default()();
|
7015
7009
|
}
|
@@ -7090,7 +7084,7 @@ var calendarMixinWrapper = function calendarMixinWrapper(ComposeComponent) {
|
|
7090
7084
|
}, _this.isAllowedDate = function (value) {
|
7091
7085
|
var disabledDate = _this.props.disabledDate;
|
7092
7086
|
var disabledTime = _this.props.disabledTime;
|
7093
|
-
return Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["
|
7087
|
+
return Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["h" /* isAllowedDate */])(value, disabledDate, disabledTime);
|
7094
7088
|
}, _temp), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
|
7095
7089
|
}
|
7096
7090
|
|
@@ -7309,9 +7303,8 @@ var DateInput = function (_React$Component) {
|
|
7309
7303
|
var selectedValue = props.selectedValue;
|
7310
7304
|
|
7311
7305
|
_this.state = {
|
7312
|
-
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7306
|
+
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(selectedValue, _this.props.format),
|
7313
7307
|
hasFocus: false,
|
7314
|
-
isEmpty: false,
|
7315
7308
|
localFormat: _this.props.format[0]
|
7316
7309
|
};
|
7317
7310
|
return _this;
|
@@ -7333,7 +7326,7 @@ var DateInput = function (_React$Component) {
|
|
7333
7326
|
// when popup show, click body will call this, bug!
|
7334
7327
|
var selectedValue = nextProps.selectedValue;
|
7335
7328
|
if (!state.hasFocus) {
|
7336
|
-
newState = { str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7329
|
+
newState = { str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(selectedValue, nextProps.format) };
|
7337
7330
|
}
|
7338
7331
|
|
7339
7332
|
return newState;
|
@@ -7413,7 +7406,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
7413
7406
|
|
7414
7407
|
this.onInputChange = function (event) {
|
7415
7408
|
var str = event.target.value;
|
7416
|
-
var calendarStr = Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7409
|
+
var calendarStr = Object(__WEBPACK_IMPORTED_MODULE_9__util__["g" /* initializeStr */])(str, _this2.state.localFormat) || '';
|
7417
7410
|
var _props = _this2.props,
|
7418
7411
|
disabledDate = _props.disabledDate,
|
7419
7412
|
format = _props.format,
|
@@ -7422,11 +7415,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
7422
7415
|
// 没有内容,合法并直接退出
|
7423
7416
|
|
7424
7417
|
if (!str || !calendarStr) {
|
7425
|
-
_this2.setState({ isEmpty: true });
|
7426
7418
|
_this2.onClear();
|
7427
7419
|
return;
|
7428
7420
|
}
|
7429
|
-
if (_this2.state.isEmpty) _this2.setState({ isEmpty: false });
|
7430
7421
|
var parsed = __WEBPACK_IMPORTED_MODULE_8_dayjs___default()(calendarStr, format[0]);
|
7431
7422
|
var value = _this2.props.value.clone();
|
7432
7423
|
value = value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
|
@@ -7450,7 +7441,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
7450
7441
|
_this2.setState(function (prevState, prevProps) {
|
7451
7442
|
return {
|
7452
7443
|
hasFocus: false,
|
7453
|
-
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["
|
7444
|
+
str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(prevProps.value, prevProps.format)
|
7454
7445
|
};
|
7455
7446
|
});
|
7456
7447
|
};
|
@@ -7465,11 +7456,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
7465
7456
|
if (keyCode === __WEBPACK_IMPORTED_MODULE_6_rc_util_es_KeyCode__["a" /* default */].ENTER && onSelect) {
|
7466
7457
|
var validateDate = !disabledDate || !disabledDate(value);
|
7467
7458
|
if (validateDate) {
|
7468
|
-
|
7469
|
-
onSelect(null);
|
7470
|
-
} else {
|
7471
|
-
onSelect(value.clone());
|
7472
|
-
}
|
7459
|
+
onSelect(value.clone());
|
7473
7460
|
}
|
7474
7461
|
event.preventDefault();
|
7475
7462
|
}
|