@zat-design/sisyphus-react 3.7.3-beta.2 → 3.7.3-beta.20

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 (118) hide show
  1. package/dist/index.esm.css +92 -2
  2. package/dist/less.esm.css +89 -2
  3. package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
  4. package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +22 -10
  5. package/es/ProEditTable/components/RenderField/index.js +3 -3
  6. package/es/ProEnum/components/Group.js +10 -2
  7. package/es/ProEnum/index.js +5 -4
  8. package/es/ProEnum/style/index.less +14 -4
  9. package/es/ProForm/components/combination/Container/index.js +5 -3
  10. package/es/ProForm/components/combination/Container/propsType.d.ts +2 -1
  11. package/es/ProForm/components/combination/ProModalSelect/index.js +50 -45
  12. package/es/ProForm/components/combination/ProNumberRange/index.js +3 -1
  13. package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
  14. package/es/ProForm/components/render/ChangedWrapper.js +108 -0
  15. package/es/ProForm/components/render/Render.js +7 -8
  16. package/es/ProForm/components/render/RenderFields.d.ts +2 -3
  17. package/es/ProForm/components/render/RenderFields.js +3 -4
  18. package/es/ProForm/components/render/propsType.d.ts +4 -3
  19. package/es/ProForm/index.js +3 -6
  20. package/es/ProForm/propsType.d.ts +13 -2
  21. package/es/ProForm/style/index.less +102 -4
  22. package/es/ProForm/utils/diffOriginal.d.ts +4 -4
  23. package/es/ProForm/utils/diffOriginal.js +18 -7
  24. package/es/ProForm/utils/transformValue.js +17 -11
  25. package/es/ProSelect/index.js +3 -3
  26. package/es/ProSelect/utils/index.js +5 -4
  27. package/es/ProStep/components/Listener/index.d.ts +1 -1
  28. package/es/ProStep/components/Listener/index.js +5 -2
  29. package/es/ProStep/index.d.ts +1 -1
  30. package/es/ProStep/index.js +24 -17
  31. package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
  32. package/es/ProTable/components/FormatColumn/index.js +14 -8
  33. package/es/ProTable/index.js +30 -13
  34. package/es/ProTable/propsType.d.ts +14 -1
  35. package/es/ProTable/style/index.less +1 -1
  36. package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
  37. package/es/ProTree/components/AdaptiveTooltip.js +55 -0
  38. package/es/ProTree/components/List.js +15 -3
  39. package/es/ProTree/components/ProTreeSelect/index.js +25 -5
  40. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
  41. package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
  42. package/es/ProTree/components/SearchTitle.d.ts +2 -0
  43. package/es/ProTree/components/SearchTitle.js +17 -8
  44. package/es/ProTree/style/index.less +14 -0
  45. package/es/ProTreeModal/components/Tree.js +15 -17
  46. package/es/ProTreeModal/index.js +62 -7
  47. package/es/ProTreeModal/utils.d.ts +1 -0
  48. package/es/ProTreeModal/utils.js +21 -1
  49. package/es/style/theme/antd.less +5 -0
  50. package/es/style/theme/index.less +2 -1
  51. package/es/style/theme/tokens.less +1 -0
  52. package/es/utils/index.d.ts +2 -0
  53. package/es/utils/index.js +13 -0
  54. package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
  55. package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +25 -11
  56. package/lib/ProEditTable/components/RenderField/index.js +3 -3
  57. package/lib/ProEnum/components/Group.js +10 -2
  58. package/lib/ProEnum/index.js +5 -4
  59. package/lib/ProEnum/style/index.less +14 -4
  60. package/lib/ProForm/components/combination/Container/index.js +5 -3
  61. package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -1
  62. package/lib/ProForm/components/combination/ProModalSelect/index.js +49 -44
  63. package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -1
  64. package/lib/ProForm/components/render/ChangedWrapper.d.ts +17 -0
  65. package/lib/ProForm/components/render/ChangedWrapper.js +113 -0
  66. package/lib/ProForm/components/render/Render.js +7 -8
  67. package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
  68. package/lib/ProForm/components/render/RenderFields.js +3 -4
  69. package/lib/ProForm/components/render/propsType.d.ts +4 -3
  70. package/lib/ProForm/index.js +3 -6
  71. package/lib/ProForm/propsType.d.ts +13 -2
  72. package/lib/ProForm/style/index.less +102 -4
  73. package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
  74. package/lib/ProForm/utils/diffOriginal.js +18 -7
  75. package/lib/ProForm/utils/transformValue.js +17 -11
  76. package/lib/ProSelect/index.js +3 -3
  77. package/lib/ProSelect/utils/index.js +5 -4
  78. package/lib/ProStep/components/Listener/index.d.ts +1 -1
  79. package/lib/ProStep/components/Listener/index.js +5 -2
  80. package/lib/ProStep/index.d.ts +1 -1
  81. package/lib/ProStep/index.js +24 -17
  82. package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
  83. package/lib/ProTable/components/FormatColumn/index.js +14 -8
  84. package/lib/ProTable/index.js +30 -13
  85. package/lib/ProTable/propsType.d.ts +14 -1
  86. package/lib/ProTable/style/index.less +1 -1
  87. package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
  88. package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
  89. package/lib/ProTree/components/List.js +15 -3
  90. package/lib/ProTree/components/ProTreeSelect/index.js +25 -5
  91. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
  92. package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
  93. package/lib/ProTree/components/SearchTitle.d.ts +2 -0
  94. package/lib/ProTree/components/SearchTitle.js +19 -7
  95. package/lib/ProTree/style/index.less +14 -0
  96. package/lib/ProTreeModal/components/Tree.js +15 -17
  97. package/lib/ProTreeModal/index.js +61 -6
  98. package/lib/ProTreeModal/utils.d.ts +1 -0
  99. package/lib/ProTreeModal/utils.js +20 -0
  100. package/lib/style/theme/antd.less +5 -0
  101. package/lib/style/theme/index.less +2 -1
  102. package/lib/style/theme/tokens.less +1 -0
  103. package/lib/utils/index.d.ts +2 -0
  104. package/lib/utils/index.js +19 -0
  105. package/package.json +1 -1
  106. package/.vscode/extensions.json +0 -5
  107. package/es/ProForm/components/render/Changed.d.ts +0 -14
  108. package/es/ProForm/components/render/Changed.js +0 -64
  109. package/lib/ProForm/components/render/Changed.d.ts +0 -14
  110. package/lib/ProForm/components/render/Changed.js +0 -69
  111. /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
  112. /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
  113. /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
  114. /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
  115. /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
  116. /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
  117. /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
  118. /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
@@ -99,10 +99,12 @@
99
99
 
100
100
  &.pro-form-item-width-auto {
101
101
  .@{ant-prefix}-form-item-control-input {
102
+ width: 100%;
102
103
  flex-grow: inherit;
103
104
  }
104
105
 
105
106
  .@{ant-prefix}-form-item-control-input-content {
107
+ width: 100%;
106
108
  flex: initial;
107
109
  }
108
110
  }
@@ -314,16 +316,23 @@
314
316
  vertical-align: middle;
315
317
  }
316
318
  }
317
- .pro-form-list-mode-block{
318
- .pro-collapse-content{
319
- .@{ant-prefix}-row{
319
+
320
+ .pro-form-list-mode-block {
321
+ .pro-collapse-content {
322
+ .@{ant-prefix}-row {
320
323
  width: auto;
321
324
  }
322
325
  }
323
326
  }
324
327
 
325
- // 比较原始值场景下 不同时的样式
326
328
  .pro-form-item-changed {
329
+ border-radius: 4px;
330
+ background: @zaui-contract-bg !important;
331
+
332
+ .@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
333
+ background: @zaui-contract-bg !important;
334
+ }
335
+
327
336
  span.@{ant-prefix}-input-affix-wrapper,
328
337
  .@{ant-prefix}-select .@{ant-prefix}-select-selector,
329
338
  .@{ant-prefix}-picker,
@@ -367,10 +376,99 @@
367
376
  }
368
377
  }
369
378
 
379
+ // checkbox
380
+ .@{ant-prefix}-checkbox-group {
381
+ padding: 5px 0
382
+ }
383
+ // switch
384
+ &:has(.@{ant-prefix}-switch) {
385
+ padding: 5px 0;
386
+ }
387
+
388
+ // textArea
389
+ .@{ant-prefix}-input-textarea > textarea {
390
+ background: @zaui-contract-bg;
391
+ }
392
+
370
393
  .pro-form-view-container {
371
394
  padding: 4px 8px;
372
395
  background: @zaui-contract-bg;
373
396
  border-radius: 4px;
374
397
  }
375
398
  }
399
+
400
+
401
+ // 比较原始值场景下 不同时的样式
402
+ .pro-form-item-add {
403
+ border-radius: 4px;
404
+ background: @zaui-contract-bg-add !important;
405
+
406
+ .@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
407
+ background: @zaui-contract-bg-add !important;
408
+ }
409
+
410
+ span.@{ant-prefix}-input-affix-wrapper,
411
+ .@{ant-prefix}-select .@{ant-prefix}-select-selector,
412
+ .@{ant-prefix}-picker,
413
+ .@{ant-prefix}-input-number {
414
+ background: @zaui-contract-bg-add !important;
415
+
416
+ input {
417
+ background: transparent !important;
418
+ }
419
+ .@{ant-prefix}-select-selection-placeholder {
420
+ z-index: 9;
421
+ }
422
+ }
423
+
424
+ .@{ant-prefix}-form-item-control:has(.@{ant-prefix}-switch-handle),
425
+ .@{ant-prefix}-form-item-control:has(.@{ant-prefix}-checkbox-wrapper-in-form-item) {
426
+ background: @zaui-contract-bg-add;
427
+ border-radius: 4px;
428
+ }
429
+
430
+ // 地址组件
431
+ .@{ant-prefix}-form-item-control-input-content {
432
+ // 查看模式
433
+ & > span {
434
+ border-radius: 4px;
435
+ padding: 5px 8px;
436
+ background: @zaui-contract-bg-add;
437
+ }
438
+
439
+ & > .pro-address {
440
+ .@{ant-prefix}-select-selector,
441
+ .@{ant-prefix}-input-affix-wrapper,
442
+ .@{ant-prefix}-input-disabled {
443
+ background: @zaui-contract-bg-add;
444
+ }
445
+ }
446
+ & > .@{ant-prefix}-input-group {
447
+ .forever-checkbox {
448
+ background: @zaui-contract-bg-add;
449
+ }
450
+ }
451
+ }
452
+
453
+ // checkbox
454
+ .@{ant-prefix}-checkbox-group {
455
+ padding: 5px 0
456
+ }
457
+ // switch
458
+ &:has(.@{ant-prefix}-switch) {
459
+ padding: 5px 0;
460
+ }
461
+
462
+ // textArea
463
+ .@{ant-prefix}-input-textarea > textarea {
464
+ background: @zaui-contract-bg-add;
465
+ }
466
+
467
+
468
+ .pro-form-view-container {
469
+ padding: 4px 8px;
470
+ background: @zaui-contract-bg-add;
471
+ border-radius: 4px;
472
+ }
473
+ }
376
474
  }
@@ -1,9 +1,9 @@
1
1
  import { FormInstance } from 'antd';
2
- interface Params {
2
+ export interface DiffOriginalParams {
3
3
  originalValue: any;
4
4
  value: any;
5
5
  form: FormInstance;
6
- equalWith?: (originalValue: any, currentValue: any) => boolean;
6
+ equalWith?: (originalValue: any, currentValue: any) => DiffType | boolean | undefined;
7
7
  }
8
- export declare const diffOriginal: (params: Params) => boolean;
9
- export {};
8
+ export type DiffType = 'same' | 'add' | 'changed';
9
+ export declare const diffOriginal: (params: DiffOriginalParams) => DiffType;
@@ -1,4 +1,5 @@
1
1
  import { isEqual, isFunction } from 'lodash';
2
+ import { isEmpty } from '../../utils';
2
3
  var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
3
4
  export var diffOriginal = function diffOriginal(params) {
4
5
  var originalValue = params.originalValue,
@@ -6,19 +7,29 @@ export var diffOriginal = function diffOriginal(params) {
6
7
  equalWith = params.equalWith;
7
8
  // 支持传入自定义比较事件
8
9
  if (isFunction(equalWith)) {
9
- return !equalWith(originalValue, value);
10
+ var diffRes = equalWith(originalValue, value);
11
+ if (diffRes === undefined) return 'same';
12
+ if (typeof diffRes === 'boolean') {
13
+ return diffRes ? 'same' : 'changed';
14
+ }
15
+ return diffRes;
16
+ }
17
+ // 如果原始值为空 且当前有值的话 认为变更类型是新增
18
+ if (isEmpty(originalValue) && !isEmpty(value)) {
19
+ return 'add';
10
20
  }
11
21
  if (Array.isArray(originalValue)) {
12
- return originalValue.some(function (valueItem, index) {
22
+ var isSame = originalValue.every(function (valueItem, index) {
13
23
  // 如果两个值有一个不是空值, 则进行深比较
14
- if (!nullValue.includes(value === null || value === void 0 ? void 0 : value[index]) || !nullValue.includes(valueItem)) {
15
- return !isEqual(value === null || value === void 0 ? void 0 : value[index], valueItem);
24
+ if (!isEmpty(value === null || value === void 0 ? void 0 : value[index]) || !isEmpty(valueItem)) {
25
+ return isEqual(value === null || value === void 0 ? void 0 : value[index], valueItem);
16
26
  }
17
- return false;
27
+ return true;
18
28
  });
29
+ return isSame ? 'same' : 'changed';
19
30
  }
20
31
  if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
21
- return !isEqual(value, originalValue);
32
+ return isEqual(value, originalValue) ? 'same' : 'changed';
22
33
  }
23
- return false;
34
+ return 'same';
24
35
  };
@@ -1,8 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["value"];
4
2
  import { set } from 'lodash';
5
3
  import { diffField } from '../utils';
4
+ import { isEmpty } from '../../utils';
6
5
  export var transformValue = function transformValue(names, form, fieldName, _normalize, _getValueProps) {
7
6
  return {
8
7
  normalize: function normalize(value) {
@@ -22,23 +21,30 @@ export var transformValue = function transformValue(names, form, fieldName, _nor
22
21
  return _value;
23
22
  },
24
23
  getValueProps: function getValueProps(value) {
24
+ var _curValue;
25
25
  var _value = [];
26
26
  names.forEach(function (name, index) {
27
27
  var value = form.getFieldValue(name);
28
28
  _value[index] = value;
29
29
  });
30
30
  // 支持外部传入转换函数
31
- var _ref = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
32
- value: _value
33
- },
34
- cusValue = _ref.value,
35
- cusRest = _objectWithoutProperties(_ref, _excluded);
31
+ var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
32
+ value: _value
33
+ };
34
+ // 如果数组中值都为空, 则值置为空
35
+ var curValue = res === null || res === void 0 ? void 0 : res.value;
36
36
  // @ts-ignore
37
- set(form.getFieldsValue(true), fieldName, cusValue);
37
+ if ((_curValue = curValue) === null || _curValue === void 0 ? void 0 : _curValue.every(function (item) {
38
+ return isEmpty(item);
39
+ })) {
40
+ curValue = undefined;
41
+ }
42
+ // @ts-ignore
43
+ set(form.getFieldsValue(true), fieldName, curValue);
38
44
  // 如果表单里的值和组合得到的值不全等 更新表单里的值、
39
- return _objectSpread({
40
- value: cusValue
41
- }, cusRest);
45
+ return _objectSpread(_objectSpread({}, res), {}, {
46
+ value: curValue
47
+ });
42
48
  },
43
49
  shouldUpdate: function shouldUpdate(prevValues, curValues) {
44
50
  return diffField(prevValues, curValues, names);
@@ -296,7 +296,8 @@ export var ProSelect = function ProSelect(props, ref) {
296
296
  showArrow: true,
297
297
  loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
298
298
  onChange: handleChange,
299
- optionLabelProp: "children" // 解决warning报错,添加默认值
299
+ // optionLabelProp={otherProps?.isDiffChange ? "label" : 'children'} // 解决warning报错,添加默认值
300
+ optionLabelProp: "label" // 解决warning报错,添加默认值
300
301
  ,
301
302
  showSearch: true,
302
303
  filterOption: isFunction(_onSearch) ? false : function (input, option) {
@@ -314,16 +315,15 @@ export var ProSelect = function ProSelect(props, ref) {
314
315
  value: transformValue(),
315
316
  children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
316
317
  return _jsx(Option, {
318
+ label: item[label],
317
319
  value: item[code],
318
320
  record: item,
319
321
  disabled: !!item.disabled,
320
322
  children: _jsx(TooltipOption, {
321
323
  title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
322
324
  children: OptionRender ? _jsx("span", {
323
- title: OptionRender(item),
324
325
  children: OptionRender(item)
325
326
  }) : _jsx("span", {
326
- title: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
327
327
  children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
328
328
  })
329
329
  }, item[code])
@@ -30,7 +30,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
30
30
  _iterator.f();
31
31
  }
32
32
  if (mode === 'multiple') {
33
- selectValues = [].concat(_toConsumableArray(selectValues), _toConsumableArray(result));
33
+ selectValues = [].concat(_toConsumableArray(selectValues), _toConsumableArray(result || []));
34
34
  } else {
35
35
  selectValues.push(result);
36
36
  }
@@ -53,13 +53,14 @@ export var getSelectList = function getSelectList(_ref2) {
53
53
  if (!otherProps) {
54
54
  return null;
55
55
  }
56
- var listName = otherProps.listName,
56
+ var name = otherProps.name,
57
+ listName = otherProps.listName,
57
58
  form = otherProps.form;
58
59
  var firstNumberIndex = listName.lastIndexOf(listName.findLast(function (item) {
59
60
  return typeof item === 'number';
60
61
  }));
61
- var fatherName = listName.slice(0, firstNumberIndex);
62
- var selectName = listName.slice(firstNumberIndex + 1);
62
+ var fatherName = (name || listName).slice(0, firstNumberIndex);
63
+ var selectName = (name || listName).slice(firstNumberIndex + 1);
63
64
  return findSelectNameValues({
64
65
  list: form.getFieldValue(fatherName) || [],
65
66
  selectName: selectName,
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const _default: ({ children, delayTime, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>;
2
+ declare const _default: ({ children, delayTime, excludes, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>;
3
3
  export default _default;
@@ -2,13 +2,14 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["children", "delayTime"];
5
+ var _excluded = ["children", "delayTime", "excludes"];
6
6
  import { throttle } from 'lodash';
7
7
  import React from 'react';
8
8
  import { useStep } from '../../index';
9
9
  export default (function (_ref) {
10
10
  var children = _ref.children,
11
11
  delayTime = _ref.delayTime,
12
+ excludes = _ref.excludes,
12
13
  props = _objectWithoutProperties(_ref, _excluded);
13
14
  var _useStep = useStep(),
14
15
  notify = _useStep.notify;
@@ -20,7 +21,9 @@ export default (function (_ref) {
20
21
  case 0:
21
22
  localStorage.setItem('cache-pro-step', '');
22
23
  _context.next = 3;
23
- return notify === null || notify === void 0 ? void 0 : notify();
24
+ return notify === null || notify === void 0 ? void 0 : notify({
25
+ excludes: excludes
26
+ });
24
27
  case 3:
25
28
  values = _context.sent;
26
29
  setTimeout(function () {
@@ -7,6 +7,6 @@ declare const ProStep: {
7
7
  ({ children, ...resetProps }: ProStepPropsType): import("react/jsx-runtime").JSX.Element;
8
8
  useStep: () => any;
9
9
  Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItem) => import("react/jsx-runtime").JSX.Element;
10
- Listener: ({ children, delayTime, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
10
+ Listener: ({ children, delayTime, excludes, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
11
11
  };
12
12
  export default ProStep;
@@ -128,47 +128,54 @@ var ProStep = function ProStep(_ref) {
128
128
  registerMap.current[id] = record;
129
129
  };
130
130
  var notify = /*#__PURE__*/function () {
131
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
132
- var events, res, nextErrorCollection;
131
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
132
+ var _ref7, excludes, triggerIds, events, res, nextErrorCollection;
133
133
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
134
134
  while (1) switch (_context2.prev = _context2.next) {
135
135
  case 0:
136
- events = Object.values(registerMap.current).map(function (item) {
137
- var _item$subEvent;
138
- return item === null || item === void 0 ? void 0 : (_item$subEvent = item.subEvent) === null || _item$subEvent === void 0 ? void 0 : _item$subEvent.call(item);
136
+ _ref7 = params || {}, excludes = _ref7.excludes;
137
+ triggerIds = Object.keys(registerMap.current); // 排除指定模块不触发校验
138
+ if (excludes === null || excludes === void 0 ? void 0 : excludes.length) {
139
+ triggerIds = triggerIds.filter(function (id) {
140
+ return !excludes.includes(id);
141
+ });
142
+ }
143
+ events = triggerIds.map(function (id) {
144
+ var _registerMap$current$, _registerMap$current$2;
145
+ return (_registerMap$current$ = registerMap.current[id]) === null || _registerMap$current$ === void 0 ? void 0 : (_registerMap$current$2 = _registerMap$current$.subEvent) === null || _registerMap$current$2 === void 0 ? void 0 : _registerMap$current$2.call(_registerMap$current$);
139
146
  });
140
- _context2.next = 3;
147
+ _context2.next = 6;
141
148
  return Promise.all(events);
142
- case 3:
149
+ case 6:
143
150
  res = _context2.sent;
144
151
  nextErrorCollection = {};
145
- Object.keys(registerMap.current).forEach(function (id, index) {
146
- var _ref7 = (res === null || res === void 0 ? void 0 : res[index]) || {},
147
- errorFields = _ref7.errorFields;
152
+ triggerIds.forEach(function (id, index) {
153
+ var _ref8 = (res === null || res === void 0 ? void 0 : res[index]) || {},
154
+ errorFields = _ref8.errorFields;
148
155
  nextErrorCollection[id] = (errorFields === null || errorFields === void 0 ? void 0 : errorFields.length) || 0;
149
156
  });
150
157
  setErrorCollection(nextErrorCollection);
151
158
  return _context2.abrupt("return", res);
152
- case 8:
159
+ case 11:
153
160
  case "end":
154
161
  return _context2.stop();
155
162
  }
156
163
  }, _callee2);
157
164
  }));
158
- return function notify() {
165
+ return function notify(_x) {
159
166
  return _ref6.apply(this, arguments);
160
167
  };
161
168
  }();
162
169
  var triggerTo = /*#__PURE__*/function () {
163
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(keys) {
170
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(keys) {
164
171
  var events, result, nextErrorCollection;
165
172
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
166
173
  while (1) switch (_context3.prev = _context3.next) {
167
174
  case 0:
168
175
  events = [];
169
176
  keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {
170
- var _registerMap$current, _registerMap$current$, _registerMap$current$2;
171
- events.push(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current = registerMap.current) === null || _registerMap$current === void 0 ? void 0 : (_registerMap$current$ = _registerMap$current[key]) === null || _registerMap$current$ === void 0 ? void 0 : (_registerMap$current$2 = _registerMap$current$.subEvent) === null || _registerMap$current$2 === void 0 ? void 0 : _registerMap$current$2.call(_registerMap$current$));
177
+ var _registerMap$current, _registerMap$current$3, _registerMap$current$4;
178
+ events.push(registerMap === null || registerMap === void 0 ? void 0 : (_registerMap$current = registerMap.current) === null || _registerMap$current === void 0 ? void 0 : (_registerMap$current$3 = _registerMap$current[key]) === null || _registerMap$current$3 === void 0 ? void 0 : (_registerMap$current$4 = _registerMap$current$3.subEvent) === null || _registerMap$current$4 === void 0 ? void 0 : _registerMap$current$4.call(_registerMap$current$3));
172
179
  });
173
180
  _context3.next = 4;
174
181
  return Promise.all(events);
@@ -190,8 +197,8 @@ var ProStep = function ProStep(_ref) {
190
197
  }
191
198
  }, _callee3);
192
199
  }));
193
- return function triggerTo(_x) {
194
- return _ref8.apply(this, arguments);
200
+ return function triggerTo(_x2) {
201
+ return _ref9.apply(this, arguments);
195
202
  };
196
203
  }();
197
204
  useDeepCompareEffect(function () {
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ProTableColumn } from '../../propsType';
3
- export declare const formatColumn: (column: ProTableColumn, originalObj: any, dataSourceObj: any, rowKey: any) => void;
3
+ export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, }: {
4
+ column: ProTableColumn;
5
+ originalObj: any;
6
+ dataSourceObj: any;
7
+ rowKey: any;
8
+ diffToolTip?: boolean;
9
+ }) => void;
4
10
  /**
5
11
  * 查找最近的父级className
6
12
  * @param element 当前node节点
@@ -11,7 +11,12 @@ import RenderColumn from '../RenderColumn';
11
11
  import { getDecimalDigits, getOriginalValue } from '../../utils';
12
12
  import getEnumLabel from '../../../ProEnum/utils/getEnumLabel';
13
13
  import ProForm from '../../../ProForm';
14
- export var formatColumn = function formatColumn(column, originalObj, dataSourceObj, rowKey) {
14
+ export var formatColumn = function formatColumn(_ref) {
15
+ var column = _ref.column,
16
+ originalObj = _ref.originalObj,
17
+ dataSourceObj = _ref.dataSourceObj,
18
+ rowKey = _ref.rowKey,
19
+ diffToolTip = _ref.diffToolTip;
15
20
  var title = column.title,
16
21
  valueType = column.valueType,
17
22
  _column$format = column.format,
@@ -31,6 +36,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
31
36
  originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
32
37
  _column$toolTipProps = column.toolTipProps,
33
38
  toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps;
39
+ var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
34
40
  // 前缀处理
35
41
  var prefixNode = function prefixNode(value, record, index) {
36
42
  if (!prefix) {
@@ -98,7 +104,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
98
104
  node: node,
99
105
  value: value,
100
106
  currentValue: renderValue,
101
- originalDiffTip: originalDiffTip,
107
+ originalDiffTip: _originalDiffTip,
102
108
  toolTipProps: toolTipProps
103
109
  });
104
110
  };
@@ -128,7 +134,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
128
134
  node: node,
129
135
  value: value,
130
136
  currentValue: renderValue,
131
- originalDiffTip: originalDiffTip,
137
+ originalDiffTip: _originalDiffTip,
132
138
  toolTipProps: toolTipProps
133
139
  });
134
140
  };
@@ -181,7 +187,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
181
187
  node: node,
182
188
  value: value,
183
189
  currentValue: renderValue,
184
- originalDiffTip: originalDiffTip,
190
+ originalDiffTip: _originalDiffTip,
185
191
  toolTipProps: toolTipProps
186
192
  });
187
193
  };
@@ -219,7 +225,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
219
225
  node: node,
220
226
  value: value,
221
227
  currentValue: renderValue,
222
- originalDiffTip: originalDiffTip,
228
+ originalDiffTip: _originalDiffTip,
223
229
  toolTipProps: toolTipProps
224
230
  });
225
231
  };
@@ -246,7 +252,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
246
252
  node: node,
247
253
  value: value,
248
254
  currentValue: renderValue,
249
- originalDiffTip: originalDiffTip,
255
+ originalDiffTip: _originalDiffTip,
250
256
  toolTipProps: toolTipProps
251
257
  });
252
258
  };
@@ -323,7 +329,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
323
329
  node: value,
324
330
  value: value,
325
331
  currentValue: value || '-',
326
- originalDiffTip: originalDiffTip,
332
+ originalDiffTip: _originalDiffTip,
327
333
  toolTipProps: toolTipProps
328
334
  }), suffixNode(value, record, index)]
329
335
  });
@@ -346,7 +352,7 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
346
352
  node: node,
347
353
  value: value,
348
354
  currentValue: value || '-',
349
- originalDiffTip: originalDiffTip,
355
+ originalDiffTip: _originalDiffTip,
350
356
  toolTipProps: toolTipProps
351
357
  });
352
358
  };
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
7
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
8
- var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "originalDataSource", "onDragStart", "onDragEnd"],
8
+ var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "diffConfig", "onDragStart", "onDragEnd"],
9
9
  _excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
10
10
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { useEffect, useMemo, useState, createContext } from 'react';
@@ -52,10 +52,15 @@ function ProTable(props) {
52
52
  summary = props.summary,
53
53
  _props$emptyText = props.emptyText,
54
54
  emptyText = _props$emptyText === void 0 ? locale === null || locale === void 0 ? void 0 : (_locale$ProTable = locale.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.noData : _props$emptyText,
55
- originalDataSource = props.originalDataSource,
55
+ diffConfig = props.diffConfig,
56
56
  onDragStartGuard = props.onDragStart,
57
57
  onDragEndGuard = props.onDragEnd,
58
58
  restProps = _objectWithoutProperties(props, _excluded);
59
+ var _ref3 = diffConfig || {},
60
+ originalDataSource = _ref3.originalDataSource,
61
+ changeTipColor = _ref3.changeTipColor,
62
+ addTipColor = _ref3.addTipColor,
63
+ toolTip = _ref3.toolTip;
59
64
  var quickTableConfig = quickConfig ? _objectSpread({
60
65
  columnConfig: true,
61
66
  cacheTime: true
@@ -71,10 +76,10 @@ function ProTable(props) {
71
76
  _quickTableConfig$sto = quickTableConfig.storage,
72
77
  storage = _quickTableConfig$sto === void 0 ? configStorage : _quickTableConfig$sto,
73
78
  tableProps = _objectWithoutProperties(quickTableConfig, _excluded2);
74
- var _ref3 = tableProps || {},
75
- pagination = _ref3.pagination,
76
- dataSource = _ref3.dataSource,
77
- rowKey = _ref3.rowKey;
79
+ var _ref4 = tableProps || {},
80
+ pagination = _ref4.pagination,
81
+ dataSource = _ref4.dataSource,
82
+ rowKey = _ref4.rowKey;
78
83
  var initDataSource = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
79
84
  return _objectSpread(_objectSpread({}, item), {}, {
80
85
  rowKey: getRowKey(rowKey, item)
@@ -157,8 +162,8 @@ function ProTable(props) {
157
162
  };
158
163
  // 列宽resize函数
159
164
  var handleResize = function handleResize(index) {
160
- return function (e, _ref4) {
161
- var size = _ref4.size;
165
+ return function (e, _ref5) {
166
+ var size = _ref5.size;
162
167
  var nextColumns = _toConsumableArray(curColumns);
163
168
  nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
164
169
  width: size.width
@@ -188,7 +193,13 @@ function ProTable(props) {
188
193
  return !(item === null || item === void 0 ? void 0 : item.delete);
189
194
  });
190
195
  newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
191
- formatColumn(item, originalObj, dataSourceObj, 'rowKey');
196
+ formatColumn({
197
+ column: item,
198
+ originalObj: originalObj,
199
+ dataSourceObj: dataSourceObj,
200
+ rowKey: 'rowKey',
201
+ diffToolTip: toolTip
202
+ });
192
203
  });
193
204
  return newColumns;
194
205
  }, [curColumns, handleResize]);
@@ -205,7 +216,7 @@ function ProTable(props) {
205
216
  });
206
217
  }, [columns]);
207
218
  var handleColumnConfig = /*#__PURE__*/function () {
208
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
219
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
209
220
  var newColumns, _columnConfig$onColum, catchColumns;
210
221
  return _regeneratorRuntime().wrap(function _callee$(_context) {
211
222
  while (1) switch (_context.prev = _context.next) {
@@ -241,7 +252,7 @@ function ProTable(props) {
241
252
  }, _callee);
242
253
  }));
243
254
  return function handleColumnConfig(_x) {
244
- return _ref5.apply(this, arguments);
255
+ return _ref6.apply(this, arguments);
245
256
  };
246
257
  }();
247
258
  useDebounceEffect(function () {
@@ -314,7 +325,7 @@ function ProTable(props) {
314
325
  return _rowSelection;
315
326
  };
316
327
  var onDataSourceChange = /*#__PURE__*/function () {
317
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
328
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nextDataSource) {
318
329
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
319
330
  while (1) switch (_context2.prev = _context2.next) {
320
331
  case 0:
@@ -330,7 +341,7 @@ function ProTable(props) {
330
341
  }, _callee2);
331
342
  }));
332
343
  return function onDataSourceChange(_x2) {
333
- return _ref6.apply(this, arguments);
344
+ return _ref7.apply(this, arguments);
334
345
  };
335
346
  }();
336
347
  var _rowClassName = function _rowClassName(record, index) {
@@ -339,6 +350,11 @@ function ProTable(props) {
339
350
  }
340
351
  };
341
352
  var TableComponent = draggable ? DraggableTable : BaseTable;
353
+ // 标记样式
354
+ var tagStyle = {
355
+ '--zaui-contract-bg': changeTipColor,
356
+ '--zaui-contract-bg-add': addTipColor
357
+ };
342
358
  return _jsx(TableContext.Provider, {
343
359
  value: {
344
360
  pathKey: pathKey,
@@ -362,6 +378,7 @@ function ProTable(props) {
362
378
  }
363
379
  }), _jsxs("div", {
364
380
  className: "pro-table-container",
381
+ style: tagStyle,
365
382
  children: [_jsx(TableComponent, _objectSpread(_objectSpread({}, restProps), {}, {
366
383
  draggableProps: {
367
384
  onChange: onDataSourceChange,