@zat-design/sisyphus-react 3.10.2 → 3.10.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 (57) hide show
  1. package/dist/index.esm.css +41 -34
  2. package/dist/less.esm.css +41 -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/propsType.d.ts +1 -1
  7. package/es/ProEditTable/utils/diffOriginal.d.ts +1 -1
  8. package/es/ProEditTable/utils/diffOriginal.js +3 -3
  9. package/es/ProForm/components/combination/ProModalSelect/index.js +2 -2
  10. package/es/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  11. package/es/ProForm/components/render/ChangedWrapper.js +5 -6
  12. package/es/ProForm/components/render/Render.js +3 -2
  13. package/es/ProForm/components/render/RenderFields.js +2 -3
  14. package/es/ProForm/components/render/propsType.d.ts +1 -2
  15. package/es/ProForm/utils/_useChanged.d.ts +2 -2
  16. package/es/ProForm/utils/_useChanged.js +3 -3
  17. package/es/ProForm/utils/_useListChanged.d.ts +1 -1
  18. package/es/ProForm/utils/_useListChanged.js +3 -3
  19. package/es/ProForm/utils/diffOriginal.d.ts +1 -1
  20. package/es/ProForm/utils/diffOriginal.js +3 -3
  21. package/es/ProForm/utils/transformValue.js +9 -7
  22. package/es/ProStep/components/Anchor/index.js +12 -10
  23. package/es/ProStep/components/Listener/index.js +25 -0
  24. package/es/ProStep/components/Step/index.js +2 -2
  25. package/es/ProStep/style/index.less +28 -16
  26. package/es/ProTable/components/FormatColumn/index.js +0 -5
  27. package/es/ProTable/components/RenderColumn/index.js +55 -42
  28. package/es/ProTable/utils/index.d.ts +6 -0
  29. package/es/ProTable/utils/index.js +14 -0
  30. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +1 -1
  31. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +4 -4
  32. package/lib/ProEditTable/components/RenderField/index.js +2 -1
  33. package/lib/ProEditTable/propsType.d.ts +1 -1
  34. package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -1
  35. package/lib/ProEditTable/utils/diffOriginal.js +3 -3
  36. package/lib/ProForm/components/combination/ProModalSelect/index.js +1 -1
  37. package/lib/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  38. package/lib/ProForm/components/render/ChangedWrapper.js +5 -6
  39. package/lib/ProForm/components/render/Render.js +3 -2
  40. package/lib/ProForm/components/render/RenderFields.js +2 -3
  41. package/lib/ProForm/components/render/propsType.d.ts +1 -2
  42. package/lib/ProForm/utils/_useChanged.d.ts +2 -2
  43. package/lib/ProForm/utils/_useChanged.js +3 -3
  44. package/lib/ProForm/utils/_useListChanged.d.ts +1 -1
  45. package/lib/ProForm/utils/_useListChanged.js +3 -3
  46. package/lib/ProForm/utils/diffOriginal.d.ts +1 -1
  47. package/lib/ProForm/utils/diffOriginal.js +3 -3
  48. package/lib/ProForm/utils/transformValue.js +9 -7
  49. package/lib/ProStep/components/Anchor/index.js +11 -10
  50. package/lib/ProStep/components/Listener/index.js +25 -0
  51. package/lib/ProStep/components/Step/index.js +2 -2
  52. package/lib/ProStep/style/index.less +28 -16
  53. package/lib/ProTable/components/FormatColumn/index.js +0 -5
  54. package/lib/ProTable/components/RenderColumn/index.js +56 -43
  55. package/lib/ProTable/utils/index.d.ts +6 -0
  56. package/lib/ProTable/utils/index.js +15 -1
  57. package/package.json +1 -1
@@ -9,7 +9,7 @@ interface Props {
9
9
  namesStr?: string;
10
10
  diffConfig?: DiffConfigProps;
11
11
  form: FormInstance;
12
- equalWith?: DiffOriginalParams['equalWith'];
12
+ onDiff?: DiffOriginalParams['onDiff'];
13
13
  valuePropName?: string;
14
14
  [name: string]: any;
15
15
  }
@@ -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 鼠标移入显示移出隐藏 获得焦点时不显示气泡
@@ -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)]
@@ -14,7 +14,8 @@ var _lodash = require("lodash");
14
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
15
  var _icons = require("@ant-design/icons");
16
16
  var _reactSvg = require("react-svg");
17
- var _utils = require("../../../utils");
17
+ var _utils = require("../../utils");
18
+ var _utils2 = require("../../../utils");
18
19
  var _copy = _interopRequireDefault(require("../../../assets/copy.svg"));
19
20
  var Paragraph = _antd.Typography.Paragraph,
20
21
  Text = _antd.Typography.Text;
@@ -43,6 +44,32 @@ var RenderColumn = function RenderColumn(props) {
43
44
  'varied-cell': props === null || props === void 0 ? void 0 : props.isChanged,
44
45
  'add-cell': props === null || props === void 0 ? void 0 : props.isAddCell
45
46
  });
47
+ var checkEllipsis = function checkEllipsis(box) {
48
+ var range = document.createRange();
49
+ range.setStart(box, 0);
50
+ range.setEnd(box, box.childNodes.length);
51
+ var rangeWidth = range.getBoundingClientRect().width;
52
+ var _getPadding = (0, _utils.getPadding)(box),
53
+ pLeft = _getPadding.pLeft,
54
+ pRight = _getPadding.pRight,
55
+ pTop = _getPadding.pTop,
56
+ pBottom = _getPadding.pBottom;
57
+ var horizontalPadding = pLeft + pRight;
58
+ if (rangeWidth + horizontalPadding > box.clientWidth) {
59
+ return true;
60
+ }
61
+ return false;
62
+ };
63
+ var handleMouseOver = function handleMouseOver(e) {
64
+ setState({
65
+ tooltip: checkEllipsis(e.target)
66
+ });
67
+ };
68
+ var tooltipProps = (0, _objectSpread2.default)({
69
+ getPopupContainer: function getPopupContainer(triggerNode) {
70
+ return triggerNode.parentNode;
71
+ }
72
+ }, toolTipProps);
46
73
  // 比对场景走的逻辑
47
74
  if (!isInNewRowFlag && (0, _lodash.isBoolean)(props === null || props === void 0 ? void 0 : props.isChanged)) {
48
75
  var renderNode = value ? node : '-';
@@ -60,11 +87,36 @@ var RenderColumn = function RenderColumn(props) {
60
87
  }) : (0, _jsxRuntime.jsx)("div", {
61
88
  style: {
62
89
  minWidth: minWidth,
63
- width: width
90
+ width: width,
91
+ overflow: 'hidden',
92
+ textOverflow: 'ellipsis',
93
+ whiteSpace: 'nowrap'
64
94
  },
65
95
  children: ellipsis ? currentValue : renderNode
66
96
  });
67
97
  if ((props === null || props === void 0 ? void 0 : props.isChanged) === false) {
98
+ if (ellipsis) {
99
+ return (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
100
+ title: currentValue,
101
+ onOpenChange: function onOpenChange(open) {
102
+ setState({
103
+ tooltip: false
104
+ });
105
+ },
106
+ open: tooltip
107
+ }, tooltipProps), {}, {
108
+ children: (0, _jsxRuntime.jsx)(Text, {
109
+ style: {
110
+ width: width,
111
+ minWidth: minWidth
112
+ },
113
+ ellipsis: true,
114
+ onMouseOver: handleMouseOver,
115
+ onFocus: handleMouseOver,
116
+ children: renderNode
117
+ })
118
+ }));
119
+ }
68
120
  return renderNode;
69
121
  }
70
122
  if (Array.isArray(originalValue)) {
@@ -74,7 +126,7 @@ var RenderColumn = function RenderColumn(props) {
74
126
  if (Array.isArray(originalValue)) {
75
127
  return null;
76
128
  }
77
- return !(0, _utils.isEmpty)(originalValue) ? originalValue : '-';
129
+ return !(0, _utils2.isEmpty)(originalValue) ? originalValue : '-';
78
130
  };
79
131
  return (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
80
132
  className: cellDiffCls,
@@ -88,7 +140,7 @@ var RenderColumn = function RenderColumn(props) {
88
140
  title: (0, _jsxRuntime.jsx)(_antd.Space, {
89
141
  direction: "vertical",
90
142
  className: "changed-tooltip",
91
- children: (props === null || props === void 0 ? void 0 : props.isChanged) ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
143
+ children: (props === null || props === void 0 ? void 0 : props.isChanged) && !(props === null || props === void 0 ? void 0 : props.isAddCell) ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
92
144
  children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
93
145
  align: "start",
94
146
  className: "original-value-container",
@@ -140,45 +192,6 @@ var RenderColumn = function RenderColumn(props) {
140
192
  });
141
193
  }
142
194
  if (ellipsis) {
143
- var getPadding = function getPadding(el) {
144
- var style = window.getComputedStyle(el, null);
145
- var paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
146
- var paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
147
- var paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
148
- var paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0;
149
- return {
150
- pLeft: paddingLeft,
151
- pRight: paddingRight,
152
- pTop: paddingTop,
153
- pBottom: paddingBottom
154
- };
155
- };
156
- var checkEllipsis = function checkEllipsis(box) {
157
- var range = document.createRange();
158
- range.setStart(box, 0);
159
- range.setEnd(box, box.childNodes.length);
160
- var rangeWidth = range.getBoundingClientRect().width;
161
- var _getPadding = getPadding(box),
162
- pLeft = _getPadding.pLeft,
163
- pRight = _getPadding.pRight,
164
- pTop = _getPadding.pTop,
165
- pBottom = _getPadding.pBottom;
166
- var horizontalPadding = pLeft + pRight;
167
- if (rangeWidth + horizontalPadding > box.clientWidth) {
168
- return true;
169
- }
170
- return false;
171
- };
172
- var handleMouseOver = function handleMouseOver(e) {
173
- setState({
174
- tooltip: checkEllipsis(e.target)
175
- });
176
- };
177
- var tooltipProps = (0, _objectSpread2.default)({
178
- getPopupContainer: function getPopupContainer(triggerNode) {
179
- return triggerNode.parentNode;
180
- }
181
- }, toolTipProps);
182
195
  if (!value) {
183
196
  return (0, _jsxRuntime.jsx)("div", {
184
197
  style: {
@@ -33,3 +33,9 @@ export declare const getRowKey: (rowKey: any, record: any) => any;
33
33
  export declare const removeEmptyKeys: (obj: any) => {
34
34
  [k: string]: unknown;
35
35
  };
36
+ export declare const getPadding: (el: HTMLElement) => {
37
+ pLeft: number;
38
+ pRight: number;
39
+ pTop: number;
40
+ pBottom: number;
41
+ };