@zat-design/sisyphus-react 3.12.1-beta.1 → 3.12.1-beta.2

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.
@@ -148,20 +148,26 @@ var ProStep = function ProStep(_ref) {
148
148
  }
149
149
  };
150
150
  var handleScrollError = function handleScrollError(data) {
151
- var errorModuleKeys = Object.keys(data).reverse();
152
- if (errorModuleKeys === null || errorModuleKeys === void 0 ? void 0 : errorModuleKeys.length) {
153
- var _dataSource$find;
154
- var firstErrorModuleKey = (_dataSource$find = dataSource.find(function (item) {
155
- var moduleKey = errorModuleKeys.find(function (child) {
156
- return child === item.code;
157
- });
158
- return data[moduleKey];
159
- })) === null || _dataSource$find === void 0 ? void 0 : _dataSource$find.code;
160
- firstErrorModuleKey && handleScroll(firstErrorModuleKey, {
161
- targetOffset: targetOffset,
162
- scrollToError: scrollToError
151
+ var errorDom = document.querySelector('.ant-form-item-explain-error');
152
+ if (errorDom) {
153
+ errorDom.scrollIntoView({
154
+ behavior: 'smooth',
155
+ block: 'center'
163
156
  });
164
157
  }
158
+ // const errorModuleKeys = Object.keys(data).reverse();
159
+ // if (errorModuleKeys?.length) {
160
+ // const firstErrorModuleKey = dataSource.find((item) => {
161
+ // const moduleKey = errorModuleKeys.find((child) => child === item.code);
162
+ // return data[moduleKey];
163
+ // })?.code;
164
+ // console.log('firstErrorModuleKey', firstErrorModuleKey)·;
165
+ // firstErrorModuleKey &&
166
+ // handleScroll(firstErrorModuleKey, {
167
+ // targetOffset,
168
+ // scrollToError,
169
+ // });
170
+ // }
165
171
  };
166
172
  var notify = /*#__PURE__*/function () {
167
173
  var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
@@ -155,20 +155,26 @@ var ProStep = function ProStep(_ref) {
155
155
  }
156
156
  };
157
157
  var handleScrollError = function handleScrollError(data) {
158
- var errorModuleKeys = Object.keys(data).reverse();
159
- if (errorModuleKeys === null || errorModuleKeys === void 0 ? void 0 : errorModuleKeys.length) {
160
- var _dataSource$find;
161
- var firstErrorModuleKey = (_dataSource$find = dataSource.find(function (item) {
162
- var moduleKey = errorModuleKeys.find(function (child) {
163
- return child === item.code;
164
- });
165
- return data[moduleKey];
166
- })) === null || _dataSource$find === void 0 ? void 0 : _dataSource$find.code;
167
- firstErrorModuleKey && (0, _utils.handleScroll)(firstErrorModuleKey, {
168
- targetOffset: targetOffset,
169
- scrollToError: scrollToError
158
+ var errorDom = document.querySelector('.ant-form-item-explain-error');
159
+ if (errorDom) {
160
+ errorDom.scrollIntoView({
161
+ behavior: 'smooth',
162
+ block: 'center'
170
163
  });
171
164
  }
165
+ // const errorModuleKeys = Object.keys(data).reverse();
166
+ // if (errorModuleKeys?.length) {
167
+ // const firstErrorModuleKey = dataSource.find((item) => {
168
+ // const moduleKey = errorModuleKeys.find((child) => child === item.code);
169
+ // return data[moduleKey];
170
+ // })?.code;
171
+ // console.log('firstErrorModuleKey', firstErrorModuleKey)·;
172
+ // firstErrorModuleKey &&
173
+ // handleScroll(firstErrorModuleKey, {
174
+ // targetOffset,
175
+ // scrollToError,
176
+ // });
177
+ // }
172
178
  };
173
179
  var notify = /*#__PURE__*/function () {
174
180
  var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.12.1-beta.1",
3
+ "version": "3.12.1-beta.2",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",