@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.
@@ -103,7 +103,6 @@ var DateInput = function (_React$Component) {
103
103
  clearIcon = props.clearIcon,
104
104
  inputMode = props.inputMode;
105
105
 
106
-
107
106
  return _react2['default'].createElement(
108
107
  'div',
109
108
  { className: prefixCls + '-input-wrap' },
@@ -152,8 +151,7 @@ DateInput.propTypes = {
152
151
  onSelect: _propTypes2['default'].func,
153
152
  selectedValue: _propTypes2['default'].object,
154
153
  clearIcon: _propTypes2['default'].node,
155
- inputMode: _propTypes2['default'].string,
156
- defaultInputValue: _propTypes2['default'].object
154
+ inputMode: _propTypes2['default'].string
157
155
  };
158
156
 
159
157
  var _initialiseProps = function _initialiseProps() {
@@ -165,21 +163,28 @@ var _initialiseProps = function _initialiseProps() {
165
163
  };
166
164
 
167
165
  this.onInputChange = function (event) {
166
+ console.log(_this2.props);
168
167
  var str = event.target.value;
169
168
  var calendarStr = (0, _util.initializeStr)(str, _this2.state.localFormat) || '';
170
169
  var _props = _this2.props,
171
170
  disabledDate = _props.disabledDate,
172
171
  format = _props.format,
173
172
  onChange = _props.onChange,
174
- selectedValue = _props.selectedValue,
175
- defaultInputValue = _props.defaultInputValue;
173
+ selectedValue = _props.selectedValue;
174
+
175
+ // 没有内容,合法并直接退出
176
176
 
177
- console.log('calendarStr', !calendarStr);
177
+ if (!str) {
178
+ onChange((0, _dayjs2['default'])());
179
+ _this2.setState({ str: '' });
180
+ return;
181
+ }
178
182
  var parsed = (0, _dayjs2['default'])(calendarStr, format[0]);
179
183
  var value = _this2.props.value.clone();
180
- console.log('defaultValue', defaultInputValue);
181
184
  value = value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
185
+ console.log('calendarStr', calendarStr);
182
186
 
187
+ console.log('value', value);
183
188
  if (!value || disabledDate && disabledDate(value)) {
184
189
  _this2.setState({ str: str });
185
190
  return;
@@ -187,9 +192,7 @@ var _initialiseProps = function _initialiseProps() {
187
192
 
188
193
  if (selectedValue !== value || selectedValue && value && !selectedValue.isSame(value)) {
189
194
  _this2.setState({ str: str });
190
- var changeVal = !calendarStr ? defaultInputValue : value;
191
- console.log('changeVal', changeVal);
192
- onChange(changeVal);
195
+ onChange(value);
193
196
  }
194
197
  };
195
198
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-calendar",
3
- "version": "0.0.31Apph0.35",
3
+ "version": "0.0.31Apph0.37",
4
4
  "description": "React Calendar",
5
5
  "keywords": [
6
6
  "react",