@zat-design/sisyphus-react 3.5.0-beta.12 → 3.5.0-beta.13
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/utils/useForm.js +11 -11
- package/lib/ProForm/utils/useForm.js +11 -11
- package/package.json +1 -1
|
@@ -47,7 +47,7 @@ export var useForm = function useForm(originForm) {
|
|
|
47
47
|
isRecursive = rest === null || rest === void 0 ? void 0 : (_rest$ = rest[0]) === null || _rest$ === void 0 ? void 0 : _rest$.recursive;
|
|
48
48
|
validateNames = []; // 前缀校验模式
|
|
49
49
|
if (!isRecursive) {
|
|
50
|
-
_context.next =
|
|
50
|
+
_context.next = 12;
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
// @ts-ignore
|
|
@@ -63,22 +63,22 @@ export var useForm = function useForm(originForm) {
|
|
|
63
63
|
validateNames = _toConsumableArray(nameList);
|
|
64
64
|
}
|
|
65
65
|
// @ts-ignore
|
|
66
|
-
delete rest[0].recursive;
|
|
67
|
-
_context.next =
|
|
66
|
+
// delete rest[0].recursive;
|
|
67
|
+
_context.next = 11;
|
|
68
68
|
return validateFields.apply(void 0, [validateNames].concat(rest)).then(function (values) {
|
|
69
69
|
return filterInternalFields(values);
|
|
70
70
|
});
|
|
71
|
-
case
|
|
71
|
+
case 11:
|
|
72
72
|
return _context.abrupt("return", _context.sent);
|
|
73
|
-
case
|
|
74
|
-
_context.next =
|
|
73
|
+
case 12:
|
|
74
|
+
_context.next = 14;
|
|
75
75
|
return validateFields.apply(void 0, [nameList].concat(rest)).then(function (values) {
|
|
76
76
|
return nameList ? values : _getFieldsValue();
|
|
77
77
|
});
|
|
78
|
-
case
|
|
78
|
+
case 14:
|
|
79
79
|
return _context.abrupt("return", _context.sent);
|
|
80
|
-
case
|
|
81
|
-
_context.prev =
|
|
80
|
+
case 17:
|
|
81
|
+
_context.prev = 17;
|
|
82
82
|
_context.t0 = _context["catch"](0);
|
|
83
83
|
if (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.errorFields) {
|
|
84
84
|
form.scrollToField((_error$errorFields$ = _context.t0.errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name, {
|
|
@@ -88,11 +88,11 @@ export var useForm = function useForm(originForm) {
|
|
|
88
88
|
}
|
|
89
89
|
handleScrollToError();
|
|
90
90
|
throw _context.t0;
|
|
91
|
-
case
|
|
91
|
+
case 22:
|
|
92
92
|
case "end":
|
|
93
93
|
return _context.stop();
|
|
94
94
|
}
|
|
95
|
-
}, _callee, null, [[0,
|
|
95
|
+
}, _callee, null, [[0, 17]]);
|
|
96
96
|
}));
|
|
97
97
|
return function _validateFields(_x) {
|
|
98
98
|
return _ref.apply(this, arguments);
|
|
@@ -53,7 +53,7 @@ var useForm = exports.useForm = function useForm(originForm) {
|
|
|
53
53
|
isRecursive = rest === null || rest === void 0 ? void 0 : (_rest$ = rest[0]) === null || _rest$ === void 0 ? void 0 : _rest$.recursive;
|
|
54
54
|
validateNames = []; // 前缀校验模式
|
|
55
55
|
if (!isRecursive) {
|
|
56
|
-
_context.next =
|
|
56
|
+
_context.next = 12;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
// @ts-ignore
|
|
@@ -69,22 +69,22 @@ var useForm = exports.useForm = function useForm(originForm) {
|
|
|
69
69
|
validateNames = (0, _toConsumableArray2.default)(nameList);
|
|
70
70
|
}
|
|
71
71
|
// @ts-ignore
|
|
72
|
-
delete rest[0].recursive;
|
|
73
|
-
_context.next =
|
|
72
|
+
// delete rest[0].recursive;
|
|
73
|
+
_context.next = 11;
|
|
74
74
|
return validateFields.apply(void 0, [validateNames].concat(rest)).then(function (values) {
|
|
75
75
|
return (0, _index.filterInternalFields)(values);
|
|
76
76
|
});
|
|
77
|
-
case
|
|
77
|
+
case 11:
|
|
78
78
|
return _context.abrupt("return", _context.sent);
|
|
79
|
-
case
|
|
80
|
-
_context.next =
|
|
79
|
+
case 12:
|
|
80
|
+
_context.next = 14;
|
|
81
81
|
return validateFields.apply(void 0, [nameList].concat(rest)).then(function (values) {
|
|
82
82
|
return nameList ? values : _getFieldsValue();
|
|
83
83
|
});
|
|
84
|
-
case
|
|
84
|
+
case 14:
|
|
85
85
|
return _context.abrupt("return", _context.sent);
|
|
86
|
-
case
|
|
87
|
-
_context.prev =
|
|
86
|
+
case 17:
|
|
87
|
+
_context.prev = 17;
|
|
88
88
|
_context.t0 = _context["catch"](0);
|
|
89
89
|
if (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.errorFields) {
|
|
90
90
|
form.scrollToField((_error$errorFields$ = _context.t0.errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name, {
|
|
@@ -94,11 +94,11 @@ var useForm = exports.useForm = function useForm(originForm) {
|
|
|
94
94
|
}
|
|
95
95
|
(0, _tools.handleScrollToError)();
|
|
96
96
|
throw _context.t0;
|
|
97
|
-
case
|
|
97
|
+
case 22:
|
|
98
98
|
case "end":
|
|
99
99
|
return _context.stop();
|
|
100
100
|
}
|
|
101
|
-
}, _callee, null, [[0,
|
|
101
|
+
}, _callee, null, [[0, 17]]);
|
|
102
102
|
}));
|
|
103
103
|
return function _validateFields(_x) {
|
|
104
104
|
return _ref.apply(this, arguments);
|