@zat-design/sisyphus-react 3.11.14-beta.9 → 3.12.0-beta.1

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 (231) hide show
  1. package/dist/index.esm.css +4 -0
  2. package/dist/less.esm.css +4 -0
  3. package/es/ProConfigProvider/index.d.ts +4 -4
  4. package/es/ProDrawerForm/components/ProDrawer/index.js +12 -2
  5. package/es/ProDrawerForm/components/ProModal/index.js +12 -2
  6. package/es/ProDrawerForm/propsType.d.ts +1 -1
  7. package/es/ProEditLabel/propsType.d.ts +2 -2
  8. package/es/ProEditTable/components/Summary/index.d.ts +2 -2
  9. package/es/ProEditTable/index.js +12 -8
  10. package/es/ProEditTable/propsType.d.ts +40 -42
  11. package/es/ProEditTable/style/index.less +1 -0
  12. package/es/ProEditTable/utils/index.d.ts +1 -1
  13. package/es/ProEditTable/utils/index.js +6 -4
  14. package/es/ProEditTable/utils/tools.d.ts +57 -22
  15. package/es/ProEditTable/utils/tools.js +47 -21
  16. package/es/ProEnum/hooks/useEnum.d.ts +2 -2
  17. package/es/ProEnum/hooks/useEnum.js +46 -17
  18. package/es/ProEnum/propsType.d.ts +2 -2
  19. package/es/ProEnum/utils/index.d.ts +8 -1
  20. package/es/ProEnum/utils/index.js +9 -2
  21. package/es/ProForm/components/FormFooter/index.d.ts +1 -1
  22. package/es/ProForm/components/base/Checkbox/index.d.ts +1 -1
  23. package/es/ProForm/components/base/Input/index.js +17 -4
  24. package/es/ProForm/components/base/Input/propsType.d.ts +3 -3
  25. package/es/ProForm/components/base/InputNumber/index.d.ts +1 -1
  26. package/es/ProForm/components/base/Radio/index.d.ts +1 -1
  27. package/es/ProForm/components/base/RangePicker/index.d.ts +1 -1
  28. package/es/ProForm/components/base/Select/index.d.ts +1 -1
  29. package/es/ProForm/components/base/Switch/index.d.ts +1 -1
  30. package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -1
  31. package/es/ProForm/components/base/TextArea/index.d.ts +1 -1
  32. package/es/ProForm/components/base/TimePicker/index.d.ts +1 -1
  33. package/es/ProForm/components/combination/Container/propsType.d.ts +3 -3
  34. package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -1
  35. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
  36. package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -2
  37. package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +1 -1
  38. package/es/ProForm/components/combination/FormList/propsType.d.ts +2 -2
  39. package/es/ProForm/components/combination/Group/index.d.ts +1 -1
  40. package/es/ProForm/components/combination/Group/propsType.d.ts +1 -1
  41. package/es/ProForm/components/combination/Group/utils.d.ts +3 -3
  42. package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
  43. package/es/ProForm/components/combination/ProCombination/index.d.ts +1 -1
  44. package/es/ProForm/components/combination/ProCombination/propsType.d.ts +1 -1
  45. package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
  46. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +5 -5
  47. package/es/ProForm/components/combination/ProNumberRange/index.d.ts +2 -2
  48. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -1
  49. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
  50. package/es/ProForm/components/old/EnumSelect/index.d.ts +1 -1
  51. package/es/ProForm/components/old/EnumSelect/interface.d.ts +2 -2
  52. package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
  53. package/es/ProForm/components/old/ProAddress/index.d.ts +1 -1
  54. package/es/ProForm/components/old/ProCertNo/index.d.ts +1 -1
  55. package/es/ProForm/components/old/ProCertValidity/index.d.ts +1 -1
  56. package/es/ProForm/components/old/ProRangeBox/index.d.ts +1 -1
  57. package/es/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  58. package/es/ProForm/components/render/ConfirmWrapper.d.ts +2 -2
  59. package/es/ProForm/components/render/RenderFields.d.ts +3 -3
  60. package/es/ProForm/components/render/propsType.d.ts +37 -41
  61. package/es/ProForm/index.d.ts +1 -1
  62. package/es/ProForm/index.js +3 -1
  63. package/es/ProForm/propsType.d.ts +6 -4
  64. package/es/ProForm/propsType.js +0 -1
  65. package/es/ProForm/utils/transformValue.d.ts +1 -1
  66. package/es/ProForm/utils/useFieldProps.d.ts +1 -1
  67. package/es/ProForm/utils/useForm.d.ts +2 -1
  68. package/es/ProForm/utils/useForm.js +3 -2
  69. package/es/ProForm/utils/useRules.d.ts +1 -1
  70. package/es/ProForm/utils/useShouldUpdate.d.ts +3 -3
  71. package/es/ProIcon/index.d.ts +2 -2
  72. package/es/ProIcon/propsTypes.d.ts +120 -49
  73. package/es/ProSelect/propsType.d.ts +1 -1
  74. package/es/ProStep/components/Anchor/index.d.ts +2 -1
  75. package/es/ProStep/components/Item/index.d.ts +1 -1
  76. package/es/ProStep/components/Item/index.js +6 -2
  77. package/es/ProStep/components/Listener/index.d.ts +4 -3
  78. package/es/ProStep/components/Listener/index.js +18 -4
  79. package/es/ProStep/index.d.ts +7 -7
  80. package/es/ProStep/index.js +7 -3
  81. package/es/ProStep/propsType.d.ts +145 -5
  82. package/es/ProStep/utils/index.d.ts +16 -3
  83. package/es/ProStep/utils/index.js +11 -2
  84. package/es/ProTable/components/FormatColumn/index.d.ts +1 -1
  85. package/es/ProTable/components/FormatColumn/index.js +3 -6
  86. package/es/ProTable/components/RenderTabs/index.d.ts +4 -0
  87. package/es/ProTable/components/RenderTabs/index.js +78 -0
  88. package/es/ProTable/components/index.d.ts +25 -0
  89. package/es/ProTable/components/index.js +26 -1
  90. package/es/ProTable/hooks/useAntdTable.d.ts +2 -93
  91. package/es/ProTable/hooks/useAntdTable.js +6 -2
  92. package/es/ProTable/index.d.ts +1 -1
  93. package/es/ProTable/index.js +6 -3
  94. package/es/ProTable/propsType.d.ts +68 -28
  95. package/es/ProTooltip/propsType.d.ts +0 -3
  96. package/es/ProTree/components/List.d.ts +2 -2
  97. package/es/ProTree/components/List.js +2 -2
  98. package/es/ProTree/components/ProTree.d.ts +2 -2
  99. package/es/ProTree/components/ProTreeSelect/index.d.ts +3 -3
  100. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +371 -33
  101. package/es/ProTree/components/SearchTitle.d.ts +1 -1
  102. package/es/ProTree/components/Tree.d.ts +3 -3
  103. package/es/ProTree/index.d.ts +2 -2
  104. package/es/ProTree/index.js +1 -1
  105. package/es/ProTree/propsType.d.ts +692 -101
  106. package/es/ProTree/utils.d.ts +7 -7
  107. package/es/ProTreeModal/components/Cascader.d.ts +3 -3
  108. package/es/ProTreeModal/components/List.d.ts +3 -3
  109. package/es/ProTreeModal/components/Tree.d.ts +2 -2
  110. package/es/ProTreeModal/index.d.ts +2 -2
  111. package/es/ProTreeModal/index.js +2 -2
  112. package/es/ProTreeModal/propsType.d.ts +257 -48
  113. package/es/ProTreeModal/utils.d.ts +7 -7
  114. package/es/index.d.ts +15 -7
  115. package/es/index.js +1 -8
  116. package/lib/ProConfigProvider/index.d.ts +4 -4
  117. package/lib/ProDrawerForm/components/ProDrawer/index.js +12 -2
  118. package/lib/ProDrawerForm/components/ProModal/index.js +12 -2
  119. package/lib/ProDrawerForm/propsType.d.ts +1 -1
  120. package/lib/ProEditLabel/propsType.d.ts +2 -2
  121. package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
  122. package/lib/ProEditTable/index.js +12 -8
  123. package/lib/ProEditTable/propsType.d.ts +40 -42
  124. package/lib/ProEditTable/style/index.less +1 -0
  125. package/lib/ProEditTable/utils/index.d.ts +1 -1
  126. package/lib/ProEditTable/utils/index.js +6 -4
  127. package/lib/ProEditTable/utils/tools.d.ts +57 -22
  128. package/lib/ProEditTable/utils/tools.js +47 -21
  129. package/lib/ProEnum/hooks/useEnum.d.ts +2 -2
  130. package/lib/ProEnum/hooks/useEnum.js +48 -17
  131. package/lib/ProEnum/propsType.d.ts +2 -2
  132. package/lib/ProEnum/utils/index.d.ts +8 -1
  133. package/lib/ProEnum/utils/index.js +9 -2
  134. package/lib/ProForm/components/FormFooter/index.d.ts +1 -1
  135. package/lib/ProForm/components/base/Checkbox/index.d.ts +1 -1
  136. package/lib/ProForm/components/base/Input/index.js +17 -4
  137. package/lib/ProForm/components/base/Input/propsType.d.ts +3 -3
  138. package/lib/ProForm/components/base/InputNumber/index.d.ts +1 -1
  139. package/lib/ProForm/components/base/Radio/index.d.ts +1 -1
  140. package/lib/ProForm/components/base/RangePicker/index.d.ts +1 -1
  141. package/lib/ProForm/components/base/Select/index.d.ts +1 -1
  142. package/lib/ProForm/components/base/Switch/index.d.ts +1 -1
  143. package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -1
  144. package/lib/ProForm/components/base/TextArea/index.d.ts +1 -1
  145. package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -1
  146. package/lib/ProForm/components/combination/Container/propsType.d.ts +3 -3
  147. package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -1
  148. package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
  149. package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -2
  150. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +1 -1
  151. package/lib/ProForm/components/combination/FormList/propsType.d.ts +2 -2
  152. package/lib/ProForm/components/combination/Group/index.d.ts +1 -1
  153. package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -1
  154. package/lib/ProForm/components/combination/Group/utils.d.ts +3 -3
  155. package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
  156. package/lib/ProForm/components/combination/ProCombination/index.d.ts +1 -1
  157. package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +1 -1
  158. package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
  159. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +5 -5
  160. package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +2 -2
  161. package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -1
  162. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
  163. package/lib/ProForm/components/old/EnumSelect/index.d.ts +1 -1
  164. package/lib/ProForm/components/old/EnumSelect/interface.d.ts +2 -2
  165. package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
  166. package/lib/ProForm/components/old/ProAddress/index.d.ts +1 -1
  167. package/lib/ProForm/components/old/ProCertNo/index.d.ts +1 -1
  168. package/lib/ProForm/components/old/ProCertValidity/index.d.ts +1 -1
  169. package/lib/ProForm/components/old/ProRangeBox/index.d.ts +1 -1
  170. package/lib/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  171. package/lib/ProForm/components/render/ConfirmWrapper.d.ts +2 -2
  172. package/lib/ProForm/components/render/RenderFields.d.ts +3 -3
  173. package/lib/ProForm/components/render/propsType.d.ts +37 -41
  174. package/lib/ProForm/index.d.ts +1 -1
  175. package/lib/ProForm/index.js +3 -1
  176. package/lib/ProForm/propsType.d.ts +6 -4
  177. package/lib/ProForm/propsType.js +0 -15
  178. package/lib/ProForm/utils/transformValue.d.ts +1 -1
  179. package/lib/ProForm/utils/useFieldProps.d.ts +1 -1
  180. package/lib/ProForm/utils/useForm.d.ts +2 -1
  181. package/lib/ProForm/utils/useForm.js +3 -2
  182. package/lib/ProForm/utils/useRules.d.ts +1 -1
  183. package/lib/ProForm/utils/useShouldUpdate.d.ts +3 -3
  184. package/lib/ProIcon/index.d.ts +2 -2
  185. package/lib/ProIcon/propsTypes.d.ts +120 -49
  186. package/lib/ProSelect/propsType.d.ts +1 -1
  187. package/lib/ProStep/components/Anchor/index.d.ts +2 -1
  188. package/lib/ProStep/components/Item/index.d.ts +1 -1
  189. package/lib/ProStep/components/Item/index.js +6 -2
  190. package/lib/ProStep/components/Listener/index.d.ts +4 -3
  191. package/lib/ProStep/components/Listener/index.js +18 -4
  192. package/lib/ProStep/index.d.ts +7 -7
  193. package/lib/ProStep/index.js +7 -3
  194. package/lib/ProStep/propsType.d.ts +145 -5
  195. package/lib/ProStep/utils/index.d.ts +16 -3
  196. package/lib/ProStep/utils/index.js +11 -2
  197. package/lib/ProTable/components/FormatColumn/index.d.ts +1 -1
  198. package/lib/ProTable/components/FormatColumn/index.js +3 -6
  199. package/lib/ProTable/components/RenderTabs/index.d.ts +4 -0
  200. package/lib/ProTable/components/RenderTabs/index.js +82 -0
  201. package/lib/ProTable/components/index.d.ts +25 -0
  202. package/lib/ProTable/components/index.js +8 -1
  203. package/lib/ProTable/hooks/useAntdTable.d.ts +2 -93
  204. package/lib/ProTable/hooks/useAntdTable.js +5 -1
  205. package/lib/ProTable/index.d.ts +1 -1
  206. package/lib/ProTable/index.js +5 -2
  207. package/lib/ProTable/propsType.d.ts +68 -28
  208. package/lib/ProTooltip/propsType.d.ts +0 -3
  209. package/lib/ProTree/components/List.d.ts +2 -2
  210. package/lib/ProTree/components/List.js +2 -2
  211. package/lib/ProTree/components/ProTree.d.ts +2 -2
  212. package/lib/ProTree/components/ProTreeSelect/index.d.ts +3 -3
  213. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +371 -33
  214. package/lib/ProTree/components/SearchTitle.d.ts +1 -1
  215. package/lib/ProTree/components/Tree.d.ts +3 -3
  216. package/lib/ProTree/index.d.ts +2 -2
  217. package/lib/ProTree/index.js +1 -1
  218. package/lib/ProTree/propsType.d.ts +692 -101
  219. package/lib/ProTree/utils.d.ts +7 -7
  220. package/lib/ProTreeModal/components/Cascader.d.ts +3 -3
  221. package/lib/ProTreeModal/components/List.d.ts +3 -3
  222. package/lib/ProTreeModal/components/Tree.d.ts +2 -2
  223. package/lib/ProTreeModal/index.d.ts +2 -2
  224. package/lib/ProTreeModal/index.js +2 -2
  225. package/lib/ProTreeModal/propsType.d.ts +257 -48
  226. package/lib/ProTreeModal/utils.d.ts +7 -7
  227. package/lib/index.d.ts +15 -7
  228. package/lib/index.js +7 -83
  229. package/package.json +1 -1
  230. package/test/__mocks__/fileMock.js +0 -0
  231. package/test/__mocks__/styleMock.js +0 -0
@@ -4596,6 +4596,10 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4596
4596
  display: -webkit-flex;
4597
4597
  display: -ms-flexbox;
4598
4598
  display: flex;
4599
+ -webkit-box-pack: end;
4600
+ -webkit-justify-content: flex-end;
4601
+ -ms-flex-pack: end;
4602
+ justify-content: flex-end;
4599
4603
  }
4600
4604
  .pro-edit-table .drag-wrapper .anticon {
4601
4605
  margin-right: var(--zaui-space-size-md, 16px);
package/dist/less.esm.css CHANGED
@@ -4596,6 +4596,10 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4596
4596
  display: -webkit-flex;
4597
4597
  display: -ms-flexbox;
4598
4598
  display: flex;
4599
+ -webkit-box-pack: end;
4600
+ -webkit-justify-content: flex-end;
4601
+ -ms-flex-pack: end;
4602
+ justify-content: flex-end;
4599
4603
  }
4600
4604
  .pro-edit-table .drag-wrapper .anticon {
4601
4605
  margin-right: var(--zaui-space-size-md, 16px);
@@ -1,9 +1,9 @@
1
1
  import React, { FC } from 'react';
2
2
  import { FormInstance } from 'antd';
3
- import { PropSelectType } from '../ProSelect/propsType';
4
- import { ProModalSelectType } from '../ProForm/components/combination/ProModalSelect/propsType';
5
- import { ProCascaderType } from '../ProForm/components/combination/ProCascader/propsType';
6
- import { ProEnumConfig } from '../ProEnum/propsType';
3
+ import type { PropSelectType } from '../ProSelect/propsType';
4
+ import type { ProModalSelectType } from '../ProForm/components/combination/ProModalSelect/propsType';
5
+ import type { ProCascaderType } from '../ProForm/components/combination/ProCascader/propsType';
6
+ import type { ProEnumConfig } from '../ProEnum/propsType';
7
7
  export interface ProConfigState {
8
8
  locale?: string;
9
9
  ProEnum?: Partial<ProEnumConfig>;
@@ -101,7 +101,7 @@ var ProDrawer = function ProDrawer(_ref) {
101
101
  }, _callee);
102
102
  })), [onCancel, modalRef.current, ref.current]);
103
103
  var handleFinish = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
104
- var values, _error$errorFields, _error$errorFields$;
104
+ var values;
105
105
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
106
106
  while (1) switch (_context2.prev = _context2.next) {
107
107
  case 0:
@@ -160,7 +160,17 @@ var ProDrawer = function ProDrawer(_ref) {
160
160
  case 26:
161
161
  _context2.prev = 26;
162
162
  _context2.t4 = _context2["catch"](0);
163
- form.scrollToField(_context2.t4 === null || _context2.t4 === void 0 ? void 0 : (_error$errorFields = _context2.t4.errorFields) === null || _error$errorFields === void 0 ? void 0 : (_error$errorFields$ = _error$errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name);
163
+ /** 使用setTimeout确保DOM已经更新,错误标记已经渲染 */
164
+ setTimeout(function () {
165
+ var _ref$current, _error$errorFields;
166
+ var errorElement = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector('[class*="form-item-has-error"]');
167
+ if (errorElement && (_context2.t4 === null || _context2.t4 === void 0 ? void 0 : (_error$errorFields = _context2.t4.errorFields) === null || _error$errorFields === void 0 ? void 0 : _error$errorFields.length)) {
168
+ errorElement.scrollIntoView({
169
+ behavior: 'smooth',
170
+ block: 'center'
171
+ });
172
+ }
173
+ }, 100);
164
174
  case 29:
165
175
  _context2.prev = 29;
166
176
  toggleLoading(false);
@@ -54,7 +54,7 @@ var ProModal = function ProModal(_ref) {
54
54
  'pro-modal-footer-shadow': height >= 450
55
55
  }]);
56
56
  var handleFinish = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
57
- var values, _error$errorFields, _error$errorFields$;
57
+ var values;
58
58
  return _regeneratorRuntime().wrap(function _callee$(_context) {
59
59
  while (1) switch (_context.prev = _context.next) {
60
60
  case 0:
@@ -113,7 +113,17 @@ var ProModal = function ProModal(_ref) {
113
113
  case 26:
114
114
  _context.prev = 26;
115
115
  _context.t4 = _context["catch"](0);
116
- form.scrollToField(_context.t4 === null || _context.t4 === void 0 ? void 0 : (_error$errorFields = _context.t4.errorFields) === null || _error$errorFields === void 0 ? void 0 : (_error$errorFields$ = _error$errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name);
116
+ /** 使用setTimeout确保DOM已经更新,错误标记已经渲染 */
117
+ setTimeout(function () {
118
+ var _ref$current2, _error$errorFields;
119
+ var errorElement = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.querySelector('[class*="form-item-has-error"]');
120
+ if (errorElement && (_context.t4 === null || _context.t4 === void 0 ? void 0 : (_error$errorFields = _context.t4.errorFields) === null || _error$errorFields === void 0 ? void 0 : _error$errorFields.length)) {
121
+ errorElement.scrollIntoView({
122
+ behavior: 'smooth',
123
+ block: 'center'
124
+ });
125
+ }
126
+ }, 100);
117
127
  case 29:
118
128
  _context.prev = 29;
119
129
  toggleLoading(false);
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import type { ModalProps, DrawerProps, FormInstance } from 'antd';
3
- import { ProFormType } from '../ProForm/propsType';
3
+ import type { ProFormType } from '../ProForm/propsType';
4
4
  /**
5
5
  * 抽屉尺寸类型定义
6
6
  */
@@ -2,7 +2,7 @@ import { InputProps } from 'antd/es/input';
2
2
  import { PopconfirmProps } from 'antd/es/popconfirm';
3
3
  import { FormInstance } from 'antd/es/form';
4
4
  import React from 'react';
5
- import { ProColumnType } from '../index';
5
+ import type { ProFormColumnType } from '../index';
6
6
  export interface ContainerType {
7
7
  /**
8
8
  * @description 触发方式
@@ -77,7 +77,7 @@ export interface PopupType {
77
77
  * @description 列配置
78
78
  * @default -
79
79
  */
80
- columns?: ProColumnType;
80
+ columns?: ProFormColumnType;
81
81
  /**
82
82
  * @description 允许扩展字段
83
83
  */
@@ -1,8 +1,8 @@
1
- import { SummaryColumnType } from '../../propsType';
1
+ import { ProEditTableSummaryColumnType } from '../../propsType';
2
2
  interface SummaryProps<T = any> {
3
3
  data: T[];
4
4
  summary: {
5
- columns: SummaryColumnType[];
5
+ columns: ProEditTableSummaryColumnType[];
6
6
  total?: boolean;
7
7
  fixed?: boolean | 'top' | 'bottom';
8
8
  };
@@ -77,7 +77,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
77
77
  disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled; // formFieldProps?.disabled可能是函数??
78
78
  }
79
79
  var tableRef = useRef(null);
80
- var valueChangeRef = useRef(null);
80
+ var valueChangeRef = useRef(0);
81
81
  valueChangeRef.current = 0;
82
82
  var _React$useContext = React.useContext(_ConfigProvider.ConfigContext),
83
83
  getPrefixCls = _React$useContext.getPrefixCls;
@@ -88,7 +88,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
88
88
  var requiredAlign = useMemo(function () {
89
89
  var _ref2, _themeConfig$data$zau, _themeConfig$data;
90
90
  return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
91
- }, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign]);
91
+ }, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign, configRequiredAlign]);
92
92
  var _useSetState = useSetState({
93
93
  cellNamePath: [],
94
94
  forceUpdate: {},
@@ -211,7 +211,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
211
211
  return function (_x, _x2) {
212
212
  return _ref4.apply(this, arguments);
213
213
  };
214
- }(), []);
214
+ }(), [pagination, page.pageSize, form, name]);
215
215
  var config = _objectSpread({
216
216
  form: form,
217
217
  mode: mode,
@@ -269,10 +269,12 @@ var ProEditTable = function ProEditTable(_ref, ref) {
269
269
  return item.type === type;
270
270
  });
271
271
  if (typeof (addBtnConfig === null || addBtnConfig === void 0 ? void 0 : addBtnConfig.show) === 'function') {
272
- addBtnConfig.show = addBtnConfig.show();
272
+ var result = addBtnConfig.show();
273
+ addBtnConfig.show = result;
273
274
  }
274
275
  return (addBtnConfig === null || addBtnConfig === void 0 ? void 0 : addBtnConfig.show) === false;
275
276
  }
277
+ return false;
276
278
  }, [toolbarProps]);
277
279
  // 是否隐藏勾选框
278
280
  var isHideCheckBox = isForbiddenBtn('mulDelete');
@@ -304,7 +306,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
304
306
  className: "com-empty",
305
307
  children: [_jsx("img", {
306
308
  className: "img",
307
- src: Empty
309
+ src: Empty,
310
+ alt: "Empty"
308
311
  }), _jsx("div", {
309
312
  className: "content",
310
313
  children: disabled || isForbiddenBtn('add') ? locale.ProEditTable.noData : _jsxs(_Fragment, {
@@ -357,7 +360,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
357
360
  rowKey: getRowKey(item)
358
361
  });
359
362
  });
360
- onChange(nextValues);
363
+ onChange === null || onChange === void 0 ? void 0 : onChange(nextValues);
361
364
  if (virtualKey) {
362
365
  form.setFieldValue(virtualRowName, nextValues);
363
366
  }
@@ -377,8 +380,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
377
380
  useEffect(function () {
378
381
  if (toolbarSticky) {
379
382
  var updatePos = function updatePos() {
380
- var _affixRef$current;
381
- affixRef === null || affixRef === void 0 ? void 0 : (_affixRef$current = affixRef.current) === null || _affixRef$current === void 0 ? void 0 : _affixRef$current.updatePosition();
383
+ var _affixRef$current, _affixRef$current$upd;
384
+ affixRef === null || affixRef === void 0 ? void 0 : (_affixRef$current = affixRef.current) === null || _affixRef$current === void 0 ? void 0 : (_affixRef$current$upd = _affixRef$current.updatePosition) === null || _affixRef$current$upd === void 0 ? void 0 : _affixRef$current$upd.call(_affixRef$current);
382
385
  };
383
386
  window.addEventListener('scroll', updatePos, true);
384
387
  return function () {
@@ -480,4 +483,5 @@ ForwardProEditTable.defaultProps = {
480
483
  deletePoConfirmMsg: locale.ProEditTable.deletePoConfirmMsg,
481
484
  mulDeletePoConfirmMsg: locale.ProEditTable.mulDeletePoConfirmMsg
482
485
  };
486
+ // 导出组件
483
487
  export default ForwardProEditTable;
@@ -6,9 +6,8 @@ import type { TooltipProps } from 'antd/es/tooltip';
6
6
  import type { NamePath } from 'antd/es/form/interface';
7
7
  import type { ColumnType, TableProps } from 'antd/es/table';
8
8
  import type { FormInstance, FormItemProps } from 'antd/es/form';
9
- import type { FunctionArgs, ProRule } from '../ProForm/propsType';
10
- import { ProFormValueType, ColumnTypeMap } from '../ProForm/components/render/propsType';
11
- import { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
9
+ import type { ProFormValueType, FunctionArgs, ProRule } from '../ProForm/components/render/propsType';
10
+ import type { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
12
11
  /**
13
12
  * 操作类型定义
14
13
  */
@@ -17,14 +16,14 @@ export type ActionType = 'edit' | 'delete' | 'save' | 'cancel' | 'add' | 'mulDel
17
16
  * 操作按钮展示控制函数类型
18
17
  * @template T 记录类型
19
18
  */
20
- export type ShowFunction<T> = (record?: T, options?: {
19
+ export type ShowFunction<T = any> = (record?: T, options?: {
21
20
  index: number;
22
21
  form: FormInstance;
23
22
  name: NamePath;
24
23
  namePath: NamePath;
25
24
  tableLength: number;
26
25
  selectedRows: T[];
27
- }) => Promise<any> | boolean | void;
26
+ }) => Promise<boolean> | boolean | void;
28
27
  /**
29
28
  * 选项属性接口
30
29
  */
@@ -61,10 +60,6 @@ export interface SummaryColumnProps {
61
60
  /** 前缀 */
62
61
  prefix?: ReactNode | string;
63
62
  }
64
- /**
65
- * 汇总列属性类型(基于接口)
66
- */
67
- export type SummaryColumnType = SummaryColumnProps;
68
63
  /**
69
64
  * 基础操作按钮属性
70
65
  * @template T 记录类型
@@ -110,36 +105,31 @@ export interface BaseActionProps<T = any> {
110
105
  /**
111
106
  * 按钮前置校验事件
112
107
  */
113
- onClick?: (record?: any, index?: number) => any;
108
+ onClick?: (record?: T, index?: number) => any;
114
109
  /**
115
110
  * 按钮前置校验事件
116
111
  */
117
- onHandle?: (record?: any, index?: number) => any;
112
+ onHandle?: (record?: T, index?: number) => any;
118
113
  /**
119
114
  * 支持antd的Button属性
120
115
  */
121
116
  buttonProps?: Omit<ButtonProps, 'type' | 'onClick'>;
122
117
  }
123
- /**
124
- * 基础操作按钮类型(基于接口)
125
- * @template T 记录类型
126
- */
127
- export type BaseActionType<T = any> = BaseActionProps<T>;
128
118
  /**
129
119
  * 规则函数类型
130
120
  * @template T 记录类型
131
121
  */
132
- export type RulesFn<T> = (text?: any, record?: T, options?: OptionsProps) => ProRule[] | void;
122
+ export type RulesFn<T = any> = (text?: any, record?: T, options?: OptionsProps) => ProRule[] | void;
133
123
  /**
134
124
  * 必填函数类型
135
125
  * @template T 记录类型
136
126
  */
137
- export type RequiredFn<T> = (text?: any, record?: T, options?: OptionsProps) => boolean | void;
127
+ export type RequiredFn<T = any> = (text?: any, record?: T, options?: OptionsProps) => boolean | void;
138
128
  /**
139
129
  * 视图渲染函数类型
140
130
  * @template T 记录类型
141
131
  */
142
- export type viewRenderFn<T> = (text?: any, record?: T, options?: OptionsProps) => string | number | ReactNode | void;
132
+ export type viewRenderFn<T = any> = (text?: any, record?: T, options?: OptionsProps) => string | number | ReactNode | void;
143
133
  /**
144
134
  * 表格列属性接口
145
135
  * @template Values 值类型
@@ -157,7 +147,7 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
157
147
  /** 是否可编辑 */
158
148
  isEditable?: boolean | RequiredFn<T>;
159
149
  /** 值类型 */
160
- valueType?: ProFormValueType | ((text?: any, record?: any, options?: OptionsProps) => ProFormValueType);
150
+ valueType?: ProFormValueType | ((text?: any, record?: T, options?: OptionsProps) => ProFormValueType);
161
151
  /** 提示信息 */
162
152
  tooltip?: string | ({
163
153
  icon?: string | ReactNode;
@@ -188,20 +178,15 @@ export type ProColumnsType<Values = any, T = any> = ProColumnsProps<Values, T>;
188
178
  * 可编辑表格列属性
189
179
  * @template K 键类型
190
180
  */
191
- export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnTypeMap<K, 'ProEditTable'>;
192
- /**
193
- * 可编辑表格列属性类型(基于类型)
194
- * @template K 键类型
195
- */
196
- export type ProEditTableColumnsType<K = any> = ProEditTableColumnsProps<K>;
181
+ export type ProEditTableColumnsProps<K = any> = ProColumnsProps<K, 'ProEditTable'>;
197
182
  /**
198
183
  * 状态接口
199
184
  */
200
- export interface State {
185
+ export interface StateProps {
201
186
  /** 单元格名称路径 */
202
187
  cellNamePath: NamePath[];
203
188
  /** 表格内部强制刷新开关 */
204
- forceUpdate: {};
189
+ forceUpdate: Record<string, any>;
205
190
  /** 正在编辑行的row-key集合 */
206
191
  editingKeys: string[];
207
192
  /** 当前选中行的row-key集合 */
@@ -219,13 +204,15 @@ export interface State {
219
204
  /**
220
205
  * 状态类型(基于接口)
221
206
  */
222
- export type StateType = State;
207
+ export type StateType = StateProps;
223
208
  /**
224
209
  * 可编辑表格引用属性
225
210
  */
226
211
  export interface ProEditTableRefProps {
227
212
  /** 获取内部状态 */
228
- getInternalState: () => StateType;
213
+ getInternalState: () => StateProps;
214
+ /** 设置内部状态 */
215
+ setInternalState: (state: Partial<StateProps>) => void;
229
216
  }
230
217
  /**
231
218
  * 可编辑表格引用属性类型(基于接口)
@@ -249,12 +236,11 @@ export type ActionDirectionType = ActionDirection;
249
236
  * 汇总信息配置
250
237
  * @template T 记录类型
251
238
  */
252
- export type SummaryConfig<T> = {
253
- columns: SummaryColumnType[];
239
+ export type SummaryProps<T = any> = {
240
+ columns: ProEditTableSummaryColumnType[];
254
241
  total?: boolean;
255
242
  fixed?: boolean | 'top' | 'bottom';
256
243
  } | TableProps<T>['summary'];
257
- export type SummaryConfigType<T = any> = SummaryConfig<T>;
258
244
  /**
259
245
  * 可编辑表格属性接口
260
246
  * @template T 记录类型
@@ -267,18 +253,18 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
267
253
  /**
268
254
  * 原始数据源,设置后可以对比更新后的数值
269
255
  */
270
- originalValues?: any;
256
+ originalValues?: Record<string, any>;
271
257
  /**
272
258
  * 可编辑表格的模式
273
259
  * @default multiple
274
260
  */
275
- mode?: ProEditTableModeType;
261
+ mode?: ProEditTableMode;
276
262
  /**
277
263
  * 可编辑表格的类型,单行编辑或者多行编辑
278
264
  * @deprecated 将于下个版本 4.0.0 被弃用
279
265
  * @default multiple
280
266
  */
281
- type?: ProEditTableModeType;
267
+ type?: ProEditTableMode;
282
268
  /**
283
269
  * 必填对齐方式, 默认右对齐
284
270
  * @default right
@@ -297,7 +283,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
297
283
  * 表格列的配置描述,扩展了FormItemProps属性
298
284
  * @default []
299
285
  */
300
- columns: ProEditTableColumnsProps[];
286
+ columns: ProEditTableColumnType<T>[];
301
287
  /**
302
288
  * 是否禁止编辑
303
289
  * @default false
@@ -352,7 +338,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
352
338
  /**
353
339
  * 自定义编辑模式的操作栏 单行编辑默认为编辑、删除、保存、取消;多行编辑为删除
354
340
  */
355
- actionProps?: BaseActionType<T>[] | boolean;
341
+ actionProps?: BaseActionProps<T>[] | boolean;
356
342
  /**
357
343
  * 自定义 table footer 左侧渲染, 配置后toolbarProps会失效
358
344
  */
@@ -360,7 +346,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
360
346
  /**
361
347
  * 自定义底部操作栏 默认为添加、删除(批量)
362
348
  */
363
- toolbarProps?: BaseActionType<T>[] | boolean;
349
+ toolbarProps?: BaseActionProps<T>[] | boolean;
364
350
  /**
365
351
  * 自定义底部操作栏跟随页面滚动
366
352
  */
@@ -372,11 +358,11 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
372
358
  /**
373
359
  * formItem的props
374
360
  */
375
- otherProps?: any;
361
+ otherProps?: Record<string, any>;
376
362
  /**
377
363
  * 底部合计配置
378
364
  */
379
- summary?: SummaryConfigType<T>;
365
+ summary?: ProEditTableSummaryConfigType<T>;
380
366
  /**
381
367
  * 自定义头部渲染
382
368
  */
@@ -400,7 +386,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
400
386
  /**
401
387
  * 操作按钮方向
402
388
  */
403
- actionDirection?: ActionDirectionType;
389
+ actionDirection?: ActionDirection;
404
390
  /**
405
391
  * 校验触发方式
406
392
  */
@@ -413,6 +399,18 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
413
399
  scrollFollowParent?: boolean;
414
400
  };
415
401
  }
402
+ /**
403
+ * 基础操作按钮类型(基于接口)
404
+ * @template T 记录类型
405
+ */
406
+ export type ProEditTableActionType<T = any> = BaseActionProps<T>;
407
+ export type ProEditTableSummaryConfigType<T = any> = SummaryProps<T>;
408
+ export type ProEditTableSummaryColumnType = SummaryColumnProps;
409
+ /**
410
+ * 可编辑表格列属性类型(基于类型)
411
+ * @template K 键类型
412
+ */
413
+ export type ProEditTableColumnType<K = any> = ProEditTableColumnsProps<K>;
416
414
  /**
417
415
  * 可编辑表格属性类型(基于接口)
418
416
  * @template T 记录类型
@@ -83,6 +83,7 @@
83
83
 
84
84
  .drag-wrapper {
85
85
  display: flex;
86
+ justify-content: flex-end;
86
87
  .anticon {
87
88
  margin-right: var(--zaui-space-size-md, 16px);
88
89
  margin-left: var(--zaui-space-size-xs, 4px);
@@ -6,4 +6,4 @@
6
6
  * @param columns 表格配置数据
7
7
  * @param config
8
8
  */
9
- export declare const transformColumns: (columns: any[], config: any) => any;
9
+ export declare const transformColumns: (columns: any[], config: any) => any[];
@@ -258,11 +258,12 @@ export var transformColumns = function transformColumns() {
258
258
  var required = isBoolean(item.required) ? item.required : false;
259
259
  if (typeof item.required === 'function') {
260
260
  var namePath = getNamePath(name, virtualKey);
261
- var rowData = form.getFieldValue([].concat(_toConsumableArray(namePath), [index])) || {};
261
+ var namePathArray = Array.isArray(namePath) ? namePath : [namePath];
262
+ var rowData = form.getFieldValue([].concat(_toConsumableArray(namePathArray), [index])) || {};
262
263
  required = item.required(rowData[columnName], rowData, {
263
264
  form: form,
264
265
  index: index,
265
- namePath: [].concat(_toConsumableArray(namePath), [index])
266
+ namePath: [].concat(_toConsumableArray(namePathArray), [index])
266
267
  });
267
268
  }
268
269
  // 样式处理
@@ -282,17 +283,18 @@ export var transformColumns = function transformColumns() {
282
283
  if (virtualKey && editingKeys.includes(record.rowKey)) {
283
284
  namePath = getNamePath(name, virtualKey);
284
285
  }
286
+ var namePathArray = Array.isArray(namePath) ? namePath : [namePath];
285
287
  var columnNamePath = isArray(columnName) ? columnName : [columnName];
286
288
  index = tools.calc(firstIndex, '+', index);
287
289
  // 设置单元格formItem的namePath
288
- var cellName = columnName ? [].concat(_toConsumableArray(namePath), [index], _toConsumableArray(columnNamePath)) : [].concat(_toConsumableArray(namePath), [index]);
290
+ var cellName = columnName ? [].concat(_toConsumableArray(namePathArray), [index], _toConsumableArray(columnNamePath)) : [].concat(_toConsumableArray(namePathArray), [index]);
289
291
  var _text = text;
290
292
  // 当传入组合组件时,name需要重新组合一下,以防names中key与dataIndex重叠
291
293
  if (names === null || names === void 0 ? void 0 : names.length) {
292
294
  var nextDataIndex = splitNames(names);
293
295
  item.dataIndex = nextDataIndex;
294
296
  item.key = nextDataIndex;
295
- cellName = [].concat(_toConsumableArray(namePath), [index, nextDataIndex]);
297
+ cellName = [].concat(_toConsumableArray(namePathArray), [index, nextDataIndex]);
296
298
  // 给names返回数组值
297
299
  _text = names.map(function (item) {
298
300
  return record === null || record === void 0 ? void 0 : record[item];
@@ -1,32 +1,67 @@
1
+ import { Key } from 'react';
2
+ import { FormInstance } from 'antd/es/form';
3
+ import { NamePath } from 'antd/es/form/interface';
4
+ /**
5
+ * 生成随机字符串
6
+ * @returns 随机字符串
7
+ */
1
8
  export declare const getRandom: () => string;
2
- export declare const difference: (object: any, base: any) => unknown;
3
- export declare const customValidate: (validateKeys: any, form: any, rowName: any) => any;
9
+ /**
10
+ * 深层次对比两个对象且取出来差异值
11
+ * @param object 比较对象
12
+ * @param base 基准对象
13
+ * @returns 差异对象
14
+ */
15
+ export declare const difference: <T extends Record<string, any>, U extends Record<string, any>>(object: T, base: U) => Record<string, any>;
16
+ /**
17
+ * 数组字段循环校验,解决validateFields无法批量校验的问题
18
+ * @param validateKeys 校验键数组
19
+ * @param form 表单实例
20
+ * @param rowName 行名称路径
21
+ * @returns 校验结果Promise
22
+ */
23
+ export declare const customValidate: (validateKeys: string[], form: FormInstance, rowName: NamePath) => Promise<any>;
4
24
  /**
5
25
  * 拆解数组names
6
- * @param names [][]
7
- * @returns string
26
+ * @param names 名称数组
27
+ * @returns 拆解后的字符串
8
28
  */
9
- export declare const splitNames: (names: any[]) => any;
10
- export declare const getNamePath: (name: any, virtualKey: any) => any[];
11
- export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys }: {
12
- name: any;
13
- form: any;
14
- virtualKey: any;
15
- selectedRowKeys: any;
29
+ export declare const splitNames: (names: any[]) => string;
30
+ /**
31
+ * 获取中间formItem的name
32
+ * @param name 名称路径
33
+ * @param virtualKey 虚拟键
34
+ * @returns 完整名称路径数组
35
+ */
36
+ export declare const getNamePath: (name: NamePath, virtualKey?: string) => (string | number)[];
37
+ /**
38
+ * 删除操作
39
+ * @param params 删除参数
40
+ */
41
+ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys, }: {
42
+ name: NamePath;
43
+ form: FormInstance;
44
+ virtualKey?: string;
45
+ selectedRowKeys: Key[];
16
46
  }) => void;
17
- /** 获取最终的disabled, 两张模式【子级优先,全局优先】
47
+ /**
48
+ * 获取最终的disabled, 两张模式【子级优先,全局优先
18
49
  * 全局优先:globalControl为true时,全局控制
19
50
  * 子级优先:globalControl为false时,子级控制
20
- * @param globalControl 全局控制
21
- * @param formDisabled 表单的disabled
22
- * @param column 当前列
23
- * @param tabledDisabled 表格的disabled
24
- * @param columnFieldProps 当前列的fieldProps
25
- * @param params 当前列的参数
26
- * @param rowDisabled 行禁用参数
51
+ * @param params 禁用参数
52
+ * @returns 是否禁用
27
53
  */
28
- export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: any) => any;
29
- /** 表格自动滚动到报错位置
54
+ export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: {
55
+ globalControl: boolean;
56
+ formDisabled?: boolean | ((record: any) => boolean);
57
+ column: any;
58
+ tabledDisabled?: boolean;
59
+ columnFieldProps?: any;
60
+ params: any[];
61
+ rowDisabled?: any;
62
+ }) => boolean;
63
+ /**
64
+ * 表格自动滚动到报错位置
30
65
  */
31
66
  export declare const handleScrollToError: () => void;
32
67
  /**
@@ -34,7 +69,7 @@ export declare const handleScrollToError: () => void;
34
69
  * @param value 需要深拷贝的对象
35
70
  * @returns 深拷贝后的对象,其中的React节点会被保留
36
71
  */
37
- export declare function cloneDeepFilterNode(value: any): any;
72
+ export declare function cloneDeepFilterNode<T>(value: T): T;
38
73
  /**
39
74
  * 分页校验
40
75
  */