ztxkui 2.8.4 → 2.8.7

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.
@@ -64,26 +64,32 @@ function RangePicker(_a) {
64
64
  * @description 监听值改变触发单独选择框的值改变
65
65
  */
66
66
  useEffect(function () {
67
- var _a, _b, _c, _d;
67
+ var _a, _b;
68
68
  if (Array.isArray(restProps.value)) {
69
69
  setDatePickerValue(restProps.value[0]);
70
- console.log((_b = (_a = restProps.value[1]) === null || _a === void 0 ? void 0 : _a.format) === null || _b === void 0 ? void 0 : _b.call(_a, formatString));
71
- if (restProps.value[1] &&
72
- ['9999', '9999-12-31', '9999-12'].includes((_d = (_c = restProps.value[1]) === null || _c === void 0 ? void 0 : _c.format) === null || _d === void 0 ? void 0 : _d.call(_c, formatString))) {
70
+ if (showFar &&
71
+ restProps.value[1] &&
72
+ ['9999', '9999-12-31', '9999-12'].includes((_b = (_a = restProps.value[1]) === null || _a === void 0 ? void 0 : _a.format) === null || _b === void 0 ? void 0 : _b.call(_a, formatString))) {
73
73
  setChecked(true);
74
74
  }
75
75
  }
76
- }, [restProps.value, formatString]);
76
+ }, [restProps.value, formatString, showFar]);
77
77
  /**至今组件切换 */
78
78
  var onFarChangeHandle = function (e) {
79
- if (e.target.checked &&
80
- Array.isArray(restProps.value) &&
81
- restProps.value[0]) {
82
- var firstValue = restProps.value[0];
83
- restProps.onChange &&
84
- restProps.onChange([firstValue, dayjs('9999-12-31')], [firstValue.format(formatString), '9999-12-31']);
85
- setDatePickerValue(firstValue);
86
- }
79
+ // if (
80
+ // e.target.checked &&
81
+ // Array.isArray(restProps.value) &&
82
+ // restProps.value[0]
83
+ // ) {
84
+ // const firstValue = restProps.value[0];
85
+ // restProps.onChange &&
86
+ // restProps.onChange(
87
+ // [firstValue, dayjs('9999-12-31')],
88
+ // [firstValue.format(formatString), '9999-12-31']
89
+ // );
90
+ // setDatePickerValue(firstValue);
91
+ // }
92
+ restProps.onChange && restProps.onChange([null, null], ['', '']);
87
93
  setChecked(e.target.checked);
88
94
  };
89
95
  /**至今组件 */
@@ -101,7 +107,7 @@ function RangePicker(_a) {
101
107
  */
102
108
  var onDatePickerChangeHandle = function (value, dateString) {
103
109
  restProps.onChange &&
104
- restProps.onChange([value, dayjs('9999-12-31')], [value.format(formatString), '9999-12-31']);
110
+ restProps.onChange(value ? [value, dayjs('9999-12-31')] : [null, null], value ? [value.format(formatString), '9999-12-31'] : ['', '']);
105
111
  };
106
112
  return checked ? (React.createElement(DatePicker, { value: datePickerValue, onChange: onDatePickerChangeHandle, renderExtraFooter: showFar ? renderExtraFooterHandle : undefined, format: noformat.includes(picker) ? undefined : formatHandle })) : (React.createElement(AntRangePicker, __assign({ renderExtraFooter: showFar ? renderExtraFooterHandle : undefined, picker: picker }, restProps)));
107
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "2.8.4",
3
+ "version": "2.8.7",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",