@seafile/seafile-calendar 0.0.31-Apph0.35 → 0.0.31-Apph0.37

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.
@@ -2805,8 +2805,7 @@ var Calendar = function (_React$Component) {
2805
2805
  inputMode = props.inputMode,
2806
2806
  showHourAndMinute = props.showHourAndMinute,
2807
2807
  firstDayOfWeek = props.firstDayOfWeek,
2808
- showWeekNumber = props.showWeekNumber,
2809
- defaultInputValue = props.defaultInputValue;
2808
+ showWeekNumber = props.showWeekNumber;
2810
2809
  var value = state.value,
2811
2810
  selectedValue = state.selectedValue,
2812
2811
  mode = state.mode;
@@ -2845,7 +2844,6 @@ var Calendar = function (_React$Component) {
2845
2844
  disabledTime: disabledTime,
2846
2845
  disabledDate: disabledDate,
2847
2846
  onClear: this.onClear,
2848
- defaultInputValue: defaultInputValue,
2849
2847
  prefixCls: prefixCls,
2850
2848
  selectedValue: selectedValue,
2851
2849
  onChange: this.onDateInputChange,
@@ -2953,7 +2951,6 @@ Calendar.propTypes = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__
2953
2951
  className: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
2954
2952
  style: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
2955
2953
  defaultValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
2956
- defaultInputValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
2957
2954
  value: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
2958
2955
  selectedValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
2959
2956
  defaultSelectedValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
@@ -7333,7 +7330,6 @@ var DateInput = function (_React$Component) {
7333
7330
  clearIcon = props.clearIcon,
7334
7331
  inputMode = props.inputMode;
7335
7332
 
7336
-
7337
7333
  return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
7338
7334
  'div',
7339
7335
  { className: prefixCls + '-input-wrap' },
@@ -7382,8 +7378,7 @@ DateInput.propTypes = {
7382
7378
  onSelect: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
7383
7379
  selectedValue: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
7384
7380
  clearIcon: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.node,
7385
- inputMode: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
7386
- defaultInputValue: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object
7381
+ inputMode: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string
7387
7382
  };
7388
7383
 
7389
7384
  var _initialiseProps = function _initialiseProps() {
@@ -7395,21 +7390,28 @@ var _initialiseProps = function _initialiseProps() {
7395
7390
  };
7396
7391
 
7397
7392
  this.onInputChange = function (event) {
7393
+ console.log(_this2.props);
7398
7394
  var str = event.target.value;
7399
7395
  var calendarStr = Object(__WEBPACK_IMPORTED_MODULE_9__util__["g" /* initializeStr */])(str, _this2.state.localFormat) || '';
7400
7396
  var _props = _this2.props,
7401
7397
  disabledDate = _props.disabledDate,
7402
7398
  format = _props.format,
7403
7399
  onChange = _props.onChange,
7404
- selectedValue = _props.selectedValue,
7405
- defaultInputValue = _props.defaultInputValue;
7400
+ selectedValue = _props.selectedValue;
7401
+
7402
+ // 没有内容,合法并直接退出
7406
7403
 
7407
- console.log('calendarStr', !calendarStr);
7404
+ if (!str) {
7405
+ onChange(__WEBPACK_IMPORTED_MODULE_8_dayjs___default()());
7406
+ _this2.setState({ str: '' });
7407
+ return;
7408
+ }
7408
7409
  var parsed = __WEBPACK_IMPORTED_MODULE_8_dayjs___default()(calendarStr, format[0]);
7409
7410
  var value = _this2.props.value.clone();
7410
- console.log('defaultValue', defaultInputValue);
7411
7411
  value = value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
7412
+ console.log('calendarStr', calendarStr);
7412
7413
 
7414
+ console.log('value', value);
7413
7415
  if (!value || disabledDate && disabledDate(value)) {
7414
7416
  _this2.setState({ str: str });
7415
7417
  return;
@@ -7417,9 +7419,7 @@ var _initialiseProps = function _initialiseProps() {
7417
7419
 
7418
7420
  if (selectedValue !== value || selectedValue && value && !selectedValue.isSame(value)) {
7419
7421
  _this2.setState({ str: str });
7420
- var changeVal = !calendarStr ? defaultInputValue : value;
7421
- console.log('changeVal', changeVal);
7422
- onChange(changeVal);
7422
+ onChange(value);
7423
7423
  }
7424
7424
  };
7425
7425