@zat-design/sisyphus-react 3.10.2 → 3.10.3-beta.3

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.
Files changed (72) hide show
  1. package/dist/index.esm.css +47 -34
  2. package/dist/less.esm.css +47 -34
  3. package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
  4. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +4 -4
  5. package/es/ProEditTable/components/RenderField/index.js +2 -1
  6. package/es/ProEditTable/index.js +39 -11
  7. package/es/ProEditTable/propsType.d.ts +1 -1
  8. package/es/ProEditTable/style/index.less +3 -1
  9. package/es/ProEditTable/utils/config.d.ts +1 -1
  10. package/es/ProEditTable/utils/config.js +11 -3
  11. package/es/ProEditTable/utils/diffOriginal.d.ts +1 -1
  12. package/es/ProEditTable/utils/diffOriginal.js +3 -3
  13. package/es/ProForm/components/combination/ProModalSelect/index.js +2 -2
  14. package/es/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  15. package/es/ProForm/components/render/ChangedWrapper.js +5 -6
  16. package/es/ProForm/components/render/ConfirmWrapper.js +41 -21
  17. package/es/ProForm/components/render/Render.js +3 -2
  18. package/es/ProForm/components/render/RenderFields.js +2 -3
  19. package/es/ProForm/components/render/propsType.d.ts +1 -2
  20. package/es/ProForm/utils/_useChanged.d.ts +2 -2
  21. package/es/ProForm/utils/_useChanged.js +3 -3
  22. package/es/ProForm/utils/_useListChanged.d.ts +1 -1
  23. package/es/ProForm/utils/_useListChanged.js +3 -3
  24. package/es/ProForm/utils/diffOriginal.d.ts +1 -1
  25. package/es/ProForm/utils/diffOriginal.js +3 -3
  26. package/es/ProForm/utils/transformValue.js +9 -7
  27. package/es/ProStep/components/Anchor/index.js +12 -10
  28. package/es/ProStep/components/Listener/index.js +25 -0
  29. package/es/ProStep/components/Step/index.js +2 -2
  30. package/es/ProStep/style/index.less +28 -16
  31. package/es/ProTable/components/FormatColumn/index.js +0 -5
  32. package/es/ProTable/components/RenderColumn/index.js +55 -42
  33. package/es/ProTable/hooks/useAntdTable.js +45 -46
  34. package/es/ProTable/style/index.less +3 -1
  35. package/es/ProTable/utils/index.d.ts +8 -0
  36. package/es/ProTable/utils/index.js +19 -0
  37. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
  38. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +4 -4
  39. package/lib/ProEditTable/components/RenderField/index.js +2 -1
  40. package/lib/ProEditTable/index.js +38 -10
  41. package/lib/ProEditTable/propsType.d.ts +1 -1
  42. package/lib/ProEditTable/style/index.less +3 -1
  43. package/lib/ProEditTable/utils/config.d.ts +1 -1
  44. package/lib/ProEditTable/utils/config.js +11 -3
  45. package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -1
  46. package/lib/ProEditTable/utils/diffOriginal.js +3 -3
  47. package/lib/ProForm/components/combination/ProModalSelect/index.js +1 -1
  48. package/lib/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  49. package/lib/ProForm/components/render/ChangedWrapper.js +5 -6
  50. package/lib/ProForm/components/render/ConfirmWrapper.js +41 -21
  51. package/lib/ProForm/components/render/Render.js +3 -2
  52. package/lib/ProForm/components/render/RenderFields.js +2 -3
  53. package/lib/ProForm/components/render/propsType.d.ts +1 -2
  54. package/lib/ProForm/utils/_useChanged.d.ts +2 -2
  55. package/lib/ProForm/utils/_useChanged.js +3 -3
  56. package/lib/ProForm/utils/_useListChanged.d.ts +1 -1
  57. package/lib/ProForm/utils/_useListChanged.js +3 -3
  58. package/lib/ProForm/utils/diffOriginal.d.ts +1 -1
  59. package/lib/ProForm/utils/diffOriginal.js +3 -3
  60. package/lib/ProForm/utils/transformValue.js +9 -7
  61. package/lib/ProStep/components/Anchor/index.js +11 -10
  62. package/lib/ProStep/components/Listener/index.js +25 -0
  63. package/lib/ProStep/components/Step/index.js +2 -2
  64. package/lib/ProStep/style/index.less +28 -16
  65. package/lib/ProTable/components/FormatColumn/index.js +0 -5
  66. package/lib/ProTable/components/RenderColumn/index.js +56 -43
  67. package/lib/ProTable/hooks/useAntdTable.js +42 -43
  68. package/lib/ProTable/style/index.less +3 -1
  69. package/lib/ProTable/utils/index.d.ts +8 -0
  70. package/lib/ProTable/utils/index.js +20 -1
  71. package/package.json +1 -1
  72. package/.vscode/extensions.json +0 -5
@@ -18,7 +18,7 @@ var _react = _interopRequireWildcard(require("react"));
18
18
  var _diffOriginal = require("../../utils/diffOriginal");
19
19
  var _ProConfigProvider = require("../../../ProConfigProvider");
20
20
  var _utils = require("../../../utils");
21
- var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps", "viewRender"];
21
+ var _excluded = ["name", "names", "namesStr", "form", "onDiff", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps", "viewRender"];
22
22
  var componentsWithFloatWindow = ['Select', 'ProSelect', 'ProEnum', 'ProTimeLimit', 'ProModalSelect', 'ProCascader', 'DataPicker', 'RangePicker', 'TimePicker'];
23
23
  var ChangedWrapper = function ChangedWrapper(props) {
24
24
  var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
@@ -26,7 +26,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
26
26
  names = props.names,
27
27
  namesStr = props.namesStr,
28
28
  form = props.form,
29
- equalWith = props.equalWith,
29
+ onDiff = props.onDiff,
30
30
  children = props.children,
31
31
  type = props.type,
32
32
  diffConfig = props.diffConfig,
@@ -48,7 +48,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
48
48
  var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
49
49
  return (0, _lodash.get)(originalValues, name);
50
50
  }) : (0, _lodash.get)(originalValues, name);
51
- var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
51
+ var noChange = !onDiff && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
52
52
  var diffType = (0, _react.useMemo)(function () {
53
53
  if (!isWatch || noChange) return 'same';
54
54
  var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
@@ -63,10 +63,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
63
63
  value: _value,
64
64
  originalValue: _originalValue,
65
65
  form: form,
66
- equalWith: equalWith
66
+ onDiff: onDiff
67
67
  // name: namesStr || name,
68
68
  });
69
- }, [isWatch, noChange, props[valuePropName], originalValue, (0, _typeof2.default)(equalWith)]);
69
+ }, [isWatch, noChange, props[valuePropName], originalValue, (0, _typeof2.default)(onDiff)]);
70
70
  var isAdd = diffType === 'add';
71
71
  var isChanged = diffType === 'changed';
72
72
  var tipContent = (0, _react.useMemo)(function () {
@@ -91,7 +91,6 @@ var ChangedWrapper = function ChangedWrapper(props) {
91
91
  }, children.props), rest));
92
92
  }
93
93
  // eslint-disable-next-line react-hooks/rules-of-hooks
94
- // const isFocus = useFocus(contentRef.current);
95
94
  var tipOpenCalc = function tipOpenCalc() {
96
95
  if (!toolTip) return false;
97
96
  // 传入undefined 鼠标移入显示移出隐藏 获得焦点时不显示气泡
@@ -28,25 +28,25 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
28
28
  var _ProForm$useFieldProp = _index.default.useFieldProps(),
29
29
  form = _ProForm$useFieldProp.form;
30
30
  var handleChange = /*#__PURE__*/function () {
31
- var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value) {
31
+ var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(value) {
32
32
  var _len,
33
33
  other,
34
34
  _key,
35
35
  _value,
36
36
  confirmProps,
37
- _args = arguments;
38
- return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
39
- while (1) switch (_context.prev = _context.next) {
37
+ _args2 = arguments;
38
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
39
+ while (1) switch (_context2.prev = _context2.next) {
40
40
  case 0:
41
- for (_len = _args.length, other = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
42
- other[_key - 1] = _args[_key];
41
+ for (_len = _args2.length, other = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
42
+ other[_key - 1] = _args2[_key];
43
43
  }
44
44
  _value = (value === null || value === void 0 ? void 0 : value.target) ? value.target.value : value;
45
45
  if (!(0, _lodash.isFunction)(confirm)) {
46
- _context.next = 8;
46
+ _context2.next = 8;
47
47
  break;
48
48
  }
49
- _context.next = 5;
49
+ _context2.next = 5;
50
50
  return confirm(value, form.getFieldsValue(), {
51
51
  option: other[0],
52
52
  form: form,
@@ -56,13 +56,13 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
56
56
  preValue: form.getFieldValue(otherProps.listName || otherProps.name)
57
57
  });
58
58
  case 5:
59
- _context.t0 = _context.sent;
60
- _context.next = 9;
59
+ _context2.t0 = _context2.sent;
60
+ _context2.next = 9;
61
61
  break;
62
62
  case 8:
63
- _context.t0 = confirm;
63
+ _context2.t0 = confirm;
64
64
  case 9:
65
- confirmProps = _context.t0;
65
+ confirmProps = _context2.t0;
66
66
  // 只处理 false, true 和 对象的情况
67
67
  if (confirmProps === false) {
68
68
  onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
@@ -76,21 +76,41 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
76
76
  }
77
77
  if ((0, _lodash.isObject)(confirmProps)) {
78
78
  _antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, 'title' in confirmProps || 'content' in confirmProps ? {} : defaultConfirmProps), confirmProps), {}, {
79
- onOk: function onOk() {
80
- var _confirmProps$onOk;
81
- for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
82
- arg[_key2] = arguments[_key2];
79
+ onOk: function () {
80
+ var _onOk = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
81
+ var _confirmProps$onOk;
82
+ var _len2,
83
+ arg,
84
+ _key2,
85
+ _args = arguments;
86
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
87
+ while (1) switch (_context.prev = _context.next) {
88
+ case 0:
89
+ for (_len2 = _args.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
90
+ arg[_key2] = _args[_key2];
91
+ }
92
+ _context.next = 3;
93
+ return (_confirmProps$onOk = confirmProps.onOk) === null || _confirmProps$onOk === void 0 ? void 0 : _confirmProps$onOk.call.apply(_confirmProps$onOk, [confirmProps].concat(arg));
94
+ case 3:
95
+ onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
96
+ case 4:
97
+ case "end":
98
+ return _context.stop();
99
+ }
100
+ }, _callee);
101
+ }));
102
+ function onOk() {
103
+ return _onOk.apply(this, arguments);
83
104
  }
84
- (_confirmProps$onOk = confirmProps.onOk) === null || _confirmProps$onOk === void 0 ? void 0 : _confirmProps$onOk.call.apply(_confirmProps$onOk, [confirmProps].concat(arg));
85
- onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
86
- }
105
+ return onOk;
106
+ }()
87
107
  }));
88
108
  }
89
109
  case 13:
90
110
  case "end":
91
- return _context.stop();
111
+ return _context2.stop();
92
112
  }
93
- }, _callee);
113
+ }, _callee2);
94
114
  }));
95
115
  return function handleChange(_x) {
96
116
  return _ref.apply(this, arguments);
@@ -46,7 +46,7 @@ var Render = function Render(props) {
46
46
  formDisabled = props.formDisabled,
47
47
  type = props.type,
48
48
  isSelect = props.isSelect,
49
- equalWith = props.equalWith,
49
+ onDiff = props.onDiff,
50
50
  requiredOnView = props.requiredOnView,
51
51
  confirm = props.confirm,
52
52
  globalControl = props.globalControl,
@@ -447,9 +447,10 @@ var Render = function Render(props) {
447
447
  namesStr: namesStr,
448
448
  diffConfig: diffConfig,
449
449
  form: form,
450
- equalWith: equalWith,
450
+ onDiff: onDiff,
451
451
  type: type,
452
452
  onChange: handleChange,
453
+ onBlur: handleBlur,
453
454
  valuePropName: _otherFormItemProps.valuePropName,
454
455
  normalize: _otherFormItemProps.normalize,
455
456
  getValueProps: _otherFormItemProps.getValueProps,
@@ -17,7 +17,7 @@ var componentMap = _interopRequireWildcard(require("../index"));
17
17
  var _utils = require("../../utils");
18
18
  var _useFieldProps = require("../../utils/useFieldProps");
19
19
  var _locale = _interopRequireDefault(require("../../../locale"));
20
- var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "equalWith", "onDiff", "clearNotShow", "required", "confirm", "desensitization"];
20
+ var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "onDiff", "clearNotShow", "required", "confirm", "desensitization"];
21
21
  var RenderFields = function RenderFields(props) {
22
22
  var isView = props.isView,
23
23
  _props$columns = props.columns,
@@ -77,7 +77,6 @@ var RenderFields = function RenderFields(props) {
77
77
  formItemChildProps = _column$formItemChild === void 0 ? {} : _column$formItemChild,
78
78
  _column$fieldProps = column.fieldProps,
79
79
  fieldProps = _column$fieldProps === void 0 ? {} : _column$fieldProps,
80
- equalWith = column.equalWith,
81
80
  onDiff = column.onDiff,
82
81
  _column$clearNotShow = column.clearNotShow,
83
82
  clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
@@ -220,7 +219,7 @@ var RenderFields = function RenderFields(props) {
220
219
  fieldProps: (0, _lodash.isFunction)(fieldProps) ? fieldProps : null,
221
220
  isSelect: _isSelect,
222
221
  diffConfig: diffConfig,
223
- equalWith: onDiff || equalWith,
222
+ onDiff: onDiff,
224
223
  requiredOnView: requiredOnView,
225
224
  globalControl: globalControl,
226
225
  viewRender: viewRender,
@@ -206,8 +206,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
206
206
  upperCase?: boolean;
207
207
  hiddenNames?: string[] | any[];
208
208
  rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
209
- equalWith?: DiffOriginalParams['equalWith'];
210
- onDiff?: DiffOriginalParams['equalWith'];
209
+ onDiff?: DiffOriginalParams['onDiff'];
211
210
  required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
212
211
  labelRequired?: boolean;
213
212
  toISOString?: boolean;
@@ -1,8 +1,8 @@
1
- export declare const useChanged: ({ name, names, namesStr, originalValues, form, equalWith }: {
1
+ export declare const useChanged: ({ name, names, namesStr, originalValues, form, onDiff }: {
2
2
  name: any;
3
3
  names: any;
4
4
  namesStr: any;
5
5
  originalValues: any;
6
6
  form: any;
7
- equalWith: any;
7
+ onDiff: any;
8
8
  }) => any[];
@@ -13,18 +13,18 @@ var useChanged = exports.useChanged = function useChanged(_ref) {
13
13
  namesStr = _ref.namesStr,
14
14
  originalValues = _ref.originalValues,
15
15
  form = _ref.form,
16
- equalWith = _ref.equalWith;
16
+ onDiff = _ref.onDiff;
17
17
  var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
18
18
  return (0, _lodash.get)(originalValues, name);
19
19
  }) : (0, _lodash.get)(originalValues, name);
20
- var notWatch = !equalWith && (!originalValues || originalValue === undefined);
20
+ var notWatch = !onDiff && (!originalValues || originalValue === undefined);
21
21
  if (notWatch) return [false];
22
22
  var value = _antd.Form.useWatch(namesStr || name, form);
23
23
  var changed = (0, _diffOriginal.diffOriginal)({
24
24
  originalValue: originalValue,
25
25
  value: value,
26
26
  form: form,
27
- equalWith: equalWith
27
+ onDiff: onDiff
28
28
  });
29
29
  return [changed, originalValue];
30
30
  };
@@ -10,7 +10,7 @@ interface Params {
10
10
  originalValues: any;
11
11
  form: FormInstance;
12
12
  rowKeyPath?: InternalNamePath;
13
- equalWith?: (originalValue: any, currentValue: any) => boolean;
13
+ onDiff?: (originalValue: any, currentValue: any) => boolean;
14
14
  }
15
15
  export declare const useListChanged: (params: Params) => any[];
16
16
  export {};
@@ -69,7 +69,7 @@ var useListChanged = exports.useListChanged = function useListChanged(params) {
69
69
  originalNames = _params$originalNames === void 0 ? names : _params$originalNames,
70
70
  originalValues = params.originalValues,
71
71
  form = params.form,
72
- equalWith = params.equalWith,
72
+ onDiff = params.onDiff,
73
73
  rowKeyPath = params.rowKeyPath;
74
74
  var namePath = toNamePath(namesStr || name);
75
75
  var originalNamePath = toNamePath(originalName);
@@ -83,7 +83,7 @@ var useListChanged = exports.useListChanged = function useListChanged(params) {
83
83
  rowKeyPath: rowKeyPath,
84
84
  form: form
85
85
  }) : undefined;
86
- var noChange = !equalWith && (!originalValues || originalValue === undefined);
86
+ var noChange = !onDiff && (!originalValues || originalValue === undefined);
87
87
  var _form = form;
88
88
  if (notWatch || noChange) return [false];
89
89
  var value = _antd.Form.useWatch(namePath, _form);
@@ -91,7 +91,7 @@ var useListChanged = exports.useListChanged = function useListChanged(params) {
91
91
  value: value,
92
92
  originalValue: originalValue,
93
93
  form: form,
94
- equalWith: equalWith
94
+ onDiff: onDiff
95
95
  // name: isString(namesStr) ? namesStr : originalName || name,
96
96
  });
97
97
  return [changed, originalValue];
@@ -3,7 +3,7 @@ export interface DiffOriginalParams {
3
3
  originalValue: any;
4
4
  value: any;
5
5
  form: FormInstance;
6
- equalWith?: (originalValue: any, currentValue: any) => DiffType | boolean | undefined;
6
+ onDiff?: (originalValue: any, currentValue: any) => DiffType | boolean | undefined;
7
7
  }
8
8
  export type DiffType = 'same' | 'add' | 'changed';
9
9
  export declare const diffOriginal: (params: DiffOriginalParams) => DiffType;
@@ -36,10 +36,10 @@ var filterObject = function filterObject(data) {
36
36
  var diffOriginal = exports.diffOriginal = function diffOriginal(params) {
37
37
  var originalValue = params.originalValue,
38
38
  value = params.value,
39
- equalWith = params.equalWith;
39
+ onDiff = params.onDiff;
40
40
  // 支持传入自定义比较事件
41
- if ((0, _lodash.isFunction)(equalWith)) {
42
- var diffRes = equalWith(originalValue, value);
41
+ if ((0, _lodash.isFunction)(onDiff)) {
42
+ var diffRes = onDiff(originalValue, value);
43
43
  // 如果返回undefined走内置比较逻辑
44
44
  if (diffRes !== undefined) {
45
45
  if (typeof diffRes === 'boolean') {
@@ -22,21 +22,21 @@ var transformValue = exports.transformValue = function transformValue(names, for
22
22
  }
23
23
  names.forEach(function (name, index) {
24
24
  var _value2;
25
- // @ts-ignore
26
25
  (0, _lodash.set)(form.getFieldsValue(true), name, (_value2 = _value) === null || _value2 === void 0 ? void 0 : _value2[index]);
27
26
  });
28
27
  return _value;
29
28
  },
30
- getValueProps: function getValueProps(value, isOrg) {
29
+ getValueProps: function getValueProps(value, isOrigin) {
31
30
  var _curValue;
32
31
  var _value = [];
33
- if (!isOrg) {
32
+ if (isOrigin) {
33
+ _value = value;
34
+ } else {
35
+ // 非比对names场景
34
36
  names.forEach(function (name, index) {
35
37
  var value = form.getFieldValue(name);
36
38
  _value[index] = value;
37
39
  });
38
- } else {
39
- _value = value;
40
40
  }
41
41
  // 支持外部传入转换函数
42
42
  var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
@@ -50,8 +50,10 @@ var transformValue = exports.transformValue = function transformValue(names, for
50
50
  })) {
51
51
  curValue = undefined;
52
52
  }
53
- // @ts-ignore
54
- (0, _lodash.set)(form.getFieldsValue(true), fieldName, curValue);
53
+ // 如果来源是比对且有names场景, 则不更新表单值
54
+ if (!isOrigin) {
55
+ (0, _lodash.set)(form.getFieldsValue(true), fieldName, curValue);
56
+ }
55
57
  // 如果表单里的值和组合得到的值不全等 更新表单里的值、
56
58
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, res), {}, {
57
59
  value: curValue
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.MenuItem = void 0;
8
8
  var _jsxRuntime = require("react/jsx-runtime");
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _antd = require("antd");
10
11
  var _utils = require("../../utils");
11
12
  var AnchorSvg = function AnchorSvg(_ref) {
12
13
  var color = _ref.color;
@@ -51,7 +52,7 @@ var MenuItem = exports.MenuItem = function MenuItem(props) {
51
52
  var renderMenuIcon = function renderMenuIcon() {
52
53
  if (isCurrentStep) {
53
54
  return (0, _jsxRuntime.jsx)("span", {
54
- className: (0, _classnames.default)('dot-icon', {
55
+ className: (0, _classnames.default)('pro-step-dot-icon', {
55
56
  errored: !!errorNum,
56
57
  disabled: isDisabled
57
58
  }),
@@ -72,14 +73,14 @@ var MenuItem = exports.MenuItem = function MenuItem(props) {
72
73
  });
73
74
  }
74
75
  return (0, _jsxRuntime.jsx)("div", {
75
- className: (0, _classnames.default)('dot', {
76
+ className: (0, _classnames.default)('pro-step-dot', {
76
77
  errored: !!errorNum,
77
78
  disabled: isDisabled
78
79
  })
79
80
  });
80
81
  };
81
82
  return (0, _jsxRuntime.jsxs)("div", {
82
- className: (0, _classnames.default)('com-menu-item', {
83
+ className: (0, _classnames.default)('pro-step-com-menu-item', {
83
84
  errored: !!errorNum,
84
85
  disabled: isDisabled,
85
86
  current: isCurrentStep && onOff
@@ -91,22 +92,22 @@ var MenuItem = exports.MenuItem = function MenuItem(props) {
91
92
  });
92
93
  },
93
94
  children: [(0, _jsxRuntime.jsxs)("div", {
94
- className: "menu-item",
95
+ className: "pro-step-menu-item",
95
96
  children: [(0, _jsxRuntime.jsx)("div", {
96
- className: "menu-icon",
97
+ className: "pro-step-menu-icon",
97
98
  children: renderMenuIcon()
98
99
  }), onOff && (0, _jsxRuntime.jsx)("div", {
99
- className: (0, _classnames.default)('menu-name', {
100
+ className: (0, _classnames.default)('pro-step-menu-name', {
100
101
  disabled: isDisabled
101
102
  }),
102
103
  children: name
103
104
  })]
104
105
  }), !isDisabled && onOff && (0, _jsxRuntime.jsxs)("div", {
105
- className: "checked-status",
106
+ className: "pro-step-checked-status",
106
107
  children: [isChecked && (0, _jsxRuntime.jsx)(SuccessSvg, {}), errorNum > 0 && (0, _jsxRuntime.jsx)("div", {
107
- className: "errorDot",
108
- children: (0, _jsxRuntime.jsx)("span", {
109
- children: errorNum <= 3 ? errorNum : '!'
108
+ className: "pro-step-error-dot",
109
+ children: (0, _jsxRuntime.jsx)(_antd.Badge, {
110
+ count: errorNum
110
111
  })
111
112
  })]
112
113
  })]
@@ -13,6 +13,26 @@ var _lodash = require("lodash");
13
13
  var _react = _interopRequireDefault(require("react"));
14
14
  var _index = require("../../index");
15
15
  var _excluded = ["children", "delayTime", "excludes"];
16
+ var checkErrorList = function checkErrorList(arr) {
17
+ for (var i = 0; i < arr.length; i++) {
18
+ if (arr[i].className.includes('errored')) {
19
+ return {
20
+ errorDom: arr[i],
21
+ index: i
22
+ };
23
+ }
24
+ }
25
+ return null;
26
+ };
27
+ var findFirstErrorDom = function findFirstErrorDom() {
28
+ var errorList = document.querySelectorAll('.pro-step-com-menu-item') || [];
29
+ var hasErrorItem = document.querySelectorAll('.pro-step-com-menu-item .errored');
30
+ var hasFormError = document.querySelector('.ant-form-item-explain-error');
31
+ if ((hasErrorItem === null || hasErrorItem === void 0 ? void 0 : hasErrorItem.length) && !hasFormError) {
32
+ return checkErrorList(errorList);
33
+ }
34
+ return null;
35
+ };
16
36
  var _default = exports.default = function _default(_ref) {
17
37
  var children = _ref.children,
18
38
  delayTime = _ref.delayTime,
@@ -35,6 +55,11 @@ var _default = exports.default = function _default(_ref) {
35
55
  values = _context.sent;
36
56
  setTimeout(function () {
37
57
  var localData = localStorage.getItem('cache-pro-step');
58
+ var _ref3 = findFirstErrorDom() || {},
59
+ errorDom = _ref3.errorDom;
60
+ if (errorDom) {
61
+ errorDom.click();
62
+ }
38
63
  if (localData !== 'false') {
39
64
  var _children$props, _children$props$onCli;
40
65
  children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : (_children$props$onCli = _children$props.onClick) === null || _children$props$onCli === void 0 ? void 0 : _children$props$onCli.call(_children$props, values);
@@ -67,10 +67,10 @@ var Step = exports.Step = function Step(_ref) {
67
67
  onMouseEnter: handleMouseEnter,
68
68
  onMouseLeave: handleMouseLeave,
69
69
  children: [(0, _jsxRuntime.jsxs)("div", {
70
- className: "step-menu",
70
+ className: "pro-step-menu",
71
71
  children: [(0, _jsxRuntime.jsx)(_index.default, {
72
72
  src: _catalog.default,
73
- className: "menu-icon",
73
+ className: "pro-step-menu-icon",
74
74
  actionMap: {}
75
75
  }), onOff && (0, _jsxRuntime.jsx)("div", {
76
76
  children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProStep = _locale.default.ProStep) === null || _locale$ProStep === void 0 ? void 0 : _locale$ProStep.catalogue
@@ -20,7 +20,7 @@
20
20
  cursor: pointer;
21
21
  transition: width 0.2s;
22
22
 
23
- > .step-menu {
23
+ > .pro-step-menu {
24
24
  display: flex;
25
25
  align-items: center;
26
26
  width: 100%;
@@ -33,7 +33,7 @@
33
33
  justify-content: center;
34
34
  width: 48px;
35
35
  height: 24px;
36
- > .menu-icon {
36
+ > .pro-step-menu-icon {
37
37
  width: auto !important;
38
38
  height: auto !important;
39
39
  font-size: var(--zaui-font-size-lg-title, 24px);
@@ -49,7 +49,7 @@
49
49
  > button {
50
50
  width: auto !important;
51
51
  height: auto !important;
52
- > .menu-icon {
52
+ > .pro-step-menu-icon {
53
53
  width: auto !important;
54
54
  height: auto !important;
55
55
  font-size: var(--zaui-font-size-lg-title, 24px);
@@ -79,7 +79,7 @@
79
79
  }
80
80
  }
81
81
 
82
- .menu-content {
82
+ .pro-step-menu-content {
83
83
  overflow: hidden;
84
84
 
85
85
  &:hover {
@@ -87,7 +87,7 @@
87
87
  }
88
88
  }
89
89
 
90
- .com-menu-item {
90
+ .pro-step-com-menu-item {
91
91
  display: flex;
92
92
  align-items: center;
93
93
  justify-content: space-between;
@@ -107,11 +107,11 @@
107
107
  }
108
108
  }
109
109
 
110
- > .menu-item {
110
+ > .pro-step-menu-item {
111
111
  display: flex;
112
112
  align-items: center;
113
113
 
114
- > .menu-icon {
114
+ > .pro-step-menu-icon {
115
115
  display: flex;
116
116
  align-items: center;
117
117
  justify-content: center;
@@ -122,14 +122,19 @@
122
122
  fill: var(--zaui-brand, #006aff);
123
123
  }
124
124
 
125
- > .dot {
125
+ > .pro-step-dot {
126
126
  width: 6px;
127
127
  height: 6px;
128
128
  background: var(--zaui-brand, #006aff);
129
129
  border-radius: 3px;
130
130
 
131
+
132
+
131
133
  &.errored {
134
+ width: 12px;
135
+ height: 12px;
132
136
  background: #ff5050;
137
+ border-radius: 50%;
133
138
  fill: #ff5050;
134
139
  }
135
140
 
@@ -139,7 +144,7 @@
139
144
  }
140
145
  }
141
146
 
142
- .dot-icon {
147
+ .pro-step-dot-icon {
143
148
  display: flex;
144
149
  align-items: center;
145
150
  justify-content: center;
@@ -162,7 +167,7 @@
162
167
  }
163
168
  }
164
169
 
165
- > .menu-name {
170
+ > .pro-step-menu-name {
166
171
  color: #0a0a0a;
167
172
 
168
173
  &.disabled {
@@ -171,21 +176,28 @@
171
176
  }
172
177
  }
173
178
 
174
- > .checked-status {
179
+ > .pro-step-checked-status {
175
180
  height: 18px;
176
181
 
177
182
  > svg {
178
183
  fill: var(--zaui-brand, #006aff);
179
184
  }
180
185
 
181
- .errorDot {
186
+ .pro-step-error-dot {
182
187
  display: flex;
183
188
  align-items: center;
184
189
  justify-content: center;
185
- width: 16px;
186
- height: 16px;
187
- background: rgba(255, 80, 80, 0.2);
188
- border-radius: 8px;
190
+
191
+ .@{ant-prefix}-badge{
192
+ .@{ant-prefix}-badge-count{
193
+ background: rgba(255, 80, 80, 0.15);
194
+ color: #ff5050;
195
+ .@{ant-prefix}-scroll-number-only-unit, .@{ant-prefix}-scroll-number{
196
+ font-weight: 600;
197
+ }
198
+ }
199
+
200
+ }
189
201
 
190
202
  > span {
191
203
  color: #ff5050;
@@ -347,11 +347,6 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
347
347
  if (!originalValue) {
348
348
  originalRenderValue = '-';
349
349
  }
350
- if (originalObj && renderValue !== originalRenderValue) {
351
- otherProps.isChanged = true;
352
- } else {
353
- otherProps.isChanged = false;
354
- }
355
350
  var node = (0, _jsxRuntime.jsxs)(_antd.Space, {
356
351
  size: 8,
357
352
  children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]