@seafile/seafile-calendar 0.0.88882 → 0.0.88887

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