@zat-design/sisyphus-react 3.5.3-beta.4 → 3.5.3-beta.6
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.
|
@@ -604,7 +604,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
604
604
|
nextState.selectedRows = value;
|
|
605
605
|
}
|
|
606
606
|
} else if (value) {
|
|
607
|
-
|
|
607
|
+
var nextSelectedRowKeys = isMultiple ? value : [value];
|
|
608
|
+
nextState.selectedRowKeys = nextSelectedRowKeys;
|
|
609
|
+
nextState.selectedRows = options.filter(function (item) {
|
|
610
|
+
return nextSelectedRowKeys.includes(item[valueKey]);
|
|
611
|
+
});
|
|
608
612
|
}
|
|
609
613
|
setState(nextState);
|
|
610
614
|
}
|
|
@@ -679,6 +683,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
679
683
|
labelInValue: labelInValue,
|
|
680
684
|
dataSource: options,
|
|
681
685
|
scrollFollowParent: false,
|
|
686
|
+
mode: isMultiple ? 'multiple' : undefined,
|
|
682
687
|
onFocus: function onFocus() {
|
|
683
688
|
if (useRequest) {
|
|
684
689
|
var _useRequest$options9;
|
package/es/ProStep/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
7
|
var _excluded = ["children"];
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
9
|
+
import { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
10
|
import { useEventEmitter, useSetState, useLocalStorageState, useDeepCompareEffect } from 'ahooks';
|
|
11
11
|
import { handleScroll } from './utils';
|
|
12
12
|
import Step from './components/Step';
|
|
@@ -26,10 +26,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
26
26
|
errorCollection = _useSetState2[0],
|
|
27
27
|
setErrorCollection = _useSetState2[1];
|
|
28
28
|
// 注册子节点id与title映射的集合
|
|
29
|
-
var
|
|
30
|
-
_useSetState4 = _slicedToArray(_useSetState3, 2),
|
|
31
|
-
registerMap = _useSetState4[0],
|
|
32
|
-
setRegisterMap = _useSetState4[1];
|
|
29
|
+
var registerMap = useRef({});
|
|
33
30
|
var _useState = useState([]),
|
|
34
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
32
|
anchorIds = _useState2[0],
|
|
@@ -48,7 +45,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
48
45
|
if (resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource) {
|
|
49
46
|
return resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource;
|
|
50
47
|
}
|
|
51
|
-
return (_Object$entries = Object.entries(registerMap)) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$map = _Object$entries.map) === null || _Object$entries$map === void 0 ? void 0 : _Object$entries$map.call(_Object$entries, function (_ref2) {
|
|
48
|
+
return (_Object$entries = Object.entries(registerMap.current)) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$map = _Object$entries.map) === null || _Object$entries$map === void 0 ? void 0 : _Object$entries$map.call(_Object$entries, function (_ref2) {
|
|
52
49
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
53
50
|
key = _ref3[0],
|
|
54
51
|
_ref3$ = _ref3[1],
|
|
@@ -64,65 +61,74 @@ var ProStep = function ProStep(_ref) {
|
|
|
64
61
|
}).sort(function (pre, next) {
|
|
65
62
|
return pre.order - next.order;
|
|
66
63
|
});
|
|
67
|
-
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource, registerMap, anchorIds]);
|
|
64
|
+
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource, registerMap.current, anchorIds]);
|
|
68
65
|
// 用来注册form匹配到对应的模块id
|
|
69
66
|
var register = function register(_ref4) {
|
|
67
|
+
var _registerMap$current;
|
|
70
68
|
var id = _ref4.id,
|
|
71
69
|
form = _ref4.form,
|
|
72
70
|
title = _ref4.title,
|
|
73
71
|
validator = _ref4.validator,
|
|
74
72
|
order = _ref4.order,
|
|
75
73
|
disabled = _ref4.disabled;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
order: order
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
74
|
+
var record = {};
|
|
75
|
+
record.title = title;
|
|
76
|
+
record.order = order;
|
|
82
77
|
if (disabled) {
|
|
78
|
+
registerMap.current[id] = record;
|
|
83
79
|
return null;
|
|
84
80
|
}
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
var subEvent = /*#__PURE__*/function () {
|
|
82
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
83
|
+
var num, _form$validateFields, _errors$errorFields;
|
|
84
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
85
|
+
while (1) switch (_context.prev = _context.next) {
|
|
86
|
+
case 0:
|
|
87
|
+
num = 0;
|
|
88
|
+
_context.prev = 1;
|
|
89
|
+
if (!validator) {
|
|
90
|
+
_context.next = 8;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
_context.next = 5;
|
|
94
|
+
return validator === null || validator === void 0 ? void 0 : validator();
|
|
95
|
+
case 5:
|
|
96
|
+
values[id] = _context.sent;
|
|
97
|
+
_context.next = 11;
|
|
94
98
|
break;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
99
|
+
case 8:
|
|
100
|
+
_context.next = 10;
|
|
101
|
+
return form === null || form === void 0 ? void 0 : (_form$validateFields = form.validateFields) === null || _form$validateFields === void 0 ? void 0 : _form$validateFields.call(form);
|
|
102
|
+
case 10:
|
|
103
|
+
values[id] = _context.sent;
|
|
104
|
+
case 11:
|
|
105
|
+
_context.next = 17;
|
|
106
|
+
break;
|
|
107
|
+
case 13:
|
|
108
|
+
_context.prev = 13;
|
|
109
|
+
_context.t0 = _context["catch"](1);
|
|
110
|
+
num = _context.t0 === null || _context.t0 === void 0 ? void 0 : (_errors$errorFields = _context.t0.errorFields) === null || _errors$errorFields === void 0 ? void 0 : _errors$errorFields.length;
|
|
111
|
+
if (num) {
|
|
112
|
+
setLocalData(false);
|
|
113
|
+
console.error(_context.t0);
|
|
114
|
+
}
|
|
115
|
+
case 17:
|
|
116
|
+
setErrorCollection(_defineProperty({}, id, num));
|
|
117
|
+
case 18:
|
|
118
|
+
case "end":
|
|
119
|
+
return _context.stop();
|
|
120
|
+
}
|
|
121
|
+
}, _callee, null, [[1, 13]]);
|
|
122
|
+
}));
|
|
123
|
+
return function subEvent() {
|
|
124
|
+
return _ref5.apply(this, arguments);
|
|
125
|
+
};
|
|
126
|
+
}();
|
|
127
|
+
record.subEvent = subEvent;
|
|
128
|
+
if (title && !(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current = registerMap.current) === null || _registerMap$current === void 0 ? void 0 : _registerMap$current[id])) {
|
|
129
|
+
registerMap.current[id] = record;
|
|
130
|
+
}
|
|
131
|
+
emitter.useSubscription(subEvent);
|
|
126
132
|
};
|
|
127
133
|
var notify = /*#__PURE__*/function () {
|
|
128
134
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
@@ -164,6 +170,41 @@ var ProStep = function ProStep(_ref) {
|
|
|
164
170
|
};
|
|
165
171
|
observer.observe(targetElement, config);
|
|
166
172
|
};
|
|
173
|
+
var triggerTo = /*#__PURE__*/function () {
|
|
174
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(keys) {
|
|
175
|
+
var events, result, nextErrorCollection;
|
|
176
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
177
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
178
|
+
case 0:
|
|
179
|
+
events = [];
|
|
180
|
+
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {
|
|
181
|
+
var _registerMap$current2, _registerMap$current3, _registerMap$current4;
|
|
182
|
+
events.push(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current2 = registerMap.current) === null || _registerMap$current2 === void 0 ? void 0 : (_registerMap$current3 = _registerMap$current2[key]) === null || _registerMap$current3 === void 0 ? void 0 : (_registerMap$current4 = _registerMap$current3.subEvent) === null || _registerMap$current4 === void 0 ? void 0 : _registerMap$current4.call(_registerMap$current3));
|
|
183
|
+
});
|
|
184
|
+
_context3.next = 4;
|
|
185
|
+
return Promise.all(events);
|
|
186
|
+
case 4:
|
|
187
|
+
result = _context3.sent;
|
|
188
|
+
nextErrorCollection = {};
|
|
189
|
+
result === null || result === void 0 ? void 0 : result.forEach(function (item, index) {
|
|
190
|
+
var _item$errorFields;
|
|
191
|
+
if (item === null || item === void 0 ? void 0 : (_item$errorFields = item.errorFields) === null || _item$errorFields === void 0 ? void 0 : _item$errorFields.length) {
|
|
192
|
+
var _item$errorFields2;
|
|
193
|
+
nextErrorCollection[keys[index]] = item === null || item === void 0 ? void 0 : (_item$errorFields2 = item.errorFields) === null || _item$errorFields2 === void 0 ? void 0 : _item$errorFields2.length;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
setErrorCollection(nextErrorCollection);
|
|
197
|
+
return _context3.abrupt("return", result);
|
|
198
|
+
case 9:
|
|
199
|
+
case "end":
|
|
200
|
+
return _context3.stop();
|
|
201
|
+
}
|
|
202
|
+
}, _callee3);
|
|
203
|
+
}));
|
|
204
|
+
return function triggerTo(_x) {
|
|
205
|
+
return _ref7.apply(this, arguments);
|
|
206
|
+
};
|
|
207
|
+
}();
|
|
167
208
|
useDeepCompareEffect(function () {
|
|
168
209
|
var errorModuleKeys = Object.keys(errorCollection).reverse();
|
|
169
210
|
if (errorModuleKeys === null || errorModuleKeys === void 0 ? void 0 : errorModuleKeys.length) {
|
|
@@ -188,6 +229,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
188
229
|
collapse: collapse,
|
|
189
230
|
register: register,
|
|
190
231
|
notify: notify,
|
|
232
|
+
triggerTo: triggerTo,
|
|
191
233
|
handleScroll: handleScroll
|
|
192
234
|
},
|
|
193
235
|
children: _jsxs("div", {
|
|
@@ -601,7 +601,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
601
601
|
nextState.selectedRows = value;
|
|
602
602
|
}
|
|
603
603
|
} else if (value) {
|
|
604
|
-
|
|
604
|
+
var nextSelectedRowKeys = isMultiple ? value : [value];
|
|
605
|
+
nextState.selectedRowKeys = nextSelectedRowKeys;
|
|
606
|
+
nextState.selectedRows = options.filter(function (item) {
|
|
607
|
+
return nextSelectedRowKeys.includes(item[valueKey]);
|
|
608
|
+
});
|
|
605
609
|
}
|
|
606
610
|
setState(nextState);
|
|
607
611
|
}
|
|
@@ -676,6 +680,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
676
680
|
labelInValue: labelInValue,
|
|
677
681
|
dataSource: options,
|
|
678
682
|
scrollFollowParent: false,
|
|
683
|
+
mode: isMultiple ? 'multiple' : undefined,
|
|
679
684
|
onFocus: function onFocus() {
|
|
680
685
|
if (useRequest) {
|
|
681
686
|
var _useRequest$options9;
|
package/lib/ProStep/index.js
CHANGED
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useStep = exports.default = exports.ProStepContext = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -33,10 +33,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
33
33
|
errorCollection = _useSetState2[0],
|
|
34
34
|
setErrorCollection = _useSetState2[1];
|
|
35
35
|
// 注册子节点id与title映射的集合
|
|
36
|
-
var
|
|
37
|
-
_useSetState4 = (0, _slicedToArray2.default)(_useSetState3, 2),
|
|
38
|
-
registerMap = _useSetState4[0],
|
|
39
|
-
setRegisterMap = _useSetState4[1];
|
|
36
|
+
var registerMap = (0, _react.useRef)({});
|
|
40
37
|
var _useState = (0, _react.useState)([]),
|
|
41
38
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
39
|
anchorIds = _useState2[0],
|
|
@@ -55,7 +52,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
55
52
|
if (resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource) {
|
|
56
53
|
return resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource;
|
|
57
54
|
}
|
|
58
|
-
return (_Object$entries = Object.entries(registerMap)) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$map = _Object$entries.map) === null || _Object$entries$map === void 0 ? void 0 : _Object$entries$map.call(_Object$entries, function (_ref2) {
|
|
55
|
+
return (_Object$entries = Object.entries(registerMap.current)) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$map = _Object$entries.map) === null || _Object$entries$map === void 0 ? void 0 : _Object$entries$map.call(_Object$entries, function (_ref2) {
|
|
59
56
|
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
60
57
|
key = _ref3[0],
|
|
61
58
|
_ref3$ = _ref3[1],
|
|
@@ -71,65 +68,74 @@ var ProStep = function ProStep(_ref) {
|
|
|
71
68
|
}).sort(function (pre, next) {
|
|
72
69
|
return pre.order - next.order;
|
|
73
70
|
});
|
|
74
|
-
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource, registerMap, anchorIds]);
|
|
71
|
+
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource, registerMap.current, anchorIds]);
|
|
75
72
|
// 用来注册form匹配到对应的模块id
|
|
76
73
|
var register = function register(_ref4) {
|
|
74
|
+
var _registerMap$current;
|
|
77
75
|
var id = _ref4.id,
|
|
78
76
|
form = _ref4.form,
|
|
79
77
|
title = _ref4.title,
|
|
80
78
|
validator = _ref4.validator,
|
|
81
79
|
order = _ref4.order,
|
|
82
80
|
disabled = _ref4.disabled;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
order: order
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
81
|
+
var record = {};
|
|
82
|
+
record.title = title;
|
|
83
|
+
record.order = order;
|
|
89
84
|
if (disabled) {
|
|
85
|
+
registerMap.current[id] = record;
|
|
90
86
|
return null;
|
|
91
87
|
}
|
|
92
|
-
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
var subEvent = /*#__PURE__*/function () {
|
|
89
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
90
|
+
var num, _form$validateFields, _errors$errorFields;
|
|
91
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
92
|
+
while (1) switch (_context.prev = _context.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
num = 0;
|
|
95
|
+
_context.prev = 1;
|
|
96
|
+
if (!validator) {
|
|
97
|
+
_context.next = 8;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
_context.next = 5;
|
|
101
|
+
return validator === null || validator === void 0 ? void 0 : validator();
|
|
102
|
+
case 5:
|
|
103
|
+
values[id] = _context.sent;
|
|
104
|
+
_context.next = 11;
|
|
101
105
|
break;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
106
|
+
case 8:
|
|
107
|
+
_context.next = 10;
|
|
108
|
+
return form === null || form === void 0 ? void 0 : (_form$validateFields = form.validateFields) === null || _form$validateFields === void 0 ? void 0 : _form$validateFields.call(form);
|
|
109
|
+
case 10:
|
|
110
|
+
values[id] = _context.sent;
|
|
111
|
+
case 11:
|
|
112
|
+
_context.next = 17;
|
|
113
|
+
break;
|
|
114
|
+
case 13:
|
|
115
|
+
_context.prev = 13;
|
|
116
|
+
_context.t0 = _context["catch"](1);
|
|
117
|
+
num = _context.t0 === null || _context.t0 === void 0 ? void 0 : (_errors$errorFields = _context.t0.errorFields) === null || _errors$errorFields === void 0 ? void 0 : _errors$errorFields.length;
|
|
118
|
+
if (num) {
|
|
119
|
+
setLocalData(false);
|
|
120
|
+
console.error(_context.t0);
|
|
121
|
+
}
|
|
122
|
+
case 17:
|
|
123
|
+
setErrorCollection((0, _defineProperty2.default)({}, id, num));
|
|
124
|
+
case 18:
|
|
125
|
+
case "end":
|
|
126
|
+
return _context.stop();
|
|
127
|
+
}
|
|
128
|
+
}, _callee, null, [[1, 13]]);
|
|
129
|
+
}));
|
|
130
|
+
return function subEvent() {
|
|
131
|
+
return _ref5.apply(this, arguments);
|
|
132
|
+
};
|
|
133
|
+
}();
|
|
134
|
+
record.subEvent = subEvent;
|
|
135
|
+
if (title && !(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current = registerMap.current) === null || _registerMap$current === void 0 ? void 0 : _registerMap$current[id])) {
|
|
136
|
+
registerMap.current[id] = record;
|
|
137
|
+
}
|
|
138
|
+
emitter.useSubscription(subEvent);
|
|
133
139
|
};
|
|
134
140
|
var notify = /*#__PURE__*/function () {
|
|
135
141
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
@@ -171,6 +177,41 @@ var ProStep = function ProStep(_ref) {
|
|
|
171
177
|
};
|
|
172
178
|
observer.observe(targetElement, config);
|
|
173
179
|
};
|
|
180
|
+
var triggerTo = /*#__PURE__*/function () {
|
|
181
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3(keys) {
|
|
182
|
+
var events, result, nextErrorCollection;
|
|
183
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
|
184
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
185
|
+
case 0:
|
|
186
|
+
events = [];
|
|
187
|
+
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {
|
|
188
|
+
var _registerMap$current2, _registerMap$current3, _registerMap$current4;
|
|
189
|
+
events.push(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current2 = registerMap.current) === null || _registerMap$current2 === void 0 ? void 0 : (_registerMap$current3 = _registerMap$current2[key]) === null || _registerMap$current3 === void 0 ? void 0 : (_registerMap$current4 = _registerMap$current3.subEvent) === null || _registerMap$current4 === void 0 ? void 0 : _registerMap$current4.call(_registerMap$current3));
|
|
190
|
+
});
|
|
191
|
+
_context3.next = 4;
|
|
192
|
+
return Promise.all(events);
|
|
193
|
+
case 4:
|
|
194
|
+
result = _context3.sent;
|
|
195
|
+
nextErrorCollection = {};
|
|
196
|
+
result === null || result === void 0 ? void 0 : result.forEach(function (item, index) {
|
|
197
|
+
var _item$errorFields;
|
|
198
|
+
if (item === null || item === void 0 ? void 0 : (_item$errorFields = item.errorFields) === null || _item$errorFields === void 0 ? void 0 : _item$errorFields.length) {
|
|
199
|
+
var _item$errorFields2;
|
|
200
|
+
nextErrorCollection[keys[index]] = item === null || item === void 0 ? void 0 : (_item$errorFields2 = item.errorFields) === null || _item$errorFields2 === void 0 ? void 0 : _item$errorFields2.length;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
setErrorCollection(nextErrorCollection);
|
|
204
|
+
return _context3.abrupt("return", result);
|
|
205
|
+
case 9:
|
|
206
|
+
case "end":
|
|
207
|
+
return _context3.stop();
|
|
208
|
+
}
|
|
209
|
+
}, _callee3);
|
|
210
|
+
}));
|
|
211
|
+
return function triggerTo(_x) {
|
|
212
|
+
return _ref7.apply(this, arguments);
|
|
213
|
+
};
|
|
214
|
+
}();
|
|
174
215
|
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
175
216
|
var errorModuleKeys = Object.keys(errorCollection).reverse();
|
|
176
217
|
if (errorModuleKeys === null || errorModuleKeys === void 0 ? void 0 : errorModuleKeys.length) {
|
|
@@ -195,6 +236,7 @@ var ProStep = function ProStep(_ref) {
|
|
|
195
236
|
collapse: collapse,
|
|
196
237
|
register: register,
|
|
197
238
|
notify: notify,
|
|
239
|
+
triggerTo: triggerTo,
|
|
198
240
|
handleScroll: _utils.handleScroll
|
|
199
241
|
},
|
|
200
242
|
children: (0, _jsxRuntime.jsxs)("div", {
|