@zat-design/sisyphus-react 3.5.4-beta.2 → 3.5.4-beta.4
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.
- package/es/ProForm/components/base/DatePicker/index.js +2 -14
- package/es/ProForm/utils/useShouldUpdate.js +2 -2
- package/es/ProStep/components/Listener/index.js +4 -3
- package/lib/ProForm/components/base/DatePicker/index.js +1 -13
- package/lib/ProForm/utils/useShouldUpdate.js +2 -2
- package/lib/ProStep/components/Listener/index.js +4 -3
- package/package.json +1 -1
|
@@ -15,14 +15,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
15
15
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { isFunction, isString, isObject, uniq
|
|
18
|
+
import { isFunction, isString, isObject, uniq } from 'lodash';
|
|
19
19
|
import classNames from 'classnames';
|
|
20
20
|
import moment from 'moment';
|
|
21
21
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
22
22
|
import ProForm from '../../../../ProForm';
|
|
23
23
|
import Container from '../../Container';
|
|
24
24
|
var DatePicker = function DatePicker(props) {
|
|
25
|
-
var _rest$showTime;
|
|
26
25
|
var className = props.className,
|
|
27
26
|
_props$format = props.format,
|
|
28
27
|
format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
|
|
@@ -68,13 +67,6 @@ var DatePicker = function DatePicker(props) {
|
|
|
68
67
|
var _rest = _objectSpread(_objectSpread({}, rest), {}, {
|
|
69
68
|
showTime: rest.showTime === undefined && valueType === 'dateTime' || rest.showTime
|
|
70
69
|
});
|
|
71
|
-
if (_rest.showTime && !isBoolean(_rest.showTime) && !Reflect.ownKeys((_rest$showTime = _rest.showTime) !== null && _rest$showTime !== void 0 ? _rest$showTime : {}).includes('format')) {
|
|
72
|
-
var _rest$showTime2;
|
|
73
|
-
_rest.showTime = _objectSpread(_objectSpread({}, (_rest$showTime2 = _rest.showTime) !== null && _rest$showTime2 !== void 0 ? _rest$showTime2 : {}), _defaultShowTime);
|
|
74
|
-
}
|
|
75
|
-
if (isBoolean(_rest.showTime)) {
|
|
76
|
-
_rest.showTime = _objectSpread({}, _defaultShowTime);
|
|
77
|
-
}
|
|
78
70
|
// 字符串时间格式兼容
|
|
79
71
|
if (isString(_rest.value)) {
|
|
80
72
|
_rest.value = moment(_rest.value);
|
|
@@ -86,16 +78,12 @@ var DatePicker = function DatePicker(props) {
|
|
|
86
78
|
_defaultShowTime: _defaultShowTime
|
|
87
79
|
};
|
|
88
80
|
}
|
|
89
|
-
if (
|
|
81
|
+
if (_rest.showTime === true) {
|
|
90
82
|
_rest.showTime = _objectSpread({}, _defaultShowTime);
|
|
91
83
|
}
|
|
92
84
|
if (isObject(_rest.showTime)) {
|
|
93
85
|
_rest.showTime = Object.assign(_defaultShowTime, _rest.showTime);
|
|
94
86
|
}
|
|
95
|
-
// 传进来showTime权重最高
|
|
96
|
-
if (isBoolean(rest.showTime)) {
|
|
97
|
-
_rest.showTime = rest.showTime;
|
|
98
|
-
}
|
|
99
87
|
return _jsx(_DatePicker, _objectSpread(_objectSpread(_objectSpread({}, initialConfig), {}, {
|
|
100
88
|
format: _format
|
|
101
89
|
}, _rest), {}, {
|
|
@@ -161,7 +161,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
161
161
|
// 清值防抖 多次刷新时以最后一次为准
|
|
162
162
|
if (clearNotShow !== false && (name || names)) {
|
|
163
163
|
if (_show === false) {
|
|
164
|
-
|
|
164
|
+
clearTimeout(timerRef.current);
|
|
165
165
|
timerRef.current = setTimeout(function () {
|
|
166
166
|
if (Array.isArray(names)) {
|
|
167
167
|
form.resetFields(names);
|
|
@@ -171,7 +171,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
171
171
|
}
|
|
172
172
|
}, 200);
|
|
173
173
|
} else {
|
|
174
|
-
|
|
174
|
+
clearTimeout(timerRef.current);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
// // 当校验规则改变的时候 重新执行校验 导致: 第一次进页面直接触发校验
|
|
@@ -7,6 +7,7 @@ import { throttle } from 'lodash';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { useStep } from '../../index';
|
|
9
9
|
export default (function (_ref) {
|
|
10
|
+
var _children$props;
|
|
10
11
|
var children = _ref.children,
|
|
11
12
|
delayTime = _ref.delayTime,
|
|
12
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -15,7 +16,7 @@ export default (function (_ref) {
|
|
|
15
16
|
loading = _useStep.loading,
|
|
16
17
|
setLoading = _useStep.setLoading;
|
|
17
18
|
return /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, props), {}, {
|
|
18
|
-
loading: loading || (props === null || props === void 0 ? void 0 : props.loading),
|
|
19
|
+
loading: loading || (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.loading),
|
|
19
20
|
onClick: throttle( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
20
21
|
var values;
|
|
21
22
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -30,8 +31,8 @@ export default (function (_ref) {
|
|
|
30
31
|
setLoading(false);
|
|
31
32
|
var localData = localStorage.getItem('cache-pro-step');
|
|
32
33
|
if (localData !== 'false') {
|
|
33
|
-
var _children$
|
|
34
|
-
children === null || children === void 0 ? void 0 : (_children$
|
|
34
|
+
var _children$props2, _children$props2$onCl;
|
|
35
|
+
children === null || children === void 0 ? void 0 : (_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : (_children$props2$onCl = _children$props2.onClick) === null || _children$props2$onCl === void 0 ? void 0 : _children$props2$onCl.call(_children$props2, values);
|
|
35
36
|
}
|
|
36
37
|
}, delayTime !== null && delayTime !== void 0 ? delayTime : 0);
|
|
37
38
|
case 5:
|
|
@@ -27,7 +27,6 @@ var _excluded = ["className", "format"];
|
|
|
27
27
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
28
28
|
*/
|
|
29
29
|
var DatePicker = function DatePicker(props) {
|
|
30
|
-
var _rest$showTime;
|
|
31
30
|
var className = props.className,
|
|
32
31
|
_props$format = props.format,
|
|
33
32
|
format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
|
|
@@ -73,13 +72,6 @@ var DatePicker = function DatePicker(props) {
|
|
|
73
72
|
var _rest = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
74
73
|
showTime: rest.showTime === undefined && valueType === 'dateTime' || rest.showTime
|
|
75
74
|
});
|
|
76
|
-
if (_rest.showTime && !(0, _lodash.isBoolean)(_rest.showTime) && !Reflect.ownKeys((_rest$showTime = _rest.showTime) !== null && _rest$showTime !== void 0 ? _rest$showTime : {}).includes('format')) {
|
|
77
|
-
var _rest$showTime2;
|
|
78
|
-
_rest.showTime = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (_rest$showTime2 = _rest.showTime) !== null && _rest$showTime2 !== void 0 ? _rest$showTime2 : {}), _defaultShowTime);
|
|
79
|
-
}
|
|
80
|
-
if ((0, _lodash.isBoolean)(_rest.showTime)) {
|
|
81
|
-
_rest.showTime = (0, _objectSpread2.default)({}, _defaultShowTime);
|
|
82
|
-
}
|
|
83
75
|
// 字符串时间格式兼容
|
|
84
76
|
if ((0, _lodash.isString)(_rest.value)) {
|
|
85
77
|
_rest.value = (0, _moment.default)(_rest.value);
|
|
@@ -91,16 +83,12 @@ var DatePicker = function DatePicker(props) {
|
|
|
91
83
|
_defaultShowTime: _defaultShowTime
|
|
92
84
|
};
|
|
93
85
|
}
|
|
94
|
-
if (
|
|
86
|
+
if (_rest.showTime === true) {
|
|
95
87
|
_rest.showTime = (0, _objectSpread2.default)({}, _defaultShowTime);
|
|
96
88
|
}
|
|
97
89
|
if ((0, _lodash.isObject)(_rest.showTime)) {
|
|
98
90
|
_rest.showTime = Object.assign(_defaultShowTime, _rest.showTime);
|
|
99
91
|
}
|
|
100
|
-
// 传进来showTime权重最高
|
|
101
|
-
if ((0, _lodash.isBoolean)(rest.showTime)) {
|
|
102
|
-
_rest.showTime = rest.showTime;
|
|
103
|
-
}
|
|
104
92
|
return (0, _jsxRuntime.jsx)(_antd.DatePicker, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, initialConfig), {}, {
|
|
105
93
|
format: _format
|
|
106
94
|
}, _rest), {}, {
|
|
@@ -168,7 +168,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
168
168
|
// 清值防抖 多次刷新时以最后一次为准
|
|
169
169
|
if (clearNotShow !== false && (name || names)) {
|
|
170
170
|
if (_show === false) {
|
|
171
|
-
|
|
171
|
+
clearTimeout(timerRef.current);
|
|
172
172
|
timerRef.current = setTimeout(function () {
|
|
173
173
|
if (Array.isArray(names)) {
|
|
174
174
|
form.resetFields(names);
|
|
@@ -178,7 +178,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
178
178
|
}
|
|
179
179
|
}, 200);
|
|
180
180
|
} else {
|
|
181
|
-
|
|
181
|
+
clearTimeout(timerRef.current);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
// // 当校验规则改变的时候 重新执行校验 导致: 第一次进页面直接触发校验
|
|
@@ -14,6 +14,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
14
14
|
var _index = require("../../index");
|
|
15
15
|
var _excluded = ["children", "delayTime"];
|
|
16
16
|
var _default = exports.default = function _default(_ref) {
|
|
17
|
+
var _children$props;
|
|
17
18
|
var children = _ref.children,
|
|
18
19
|
delayTime = _ref.delayTime,
|
|
19
20
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -22,7 +23,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
22
23
|
loading = _useStep.loading,
|
|
23
24
|
setLoading = _useStep.setLoading;
|
|
24
25
|
return /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
25
|
-
loading: loading || (props === null || props === void 0 ? void 0 : props.loading),
|
|
26
|
+
loading: loading || (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.loading),
|
|
26
27
|
onClick: (0, _lodash.throttle)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
27
28
|
var values;
|
|
28
29
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
@@ -37,8 +38,8 @@ var _default = exports.default = function _default(_ref) {
|
|
|
37
38
|
setLoading(false);
|
|
38
39
|
var localData = localStorage.getItem('cache-pro-step');
|
|
39
40
|
if (localData !== 'false') {
|
|
40
|
-
var _children$
|
|
41
|
-
children === null || children === void 0 ? void 0 : (_children$
|
|
41
|
+
var _children$props2, _children$props2$onCl;
|
|
42
|
+
children === null || children === void 0 ? void 0 : (_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : (_children$props2$onCl = _children$props2.onClick) === null || _children$props2$onCl === void 0 ? void 0 : _children$props2$onCl.call(_children$props2, values);
|
|
42
43
|
}
|
|
43
44
|
}, delayTime !== null && delayTime !== void 0 ? delayTime : 0);
|
|
44
45
|
case 5:
|