@zat-design/sisyphus-react 3.4.2 → 3.4.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 (204) hide show
  1. package/dist/index.esm.css +286 -240
  2. package/dist/less.esm.css +5022 -0
  3. package/dist/less.esm.js +3 -0
  4. package/es/ProConfigProvider/index.js +2 -1
  5. package/es/ProEditLabel/style/index.less +1 -1
  6. package/es/ProEditTable/components/RenderField/index.js +28 -20
  7. package/es/ProEditTable/index.js +3 -3
  8. package/es/ProEditTable/propsType.d.ts +1 -1
  9. package/es/ProEditTable/style/index.less +1 -1
  10. package/es/ProEditTable/utils/config.js +5 -5
  11. package/es/ProEditTable/utils/index.js +67 -30
  12. package/es/ProEditTable/utils/tools.js +3 -1
  13. package/es/ProEnum/components/Group.d.ts +2 -0
  14. package/es/ProEnum/components/Group.js +26 -8
  15. package/es/ProEnum/index.js +4 -3
  16. package/es/ProEnum/style/index.less +12 -3
  17. package/es/ProForm/components/base/DatePicker/index.js +2 -2
  18. package/es/ProForm/components/combination/FormList/index.js +6 -3
  19. package/es/ProForm/components/combination/FormList/utils.d.ts +2 -1
  20. package/es/ProForm/components/combination/FormList/utils.js +5 -3
  21. package/es/ProForm/components/combination/Group/index.js +28 -15
  22. package/es/ProForm/components/combination/Group/propsType.d.ts +6 -0
  23. package/es/ProForm/components/combination/Group/style/index.less +4 -4
  24. package/es/ProForm/components/combination/Group/utils.d.ts +2 -0
  25. package/es/ProForm/components/combination/Group/utils.js +10 -0
  26. package/es/ProForm/components/combination/ProTimeLimit/index.js +8 -2
  27. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
  28. package/es/ProForm/components/index.d.ts +0 -1
  29. package/es/ProForm/components/index.js +1 -1
  30. package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
  31. package/es/ProForm/components/render/Render.js +21 -13
  32. package/es/ProForm/components/render/RenderFields.d.ts +2 -1
  33. package/es/ProForm/components/render/RenderFields.js +7 -3
  34. package/es/ProForm/components/render/propsType.d.ts +1 -4
  35. package/es/ProForm/index.js +8 -6
  36. package/es/ProForm/propsType.d.ts +5 -1
  37. package/es/ProForm/style/index.less +17 -13
  38. package/es/ProForm/utils/{contrastOriginal.d.ts → diffOriginal.d.ts} +2 -1
  39. package/es/ProForm/utils/diffOriginal.js +61 -0
  40. package/es/ProForm/utils/index.d.ts +1 -1
  41. package/es/ProForm/utils/index.js +1 -1
  42. package/es/ProForm/utils/transformNames.d.ts +1 -1
  43. package/es/ProForm/utils/transformNames.js +11 -4
  44. package/es/ProForm/utils/transformValue.js +2 -2
  45. package/es/ProForm/utils/useChanged.js +4 -3
  46. package/es/ProForm/utils/useListChanged.d.ts +1 -1
  47. package/es/ProForm/utils/useListChanged.js +5 -3
  48. package/es/ProForm/utils/valueType.d.ts +10 -5
  49. package/es/ProForm/utils/valueType.js +20 -10
  50. package/es/ProIcon/config/index.d.ts +2 -1
  51. package/es/ProIcon/config/index.js +191 -133
  52. package/es/ProIcon/index.d.ts +0 -1
  53. package/es/ProIcon/index.js +21 -36
  54. package/es/ProIcon/propsTypes.d.ts +2 -1
  55. package/es/ProLayout/components/Layout/Header/style/index.less +1 -1
  56. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +58 -55
  57. package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +25 -20
  58. package/es/ProLayout/components/Layout/Menu/style/index.less +52 -56
  59. package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +5 -0
  60. package/es/ProLayout/components/ProCollapse/index.js +22 -3
  61. package/es/ProLayout/components/ProCollapse/style/index.less +29 -11
  62. package/es/ProLayout/components/ProFooter/index.js +1 -1
  63. package/es/ProLayout/components/ProFooter/style/index.less +1 -1
  64. package/es/ProLayout/components/ProHeader/style/index.less +6 -5
  65. package/es/ProLayout/style/index.less +176 -88
  66. package/es/ProStep/components/Item/index.js +2 -1
  67. package/es/ProStep/style/index.less +71 -70
  68. package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
  69. package/es/ProTable/components/RenderColumn/index.js +3 -3
  70. package/es/ProTable/propsType.d.ts +1 -1
  71. package/es/ProTable/style/index.less +2 -2
  72. package/es/ProTable/utils.js +9 -9
  73. package/es/ProTabs/style/index.less +3 -1
  74. package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  75. package/es/ProThemeTools/component/PrdTools/index.js +2 -2
  76. package/es/ProThemeTools/component/PrdTools/style/index.less +1 -1
  77. package/es/ProThemeTools/index.js +21 -28
  78. package/es/ProThemeTools/propsType.d.ts +1 -1
  79. package/es/ProThemeTools/style/index.less +25 -8
  80. package/es/{ProTreeSelect → ProTree/components/ProTreeSelect}/index.js +7 -11
  81. package/es/{ProTreeSelect → ProTree/components/ProTreeSelect}/propsType.d.ts +1 -1
  82. package/es/ProTree/index.js +1 -1
  83. package/es/ProTreeModal/style/index.less +2 -2
  84. package/es/ProUpload/style/fileItem.less +2 -2
  85. package/es/ProUpload/style/index.less +2 -2
  86. package/es/assets/catalog.svg +30 -1
  87. package/es/assets/fold.svg +27 -0
  88. package/es/assets/setting.svg +14 -0
  89. package/es/locale/en_US.d.ts +3 -0
  90. package/es/locale/en_US.js +3 -0
  91. package/es/locale/zh_CN.d.ts +3 -0
  92. package/es/locale/zh_CN.js +3 -0
  93. package/es/style/components.less +0 -1
  94. package/es/style/less.less +2 -0
  95. package/es/style/theme/antd.less +1 -2
  96. package/es/style/theme/index.less +2 -2
  97. package/es/style/theme/tokens.less +2 -2
  98. package/es/tokens.js +2 -2
  99. package/lib/ProConfigProvider/index.js +2 -1
  100. package/lib/ProEditLabel/style/index.less +1 -1
  101. package/lib/ProEditTable/components/RenderField/index.js +27 -19
  102. package/lib/ProEditTable/index.js +3 -3
  103. package/lib/ProEditTable/propsType.d.ts +1 -1
  104. package/lib/ProEditTable/style/index.less +1 -1
  105. package/lib/ProEditTable/utils/config.js +5 -5
  106. package/lib/ProEditTable/utils/index.js +67 -30
  107. package/lib/ProEditTable/utils/tools.js +3 -1
  108. package/lib/ProEnum/components/Group.d.ts +2 -0
  109. package/lib/ProEnum/components/Group.js +26 -8
  110. package/lib/ProEnum/index.js +4 -3
  111. package/lib/ProEnum/style/index.less +12 -3
  112. package/lib/ProForm/components/base/DatePicker/index.js +1 -1
  113. package/lib/ProForm/components/combination/FormList/index.js +6 -3
  114. package/lib/ProForm/components/combination/FormList/utils.d.ts +2 -1
  115. package/lib/ProForm/components/combination/FormList/utils.js +5 -3
  116. package/lib/ProForm/components/combination/Group/index.js +25 -12
  117. package/lib/ProForm/components/combination/Group/propsType.d.ts +6 -0
  118. package/lib/ProForm/components/combination/Group/style/index.less +4 -4
  119. package/lib/ProForm/components/combination/Group/utils.d.ts +2 -0
  120. package/lib/ProForm/components/combination/Group/utils.js +11 -1
  121. package/lib/ProForm/components/combination/ProTimeLimit/index.js +7 -1
  122. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
  123. package/lib/ProForm/components/index.d.ts +0 -1
  124. package/lib/ProForm/components/index.js +0 -7
  125. package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
  126. package/lib/ProForm/components/render/Render.js +21 -13
  127. package/lib/ProForm/components/render/RenderFields.d.ts +2 -1
  128. package/lib/ProForm/components/render/RenderFields.js +7 -3
  129. package/lib/ProForm/components/render/propsType.d.ts +1 -4
  130. package/lib/ProForm/index.js +7 -5
  131. package/lib/ProForm/propsType.d.ts +5 -1
  132. package/lib/ProForm/style/index.less +17 -13
  133. package/lib/ProForm/utils/{contrastOriginal.d.ts → diffOriginal.d.ts} +2 -1
  134. package/lib/ProForm/utils/diffOriginal.js +68 -0
  135. package/lib/ProForm/utils/index.d.ts +1 -1
  136. package/lib/ProForm/utils/index.js +2 -2
  137. package/lib/ProForm/utils/transformNames.d.ts +1 -1
  138. package/lib/ProForm/utils/transformNames.js +10 -3
  139. package/lib/ProForm/utils/transformValue.js +1 -1
  140. package/lib/ProForm/utils/useChanged.js +4 -3
  141. package/lib/ProForm/utils/useListChanged.d.ts +1 -1
  142. package/lib/ProForm/utils/useListChanged.js +5 -3
  143. package/lib/ProForm/utils/valueType.d.ts +10 -5
  144. package/lib/ProForm/utils/valueType.js +20 -10
  145. package/lib/ProIcon/config/index.d.ts +2 -1
  146. package/lib/ProIcon/config/index.js +191 -133
  147. package/lib/ProIcon/index.d.ts +0 -1
  148. package/lib/ProIcon/index.js +21 -37
  149. package/lib/ProIcon/propsTypes.d.ts +2 -1
  150. package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
  151. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +58 -55
  152. package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +25 -20
  153. package/lib/ProLayout/components/Layout/Menu/style/index.less +52 -56
  154. package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +5 -0
  155. package/lib/ProLayout/components/ProCollapse/index.js +20 -3
  156. package/lib/ProLayout/components/ProCollapse/style/index.less +29 -11
  157. package/lib/ProLayout/components/ProFooter/index.js +1 -1
  158. package/lib/ProLayout/components/ProFooter/style/index.less +1 -1
  159. package/lib/ProLayout/components/ProHeader/style/index.less +6 -5
  160. package/lib/ProLayout/style/index.less +176 -88
  161. package/lib/ProStep/components/Item/index.js +2 -1
  162. package/lib/ProStep/style/index.less +71 -70
  163. package/lib/ProTable/components/RenderColumn/index.d.ts +1 -1
  164. package/lib/ProTable/components/RenderColumn/index.js +3 -3
  165. package/lib/ProTable/propsType.d.ts +1 -1
  166. package/lib/ProTable/style/index.less +2 -2
  167. package/lib/ProTable/utils.js +9 -9
  168. package/lib/ProTabs/style/index.less +3 -1
  169. package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  170. package/lib/ProThemeTools/component/PrdTools/index.js +2 -2
  171. package/lib/ProThemeTools/component/PrdTools/style/index.less +1 -1
  172. package/lib/ProThemeTools/index.js +19 -27
  173. package/lib/ProThemeTools/propsType.d.ts +1 -1
  174. package/lib/ProThemeTools/style/index.less +25 -8
  175. package/lib/{ProTreeSelect → ProTree/components/ProTreeSelect}/index.js +7 -11
  176. package/lib/{ProTreeSelect → ProTree/components/ProTreeSelect}/propsType.d.ts +1 -1
  177. package/lib/ProTree/index.js +1 -1
  178. package/lib/ProTreeModal/style/index.less +2 -2
  179. package/lib/ProUpload/style/fileItem.less +2 -2
  180. package/lib/ProUpload/style/index.less +2 -2
  181. package/lib/assets/catalog.svg +30 -1
  182. package/lib/assets/fold.svg +27 -0
  183. package/lib/assets/setting.svg +14 -0
  184. package/lib/locale/en_US.d.ts +3 -0
  185. package/lib/locale/en_US.js +3 -0
  186. package/lib/locale/zh_CN.d.ts +3 -0
  187. package/lib/locale/zh_CN.js +3 -0
  188. package/lib/style/components.less +0 -1
  189. package/lib/style/less.less +2 -0
  190. package/lib/style/theme/antd.less +1 -2
  191. package/lib/style/theme/index.less +2 -2
  192. package/lib/style/theme/tokens.less +2 -2
  193. package/lib/tokens.js +2 -2
  194. package/package.json +1 -1
  195. package/es/ProForm/utils/contrastOriginal.js +0 -24
  196. package/es/ProIcon/symbolIcon.js +0 -43
  197. package/lib/ProForm/utils/contrastOriginal.js +0 -30
  198. package/lib/ProIcon/symbolIcon.js +0 -45
  199. /package/es/{ProTreeSelect → ProTree/components/ProTreeSelect}/index.d.ts +0 -0
  200. /package/es/{ProTreeSelect → ProTree/components/ProTreeSelect}/propsType.js +0 -0
  201. /package/es/{ProTreeSelect → ProTree/components/ProTreeSelect}/style/index.less +0 -0
  202. /package/lib/{ProTreeSelect → ProTree/components/ProTreeSelect}/index.d.ts +0 -0
  203. /package/lib/{ProTreeSelect → ProTree/components/ProTreeSelect}/propsType.js +0 -0
  204. /package/lib/{ProTreeSelect → ProTree/components/ProTreeSelect}/style/index.less +0 -0
@@ -0,0 +1,3 @@
1
+ var undefined$1 = undefined;
2
+
3
+ export default undefined$1;
@@ -18,7 +18,8 @@ var initialState = {
18
18
  mode: 'icon',
19
19
  mapList: [{
20
20
  type: 'view',
21
- text: '查看'
21
+ 'text-cn': '查看',
22
+ 'text-en': 'view'
22
23
  }]
23
24
  }
24
25
  };
@@ -39,7 +39,7 @@
39
39
 
40
40
  &:active {
41
41
  background : #E3E8F0;
42
- border-radius: var(--zaui-border-radius-card, 2px);
42
+ border-radius: var(--zaui-border-radius-card, 4px);
43
43
  }
44
44
  }
45
45
 
@@ -17,7 +17,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
17
17
  /* eslint-disable prefer-const */
18
18
  import React, { useCallback, useEffect } from 'react';
19
19
  import classNames from 'classnames';
20
- import { cloneDeep, isEqual, debounce, omit, isFunction, isString } from 'lodash';
20
+ import { cloneDeep, isEqual, debounce, omit, isFunction } from 'lodash';
21
21
  import valueTypeMap from '../../../ProForm/utils/valueType';
22
22
  import transformMap from '../../utils/transform';
23
23
  import { getNamePath, difference } from '../../utils/tools';
@@ -28,9 +28,8 @@ import { FieldProvider } from '../../../ProForm/utils/useFieldProps';
28
28
  import { useListChanged } from '../../../ProForm/utils/useListChanged';
29
29
  import useRules from '../../../ProForm/utils/useRules';
30
30
  import { isSelect } from '../../../ProForm/utils';
31
- import locale from '../../../locale';
32
31
  var RenderField = function RenderField(_ref) {
33
- var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4;
32
+ var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _TargetComponent4, _componentProps;
34
33
  var value = _ref.text,
35
34
  record = _ref.record,
36
35
  index = _ref.index,
@@ -73,7 +72,7 @@ var RenderField = function RenderField(_ref) {
73
72
  virtualKey = config.virtualKey,
74
73
  viewEmpty = config.viewEmpty,
75
74
  originalValues = config.originalValues,
76
- originalTip = config.originalTip;
75
+ originalDiffTip = config.originalDiffTip;
77
76
  var _fieldProps = fieldProps || formItemProps || {};
78
77
  var _rules = rules || [];
79
78
  var _required = required;
@@ -141,7 +140,7 @@ var RenderField = function RenderField(_ref) {
141
140
  var formItemChildProps = _objectSpread({}, _fieldProps);
142
141
  // 允许formItem的属性放在column最外层
143
142
  var _formItemProps = _objectSpread(_objectSpread({}, resetProps), internalRule);
144
- if (['Switch', 'Checkbox'].includes(type)) {
143
+ if (['Switch', 'SwitchCheckbox'].includes(type)) {
145
144
  _formItemProps.valuePropName = 'checked';
146
145
  valueType = 'switch';
147
146
  }
@@ -211,7 +210,7 @@ var RenderField = function RenderField(_ref) {
211
210
  if (valueType) {
212
211
  transform = valueTypeTransform();
213
212
  }
214
- return transformNames(_objectSpread(_objectSpread({}, _formItemProps), transform), form, names, namesStr);
213
+ return transformNames(_objectSpread(_objectSpread({}, _formItemProps), transform), form, names, namesStr, type);
215
214
  };
216
215
  if (!_editRender && typeof type === 'string') {
217
216
  var _componentMap$type;
@@ -241,8 +240,6 @@ var RenderField = function RenderField(_ref) {
241
240
  TargetComponent = viewRender;
242
241
  }
243
242
  }
244
- var defaultPlaceholder = ['Select', 'EnumSelect', 'DatePicker', 'RangePicker', 'Cascader', 'ProSelect', 'ProEnum', 'ProTimeLimit'].includes(type) ? "".concat(locale.ProEditTable.select).concat(isString(label) ? label || title : '') : "".concat(locale.ProEditTable.enter).concat(isString(label) ? label || title : '');
245
- var _placeholder = (_formItemChildProps$p = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.placeholder) !== null && _formItemChildProps$p !== void 0 ? _formItemChildProps$p : defaultPlaceholder;
246
243
  var onChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onChange;
247
244
  var onFieldChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onFieldChange;
248
245
  var onBlur = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onBlur;
@@ -303,7 +300,7 @@ var RenderField = function RenderField(_ref) {
303
300
  }
304
301
  _args = [].concat(args);
305
302
  rowPath = [].concat(_toConsumableArray(namePath), [index]);
306
- row = form.getFieldValue(rowPath);
303
+ row = type === 'Group' ? _args[1] : form.getFieldValue(rowPath, true);
307
304
  orgRow = cloneDeep(row);
308
305
  if (!onFieldChange) {
309
306
  _context.next = 18;
@@ -348,14 +345,16 @@ var RenderField = function RenderField(_ref) {
348
345
  return onChange.apply(void 0, _toConsumableArray(_args));
349
346
  case 27:
350
347
  // 判断属性是否变动
351
- form.setFieldValue(rowPath, row);
348
+ type !== 'Group' && form.setFieldValue(rowPath, row);
352
349
  if (!isEqual(orgRow, row)) {
353
350
  diff = difference(row, orgRow) || {};
354
351
  validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
355
352
  return [].concat(_toConsumableArray(rowPath), [key]);
356
353
  });
357
354
  if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
358
- form.validateFields(validateFieldKeys);
355
+ setTimeout(function () {
356
+ form.validateFields(validateFieldKeys);
357
+ }, 100);
359
358
  }
360
359
  }
361
360
  setState({
@@ -468,12 +467,13 @@ var RenderField = function RenderField(_ref) {
468
467
  originalValue = _useListChanged2[1];
469
468
  var componentProps = _objectSpread(_objectSpread(_objectSpread({
470
469
  form: form,
471
- name: cellName,
472
- placeholder: _placeholder
470
+ name: cellName
473
471
  }, _fieldProps), (_TargetComponent4 = TargetComponent) === null || _TargetComponent4 === void 0 ? void 0 : _TargetComponent4.props), {}, {
472
+ namePath: [].concat(_toConsumableArray(namePath), [index]),
474
473
  disabled: _disabled,
475
474
  onChange: _onchange,
476
475
  onBlur: _onblur,
476
+ index: index,
477
477
  otherProps: {
478
478
  form: form,
479
479
  names: names,
@@ -483,11 +483,16 @@ var RenderField = function RenderField(_ref) {
483
483
  isView: isView
484
484
  }
485
485
  });
486
+ if (type === 'Group') {
487
+ componentProps.onFieldChange = _onchange;
488
+ } else {
489
+ componentProps = omit(componentProps, ['onFieldChange', 'namePath', 'index']);
490
+ }
486
491
  // 单元格编辑时,设置各个单元格disabled属性
487
492
  if (isCell) {
488
493
  record["".concat(dataIndex, "-Disabled")] = _disabled;
489
494
  }
490
- if (['Switch', 'Checkbox'].includes(type)) {
495
+ if (['Switch', 'SwitchCheckbox'].includes(type)) {
491
496
  _formItemProps.valuePropName = 'checked';
492
497
  }
493
498
  useEffect(function () {
@@ -507,12 +512,12 @@ var RenderField = function RenderField(_ref) {
507
512
  delete _formItemProps.rules;
508
513
  }
509
514
  var _className = classNames(_defineProperty(_defineProperty({}, className, className), 'pro-form-item-changed', changed));
510
- var originalTitle = originalTip ? _jsxs(_Space, {
511
- children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(TargetComponent) ? ( /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread(_objectSpread({}, omit(componentProps, ['onFieldChange'])), {}, {
515
+ var originalTitle = originalDiffTip ? _jsxs(_Space, {
516
+ children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(TargetComponent) ? ( /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread(_objectSpread({}, componentProps), {}, {
512
517
  isView: true,
513
518
  value: originalValue,
514
519
  checked: type === 'Switch' ? originalValue : undefined
515
- }))) : _jsx(TargetComponent, _objectSpread(_objectSpread({}, omit(componentProps, ['onFieldChange'])), {}, {
520
+ }))) : _jsx(TargetComponent, _objectSpread(_objectSpread({}, componentProps), {}, {
516
521
  isView: true,
517
522
  value: originalValue,
518
523
  checked: type === 'Switch' ? originalValue : undefined
@@ -523,15 +528,18 @@ var RenderField = function RenderField(_ref) {
523
528
  }, omit(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
524
529
  className: _className,
525
530
  name: cellName,
526
- children: /*#__PURE__*/React.isValidElement(TargetComponent) ? ( /*#__PURE__*/React.cloneElement(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange'])))) : _jsx(TargetComponent, _objectSpread({}, omit(componentProps, ['onFieldChange'])))
531
+ children: /*#__PURE__*/React.isValidElement(TargetComponent) ? ( /*#__PURE__*/React.cloneElement(TargetComponent, componentProps)) : _jsx(TargetComponent, _objectSpread({}, componentProps))
527
532
  })) : _jsx(Container, {
528
533
  viewEmpty: viewEmpty
529
534
  });
530
535
  return _jsx(FieldProvider, {
531
- value: componentProps === null || componentProps === void 0 ? void 0 : componentProps.otherProps,
532
- children: !originalTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : _jsx(_Tooltip, {
536
+ value: (_componentProps = componentProps) === null || _componentProps === void 0 ? void 0 : _componentProps.otherProps,
537
+ children: !originalDiffTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : _jsx(_Tooltip, {
533
538
  title: originalTitle,
534
539
  open: changed ? undefined : false,
540
+ getPopupContainer: function getPopupContainer(target) {
541
+ return target.parentElement;
542
+ },
535
543
  children: FormItem
536
544
  })
537
545
  });
@@ -10,7 +10,7 @@ import _ConfigProvider from "antd/es/config-provider";
10
10
  import "antd/es/form/style";
11
11
  import _Form from "antd/es/form";
12
12
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
- var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip", "rowKey"];
13
+ var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalDiffTip", "rowKey"];
14
14
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
16
16
  import { get, isArray } from 'lodash';
@@ -49,7 +49,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
49
49
  headerRender = _ref.headerRender,
50
50
  pagination = _ref.pagination,
51
51
  originalValues = _ref.originalValues,
52
- originalTip = _ref.originalTip,
52
+ originalDiffTip = _ref.originalDiffTip,
53
53
  rowKey = _ref.rowKey,
54
54
  resetProps = _objectWithoutProperties(_ref, _excluded);
55
55
  // 上下文form
@@ -151,7 +151,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
151
151
  tableLength: value === null || value === void 0 ? void 0 : value.length,
152
152
  page: page,
153
153
  originalValues: originalValues,
154
- originalTip: originalTip,
154
+ originalDiffTip: originalDiffTip,
155
155
  prefixCls: prefixCls
156
156
  };
157
157
  // 编辑行设置下样式
@@ -130,7 +130,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
130
130
  * @description 原始数据源,是否tooltip显示
131
131
  * @default -
132
132
  */
133
- originalTip?: boolean;
133
+ originalDiffTip?: boolean;
134
134
  /**
135
135
  * @description 可编辑表格的类型,单行、多行、单元格编辑
136
136
  * @default false
@@ -55,7 +55,7 @@
55
55
 
56
56
  &:hover {
57
57
  border : 1px solid #DEE0E3;
58
- border-radius: var(--zaui-border-radius, 4px);
58
+ border-radius: var(--zaui-border-radius, 8px);
59
59
  text-indent : 5px;
60
60
  }
61
61
  }
@@ -190,11 +190,6 @@ export var actions = {
190
190
  addData.isEditing = true;
191
191
  }
192
192
  insertType === 'before' ? nextData.unshift(addData) : nextData.push(addData);
193
- form.setFieldValue(name, nextData);
194
- (_tableRef$current$que = tableRef.current.querySelector(".".concat(prefixCls, "-table-body"))) === null || _tableRef$current$que === void 0 ? void 0 : (_tableRef$current$que2 = _tableRef$current$que.scrollTo) === null || _tableRef$current$que2 === void 0 ? void 0 : _tableRef$current$que2.call(_tableRef$current$que, {
195
- top: 10000,
196
- behavior: 'smooth'
197
- });
198
193
  // 当单选情况下,存储正在编辑值
199
194
  if (virtualKey) {
200
195
  nextEditingKeys = _toConsumableArray(editingKeys); // 开启编辑状态
@@ -204,6 +199,11 @@ export var actions = {
204
199
  editingKeys: nextEditingKeys
205
200
  });
206
201
  }
202
+ form.setFieldValue(name, nextData);
203
+ (_tableRef$current$que = tableRef.current.querySelector(".".concat(prefixCls, "-table-body"))) === null || _tableRef$current$que === void 0 ? void 0 : (_tableRef$current$que2 = _tableRef$current$que.scrollTo) === null || _tableRef$current$que2 === void 0 ? void 0 : _tableRef$current$que2.call(_tableRef$current$que, {
204
+ top: insertType === 'before' ? -10000 : 10000,
205
+ behavior: 'smooth'
206
+ });
207
207
  _context2.next = 14;
208
208
  return form.validateFields([name]);
209
209
  case 14:
@@ -85,40 +85,77 @@ var getActionColumn = function getActionColumn(config) {
85
85
  index = tools.calc(firstIndex, '+', index);
86
86
  rowName = [].concat(_toConsumableArray(virtualRowName), [index]);
87
87
  if (!(type === 'save')) {
88
- _context.next = 5;
88
+ _context.next = 12;
89
89
  break;
90
90
  }
91
- _context.next = 5;
91
+ _context.prev = 3;
92
+ _context.next = 6;
92
93
  return customValidate(validateKeys, form, rowName);
93
- case 5:
94
+ case 6:
95
+ _context.next = 12;
96
+ break;
97
+ case 8:
98
+ _context.prev = 8;
99
+ _context.t0 = _context["catch"](3);
100
+ setTimeout(function () {
101
+ var errorDom = document.querySelector('.ant-form-item-has-error');
102
+ if (errorDom) {
103
+ var tableBody = errorDom.closest('.ant-table-content') || errorDom.closest('.ant-table-body');
104
+ var tableCell = errorDom.closest('.ant-table-cell');
105
+ if (tableBody && tableCell) {
106
+ var previousSibling = tableCell.previousElementSibling;
107
+ var childOffsetLeft = 0;
108
+ var childFixedLeft = 0;
109
+ while (previousSibling) {
110
+ if (previousSibling.nodeType === 1) {
111
+ var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
112
+ var _ref2 = previousSibling.getBoundingClientRect() || {},
113
+ _ref2$width = _ref2.width,
114
+ width = _ref2$width === void 0 ? 0 : _ref2$width;
115
+ childOffsetLeft += width;
116
+ if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 = (_previousSibling$clas3 = _previousSibling$clas).contains) === null || _previousSibling$clas2 === void 0 ? void 0 : _previousSibling$clas2.call(_previousSibling$clas3, 'ant-table-cell-fix-left')) {
117
+ childFixedLeft += width;
118
+ }
119
+ }
120
+ previousSibling = previousSibling.previousElementSibling;
121
+ }
122
+ tableBody.scrollTo({
123
+ left: childOffsetLeft - childFixedLeft,
124
+ behavior: 'smooth'
125
+ });
126
+ }
127
+ }
128
+ }, 0);
129
+ return _context.abrupt("return", Promise.reject(_context.t0));
130
+ case 12:
94
131
  // 编辑状态使用自定义form值,非编辑状态直接使用行数据
95
132
  _record = (_form$getFieldValue = form.getFieldValue(rowName)) !== null && _form$getFieldValue !== void 0 ? _form$getFieldValue : record; // 新增事件可以设置初始默认值,当做函数的出参导出
96
133
  onEvent = onClick || onHandle;
97
- _context.next = 9;
134
+ _context.next = 16;
98
135
  return onEvent === null || onEvent === void 0 ? void 0 : onEvent(_record, index, {
99
136
  form: form,
100
137
  namePath: virtualRowName
101
138
  });
102
- case 9:
103
- _context.t1 = _yield$onEvent = _context.sent;
104
- _context.t0 = _context.t1 !== null;
105
- if (!_context.t0) {
106
- _context.next = 13;
139
+ case 16:
140
+ _context.t2 = _yield$onEvent = _context.sent;
141
+ _context.t1 = _context.t2 !== null;
142
+ if (!_context.t1) {
143
+ _context.next = 20;
107
144
  break;
108
145
  }
109
- _context.t0 = _yield$onEvent !== void 0;
110
- case 13:
111
- if (!_context.t0) {
112
- _context.next = 17;
146
+ _context.t1 = _yield$onEvent !== void 0;
147
+ case 20:
148
+ if (!_context.t1) {
149
+ _context.next = 24;
113
150
  break;
114
151
  }
115
- _context.t2 = _yield$onEvent;
116
- _context.next = 18;
152
+ _context.t3 = _yield$onEvent;
153
+ _context.next = 25;
117
154
  break;
118
- case 17:
119
- _context.t2 = true;
120
- case 18:
121
- result = _context.t2;
155
+ case 24:
156
+ _context.t3 = true;
157
+ case 25:
158
+ result = _context.t3;
122
159
  if (result && type !== 'custom') {
123
160
  actions[type](_objectSpread(_objectSpread({}, config), {}, {
124
161
  rowName: [].concat(_toConsumableArray(name), [index]),
@@ -128,11 +165,11 @@ var getActionColumn = function getActionColumn(config) {
128
165
  validateKeys: validateKeys
129
166
  }));
130
167
  }
131
- case 20:
168
+ case 27:
132
169
  case "end":
133
170
  return _context.stop();
134
171
  }
135
- }, _callee);
172
+ }, _callee, null, [[3, 8]]);
136
173
  }));
137
174
  return function (_x, _x2) {
138
175
  return _ref.apply(this, arguments);
@@ -210,10 +247,10 @@ export var transformColumns = function transformColumns() {
210
247
  if (typeof columnTitle === 'string') {
211
248
  item.originTitle = columnTitle;
212
249
  if (tooltip) {
213
- var _ref2 = tooltip || {},
214
- tooltipTitle = _ref2.title,
215
- icon = _ref2.icon,
216
- resetProps = _objectWithoutProperties(_ref2, _excluded2);
250
+ var _ref3 = tooltip || {},
251
+ tooltipTitle = _ref3.title,
252
+ icon = _ref3.icon,
253
+ resetProps = _objectWithoutProperties(_ref3, _excluded2);
217
254
  item.title = _jsxs("span", {
218
255
  className: "pro-edit-table-title pro-edit-table-tooltip",
219
256
  children: [before, columnTitle, _jsx(_Tooltip, _objectSpread(_objectSpread({
@@ -280,7 +317,7 @@ export var transformColumns = function transformColumns() {
280
317
  (_item$fieldProps3 = item.fieldProps) === null || _item$fieldProps3 === void 0 ? true : delete _item$fieldProps3.useRequest;
281
318
  }
282
319
  var _render = function _render(text, record, index) {
283
- var isEditing = !virtualKey || editingKeys.includes(record.rowKey);
320
+ var isEditing = !virtualKey || editingKeys.includes(record.rowKey) || record.addFlag;
284
321
  var namePath = isArray(name) ? name : [name];
285
322
  if (virtualKey && editingKeys.includes(record.rowKey)) {
286
323
  namePath = getNamePath(name, virtualKey);
@@ -365,13 +402,13 @@ export var transformColumns = function transformColumns() {
365
402
  // cacheMap 用来存储缓存值,若有值后不再请求
366
403
  if (JSON.stringify(cacheMap.current) === '{}') {
367
404
  Promise.all(Object.entries(_cacheMap).map( /*#__PURE__*/function () {
368
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
369
- var _item, key, value, _ref4, service, option;
405
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
406
+ var _item, key, value, _ref5, service, option;
370
407
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
371
408
  while (1) switch (_context2.prev = _context2.next) {
372
409
  case 0:
373
410
  _item = _slicedToArray(item, 2), key = _item[0], value = _item[1];
374
- _ref4 = (value === null || value === void 0 ? void 0 : value.useRequest) || {}, service = _ref4.service, option = _ref4.option;
411
+ _ref5 = (value === null || value === void 0 ? void 0 : value.useRequest) || {}, service = _ref5.service, option = _ref5.option;
375
412
  if (!service) {
376
413
  _context2.next = 8;
377
414
  break;
@@ -391,7 +428,7 @@ export var transformColumns = function transformColumns() {
391
428
  }, _callee2);
392
429
  }));
393
430
  return function (_x3) {
394
- return _ref3.apply(this, arguments);
431
+ return _ref4.apply(this, arguments);
395
432
  };
396
433
  }())).then(function (res) {
397
434
  res.forEach(function (item) {
@@ -6,7 +6,9 @@ export var getRandom = function getRandom() {
6
6
  export var difference = function difference(object, base) {
7
7
  var changes = function changes(object, base) {
8
8
  return transform(object, function (result, value, key) {
9
- if (!isEqual(value, base[key])) {
9
+ if (key.indexOf('-') > -1) {
10
+ result[key] = true;
11
+ } else if (!isEqual(value, base[key])) {
10
12
  result[key] = isObject(value) && isObject(base[key]) ? changes(value, base[key]) : value;
11
13
  }
12
14
  });
@@ -2,6 +2,8 @@ import { ProEnum } from '../propsType';
2
2
  interface Props extends Pick<ProEnum, 'value' | 'onChange' | 'dataSource'> {
3
3
  fieldValue: string;
4
4
  fieldLabel: string;
5
+ disabled?: boolean;
6
+ allowClear?: boolean;
5
7
  }
6
8
  declare const Group: (props: Props) => JSX.Element;
7
9
  export default Group;
@@ -8,7 +8,10 @@ var Group = function Group(props) {
8
8
  onChange = props.onChange,
9
9
  dataSource = props.dataSource,
10
10
  fieldValue = props.fieldValue,
11
- fieldLabel = props.fieldLabel;
11
+ fieldLabel = props.fieldLabel,
12
+ disabled = props.disabled,
13
+ _props$allowClear = props.allowClear,
14
+ allowClear = _props$allowClear === void 0 ? true : _props$allowClear;
12
15
  var idx = useRef(-1);
13
16
  var _useSetState = useSetState({
14
17
  checked: ''
@@ -20,13 +23,28 @@ var Group = function Group(props) {
20
23
  setState({
21
24
  checked: value
22
25
  });
23
- }, [value]);
24
- var handleClick = function handleClick(val, index) {
25
- setState({
26
- checked: val
26
+ var index = dataSource.findIndex(function (item) {
27
+ return item[fieldValue] === value;
27
28
  });
28
29
  idx.current = index;
29
- onChange === null || onChange === void 0 ? void 0 : onChange(val);
30
+ }, [value]);
31
+ var handleClick = function handleClick(val, index) {
32
+ if (state.checked === val) {
33
+ if (!allowClear) {
34
+ return false;
35
+ }
36
+ setState({
37
+ checked: ''
38
+ });
39
+ onChange === null || onChange === void 0 ? void 0 : onChange('');
40
+ idx.current = -1;
41
+ } else {
42
+ setState({
43
+ checked: val
44
+ });
45
+ idx.current = index;
46
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
47
+ }
30
48
  };
31
49
  if (dataSource.length === 0) {
32
50
  return _jsx("span", {
@@ -34,11 +52,11 @@ var Group = function Group(props) {
34
52
  });
35
53
  }
36
54
  return _jsx("div", {
37
- className: "pro-enum-group-root",
55
+ className: classNames('pro-enum-group-root', disabled ? 'pro-enum-group-root-disabled' : ''),
38
56
  children: dataSource.map(function (item, index) {
39
57
  return _jsx("div", {
40
58
  onClick: function onClick() {
41
- if (!item.disabled) {
59
+ if (!item.disabled && !disabled) {
42
60
  handleClick(item[fieldValue], index);
43
61
  }
44
62
  },
@@ -41,7 +41,8 @@ var ProEnum = function ProEnum(props) {
41
41
  enumProps = _objectWithoutProperties(props, _excluded);
42
42
  var _ref = otherProps || {},
43
43
  isView = _ref.isView,
44
- viewEmpty = _ref.viewEmpty;
44
+ viewEmpty = _ref.viewEmpty,
45
+ disabled = _ref.disabled;
45
46
  var _ref2 = useProConfig('ProEnum') || {},
46
47
  fieldNames = _ref2.fieldNames,
47
48
  _ref2$clear = _ref2.clear,
@@ -207,13 +208,13 @@ var ProEnum = function ProEnum(props) {
207
208
  dataSource: list
208
209
  });
209
210
  case 'Group':
210
- return _jsx(ProEnumGroup, {
211
+ return _jsx(ProEnumGroup, _objectSpread(_objectSpread({}, enumProps), {}, {
211
212
  value: value,
212
213
  onChange: onChange,
213
214
  fieldLabel: label,
214
215
  fieldValue: fieldValue,
215
216
  dataSource: list
216
- });
217
+ }));
217
218
  default:
218
219
  return null;
219
220
  }
@@ -7,12 +7,17 @@
7
7
  flex-direction: row;
8
8
  flex-wrap: wrap;
9
9
  }
10
+ &-group-root-disabled {
11
+ color: rgba(0, 0, 0, 0.25);
12
+ .pro-enum-group-item{
13
+ cursor: not-allowed !important;
14
+ }
15
+ }
10
16
  &-tag-item {
11
17
  display: flex;
12
18
  align-items: center;
13
19
  justify-content: center;
14
20
  margin-right: var(--zaui-space-size-sm);
15
- margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
16
21
  padding: var(--zaui-space-size-xs) 10px;
17
22
  background-color: #f5f5f5;
18
23
  border-radius: var(--zaui-space-size-xs);
@@ -38,8 +43,7 @@
38
43
  display: flex;
39
44
  align-items: center;
40
45
  justify-content: center;
41
- margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
42
- padding: var(--zaui-space-size-sm) var(--zaui-space-border);
46
+ padding: 6px var(--zaui-space-border);
43
47
  line-height: 18px;
44
48
  background-color: #f1f3f6ff;
45
49
  border: 1px solid transparent;
@@ -72,6 +76,7 @@
72
76
 
73
77
  .pro-enum-group-item-selected {
74
78
  color: var(--zaui-brand);
79
+ background: #fff;
75
80
  border: 1px solid var(--zaui-brand);
76
81
  &::after {
77
82
  background: transparent;
@@ -88,4 +93,8 @@
88
93
  cursor: not-allowed;
89
94
  }
90
95
  }
96
+
97
+ &-group-root-disabled {
98
+ opacity: 0.7;
99
+ }
91
100
  }
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
6
  var _excluded = ["className", "format"];
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
- import { isFunction, isString } from 'lodash';
8
+ import { isFunction, isString, isObject } from 'lodash';
9
9
  import classNames from 'classnames';
10
10
  import moment from 'moment';
11
11
  import { useProConfig } from '../../../../ProConfigProvider';
@@ -30,7 +30,7 @@ var DatePicker = function DatePicker(props) {
30
30
  var viewChildren = null;
31
31
  if (!value) {
32
32
  viewChildren = null;
33
- } else if (typeof format === 'string' && moment.isMoment(value)) {
33
+ } else if (typeof format === 'string' && isObject(value)) {
34
34
  viewChildren = value.format(format);
35
35
  } else if (isFunction(format)) {
36
36
  viewChildren = format(value);
@@ -41,17 +41,20 @@ var FormList = function FormList(props, ref) {
41
41
  // names的name处理
42
42
  var _name = Array.isArray(item === null || item === void 0 ? void 0 : item.names) ? [fieldName, namesPathTransform({
43
43
  names: item === null || item === void 0 ? void 0 : item.names,
44
- prefixNamePath: namePath
44
+ prefixNamePath: namePath,
45
+ type: item.type
45
46
  })] : [fieldName].concat(_toConsumableArray(toArray(item.name)));
46
- return _objectSpread(_objectSpread({}, item), {}, {
47
+ var column = _objectSpread(_objectSpread({}, item), {}, {
47
48
  name: _name,
48
49
  names: (item === null || item === void 0 ? void 0 : item.names) ? item.names.map(function (nameItem) {
49
- return [].concat(_toConsumableArray(namePath), _toConsumableArray(toArray(nameItem)));
50
+ // 传给Group的names会被渲染成真实FormItem 不能传完整name
51
+ return item.type === 'Group' ? [fieldName].concat(_toConsumableArray(toArray(nameItem))) : [].concat(_toConsumableArray(namePath), _toConsumableArray(toArray(nameItem)));
50
52
  }) : item.names,
51
53
  index: fieldName,
52
54
  namePath: namePath,
53
55
  label: mode === 'less' ? undefined : item.label
54
56
  });
57
+ return column;
55
58
  });
56
59
  }, [columns]);
57
60
  useImperativeHandle(ref, function () {
@@ -4,7 +4,8 @@
4
4
  * @param prefixNamePath formList的name前缀
5
5
  * @returns list_0_min-list_0_max
6
6
  */
7
- export declare const namesPathTransform: ({ names, prefixNamePath, }: {
7
+ export declare const namesPathTransform: ({ names, prefixNamePath, type, }: {
8
8
  names: any[];
9
9
  prefixNamePath: any[];
10
+ type: string;
10
11
  }) => string;
@@ -6,12 +6,14 @@
6
6
  */
7
7
  export var namesPathTransform = function namesPathTransform(_ref) {
8
8
  var names = _ref.names,
9
- prefixNamePath = _ref.prefixNamePath;
10
- if (!Array.isArray(names) || !Array.isArray(prefixNamePath)) {
9
+ prefixNamePath = _ref.prefixNamePath,
10
+ type = _ref.type;
11
+ if (!Array.isArray(names) || type !== 'Group' && !Array.isArray(prefixNamePath)) {
11
12
  return '';
12
13
  }
14
+ var _prefixNamePath = type === 'Group' ? '' : prefixNamePath;
13
15
  var newNamePath = names.map(function (val) {
14
- return prefixNamePath.concat(val);
16
+ return _prefixNamePath.concat(val);
15
17
  });
16
18
  return newNamePath === null || newNamePath === void 0 ? void 0 : newNamePath.map(function (name) {
17
19
  return Array.isArray(name) ? name.join('_') : name;