dtable-ui-component 6.0.39-gzc2 → 6.0.39-gzc33

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.
@@ -14,7 +14,6 @@ var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar
14
14
  var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Picker"));
15
15
  var _lang = require("../../lang");
16
16
  var _columnUtils = require("../../utils/column-utils");
17
- var _dateFormat = require("../../utils/dateFormat.js");
18
17
  require("@seafile/seafile-calendar/assets/index.css");
19
18
  let now = (0, _dayjs.default)();
20
19
  class FilterCalendar extends _react.Component {
@@ -27,18 +26,12 @@ class FilterCalendar extends _react.Component {
27
26
  const {
28
27
  onChange
29
28
  } = this.props;
30
- const searchFormat = this.columnDataFormat;
29
+ const searchFormat = 'YYYY-MM-DD';
31
30
  this.setState({
32
31
  value
33
32
  }, () => {
34
33
  if (this.state.value) {
35
- console.log('value', this.state.value);
36
- const filterStr = this.state.value.format(this.getCalendarFormat()[0]);
37
- if (typeof filterStr === 'string') {
38
- const changeVal = (0, _dateFormat.filterChangeValue)(filterStr, searchFormat);
39
- console.log('changeVal', changeVal);
40
- onChange(changeVal);
41
- }
34
+ onChange(this.state.value.format(searchFormat));
42
35
  }
43
36
  });
44
37
  };
@@ -92,9 +85,6 @@ class FilterCalendar extends _react.Component {
92
85
  this.columnDataFormat = DataFormat.split(' ')[0];
93
86
  this.calendarContainerRef = /*#__PURE__*/_react.default.createRef();
94
87
  this.defaultCalendarValue = null;
95
- this.formatDay = this.props.value ? (0, _dateFormat.getDay)(this.props.value, this.getCalendarFormat()[0]) : null;
96
- this.formatMonth = this.props.value ? (0, _dateFormat.getMonth)(this.props.value, this.getCalendarFormat()[0]) : null;
97
- this.formatYear = this.props.value ? (0, _dateFormat.getYear)(this.props.value, this.getCalendarFormat()[0]) : null;
98
88
  }
99
89
  componentDidMount() {
100
90
  const {
@@ -102,9 +92,6 @@ class FilterCalendar extends _react.Component {
102
92
  lang
103
93
  } = this.props;
104
94
  const iszhcn = lang === 'zh-cn';
105
- console.log('formatDay', this.formatDay);
106
- console.log('formatMonth', this.formatMonth);
107
- console.log('formatYear', this.formatYear);
108
95
  if (iszhcn) {
109
96
  now = now.locale('zh-cn');
110
97
  } else {
@@ -114,7 +101,7 @@ class FilterCalendar extends _react.Component {
114
101
  if (value && (0, _dayjs.default)(value).isValid()) {
115
102
  let validValue = (0, _dayjs.default)(value).isValid() ? (0, _dayjs.default)(value) : (0, _dayjs.default)(this.defaultCalendarValue);
116
103
  this.setState({
117
- value: iszhcn ? (0, _dayjs.default)(validValue).year(this.formatYear).month(this.formatMonth).date(this.formatDay).locale('zh-cn') : (0, _dayjs.default)(validValue).year(this.formatYear).month(this.formatMonth).date(this.formatDay).locale('en-gb')
104
+ value: iszhcn ? (0, _dayjs.default)(validValue).locale('zh-cn') : (0, _dayjs.default)(validValue).locale('en-gb')
118
105
  });
119
106
  }
120
107
  }
@@ -124,15 +111,12 @@ class FilterCalendar extends _react.Component {
124
111
  firstDayOfWeek
125
112
  } = this.props;
126
113
  const state = this.state;
127
- const calendarFormat = this.getCalendarFormat();
128
- const inputStr = state.value ? state.value.format(this.columnDataFormat) : '';
129
- const displayContentValue = (0, _dateFormat.renderFilterInputFormat)(inputStr, calendarFormat[0], (0, _dateFormat.delimate)(calendarFormat[0]));
130
114
  if (isReadOnly) return /*#__PURE__*/_react.default.createElement("input", {
131
115
  className: "ant-calendar-picker-input ant-input form-control",
132
- value: displayContentValue,
116
+ value: state.value ? state.value.format(this.columnDataFormat) : '',
133
117
  disabled: true
134
118
  });
135
- console.log('calendarFormat', calendarFormat, displayContentValue);
119
+ const calendarFormat = this.getCalendarFormat();
136
120
  const clearStyle = {
137
121
  position: 'absolute',
138
122
  top: '15px',
@@ -182,7 +166,7 @@ class FilterCalendar extends _react.Component {
182
166
  tabIndex: "-1",
183
167
  readOnly: true,
184
168
  className: "ant-calendar-picker-input ant-input form-control",
185
- value: displayContentValue,
169
+ value: value ? value.format(this.columnDataFormat) : '',
186
170
  onMouseDown: this.handleMouseDown
187
171
  }), /*#__PURE__*/_react.default.createElement("div", {
188
172
  ref: this.calendarContainerRef
@@ -350,8 +350,6 @@ class FilterItem extends _react.default.Component {
350
350
  const inputRangeLabel = [_dtableUtils.FILTER_TERM_MODIFIER_TYPE.EXACT_DATE, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.NUMBER_OF_DAYS_AGO, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.NUMBER_OF_DAYS_FROM_NOW, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.THE_NEXT_NUMBERS_OF_DAYS, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.THE_PAST_NUMBERS_OF_DAYS];
351
351
  if (inputRangeLabel.indexOf(filter_term_modifier) > -1) {
352
352
  if (filter_term_modifier === 'exact_date') {
353
- console.log('filterTerm', this.state.filterTerm);
354
- console.log('filterColumn', filterColumn);
355
353
  return /*#__PURE__*/_react.default.createElement(_filterCalendar.default, {
356
354
  lang: lang,
357
355
  value: this.state.filterTerm,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.39-gzc2",
3
+ "version": "6.0.39-gzc33",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "4.0.2",