@zat-design/sisyphus-react 3.7.3 → 3.8.0-beat.10

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 (191) hide show
  1. package/dist/index.esm.css +100 -4
  2. package/dist/less.esm.css +97 -4
  3. package/es/ProAction/index.js +1 -1
  4. package/es/ProDownload/index.js +3 -3
  5. package/es/ProDownload/utils.js +3 -3
  6. package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
  7. package/es/ProDrawerForm/components/ProModal/index.js +3 -3
  8. package/es/ProEditLabel/index.js +3 -3
  9. package/es/ProEditTable/components/ActionButton/index.js +3 -3
  10. package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
  11. package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +29 -14
  12. package/es/ProEditTable/components/RenderField/index.js +10 -8
  13. package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
  14. package/es/ProEditTable/utils/config.js +2 -2
  15. package/es/ProEditTable/utils/index.js +5 -5
  16. package/es/ProEditTable/utils/tools.js +1 -1
  17. package/es/ProEnum/components/Group.js +10 -2
  18. package/es/ProEnum/hooks/useEnumRequest.js +2 -2
  19. package/es/ProEnum/index.js +6 -5
  20. package/es/ProEnum/style/index.less +14 -4
  21. package/es/ProEnum/utils/index.d.ts +1 -1
  22. package/es/ProEnum/utils/index.js +4 -0
  23. package/es/ProForm/components/combination/Container/index.js +5 -3
  24. package/es/ProForm/components/combination/Container/propsType.d.ts +2 -1
  25. package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
  26. package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
  27. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
  28. package/es/ProForm/components/combination/FormList/utils.js +6 -5
  29. package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
  30. package/es/ProForm/components/combination/Group/utils.js +8 -1
  31. package/es/ProForm/components/combination/ProCascader/index.js +6 -3
  32. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
  33. package/es/ProForm/components/combination/ProModalSelect/index.js +57 -46
  34. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  35. package/es/ProForm/components/combination/ProNumberRange/index.js +14 -5
  36. package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
  37. package/es/ProForm/components/old/ProAddress/index.js +1 -1
  38. package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
  39. package/es/ProForm/components/render/ChangedWrapper.js +110 -0
  40. package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
  41. package/es/ProForm/components/render/Render.js +11 -11
  42. package/es/ProForm/components/render/RenderFields.d.ts +2 -3
  43. package/es/ProForm/components/render/RenderFields.js +3 -4
  44. package/es/ProForm/components/render/propsType.d.ts +5 -4
  45. package/es/ProForm/index.js +4 -7
  46. package/es/ProForm/propsType.d.ts +13 -2
  47. package/es/ProForm/style/index.less +103 -5
  48. package/es/ProForm/utils/diffOriginal.d.ts +4 -4
  49. package/es/ProForm/utils/diffOriginal.js +18 -7
  50. package/es/ProForm/utils/transformValue.js +17 -11
  51. package/es/ProForm/utils/useForm.js +1 -1
  52. package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
  53. package/es/ProForm/utils/useShouldUpdate.js +1 -1
  54. package/es/ProSelect/index.js +12 -11
  55. package/es/ProSelect/propsType.d.ts +4 -0
  56. package/es/ProSelect/utils/index.js +5 -4
  57. package/es/ProStep/components/Listener/index.d.ts +1 -1
  58. package/es/ProStep/components/Listener/index.js +6 -3
  59. package/es/ProStep/index.d.ts +1 -1
  60. package/es/ProStep/index.js +25 -18
  61. package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
  62. package/es/ProTable/components/FormatColumn/index.js +14 -8
  63. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
  64. package/es/ProTable/hooks/useAntdTable.js +3 -3
  65. package/es/ProTable/index.js +30 -13
  66. package/es/ProTable/propsType.d.ts +14 -1
  67. package/es/ProTable/style/index.less +1 -1
  68. package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
  69. package/es/ProTree/components/AdaptiveTooltip.js +55 -0
  70. package/es/ProTree/components/List.js +15 -3
  71. package/es/ProTree/components/ProTree.js +1 -1
  72. package/es/ProTree/components/ProTreeSelect/index.js +38 -5
  73. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
  74. package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
  75. package/es/ProTree/components/SearchTitle.d.ts +2 -0
  76. package/es/ProTree/components/SearchTitle.js +17 -8
  77. package/es/ProTree/components/Tree.js +1 -1
  78. package/es/ProTree/style/index.less +14 -0
  79. package/es/ProTreeModal/components/Tree.js +15 -17
  80. package/es/ProTreeModal/index.js +62 -7
  81. package/es/ProTreeModal/utils.d.ts +1 -0
  82. package/es/ProTreeModal/utils.js +21 -1
  83. package/es/ProUpload/components/ImageRender.js +1 -1
  84. package/es/ProViewer/index.js +2 -2
  85. package/es/old/ProEditableTable/index.js +4 -4
  86. package/es/style/theme/antd.less +5 -0
  87. package/es/style/theme/index.less +2 -1
  88. package/es/style/theme/tokens.less +1 -0
  89. package/es/utils/index.d.ts +2 -0
  90. package/es/utils/index.js +13 -0
  91. package/lib/ProAction/index.js +1 -1
  92. package/lib/ProDownload/index.js +3 -3
  93. package/lib/ProDownload/utils.js +3 -3
  94. package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
  95. package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
  96. package/lib/ProEditLabel/index.js +3 -3
  97. package/lib/ProEditTable/components/ActionButton/index.js +3 -3
  98. package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
  99. package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +32 -15
  100. package/lib/ProEditTable/components/RenderField/index.js +10 -8
  101. package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
  102. package/lib/ProEditTable/utils/config.js +2 -2
  103. package/lib/ProEditTable/utils/index.js +5 -5
  104. package/lib/ProEditTable/utils/tools.js +1 -1
  105. package/lib/ProEnum/components/Group.js +10 -2
  106. package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
  107. package/lib/ProEnum/index.js +6 -5
  108. package/lib/ProEnum/style/index.less +14 -4
  109. package/lib/ProEnum/utils/index.d.ts +1 -1
  110. package/lib/ProEnum/utils/index.js +4 -0
  111. package/lib/ProForm/components/combination/Container/index.js +5 -3
  112. package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -1
  113. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
  114. package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
  115. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
  116. package/lib/ProForm/components/combination/FormList/utils.js +5 -4
  117. package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
  118. package/lib/ProForm/components/combination/Group/utils.js +8 -1
  119. package/lib/ProForm/components/combination/ProCascader/index.js +6 -3
  120. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
  121. package/lib/ProForm/components/combination/ProModalSelect/index.js +56 -45
  122. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  123. package/lib/ProForm/components/combination/ProNumberRange/index.js +14 -5
  124. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
  125. package/lib/ProForm/components/old/ProAddress/index.js +1 -1
  126. package/lib/ProForm/components/render/ChangedWrapper.d.ts +17 -0
  127. package/lib/ProForm/components/render/ChangedWrapper.js +115 -0
  128. package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
  129. package/lib/ProForm/components/render/Render.js +11 -11
  130. package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
  131. package/lib/ProForm/components/render/RenderFields.js +3 -4
  132. package/lib/ProForm/components/render/propsType.d.ts +5 -4
  133. package/lib/ProForm/index.js +4 -7
  134. package/lib/ProForm/propsType.d.ts +13 -2
  135. package/lib/ProForm/style/index.less +103 -5
  136. package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
  137. package/lib/ProForm/utils/diffOriginal.js +18 -7
  138. package/lib/ProForm/utils/transformValue.js +17 -11
  139. package/lib/ProForm/utils/useForm.js +1 -1
  140. package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
  141. package/lib/ProForm/utils/useShouldUpdate.js +1 -1
  142. package/lib/ProSelect/index.js +12 -11
  143. package/lib/ProSelect/propsType.d.ts +4 -0
  144. package/lib/ProSelect/utils/index.js +5 -4
  145. package/lib/ProStep/components/Listener/index.d.ts +1 -1
  146. package/lib/ProStep/components/Listener/index.js +6 -3
  147. package/lib/ProStep/index.d.ts +1 -1
  148. package/lib/ProStep/index.js +25 -18
  149. package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
  150. package/lib/ProTable/components/FormatColumn/index.js +14 -8
  151. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
  152. package/lib/ProTable/hooks/useAntdTable.js +3 -3
  153. package/lib/ProTable/index.js +30 -13
  154. package/lib/ProTable/propsType.d.ts +14 -1
  155. package/lib/ProTable/style/index.less +1 -1
  156. package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
  157. package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
  158. package/lib/ProTree/components/List.js +15 -3
  159. package/lib/ProTree/components/ProTree.js +1 -1
  160. package/lib/ProTree/components/ProTreeSelect/index.js +38 -5
  161. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
  162. package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
  163. package/lib/ProTree/components/SearchTitle.d.ts +2 -0
  164. package/lib/ProTree/components/SearchTitle.js +19 -7
  165. package/lib/ProTree/components/Tree.js +1 -1
  166. package/lib/ProTree/style/index.less +14 -0
  167. package/lib/ProTreeModal/components/Tree.js +15 -17
  168. package/lib/ProTreeModal/index.js +61 -6
  169. package/lib/ProTreeModal/utils.d.ts +1 -0
  170. package/lib/ProTreeModal/utils.js +20 -0
  171. package/lib/ProUpload/components/ImageRender.js +1 -1
  172. package/lib/ProViewer/index.js +2 -2
  173. package/lib/old/ProEditableTable/index.js +4 -4
  174. package/lib/style/theme/antd.less +5 -0
  175. package/lib/style/theme/index.less +2 -1
  176. package/lib/style/theme/tokens.less +1 -0
  177. package/lib/utils/index.d.ts +2 -0
  178. package/lib/utils/index.js +19 -0
  179. package/package.json +4 -4
  180. package/es/ProForm/components/render/Changed.d.ts +0 -14
  181. package/es/ProForm/components/render/Changed.js +0 -64
  182. package/lib/ProForm/components/render/Changed.d.ts +0 -14
  183. package/lib/ProForm/components/render/Changed.js +0 -69
  184. /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
  185. /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
  186. /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
  187. /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
  188. /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
  189. /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
  190. /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
  191. /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.diffOriginal = void 0;
7
7
  var _lodash = require("lodash");
8
+ var _utils = require("../../utils");
8
9
  var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
9
10
  var diffOriginal = exports.diffOriginal = function diffOriginal(params) {
10
11
  var originalValue = params.originalValue,
@@ -12,19 +13,29 @@ var diffOriginal = exports.diffOriginal = function diffOriginal(params) {
12
13
  equalWith = params.equalWith;
13
14
  // 支持传入自定义比较事件
14
15
  if ((0, _lodash.isFunction)(equalWith)) {
15
- return !equalWith(originalValue, value);
16
+ var diffRes = equalWith(originalValue, value);
17
+ if (diffRes === undefined) return 'same';
18
+ if (typeof diffRes === 'boolean') {
19
+ return diffRes ? 'same' : 'changed';
20
+ }
21
+ return diffRes;
22
+ }
23
+ // 如果原始值为空 且当前有值的话 认为变更类型是新增
24
+ if ((0, _utils.isEmpty)(originalValue) && !(0, _utils.isEmpty)(value)) {
25
+ return 'add';
16
26
  }
17
27
  if (Array.isArray(originalValue)) {
18
- return originalValue.some(function (valueItem, index) {
28
+ var isSame = originalValue.every(function (valueItem, index) {
19
29
  // 如果两个值有一个不是空值, 则进行深比较
20
- if (!nullValue.includes(value === null || value === void 0 ? void 0 : value[index]) || !nullValue.includes(valueItem)) {
21
- return !(0, _lodash.isEqual)(value === null || value === void 0 ? void 0 : value[index], valueItem);
30
+ if (!(0, _utils.isEmpty)(value === null || value === void 0 ? void 0 : value[index]) || !(0, _utils.isEmpty)(valueItem)) {
31
+ return (0, _lodash.isEqual)(value === null || value === void 0 ? void 0 : value[index], valueItem);
22
32
  }
23
- return false;
33
+ return true;
24
34
  });
35
+ return isSame ? 'same' : 'changed';
25
36
  }
26
37
  if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
27
- return !(0, _lodash.isEqual)(value, originalValue);
38
+ return (0, _lodash.isEqual)(value, originalValue) ? 'same' : 'changed';
28
39
  }
29
- return false;
40
+ return 'same';
30
41
  };
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.transformValue = exports.default = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
9
  var _lodash = require("lodash");
11
10
  var _utils = require("../utils");
12
- var _excluded = ["value"];
11
+ var _utils2 = require("../../utils");
13
12
  var transformValue = exports.transformValue = function transformValue(names, form, fieldName, _normalize, _getValueProps) {
14
13
  return {
15
14
  normalize: function normalize(value) {
@@ -29,23 +28,30 @@ var transformValue = exports.transformValue = function transformValue(names, for
29
28
  return _value;
30
29
  },
31
30
  getValueProps: function getValueProps(value) {
31
+ var _curValue;
32
32
  var _value = [];
33
33
  names.forEach(function (name, index) {
34
34
  var value = form.getFieldValue(name);
35
35
  _value[index] = value;
36
36
  });
37
37
  // 支持外部传入转换函数
38
- var _ref = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
39
- value: _value
40
- },
41
- cusValue = _ref.value,
42
- cusRest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
38
+ var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
39
+ value: _value
40
+ };
41
+ // 如果数组中值都为空, 则值置为空
42
+ var curValue = res === null || res === void 0 ? void 0 : res.value;
43
43
  // @ts-ignore
44
- (0, _lodash.set)(form.getFieldsValue(true), fieldName, cusValue);
44
+ if ((_curValue = curValue) === null || _curValue === void 0 ? void 0 : _curValue.every(function (item) {
45
+ return (0, _utils2.isEmpty)(item);
46
+ })) {
47
+ curValue = undefined;
48
+ }
49
+ // @ts-ignore
50
+ (0, _lodash.set)(form.getFieldsValue(true), fieldName, curValue);
45
51
  // 如果表单里的值和组合得到的值不全等 更新表单里的值、
46
- return (0, _objectSpread2.default)({
47
- value: cusValue
48
- }, cusRest);
52
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, res), {}, {
53
+ value: curValue
54
+ });
49
55
  },
50
56
  shouldUpdate: function shouldUpdate(prevValues, curValues) {
51
57
  return (0, _utils.diffField)(prevValues, curValues, names);
@@ -44,7 +44,7 @@ var useForm = exports.useForm = function useForm(originForm, options) {
44
44
  return getFieldsValue(nameList, filterFunc);
45
45
  };
46
46
  var _validateFields = /*#__PURE__*/function () {
47
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(nameList) {
47
+ var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(nameList) {
48
48
  var _rest$,
49
49
  _len,
50
50
  rest,
@@ -3,7 +3,7 @@ import { ProColumnProps, ProRule } from '../components/render/propsType';
3
3
  interface Result<Values> {
4
4
  shouldUpdate?: FormItemProps<Values>['shouldUpdate'];
5
5
  show?: boolean;
6
- disabled?: boolean;
6
+ disabled?: boolean | boolean[];
7
7
  rules?: ProRule[];
8
8
  required?: boolean;
9
9
  [key: string]: any;
@@ -15,7 +15,7 @@ interface UseShouldUpdateProps<Values> {
15
15
  names?: any[];
16
16
  };
17
17
  form?: FormInstance<Values>;
18
- disabled?: ProColumnProps['disabled'];
18
+ disabled?: boolean;
19
19
  rules?: ProRule[];
20
20
  required?: boolean;
21
21
  type: string;
@@ -70,7 +70,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
70
70
  }
71
71
  if ((0, _lodash.isFunction)(disabled)) {
72
72
  // RangePicker返回数组时,特殊处理
73
- if (type === 'RangePicker' && Array.isArray(disabled(values, {
73
+ if (['Group', 'RangePicker'].includes(type) && Array.isArray(disabled(values, {
74
74
  form: form,
75
75
  index: index,
76
76
  namePath: namePath
@@ -21,7 +21,7 @@ var _ = require("..");
21
21
  var _locale = _interopRequireDefault(require("../locale"));
22
22
  var _utils = require("./utils");
23
23
  require("./index.less");
24
- var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
24
+ var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "getValueProps", "isView"];
25
25
  var Option = _antd.Select.Option;
26
26
  var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
27
27
  var _selectProps$showCode, _locale$ProSelect;
@@ -54,10 +54,11 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
54
54
  onChange = props.onChange,
55
55
  updateDataSource = props.updateDataSource,
56
56
  transformResponse = props.transformResponse,
57
+ getValueProps = props.getValueProps,
57
58
  isViewPro = props.isView,
58
59
  selectProps = (0, _objectWithoutProperties2.default)(props, _excluded);
59
60
  selectProps.showCodeName = (_selectProps$showCode = selectProps.showCodeName) !== null && _selectProps$showCode !== void 0 ? _selectProps$showCode : showCodeName;
60
- var value = props.value;
61
+ var value = getValueProps && props.value ? getValueProps(props.value) : props.value;
61
62
  var _ref2 = _.ProForm.useFieldProps() || {},
62
63
  isViewCon = _ref2.isView,
63
64
  viewEmpty = _ref2.viewEmpty;
@@ -217,6 +218,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
217
218
  return props.children;
218
219
  };
219
220
  var handleChange = function handleChange(value, option) {
221
+ var getChangeValue = selectProps.getChangeValue;
220
222
  if (selectProps.mode && selectProps.mode === 'multiple') {
221
223
  if (Array.isArray(option)) {
222
224
  option.forEach(function (item) {
@@ -226,14 +228,14 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
226
228
  });
227
229
  }
228
230
  if (labelInValue) {
229
- onChange === null || onChange === void 0 ? void 0 : onChange(getValueObject(value), option);
231
+ onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(getValueObject(value)) : getValueObject(value), option);
230
232
  } else {
231
- onChange === null || onChange === void 0 ? void 0 : onChange(value, option);
233
+ onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, option);
232
234
  }
233
235
  } else if (!selectProps.mode && labelInValue) {
234
- onChange(getValueObject(value), option);
236
+ onChange(getChangeValue ? getChangeValue(getValueObject(value)) : getValueObject(value), option);
235
237
  } else {
236
- onChange === null || onChange === void 0 ? void 0 : onChange(value, option === null || option === void 0 ? void 0 : option.record);
238
+ onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, option === null || option === void 0 ? void 0 : option.record);
237
239
  }
238
240
  };
239
241
  /**
@@ -279,7 +281,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
279
281
  if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
280
282
  newSelectList = (0, _utils.getSelectList)({
281
283
  otherProps: otherProps,
282
- value: props.value,
284
+ value: value,
283
285
  dataSource: selectList,
284
286
  labelInValue: labelInValue,
285
287
  fieldNames: fieldNames,
@@ -295,8 +297,8 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
295
297
  showArrow: true,
296
298
  loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
297
299
  onChange: handleChange,
298
- optionLabelProp: "children" // 解决warning报错,添加默认值
299
- ,
300
+ optionLabelProp: (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isDiffChange) ? 'label' : 'children',
301
+ // optionLabelProp="label" // 解决warning报错,添加默认值
300
302
  showSearch: true,
301
303
  filterOption: (0, _lodash.isFunction)(_onSearch) ? false : function (input, option) {
302
304
  var _option$children, _option$children$prop;
@@ -313,16 +315,15 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
313
315
  value: transformValue(),
314
316
  children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
315
317
  return (0, _jsxRuntime.jsx)(Option, {
318
+ label: item[label],
316
319
  value: item[code],
317
320
  record: item,
318
321
  disabled: !!item.disabled,
319
322
  children: (0, _jsxRuntime.jsx)(TooltipOption, {
320
323
  title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
321
324
  children: OptionRender ? (0, _jsxRuntime.jsx)("span", {
322
- title: OptionRender(item),
323
325
  children: OptionRender(item)
324
326
  }) : (0, _jsxRuntime.jsx)("span", {
325
- title: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
326
327
  children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
327
328
  })
328
329
  }, item[code])
@@ -46,6 +46,10 @@ export interface PropSelectProps extends Omit<SelectProps, 'onSearch'> {
46
46
  onSearch?: (value: string, useRequest: Result<any, any>) => void;
47
47
  /** 自定义展示 */
48
48
  optionRender?: (value: DataOption) => string | ReactNode;
49
+ /** 用来转换修改value值 和 getValueProps配合使用 */
50
+ getChangeValue?: (value: DataOption) => any;
51
+ /** 用来转换传入的value值 getChangeValue配合使用 */
52
+ getValueProps?: (value: DataOption) => any;
49
53
  }
50
54
  export interface ProSelectAction {
51
55
  /** 实例方法、根据 code | code[] 批量获取数据 */
@@ -38,7 +38,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
38
38
  _iterator.f();
39
39
  }
40
40
  if (mode === 'multiple') {
41
- selectValues = [].concat((0, _toConsumableArray2.default)(selectValues), (0, _toConsumableArray2.default)(result));
41
+ selectValues = [].concat((0, _toConsumableArray2.default)(selectValues), (0, _toConsumableArray2.default)(result || []));
42
42
  } else {
43
43
  selectValues.push(result);
44
44
  }
@@ -61,13 +61,14 @@ var getSelectList = exports.getSelectList = function getSelectList(_ref2) {
61
61
  if (!otherProps) {
62
62
  return null;
63
63
  }
64
- var listName = otherProps.listName,
64
+ var name = otherProps.name,
65
+ listName = otherProps.listName,
65
66
  form = otherProps.form;
66
67
  var firstNumberIndex = listName.lastIndexOf(listName.findLast(function (item) {
67
68
  return typeof item === 'number';
68
69
  }));
69
- var fatherName = listName.slice(0, firstNumberIndex);
70
- var selectName = listName.slice(firstNumberIndex + 1);
70
+ var fatherName = (name || listName).slice(0, firstNumberIndex);
71
+ var selectName = (name || listName).slice(firstNumberIndex + 1);
71
72
  return findSelectNameValues({
72
73
  list: form.getFieldValue(fatherName) || [],
73
74
  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;
@@ -12,22 +12,25 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
12
12
  var _lodash = require("lodash");
13
13
  var _react = _interopRequireDefault(require("react"));
14
14
  var _index = require("../../index");
15
- var _excluded = ["children", "delayTime"];
15
+ var _excluded = ["children", "delayTime", "excludes"];
16
16
  var _default = exports.default = function _default(_ref) {
17
17
  var children = _ref.children,
18
18
  delayTime = _ref.delayTime,
19
+ excludes = _ref.excludes,
19
20
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
21
  var _useStep = (0, _index.useStep)(),
21
22
  notify = _useStep.notify;
22
23
  return /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
23
- onClick: (0, _lodash.throttle)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
24
+ onClick: (0, _lodash.throttle)(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
24
25
  var values;
25
26
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
26
27
  while (1) switch (_context.prev = _context.next) {
27
28
  case 0:
28
29
  localStorage.setItem('cache-pro-step', '');
29
30
  _context.next = 3;
30
- return notify === null || notify === void 0 ? void 0 : notify();
31
+ return notify === null || notify === void 0 ? void 0 : notify({
32
+ excludes: excludes
33
+ });
31
34
  case 3:
32
35
  values = _context.sent;
33
36
  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;
@@ -89,7 +89,7 @@ var ProStep = function ProStep(_ref) {
89
89
  return null;
90
90
  }
91
91
  var subEvent = /*#__PURE__*/function () {
92
- var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
92
+ var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
93
93
  var value, _form$validateFields, _error$errorFields;
94
94
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
95
95
  while (1) switch (_context.prev = _context.next) {
@@ -135,47 +135,54 @@ var ProStep = function ProStep(_ref) {
135
135
  registerMap.current[id] = record;
136
136
  };
137
137
  var notify = /*#__PURE__*/function () {
138
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
139
- var events, res, nextErrorCollection;
138
+ var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(params) {
139
+ var _ref7, excludes, triggerIds, events, res, nextErrorCollection;
140
140
  return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
141
141
  while (1) switch (_context2.prev = _context2.next) {
142
142
  case 0:
143
- events = Object.values(registerMap.current).map(function (item) {
144
- var _item$subEvent;
145
- return item === null || item === void 0 ? void 0 : (_item$subEvent = item.subEvent) === null || _item$subEvent === void 0 ? void 0 : _item$subEvent.call(item);
143
+ _ref7 = params || {}, excludes = _ref7.excludes;
144
+ triggerIds = Object.keys(registerMap.current); // 排除指定模块不触发校验
145
+ if (excludes === null || excludes === void 0 ? void 0 : excludes.length) {
146
+ triggerIds = triggerIds.filter(function (id) {
147
+ return !excludes.includes(id);
148
+ });
149
+ }
150
+ events = triggerIds.map(function (id) {
151
+ var _registerMap$current$, _registerMap$current$2;
152
+ 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$);
146
153
  });
147
- _context2.next = 3;
154
+ _context2.next = 6;
148
155
  return Promise.all(events);
149
- case 3:
156
+ case 6:
150
157
  res = _context2.sent;
151
158
  nextErrorCollection = {};
152
- Object.keys(registerMap.current).forEach(function (id, index) {
153
- var _ref7 = (res === null || res === void 0 ? void 0 : res[index]) || {},
154
- errorFields = _ref7.errorFields;
159
+ triggerIds.forEach(function (id, index) {
160
+ var _ref8 = (res === null || res === void 0 ? void 0 : res[index]) || {},
161
+ errorFields = _ref8.errorFields;
155
162
  nextErrorCollection[id] = (errorFields === null || errorFields === void 0 ? void 0 : errorFields.length) || 0;
156
163
  });
157
164
  setErrorCollection(nextErrorCollection);
158
165
  return _context2.abrupt("return", res);
159
- case 8:
166
+ case 11:
160
167
  case "end":
161
168
  return _context2.stop();
162
169
  }
163
170
  }, _callee2);
164
171
  }));
165
- return function notify() {
172
+ return function notify(_x) {
166
173
  return _ref6.apply(this, arguments);
167
174
  };
168
175
  }();
169
176
  var triggerTo = /*#__PURE__*/function () {
170
- var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3(keys) {
177
+ var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3(keys) {
171
178
  var events, result, nextErrorCollection;
172
179
  return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
173
180
  while (1) switch (_context3.prev = _context3.next) {
174
181
  case 0:
175
182
  events = [];
176
183
  keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {
177
- var _registerMap$current, _registerMap$current$, _registerMap$current$2;
178
- 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$));
184
+ var _registerMap$current, _registerMap$current$3, _registerMap$current$4;
185
+ 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));
179
186
  });
180
187
  _context3.next = 4;
181
188
  return Promise.all(events);
@@ -197,8 +204,8 @@ var ProStep = function ProStep(_ref) {
197
204
  }
198
205
  }, _callee3);
199
206
  }));
200
- return function triggerTo(_x) {
201
- return _ref8.apply(this, arguments);
207
+ return function triggerTo(_x2) {
208
+ return _ref9.apply(this, arguments);
202
209
  };
203
210
  }();
204
211
  (0, _ahooks.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节点
@@ -17,7 +17,12 @@ var _RenderColumn = _interopRequireDefault(require("../RenderColumn"));
17
17
  var _utils2 = require("../../utils");
18
18
  var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
19
19
  var _ProForm = _interopRequireDefault(require("../../../ProForm"));
20
- var formatColumn = exports.formatColumn = function formatColumn(column, originalObj, dataSourceObj, rowKey) {
20
+ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
21
+ var column = _ref.column,
22
+ originalObj = _ref.originalObj,
23
+ dataSourceObj = _ref.dataSourceObj,
24
+ rowKey = _ref.rowKey,
25
+ diffToolTip = _ref.diffToolTip;
21
26
  var title = column.title,
22
27
  valueType = column.valueType,
23
28
  _column$format = column.format,
@@ -37,6 +42,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
37
42
  originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
38
43
  _column$toolTipProps = column.toolTipProps,
39
44
  toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps;
45
+ var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
40
46
  // 前缀处理
41
47
  var prefixNode = function prefixNode(value, record, index) {
42
48
  if (!prefix) {
@@ -104,7 +110,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
104
110
  node: node,
105
111
  value: value,
106
112
  currentValue: renderValue,
107
- originalDiffTip: originalDiffTip,
113
+ originalDiffTip: _originalDiffTip,
108
114
  toolTipProps: toolTipProps
109
115
  });
110
116
  };
@@ -134,7 +140,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
134
140
  node: node,
135
141
  value: value,
136
142
  currentValue: renderValue,
137
- originalDiffTip: originalDiffTip,
143
+ originalDiffTip: _originalDiffTip,
138
144
  toolTipProps: toolTipProps
139
145
  });
140
146
  };
@@ -187,7 +193,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
187
193
  node: node,
188
194
  value: value,
189
195
  currentValue: renderValue,
190
- originalDiffTip: originalDiffTip,
196
+ originalDiffTip: _originalDiffTip,
191
197
  toolTipProps: toolTipProps
192
198
  });
193
199
  };
@@ -225,7 +231,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
225
231
  node: node,
226
232
  value: value,
227
233
  currentValue: renderValue,
228
- originalDiffTip: originalDiffTip,
234
+ originalDiffTip: _originalDiffTip,
229
235
  toolTipProps: toolTipProps
230
236
  });
231
237
  };
@@ -252,7 +258,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
252
258
  node: node,
253
259
  value: value,
254
260
  currentValue: renderValue,
255
- originalDiffTip: originalDiffTip,
261
+ originalDiffTip: _originalDiffTip,
256
262
  toolTipProps: toolTipProps
257
263
  });
258
264
  };
@@ -329,7 +335,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
329
335
  node: value,
330
336
  value: value,
331
337
  currentValue: value || '-',
332
- originalDiffTip: originalDiffTip,
338
+ originalDiffTip: _originalDiffTip,
333
339
  toolTipProps: toolTipProps
334
340
  }), suffixNode(value, record, index)]
335
341
  });
@@ -352,7 +358,7 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
352
358
  node: node,
353
359
  value: value,
354
360
  currentValue: value || '-',
355
- originalDiffTip: originalDiffTip,
361
+ originalDiffTip: _originalDiffTip,
356
362
  toolTipProps: toolTipProps
357
363
  });
358
364
  };
@@ -81,7 +81,7 @@ var DndWrapper = function DndWrapper(_ref2) {
81
81
  onDragStartGuard = _ref2.onDragStartGuard,
82
82
  onDragEndGuard = _ref2.onDragEndGuard;
83
83
  var onDragStart = /*#__PURE__*/function () {
84
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref3) {
84
+ var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref3) {
85
85
  var active, _transformedValue, activeObject;
86
86
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
87
87
  while (1) switch (_context.prev = _context.next) {
@@ -112,7 +112,7 @@ var DndWrapper = function DndWrapper(_ref2) {
112
112
  };
113
113
  }();
114
114
  var onDragEnd = /*#__PURE__*/function () {
115
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
115
+ var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
116
116
  var active, over, transformedValue, activeObject, overObject, activeLevel, activeParentId, overLevel, overParentId, nextDataSource, _flatTree, activeIndex, overIndex, nextValue;
117
117
  return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
118
118
  while (1) switch (_context2.prev = _context2.next) {
@@ -283,7 +283,7 @@ function useAntdTable(service, options, useRequestOptions) {
283
283
  }
284
284
  };
285
285
  var handleRefresh = /*#__PURE__*/function () {
286
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
286
+ var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
287
287
  var res;
288
288
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
289
289
  while (1) switch (_context.prev = _context.next) {
@@ -395,7 +395,7 @@ function useAntdTable(service, options, useRequestOptions) {
395
395
  total: total
396
396
  }),
397
397
  onSelect: function () {
398
- var _onSelect = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(changeableRowKeys) {
398
+ var _onSelect = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(changeableRowKeys) {
399
399
  return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
400
400
  while (1) switch (_context2.prev = _context2.next) {
401
401
  case 0:
@@ -419,7 +419,7 @@ function useAntdTable(service, options, useRequestOptions) {
419
419
  key: 'uncheckAll',
420
420
  text: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable4 = _locale.default.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
421
421
  onSelect: function () {
422
- var _onSelect2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
422
+ var _onSelect2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
423
423
  return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
424
424
  while (1) switch (_context3.prev = _context3.next) {
425
425
  case 0: