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

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 (229) hide show
  1. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
  2. package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
  3. package/coverage/lcov-report/src/.umi/core/index.html +206 -0
  4. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
  5. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
  6. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
  7. package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
  8. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
  9. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
  10. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
  11. package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
  12. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
  13. package/coverage/lcov-report/src/.umi/index.html +116 -0
  14. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
  15. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  16. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
  17. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
  18. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  23. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  24. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  25. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
  26. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
  27. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  28. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  29. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
  30. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  33. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
  34. package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
  35. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
  36. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
  37. package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
  38. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
  39. package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
  40. package/dist/index.esm.css +100 -4
  41. package/dist/less.esm.css +97 -4
  42. package/es/ProAction/index.js +1 -1
  43. package/es/ProDownload/index.js +3 -3
  44. package/es/ProDownload/utils.js +3 -3
  45. package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
  46. package/es/ProDrawerForm/components/ProModal/index.js +3 -3
  47. package/es/ProEditLabel/index.js +3 -3
  48. package/es/ProEditTable/components/ActionButton/index.js +3 -3
  49. package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
  50. package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +22 -10
  51. package/es/ProEditTable/components/RenderField/index.js +8 -8
  52. package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
  53. package/es/ProEditTable/utils/config.js +2 -2
  54. package/es/ProEditTable/utils/index.js +5 -5
  55. package/es/ProEditTable/utils/tools.js +1 -1
  56. package/es/ProEnum/components/Group.js +10 -2
  57. package/es/ProEnum/hooks/useEnumRequest.js +2 -2
  58. package/es/ProEnum/index.js +6 -5
  59. package/es/ProEnum/style/index.less +14 -4
  60. package/es/ProEnum/utils/index.d.ts +1 -1
  61. package/es/ProEnum/utils/index.js +4 -0
  62. package/es/ProForm/components/combination/Container/index.js +5 -3
  63. package/es/ProForm/components/combination/Container/propsType.d.ts +2 -1
  64. package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
  65. package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
  66. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
  67. package/es/ProForm/components/combination/FormList/utils.js +6 -5
  68. package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
  69. package/es/ProForm/components/combination/Group/utils.js +8 -1
  70. package/es/ProForm/components/combination/ProCascader/index.js +1 -1
  71. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
  72. package/es/ProForm/components/combination/ProModalSelect/index.js +50 -45
  73. package/es/ProForm/components/combination/ProNumberRange/index.js +14 -5
  74. package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
  75. package/es/ProForm/components/old/ProAddress/index.js +1 -1
  76. package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
  77. package/es/ProForm/components/render/ChangedWrapper.js +108 -0
  78. package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
  79. package/es/ProForm/components/render/Render.js +10 -11
  80. package/es/ProForm/components/render/RenderFields.d.ts +2 -3
  81. package/es/ProForm/components/render/RenderFields.js +3 -4
  82. package/es/ProForm/components/render/propsType.d.ts +5 -4
  83. package/es/ProForm/index.js +4 -7
  84. package/es/ProForm/propsType.d.ts +13 -2
  85. package/es/ProForm/style/index.less +103 -5
  86. package/es/ProForm/utils/diffOriginal.d.ts +4 -4
  87. package/es/ProForm/utils/diffOriginal.js +18 -7
  88. package/es/ProForm/utils/transformValue.js +17 -11
  89. package/es/ProForm/utils/useForm.js +1 -1
  90. package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
  91. package/es/ProForm/utils/useShouldUpdate.js +1 -1
  92. package/es/ProSelect/index.js +12 -11
  93. package/es/ProSelect/propsType.d.ts +4 -0
  94. package/es/ProSelect/utils/index.js +5 -4
  95. package/es/ProStep/components/Listener/index.d.ts +1 -1
  96. package/es/ProStep/components/Listener/index.js +6 -3
  97. package/es/ProStep/index.d.ts +1 -1
  98. package/es/ProStep/index.js +25 -18
  99. package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
  100. package/es/ProTable/components/FormatColumn/index.js +14 -8
  101. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
  102. package/es/ProTable/hooks/useAntdTable.js +3 -3
  103. package/es/ProTable/index.js +30 -13
  104. package/es/ProTable/propsType.d.ts +14 -1
  105. package/es/ProTable/style/index.less +1 -1
  106. package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
  107. package/es/ProTree/components/AdaptiveTooltip.js +55 -0
  108. package/es/ProTree/components/List.js +15 -3
  109. package/es/ProTree/components/ProTree.js +1 -1
  110. package/es/ProTree/components/ProTreeSelect/index.js +28 -8
  111. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
  112. package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
  113. package/es/ProTree/components/SearchTitle.d.ts +2 -0
  114. package/es/ProTree/components/SearchTitle.js +17 -8
  115. package/es/ProTree/components/Tree.js +1 -1
  116. package/es/ProTree/style/index.less +14 -0
  117. package/es/ProTreeModal/components/Tree.js +15 -17
  118. package/es/ProTreeModal/index.js +62 -7
  119. package/es/ProTreeModal/utils.d.ts +1 -0
  120. package/es/ProTreeModal/utils.js +21 -1
  121. package/es/ProUpload/components/ImageRender.js +1 -1
  122. package/es/ProViewer/index.js +2 -2
  123. package/es/old/ProEditableTable/index.js +4 -4
  124. package/es/style/theme/antd.less +5 -0
  125. package/es/style/theme/index.less +2 -1
  126. package/es/style/theme/tokens.less +1 -0
  127. package/es/utils/index.d.ts +2 -0
  128. package/es/utils/index.js +13 -0
  129. package/lib/ProAction/index.js +1 -1
  130. package/lib/ProDownload/index.js +3 -3
  131. package/lib/ProDownload/utils.js +3 -3
  132. package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
  133. package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
  134. package/lib/ProEditLabel/index.js +3 -3
  135. package/lib/ProEditTable/components/ActionButton/index.js +3 -3
  136. package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
  137. package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +25 -11
  138. package/lib/ProEditTable/components/RenderField/index.js +8 -8
  139. package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
  140. package/lib/ProEditTable/utils/config.js +2 -2
  141. package/lib/ProEditTable/utils/index.js +5 -5
  142. package/lib/ProEditTable/utils/tools.js +1 -1
  143. package/lib/ProEnum/components/Group.js +10 -2
  144. package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
  145. package/lib/ProEnum/index.js +6 -5
  146. package/lib/ProEnum/style/index.less +14 -4
  147. package/lib/ProEnum/utils/index.d.ts +1 -1
  148. package/lib/ProEnum/utils/index.js +4 -0
  149. package/lib/ProForm/components/combination/Container/index.js +5 -3
  150. package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -1
  151. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
  152. package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
  153. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
  154. package/lib/ProForm/components/combination/FormList/utils.js +5 -4
  155. package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
  156. package/lib/ProForm/components/combination/Group/utils.js +8 -1
  157. package/lib/ProForm/components/combination/ProCascader/index.js +1 -1
  158. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
  159. package/lib/ProForm/components/combination/ProModalSelect/index.js +49 -44
  160. package/lib/ProForm/components/combination/ProNumberRange/index.js +14 -5
  161. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
  162. package/lib/ProForm/components/old/ProAddress/index.js +1 -1
  163. package/lib/ProForm/components/render/ChangedWrapper.d.ts +17 -0
  164. package/lib/ProForm/components/render/ChangedWrapper.js +113 -0
  165. package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
  166. package/lib/ProForm/components/render/Render.js +10 -11
  167. package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
  168. package/lib/ProForm/components/render/RenderFields.js +3 -4
  169. package/lib/ProForm/components/render/propsType.d.ts +5 -4
  170. package/lib/ProForm/index.js +4 -7
  171. package/lib/ProForm/propsType.d.ts +13 -2
  172. package/lib/ProForm/style/index.less +103 -5
  173. package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
  174. package/lib/ProForm/utils/diffOriginal.js +18 -7
  175. package/lib/ProForm/utils/transformValue.js +17 -11
  176. package/lib/ProForm/utils/useForm.js +1 -1
  177. package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
  178. package/lib/ProForm/utils/useShouldUpdate.js +1 -1
  179. package/lib/ProSelect/index.js +12 -11
  180. package/lib/ProSelect/propsType.d.ts +4 -0
  181. package/lib/ProSelect/utils/index.js +5 -4
  182. package/lib/ProStep/components/Listener/index.d.ts +1 -1
  183. package/lib/ProStep/components/Listener/index.js +6 -3
  184. package/lib/ProStep/index.d.ts +1 -1
  185. package/lib/ProStep/index.js +25 -18
  186. package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
  187. package/lib/ProTable/components/FormatColumn/index.js +14 -8
  188. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
  189. package/lib/ProTable/hooks/useAntdTable.js +3 -3
  190. package/lib/ProTable/index.js +30 -13
  191. package/lib/ProTable/propsType.d.ts +14 -1
  192. package/lib/ProTable/style/index.less +1 -1
  193. package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
  194. package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
  195. package/lib/ProTree/components/List.js +15 -3
  196. package/lib/ProTree/components/ProTree.js +1 -1
  197. package/lib/ProTree/components/ProTreeSelect/index.js +28 -8
  198. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
  199. package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
  200. package/lib/ProTree/components/SearchTitle.d.ts +2 -0
  201. package/lib/ProTree/components/SearchTitle.js +19 -7
  202. package/lib/ProTree/components/Tree.js +1 -1
  203. package/lib/ProTree/style/index.less +14 -0
  204. package/lib/ProTreeModal/components/Tree.js +15 -17
  205. package/lib/ProTreeModal/index.js +61 -6
  206. package/lib/ProTreeModal/utils.d.ts +1 -0
  207. package/lib/ProTreeModal/utils.js +20 -0
  208. package/lib/ProUpload/components/ImageRender.js +1 -1
  209. package/lib/ProViewer/index.js +2 -2
  210. package/lib/old/ProEditableTable/index.js +4 -4
  211. package/lib/style/theme/antd.less +5 -0
  212. package/lib/style/theme/index.less +2 -1
  213. package/lib/style/theme/tokens.less +1 -0
  214. package/lib/utils/index.d.ts +2 -0
  215. package/lib/utils/index.js +19 -0
  216. package/package.json +3 -1
  217. package/patches/rc-table+7.26.0.patch +49 -0
  218. package/es/ProForm/components/render/Changed.d.ts +0 -14
  219. package/es/ProForm/components/render/Changed.js +0 -64
  220. package/lib/ProForm/components/render/Changed.d.ts +0 -14
  221. package/lib/ProForm/components/render/Changed.js +0 -69
  222. /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
  223. /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
  224. /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
  225. /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
  226. /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
  227. /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
  228. /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
  229. /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
@@ -30,7 +30,8 @@ import { ProUploadProps } from '../../../ProUpload/propsType';
30
30
  import { ProTreeProps } from '../../../ProTree/propsType';
31
31
  import { GroupProps as GroupCopyProps } from '../combination/Group/propsType';
32
32
  import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
33
- import { DistributiveOmit } from '../../propsType';
33
+ import { DistributiveOmit, DiffConfigProps } from '../../propsType';
34
+ import { DiffOriginalParams } from '../../utils/diffOriginal';
34
35
  export type ComponentMap = keyof typeof componentMap;
35
36
  type ValidateKey = keyof typeof validate;
36
37
  type RegExpKey = keyof typeof regExp;
@@ -196,12 +197,12 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
196
197
  * @default -
197
198
  */
198
199
  labelWidth?: string | number;
199
- disabled?: boolean | ReactiveFunction<Values, boolean>;
200
+ disabled?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
200
201
  trim?: boolean;
201
202
  upperCase?: boolean;
202
203
  hiddenNames?: string[] | any[];
203
204
  rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
204
- equalWith?: (originValue: any, currentValue: any) => boolean;
205
+ equalWith?: DiffOriginalParams['equalWith'];
205
206
  required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
206
207
  labelRequired?: boolean;
207
208
  toISOString?: boolean;
@@ -267,7 +268,7 @@ export interface RenderProps<Values = any> {
267
268
  form: FormInstance<Values>;
268
269
  fieldProps?: ReactiveFunction<Values, React.ReactNode>;
269
270
  isSelect: boolean;
270
- originalValues?: Values;
271
+ diffConfig: DiffConfigProps;
271
272
  requiredOnView?: boolean;
272
273
  confirm?: ProFormColumnProps['confirm'];
273
274
  globalControl?: boolean;
@@ -11,7 +11,7 @@ import _Space from "antd/es/space";
11
11
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
12
12
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
13
13
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
14
- var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "originalValues", "submitOnEnter", "clearNotShow", "initialValues", "requiredOnView", "formId", "required", "originalDiffTip", "formKey", "globalControl", "scrollToError", "optimize"];
14
+ var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "diffConfig", "submitOnEnter", "clearNotShow", "initialValues", "requiredOnView", "formId", "required", "formKey", "globalControl", "scrollToError", "optimize"];
15
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
16
  import { DoubleLeftOutlined } from '@ant-design/icons';
17
17
  import classnames from 'classnames';
@@ -53,7 +53,7 @@ var ProForm = function ProForm(props, ref) {
53
53
  labelWidth = props.labelWidth,
54
54
  onValuesChange = props.onValuesChange,
55
55
  onFinish = props.onFinish,
56
- originalValues = props.originalValues,
56
+ diffConfig = props.diffConfig,
57
57
  submitOnEnter = props.submitOnEnter,
58
58
  _props$clearNotShow = props.clearNotShow,
59
59
  clearNotShow = _props$clearNotShow === void 0 ? true : _props$clearNotShow,
@@ -62,8 +62,6 @@ var ProForm = function ProForm(props, ref) {
62
62
  requiredOnView = _props$requiredOnView === void 0 ? true : _props$requiredOnView,
63
63
  formId = props.formId,
64
64
  required = props.required,
65
- _props$originalDiffTi = props.originalDiffTip,
66
- originalDiffTip = _props$originalDiffTi === void 0 ? true : _props$originalDiffTi,
67
65
  formKey = props.formKey,
68
66
  globalControl = props.globalControl,
69
67
  _props$scrollToError = props.scrollToError,
@@ -202,7 +200,7 @@ var ProForm = function ProForm(props, ref) {
202
200
  if (isView || disabled) {
203
201
  // 查看或禁用模式
204
202
  footerEle = null;
205
- } else if ( /*#__PURE__*/React.isValidElement(footer)) {
203
+ } else if (/*#__PURE__*/React.isValidElement(footer)) {
206
204
  // 传入组件渲染组件
207
205
  footerEle = footer;
208
206
  } else if (footer === undefined || footer || isObject(footer)) {
@@ -261,11 +259,10 @@ var ProForm = function ProForm(props, ref) {
261
259
  colProps: colProps,
262
260
  viewEmpty: viewEmpty,
263
261
  labelWidth: labelWidth,
264
- originalValues: originalValues,
262
+ diffConfig: diffConfig,
265
263
  clearNotShow: clearNotShow,
266
264
  requiredOnView: requiredOnView,
267
265
  required: required,
268
- originalDiffTip: originalDiffTip,
269
266
  globalControl: globalControl
270
267
  }), footerRender()]
271
268
  })), children]
@@ -44,6 +44,17 @@ export interface ProFormOtherProps {
44
44
  listName?: any[] | string | number;
45
45
  globalControl?: boolean;
46
46
  formDisabled?: boolean;
47
+ isDiffChange?: boolean;
48
+ }
49
+ export interface DiffConfigProps<Values = any> {
50
+ /** 比对原始数据源 */
51
+ originalValues: Values;
52
+ /** 是否显示对比值气泡 */
53
+ toolTip?: boolean;
54
+ /** 变更提示颜色 */
55
+ changeTipColor?: string;
56
+ /** 新增提示颜色 */
57
+ addTipColor?: string;
47
58
  }
48
59
  export interface ProFormProps<Values = any> extends FormProps<Values> {
49
60
  disabled?: boolean;
@@ -67,14 +78,14 @@ export interface ProFormProps<Values = any> extends FormProps<Values> {
67
78
  viewEmpty?: React.ReactNode | string;
68
79
  confirmLoading?: boolean;
69
80
  labelWidth?: string | number;
70
- originalValues?: Values;
71
81
  /** 是否回车提交 */
72
82
  submitOnEnter?: boolean;
73
83
  clearNotShow?: boolean;
74
84
  requiredOnView?: boolean;
75
85
  formId?: string;
76
86
  required?: boolean | boolean[];
77
- originalDiffTip?: boolean;
87
+ /** 表单比对配置 */
88
+ diffConfig?: DiffConfigProps;
78
89
  scrollToError?: boolean;
79
90
  /** 性能模式,谨慎使用,默认不开启
80
91
  * 1. 开启不过滤names的中间态值
@@ -99,10 +99,12 @@
99
99
 
100
100
  &.pro-form-item-width-auto {
101
101
  .@{ant-prefix}-form-item-control-input {
102
+ width: 100%;
102
103
  flex-grow: inherit;
103
104
  }
104
105
 
105
106
  .@{ant-prefix}-form-item-control-input-content {
107
+ width: 100%;
106
108
  flex: initial;
107
109
  }
108
110
  }
@@ -216,7 +218,7 @@
216
218
 
217
219
  .site-input-left,
218
220
  .site-input-right {
219
- width: calc(50% - 20px);
221
+ width: calc(50% - 16px);
220
222
  }
221
223
 
222
224
  .site-input-left {
@@ -314,16 +316,23 @@
314
316
  vertical-align: middle;
315
317
  }
316
318
  }
317
- .pro-form-list-mode-block{
318
- .pro-collapse-content{
319
- .@{ant-prefix}-row{
319
+
320
+ .pro-form-list-mode-block {
321
+ .pro-collapse-content {
322
+ .@{ant-prefix}-row {
320
323
  width: auto;
321
324
  }
322
325
  }
323
326
  }
324
327
 
325
- // 比较原始值场景下 不同时的样式
326
328
  .pro-form-item-changed {
329
+ border-radius: 4px;
330
+ background: @zaui-contract-bg !important;
331
+
332
+ .@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
333
+ background: @zaui-contract-bg !important;
334
+ }
335
+
327
336
  span.@{ant-prefix}-input-affix-wrapper,
328
337
  .@{ant-prefix}-select .@{ant-prefix}-select-selector,
329
338
  .@{ant-prefix}-picker,
@@ -367,10 +376,99 @@
367
376
  }
368
377
  }
369
378
 
379
+ // checkbox
380
+ .@{ant-prefix}-checkbox-group {
381
+ padding: 5px 0
382
+ }
383
+ // switch
384
+ &:has(.@{ant-prefix}-switch) {
385
+ padding: 5px 0;
386
+ }
387
+
388
+ // textArea
389
+ .@{ant-prefix}-input-textarea > textarea {
390
+ background: @zaui-contract-bg;
391
+ }
392
+
370
393
  .pro-form-view-container {
371
394
  padding: 4px 8px;
372
395
  background: @zaui-contract-bg;
373
396
  border-radius: 4px;
374
397
  }
375
398
  }
399
+
400
+
401
+ // 比较原始值场景下 不同时的样式
402
+ .pro-form-item-add {
403
+ border-radius: 4px;
404
+ background: @zaui-contract-bg-add !important;
405
+
406
+ .@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
407
+ background: @zaui-contract-bg-add !important;
408
+ }
409
+
410
+ span.@{ant-prefix}-input-affix-wrapper,
411
+ .@{ant-prefix}-select .@{ant-prefix}-select-selector,
412
+ .@{ant-prefix}-picker,
413
+ .@{ant-prefix}-input-number {
414
+ background: @zaui-contract-bg-add !important;
415
+
416
+ input {
417
+ background: transparent !important;
418
+ }
419
+ .@{ant-prefix}-select-selection-placeholder {
420
+ z-index: 9;
421
+ }
422
+ }
423
+
424
+ .@{ant-prefix}-form-item-control:has(.@{ant-prefix}-switch-handle),
425
+ .@{ant-prefix}-form-item-control:has(.@{ant-prefix}-checkbox-wrapper-in-form-item) {
426
+ background: @zaui-contract-bg-add;
427
+ border-radius: 4px;
428
+ }
429
+
430
+ // 地址组件
431
+ .@{ant-prefix}-form-item-control-input-content {
432
+ // 查看模式
433
+ & > span {
434
+ border-radius: 4px;
435
+ padding: 5px 8px;
436
+ background: @zaui-contract-bg-add;
437
+ }
438
+
439
+ & > .pro-address {
440
+ .@{ant-prefix}-select-selector,
441
+ .@{ant-prefix}-input-affix-wrapper,
442
+ .@{ant-prefix}-input-disabled {
443
+ background: @zaui-contract-bg-add;
444
+ }
445
+ }
446
+ & > .@{ant-prefix}-input-group {
447
+ .forever-checkbox {
448
+ background: @zaui-contract-bg-add;
449
+ }
450
+ }
451
+ }
452
+
453
+ // checkbox
454
+ .@{ant-prefix}-checkbox-group {
455
+ padding: 5px 0
456
+ }
457
+ // switch
458
+ &:has(.@{ant-prefix}-switch) {
459
+ padding: 5px 0;
460
+ }
461
+
462
+ // textArea
463
+ .@{ant-prefix}-input-textarea > textarea {
464
+ background: @zaui-contract-bg-add;
465
+ }
466
+
467
+
468
+ .pro-form-view-container {
469
+ padding: 4px 8px;
470
+ background: @zaui-contract-bg-add;
471
+ border-radius: 4px;
472
+ }
473
+ }
376
474
  }
@@ -1,9 +1,9 @@
1
1
  import { FormInstance } from 'antd';
2
- interface Params {
2
+ export interface DiffOriginalParams {
3
3
  originalValue: any;
4
4
  value: any;
5
5
  form: FormInstance;
6
- equalWith?: (originalValue: any, currentValue: any) => boolean;
6
+ equalWith?: (originalValue: any, currentValue: any) => DiffType | boolean | undefined;
7
7
  }
8
- export declare const diffOriginal: (params: Params) => boolean;
9
- export {};
8
+ export type DiffType = 'same' | 'add' | 'changed';
9
+ export declare const diffOriginal: (params: DiffOriginalParams) => DiffType;
@@ -1,4 +1,5 @@
1
1
  import { isEqual, isFunction } from 'lodash';
2
+ import { isEmpty } from '../../utils';
2
3
  var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
3
4
  export var diffOriginal = function diffOriginal(params) {
4
5
  var originalValue = params.originalValue,
@@ -6,19 +7,29 @@ export var diffOriginal = function diffOriginal(params) {
6
7
  equalWith = params.equalWith;
7
8
  // 支持传入自定义比较事件
8
9
  if (isFunction(equalWith)) {
9
- return !equalWith(originalValue, value);
10
+ var diffRes = equalWith(originalValue, value);
11
+ if (diffRes === undefined) return 'same';
12
+ if (typeof diffRes === 'boolean') {
13
+ return diffRes ? 'same' : 'changed';
14
+ }
15
+ return diffRes;
16
+ }
17
+ // 如果原始值为空 且当前有值的话 认为变更类型是新增
18
+ if (isEmpty(originalValue) && !isEmpty(value)) {
19
+ return 'add';
10
20
  }
11
21
  if (Array.isArray(originalValue)) {
12
- return originalValue.some(function (valueItem, index) {
22
+ var isSame = originalValue.every(function (valueItem, index) {
13
23
  // 如果两个值有一个不是空值, 则进行深比较
14
- if (!nullValue.includes(value === null || value === void 0 ? void 0 : value[index]) || !nullValue.includes(valueItem)) {
15
- return !isEqual(value === null || value === void 0 ? void 0 : value[index], valueItem);
24
+ if (!isEmpty(value === null || value === void 0 ? void 0 : value[index]) || !isEmpty(valueItem)) {
25
+ return isEqual(value === null || value === void 0 ? void 0 : value[index], valueItem);
16
26
  }
17
- return false;
27
+ return true;
18
28
  });
29
+ return isSame ? 'same' : 'changed';
19
30
  }
20
31
  if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
21
- return !isEqual(value, originalValue);
32
+ return isEqual(value, originalValue) ? 'same' : 'changed';
22
33
  }
23
- return false;
34
+ return 'same';
24
35
  };
@@ -1,8 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["value"];
4
2
  import { set } from 'lodash';
5
3
  import { diffField } from '../utils';
4
+ import { isEmpty } from '../../utils';
6
5
  export var transformValue = function transformValue(names, form, fieldName, _normalize, _getValueProps) {
7
6
  return {
8
7
  normalize: function normalize(value) {
@@ -22,23 +21,30 @@ export var transformValue = function transformValue(names, form, fieldName, _nor
22
21
  return _value;
23
22
  },
24
23
  getValueProps: function getValueProps(value) {
24
+ var _curValue;
25
25
  var _value = [];
26
26
  names.forEach(function (name, index) {
27
27
  var value = form.getFieldValue(name);
28
28
  _value[index] = value;
29
29
  });
30
30
  // 支持外部传入转换函数
31
- var _ref = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
32
- value: _value
33
- },
34
- cusValue = _ref.value,
35
- cusRest = _objectWithoutProperties(_ref, _excluded);
31
+ var res = (_getValueProps === null || _getValueProps === void 0 ? void 0 : _getValueProps(_value)) || {
32
+ value: _value
33
+ };
34
+ // 如果数组中值都为空, 则值置为空
35
+ var curValue = res === null || res === void 0 ? void 0 : res.value;
36
36
  // @ts-ignore
37
- set(form.getFieldsValue(true), fieldName, cusValue);
37
+ if ((_curValue = curValue) === null || _curValue === void 0 ? void 0 : _curValue.every(function (item) {
38
+ return isEmpty(item);
39
+ })) {
40
+ curValue = undefined;
41
+ }
42
+ // @ts-ignore
43
+ set(form.getFieldsValue(true), fieldName, curValue);
38
44
  // 如果表单里的值和组合得到的值不全等 更新表单里的值、
39
- return _objectSpread({
40
- value: cusValue
41
- }, cusRest);
45
+ return _objectSpread(_objectSpread({}, res), {}, {
46
+ value: curValue
47
+ });
42
48
  },
43
49
  shouldUpdate: function shouldUpdate(prevValues, curValues) {
44
50
  return diffField(prevValues, curValues, names);
@@ -38,7 +38,7 @@ export var useForm = function useForm(originForm, options) {
38
38
  return getFieldsValue(nameList, filterFunc);
39
39
  };
40
40
  var _validateFields = /*#__PURE__*/function () {
41
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
41
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
42
42
  var _rest$,
43
43
  _len,
44
44
  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;
@@ -63,7 +63,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
63
63
  }
64
64
  if (isFunction(disabled)) {
65
65
  // RangePicker返回数组时,特殊处理
66
- if (type === 'RangePicker' && Array.isArray(disabled(values, {
66
+ if (['Group', 'RangePicker'].includes(type) && Array.isArray(disabled(values, {
67
67
  form: form,
68
68
  index: index,
69
69
  namePath: namePath
@@ -9,7 +9,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
9
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
10
10
  import "antd/es/select/style";
11
11
  import _Select from "antd/es/select";
12
- var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
12
+ var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "getValueProps", "isView"];
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
15
15
  import React, { useImperativeHandle, useState, forwardRef } from 'react';
@@ -53,10 +53,11 @@ export var ProSelect = function ProSelect(props, ref) {
53
53
  onChange = props.onChange,
54
54
  updateDataSource = props.updateDataSource,
55
55
  transformResponse = props.transformResponse,
56
+ getValueProps = props.getValueProps,
56
57
  isViewPro = props.isView,
57
58
  selectProps = _objectWithoutProperties(props, _excluded);
58
59
  selectProps.showCodeName = (_selectProps$showCode = selectProps.showCodeName) !== null && _selectProps$showCode !== void 0 ? _selectProps$showCode : showCodeName;
59
- var value = props.value;
60
+ var value = getValueProps && props.value ? getValueProps(props.value) : props.value;
60
61
  var _ref2 = ProForm.useFieldProps() || {},
61
62
  isViewCon = _ref2.isView,
62
63
  viewEmpty = _ref2.viewEmpty;
@@ -216,6 +217,7 @@ export var ProSelect = function ProSelect(props, ref) {
216
217
  return props.children;
217
218
  };
218
219
  var handleChange = function handleChange(value, option) {
220
+ var getChangeValue = selectProps.getChangeValue;
219
221
  if (selectProps.mode && selectProps.mode === 'multiple') {
220
222
  if (Array.isArray(option)) {
221
223
  option.forEach(function (item) {
@@ -225,14 +227,14 @@ export var ProSelect = function ProSelect(props, ref) {
225
227
  });
226
228
  }
227
229
  if (labelInValue) {
228
- onChange === null || onChange === void 0 ? void 0 : onChange(getValueObject(value), option);
230
+ onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(getValueObject(value)) : getValueObject(value), option);
229
231
  } else {
230
- onChange === null || onChange === void 0 ? void 0 : onChange(value, option);
232
+ onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, option);
231
233
  }
232
234
  } else if (!selectProps.mode && labelInValue) {
233
- onChange(getValueObject(value), option);
235
+ onChange(getChangeValue ? getChangeValue(getValueObject(value)) : getValueObject(value), option);
234
236
  } else {
235
- onChange === null || onChange === void 0 ? void 0 : onChange(value, option === null || option === void 0 ? void 0 : option.record);
237
+ onChange === null || onChange === void 0 ? void 0 : onChange(getChangeValue ? getChangeValue(value) : value, option === null || option === void 0 ? void 0 : option.record);
236
238
  }
237
239
  };
238
240
  /**
@@ -278,7 +280,7 @@ export var ProSelect = function ProSelect(props, ref) {
278
280
  if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
279
281
  newSelectList = getSelectList({
280
282
  otherProps: otherProps,
281
- value: props.value,
283
+ value: value,
282
284
  dataSource: selectList,
283
285
  labelInValue: labelInValue,
284
286
  fieldNames: fieldNames,
@@ -294,8 +296,8 @@ export var ProSelect = function ProSelect(props, ref) {
294
296
  showArrow: true,
295
297
  loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
296
298
  onChange: handleChange,
297
- optionLabelProp: "children" // 解决warning报错,添加默认值
298
- ,
299
+ optionLabelProp: (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isDiffChange) ? 'label' : 'children',
300
+ // optionLabelProp="label" // 解决warning报错,添加默认值
299
301
  showSearch: true,
300
302
  filterOption: isFunction(_onSearch) ? false : function (input, option) {
301
303
  var _option$children, _option$children$prop;
@@ -312,16 +314,15 @@ export var ProSelect = function ProSelect(props, ref) {
312
314
  value: transformValue(),
313
315
  children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
314
316
  return _jsx(Option, {
317
+ label: item[label],
315
318
  value: item[code],
316
319
  record: item,
317
320
  disabled: !!item.disabled,
318
321
  children: _jsx(TooltipOption, {
319
322
  title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
320
323
  children: OptionRender ? _jsx("span", {
321
- title: OptionRender(item),
322
324
  children: OptionRender(item)
323
325
  }) : _jsx("span", {
324
- title: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
325
326
  children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
326
327
  })
327
328
  }, 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[] 批量获取数据 */
@@ -30,7 +30,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
30
30
  _iterator.f();
31
31
  }
32
32
  if (mode === 'multiple') {
33
- selectValues = [].concat(_toConsumableArray(selectValues), _toConsumableArray(result));
33
+ selectValues = [].concat(_toConsumableArray(selectValues), _toConsumableArray(result || []));
34
34
  } else {
35
35
  selectValues.push(result);
36
36
  }
@@ -53,13 +53,14 @@ export var getSelectList = function getSelectList(_ref2) {
53
53
  if (!otherProps) {
54
54
  return null;
55
55
  }
56
- var listName = otherProps.listName,
56
+ var name = otherProps.name,
57
+ listName = otherProps.listName,
57
58
  form = otherProps.form;
58
59
  var firstNumberIndex = listName.lastIndexOf(listName.findLast(function (item) {
59
60
  return typeof item === 'number';
60
61
  }));
61
- var fatherName = listName.slice(0, firstNumberIndex);
62
- var selectName = listName.slice(firstNumberIndex + 1);
62
+ var fatherName = (name || listName).slice(0, firstNumberIndex);
63
+ var selectName = (name || listName).slice(firstNumberIndex + 1);
63
64
  return findSelectNameValues({
64
65
  list: form.getFieldValue(fatherName) || [],
65
66
  selectName: selectName,
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const _default: ({ children, delayTime, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>;
2
+ declare const _default: ({ children, delayTime, excludes, ...props }: any) => React.DetailedReactHTMLElement<any, HTMLElement>;
3
3
  export default _default;
@@ -2,25 +2,28 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["children", "delayTime"];
5
+ var _excluded = ["children", "delayTime", "excludes"];
6
6
  import { throttle } from 'lodash';
7
7
  import React from 'react';
8
8
  import { useStep } from '../../index';
9
9
  export default (function (_ref) {
10
10
  var children = _ref.children,
11
11
  delayTime = _ref.delayTime,
12
+ excludes = _ref.excludes,
12
13
  props = _objectWithoutProperties(_ref, _excluded);
13
14
  var _useStep = useStep(),
14
15
  notify = _useStep.notify;
15
16
  return /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, props), {}, {
16
- onClick: throttle( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
17
+ onClick: throttle(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
17
18
  var values;
18
19
  return _regeneratorRuntime().wrap(function _callee$(_context) {
19
20
  while (1) switch (_context.prev = _context.next) {
20
21
  case 0:
21
22
  localStorage.setItem('cache-pro-step', '');
22
23
  _context.next = 3;
23
- return notify === null || notify === void 0 ? void 0 : notify();
24
+ return notify === null || notify === void 0 ? void 0 : notify({
25
+ excludes: excludes
26
+ });
24
27
  case 3:
25
28
  values = _context.sent;
26
29
  setTimeout(function () {
@@ -7,6 +7,6 @@ declare const ProStep: {
7
7
  ({ children, ...resetProps }: ProStepPropsType): import("react/jsx-runtime").JSX.Element;
8
8
  useStep: () => any;
9
9
  Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItem) => import("react/jsx-runtime").JSX.Element;
10
- Listener: ({ children, delayTime, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
10
+ Listener: ({ children, delayTime, excludes, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
11
11
  };
12
12
  export default ProStep;