@zat-design/sisyphus-react 4.0.0-beta.8 → 4.0.0

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 (443) hide show
  1. package/babel.config.js.backup +13 -0
  2. package/dist/index.esm.css +1 -1
  3. package/dist/less.esm.css +1 -1
  4. package/es/ProAction/index.js +14 -4
  5. package/es/ProConfigProvider/index.js +11 -2
  6. package/es/ProDownload/index.js +16 -5
  7. package/es/ProDownload/utils.js +8 -3
  8. package/es/ProDrawerForm/components/ProDrawer/index.js +14 -4
  9. package/es/ProDrawerForm/components/ProModal/index.js +14 -4
  10. package/es/ProDrawerForm/index.js +13 -3
  11. package/es/ProEditLabel/components/RenderProForm.js +5 -1
  12. package/es/ProEditLabel/index.js +16 -5
  13. package/es/ProEditTable/components/ActionButton/index.js +5 -1
  14. package/es/ProEditTable/components/RcTable/BaseTable.js +13 -3
  15. package/es/ProEditTable/components/RcTable/DraggableTable.js +12 -5
  16. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -2
  17. package/es/ProEditTable/components/RenderField/index.js +54 -29
  18. package/es/ProEditTable/components/RenderToolbar/index.js +10 -4
  19. package/es/ProEditTable/index.js +16 -5
  20. package/es/ProEditTable/propsType.d.ts +12 -6
  21. package/es/ProEditTable/style/index.less +30 -3
  22. package/es/ProEditTable/utils/config.js +8 -3
  23. package/es/ProEditTable/utils/index.js +13 -9
  24. package/es/ProEditTable/utils/tools.js +22 -10
  25. package/es/ProEditTable/utils/useEditTableError.js +6 -1
  26. package/es/ProEditTable/utils/useShouldUpdateForTable.js +16 -7
  27. package/es/ProEnum/components/Group.js +6 -1
  28. package/es/ProEnum/components/Tag.js +6 -1
  29. package/es/ProEnum/hooks/useEnum.d.ts +8 -0
  30. package/es/ProEnum/hooks/useEnum.js +76 -4
  31. package/es/ProEnum/hooks/useEnumRequest.js +8 -3
  32. package/es/ProEnum/hooks/useFrequentEnumRequest.js +8 -3
  33. package/es/ProEnum/index.js +25 -15
  34. package/es/ProEnum/utils/eventCenter.js +3 -1
  35. package/es/ProEnum/utils/frequentEnum.js +5 -1
  36. package/es/ProEnum/utils/index.js +2 -1
  37. package/es/ProForm/components/FormFooter/index.js +5 -1
  38. package/es/ProForm/components/base/Checkbox/index.js +7 -2
  39. package/es/ProForm/components/base/DatePicker/index.js +7 -2
  40. package/es/ProForm/components/base/DatePicker/useDateLimit.js +6 -1
  41. package/es/ProForm/components/base/Input/index.js +7 -2
  42. package/es/ProForm/components/base/InputNumber/index.js +13 -3
  43. package/es/ProForm/components/base/Radio/index.js +7 -2
  44. package/es/ProForm/components/base/RangePicker/index.d.ts +7 -1
  45. package/es/ProForm/components/base/RangePicker/index.js +50 -4
  46. package/es/ProForm/components/base/RangePicker/useDateRange.js +6 -1
  47. package/es/ProForm/components/base/Select/index.js +7 -2
  48. package/es/ProForm/components/base/Switch/index.js +7 -2
  49. package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -2
  50. package/es/ProForm/components/base/TextArea/index.js +7 -2
  51. package/es/ProForm/components/base/TimePicker/index.js +7 -2
  52. package/es/ProForm/components/combination/Container/index.js +5 -1
  53. package/es/ProForm/components/combination/Container/style/index.less +5 -0
  54. package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
  55. package/es/ProForm/components/combination/FormList/components/ActionButton.js +94 -7
  56. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
  57. package/es/ProForm/components/combination/FormList/components/BlockFields.js +63 -6
  58. package/es/ProForm/components/combination/FormList/components/Empty.js +14 -4
  59. package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +1 -0
  60. package/es/ProForm/components/combination/FormList/components/LineFields.js +9 -3
  61. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +48 -13
  62. package/es/ProForm/components/combination/FormList/index.js +108 -61
  63. package/es/ProForm/components/combination/FormList/propsType.d.ts +7 -2
  64. package/es/ProForm/components/combination/FormList/style/index.less +41 -0
  65. package/es/ProForm/components/combination/FormList/utils.d.ts +6 -0
  66. package/es/ProForm/components/combination/FormList/utils.js +17 -0
  67. package/es/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
  68. package/es/ProForm/components/combination/Group/component/ComRender.js +70 -3
  69. package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
  70. package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +351 -0
  71. package/es/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
  72. package/es/ProForm/components/combination/Group/hooks/index.js +107 -4
  73. package/es/ProForm/components/combination/Group/index.d.ts +3 -4
  74. package/es/ProForm/components/combination/Group/index.js +108 -24
  75. package/es/ProForm/components/combination/Group/propsType.d.ts +44 -1
  76. package/es/ProForm/components/combination/Group/style/index.less +425 -3
  77. package/es/ProForm/components/combination/Group/utils/index.d.ts +154 -0
  78. package/es/ProForm/components/combination/Group/utils/index.js +428 -0
  79. package/es/ProForm/components/combination/ProCascader/index.js +13 -3
  80. package/es/ProForm/components/combination/ProCascader/utils/index.js +7 -2
  81. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +14 -4
  82. package/es/ProForm/components/combination/ProModalSelect/index.js +16 -5
  83. package/es/ProForm/components/combination/ProNumberRange/index.js +24 -12
  84. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
  85. package/es/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
  86. package/es/ProForm/components/combination/ProRangeLimit/index.js +13 -3
  87. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +6 -1
  88. package/es/ProForm/components/combination/ProTimeLimit/index.js +13 -3
  89. package/es/ProForm/components/render/ChangedWrapper.js +7 -2
  90. package/es/ProForm/components/render/ConfirmWrapper.js +10 -4
  91. package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
  92. package/es/ProForm/components/render/CustomComponentViewWrapper.js +120 -0
  93. package/es/ProForm/components/render/Render.js +71 -16
  94. package/es/ProForm/components/render/RenderFields.js +7 -2
  95. package/es/ProForm/index.js +13 -3
  96. package/es/ProForm/propsType.d.ts +7 -0
  97. package/es/ProForm/style/index.less +11 -2
  98. package/es/ProForm/utils/index.js +7 -2
  99. package/es/ProForm/utils/rulesCreator.js +5 -1
  100. package/es/ProForm/utils/transformValue.js +5 -1
  101. package/es/ProForm/utils/useForm.js +15 -5
  102. package/es/ProForm/utils/useShouldUpdate.js +93 -35
  103. package/es/ProForm/utils/useWatch.js +9 -4
  104. package/es/ProForm/utils/valueType.js +11 -2
  105. package/es/ProIcon/index.js +13 -3
  106. package/es/ProIcon/utils/index.js +5 -1
  107. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +19 -14
  108. package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
  109. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +48 -31
  110. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
  111. package/es/ProLayout/components/Layout/Notice/style/index.less +4 -0
  112. package/es/ProLayout/components/ProCollapse/index.js +5 -1
  113. package/es/ProLayout/components/ProCollapse/style/index.less +9 -9
  114. package/es/ProLayout/components/ProFooter/index.js +6 -2
  115. package/es/ProLayout/components/ProHeader/index.js +33 -19
  116. package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
  117. package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +100 -0
  118. package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
  119. package/es/ProLayout/components/TabsManager/components/TabItem.js +61 -0
  120. package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
  121. package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -0
  122. package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
  123. package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +14 -0
  124. package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
  125. package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +26 -0
  126. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
  127. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +96 -0
  128. package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
  129. package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +364 -0
  130. package/es/ProLayout/components/TabsManager/index.d.ts +8 -0
  131. package/es/ProLayout/components/TabsManager/index.js +180 -0
  132. package/es/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
  133. package/es/ProLayout/components/TabsManager/propTypes.js +16 -0
  134. package/es/ProLayout/components/TabsManager/style/index.less +179 -0
  135. package/es/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
  136. package/es/ProLayout/components/TabsManager/utils/index.js +106 -0
  137. package/es/ProLayout/index.d.ts +21 -4
  138. package/es/ProLayout/index.js +107 -14
  139. package/es/ProLayout/propTypes.d.ts +139 -1
  140. package/es/ProLayout/propTypes.js +37 -1
  141. package/es/ProLayout/utils/index.js +16 -7
  142. package/es/ProSelect/components/AdaptiveTooltip.js +6 -1
  143. package/es/ProSelect/index.js +13 -3
  144. package/es/ProSelect/utils/index.js +3 -1
  145. package/es/ProStep/components/Item/index.js +8 -2
  146. package/es/ProStep/components/Listener/index.js +10 -4
  147. package/es/ProStep/components/Step/index.js +11 -2
  148. package/es/ProStep/index.js +16 -5
  149. package/es/ProStep/utils/index.js +5 -1
  150. package/es/ProStepTab/index.js +19 -8
  151. package/es/ProTable/components/FormatColumn/index.js +7 -2
  152. package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -2
  153. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +10 -4
  154. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +5 -1
  155. package/es/ProTable/components/RcTable/components/DraggableTable/index.js +7 -2
  156. package/es/ProTable/components/RenderColumn/index.js +11 -2
  157. package/es/ProTable/components/RenderTabs/index.js +11 -2
  158. package/es/ProTable/components/TableResizable/index.js +13 -3
  159. package/es/ProTable/components/TooltipTitle/index.js +3 -5
  160. package/es/ProTable/hooks/useAntdTable.js +69 -35
  161. package/es/ProTable/index.js +16 -5
  162. package/es/ProTable/style/index.less +3 -0
  163. package/es/ProTable/utils/index.js +6 -1
  164. package/es/ProTabs/index.js +13 -3
  165. package/es/ProThemeTools/component/ProTools/index.js +11 -2
  166. package/es/ProThemeTools/context/ThemeContext.js +11 -2
  167. package/es/ProThemeTools/index.js +13 -3
  168. package/es/ProThemeTools/utils/index.js +5 -1
  169. package/es/ProTooltip/index.js +13 -3
  170. package/es/ProTree/components/CloseIcon.js +5 -1
  171. package/es/ProTree/components/List.js +7 -2
  172. package/es/ProTree/components/ProTree.js +16 -5
  173. package/es/ProTree/components/ProTreeSelect/index.js +119 -75
  174. package/es/ProTree/components/Tree.js +16 -5
  175. package/es/ProTree/index.js +5 -1
  176. package/es/ProTree/utils.js +8 -2
  177. package/es/ProTreeModal/components/Cascader.js +11 -2
  178. package/es/ProTreeModal/components/CloseIcon.js +5 -1
  179. package/es/ProTreeModal/components/List.js +6 -1
  180. package/es/ProTreeModal/components/SortableItem.js +5 -1
  181. package/es/ProTreeModal/components/Tree.js +13 -3
  182. package/es/ProTreeModal/components/Trigger.js +11 -2
  183. package/es/ProTreeModal/index.js +11 -2
  184. package/es/ProTreeModal/style/index.less +6 -0
  185. package/es/ProTreeModal/utils.js +8 -2
  186. package/es/ProUpload/components/ButtonRender.js +8 -3
  187. package/es/ProUpload/components/DragRender.d.ts +1 -0
  188. package/es/ProUpload/components/DragRender.js +10 -2
  189. package/es/ProUpload/components/DraggableUploadListItem.js +5 -1
  190. package/es/ProUpload/components/Example.js +11 -2
  191. package/es/ProUpload/components/ImageRender.js +14 -4
  192. package/es/ProUpload/index.js +17 -5
  193. package/es/ProUpload/propsType.d.ts +5 -0
  194. package/es/ProViewer/index.js +14 -4
  195. package/es/ProWaterMark/index.js +5 -1
  196. package/es/index.d.ts +1 -2
  197. package/es/index.js +1 -0
  198. package/es/locale/en_US.d.ts +9 -0
  199. package/es/locale/en_US.js +9 -0
  200. package/es/locale/zh_CN.d.ts +9 -0
  201. package/es/locale/zh_CN.js +9 -0
  202. package/es/style/theme/antd.less +11 -35
  203. package/es/utils/index.js +6 -1
  204. package/jest.config.js +3 -1
  205. package/lib/FormsProvider/index.js +2 -1
  206. package/lib/ProAction/index.js +20 -10
  207. package/lib/ProConfigProvider/index.js +29 -19
  208. package/lib/ProDownload/index.js +29 -17
  209. package/lib/ProDownload/utils.js +14 -12
  210. package/lib/ProDrawerForm/components/ProDrawer/index.js +27 -16
  211. package/lib/ProDrawerForm/components/ProModal/index.js +21 -10
  212. package/lib/ProDrawerForm/components/index.js +2 -2
  213. package/lib/ProDrawerForm/index.js +20 -9
  214. package/lib/ProEditLabel/components/RenderProForm.js +9 -6
  215. package/lib/ProEditLabel/index.js +30 -18
  216. package/lib/ProEditTable/components/ActionButton/index.js +14 -11
  217. package/lib/ProEditTable/components/RcTable/BaseTable.js +19 -9
  218. package/lib/ProEditTable/components/RcTable/DraggableTable.js +24 -16
  219. package/lib/ProEditTable/components/RcTable/index.js +2 -2
  220. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +16 -10
  221. package/lib/ProEditTable/components/RenderField/index.js +76 -50
  222. package/lib/ProEditTable/components/RenderToolbar/index.js +18 -12
  223. package/lib/ProEditTable/components/index.js +2 -2
  224. package/lib/ProEditTable/index.js +33 -21
  225. package/lib/ProEditTable/propsType.d.ts +12 -6
  226. package/lib/ProEditTable/style/index.less +30 -3
  227. package/lib/ProEditTable/utils/config.js +20 -15
  228. package/lib/ProEditTable/utils/index.js +22 -18
  229. package/lib/ProEditTable/utils/tools.js +30 -21
  230. package/lib/ProEditTable/utils/useEditTableError.js +7 -3
  231. package/lib/ProEditTable/utils/useShouldUpdateForTable.js +17 -9
  232. package/lib/ProEnum/components/Group.js +8 -3
  233. package/lib/ProEnum/components/Tag.js +8 -3
  234. package/lib/ProEnum/hooks/useEnum.d.ts +8 -0
  235. package/lib/ProEnum/hooks/useEnum.js +76 -4
  236. package/lib/ProEnum/hooks/useEnumRequest.js +23 -18
  237. package/lib/ProEnum/hooks/useFrequentEnumRequest.js +12 -8
  238. package/lib/ProEnum/index.js +37 -26
  239. package/lib/ProEnum/utils/eventCenter.js +4 -3
  240. package/lib/ProEnum/utils/frequentEnum.js +6 -3
  241. package/lib/ProEnum/utils/index.js +3 -3
  242. package/lib/ProForm/components/Container.js +1 -1
  243. package/lib/ProForm/components/FormFooter/index.js +11 -6
  244. package/lib/ProForm/components/base/Checkbox/index.js +13 -7
  245. package/lib/ProForm/components/base/DatePicker/index.js +11 -6
  246. package/lib/ProForm/components/base/DatePicker/useDateLimit.js +7 -3
  247. package/lib/ProForm/components/base/Input/index.js +11 -6
  248. package/lib/ProForm/components/base/InputNumber/index.js +21 -10
  249. package/lib/ProForm/components/base/Radio/index.js +10 -5
  250. package/lib/ProForm/components/base/RangePicker/index.d.ts +7 -1
  251. package/lib/ProForm/components/base/RangePicker/index.js +55 -9
  252. package/lib/ProForm/components/base/RangePicker/useDateRange.js +7 -3
  253. package/lib/ProForm/components/base/Select/index.js +10 -5
  254. package/lib/ProForm/components/base/Switch/index.js +10 -5
  255. package/lib/ProForm/components/base/SwitchCheckbox/index.js +12 -6
  256. package/lib/ProForm/components/base/TextArea/index.js +10 -5
  257. package/lib/ProForm/components/base/TimePicker/index.js +10 -5
  258. package/lib/ProForm/components/combination/Container/index.js +11 -6
  259. package/lib/ProForm/components/combination/Container/style/index.less +5 -0
  260. package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
  261. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +108 -20
  262. package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
  263. package/lib/ProForm/components/combination/FormList/components/BlockFields.js +65 -8
  264. package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
  265. package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -7
  266. package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +1 -0
  267. package/lib/ProForm/components/combination/FormList/components/LineFields.js +11 -5
  268. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +58 -23
  269. package/lib/ProForm/components/combination/FormList/index.js +113 -65
  270. package/lib/ProForm/components/combination/FormList/propsType.d.ts +7 -2
  271. package/lib/ProForm/components/combination/FormList/style/index.less +41 -0
  272. package/lib/ProForm/components/combination/FormList/utils.d.ts +6 -0
  273. package/lib/ProForm/components/combination/FormList/utils.js +20 -2
  274. package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
  275. package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
  276. package/lib/ProForm/components/combination/Group/component/ComRender.js +79 -11
  277. package/lib/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
  278. package/lib/ProForm/components/combination/Group/component/FlexibleGroup.js +360 -0
  279. package/lib/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
  280. package/lib/ProForm/components/combination/Group/hooks/index.js +111 -9
  281. package/lib/ProForm/components/combination/Group/index.d.ts +3 -4
  282. package/lib/ProForm/components/combination/Group/index.js +111 -27
  283. package/lib/ProForm/components/combination/Group/propsType.d.ts +44 -1
  284. package/lib/ProForm/components/combination/Group/style/index.less +425 -3
  285. package/lib/ProForm/components/combination/Group/utils/index.d.ts +154 -0
  286. package/lib/ProForm/components/combination/Group/utils/index.js +444 -0
  287. package/lib/ProForm/components/combination/ProCascader/index.js +20 -10
  288. package/lib/ProForm/components/combination/ProCascader/utils/index.js +9 -5
  289. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +25 -15
  290. package/lib/ProForm/components/combination/ProModalSelect/index.js +53 -41
  291. package/lib/ProForm/components/combination/ProNumberRange/index.js +28 -16
  292. package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
  293. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
  294. package/lib/ProForm/components/combination/ProRangeLimit/index.js +29 -18
  295. package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +8 -3
  296. package/lib/ProForm/components/combination/ProTimeLimit/index.js +26 -15
  297. package/lib/ProForm/components/index.js +2 -2
  298. package/lib/ProForm/components/render/ChangedWrapper.js +16 -10
  299. package/lib/ProForm/components/render/ConfirmWrapper.js +19 -13
  300. package/lib/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
  301. package/lib/ProForm/components/render/CustomComponentViewWrapper.js +127 -0
  302. package/lib/ProForm/components/render/Render.js +93 -37
  303. package/lib/ProForm/components/render/RenderFields.js +15 -9
  304. package/lib/ProForm/index.js +23 -12
  305. package/lib/ProForm/propsType.d.ts +7 -0
  306. package/lib/ProForm/style/index.less +11 -2
  307. package/lib/ProForm/utils/index.js +12 -8
  308. package/lib/ProForm/utils/rulesCreator.js +8 -4
  309. package/lib/ProForm/utils/transformValue.js +6 -3
  310. package/lib/ProForm/utils/useFieldProps.js +2 -1
  311. package/lib/ProForm/utils/useForm.js +21 -12
  312. package/lib/ProForm/utils/useRules.js +1 -1
  313. package/lib/ProForm/utils/useShouldUpdate.js +94 -37
  314. package/lib/ProForm/utils/useWatch.js +11 -6
  315. package/lib/ProForm/utils/valueType.js +15 -6
  316. package/lib/ProIcon/index.js +26 -16
  317. package/lib/ProIcon/utils/index.js +7 -4
  318. package/lib/ProLayout/components/Layout/Header/index.js +1 -1
  319. package/lib/ProLayout/components/Layout/Icon/Icon.js +2 -1
  320. package/lib/ProLayout/components/Layout/Icon/index.js +1 -1
  321. package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +24 -19
  322. package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
  323. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +50 -33
  324. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
  325. package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +1 -1
  326. package/lib/ProLayout/components/Layout/Menu/index.js +1 -1
  327. package/lib/ProLayout/components/Layout/Notice/index.js +1 -1
  328. package/lib/ProLayout/components/Layout/Notice/style/index.less +4 -0
  329. package/lib/ProLayout/components/Layout/index.js +2 -2
  330. package/lib/ProLayout/components/ProCollapse/index.js +10 -6
  331. package/lib/ProLayout/components/ProCollapse/style/index.less +9 -9
  332. package/lib/ProLayout/components/ProFooter/index.js +8 -4
  333. package/lib/ProLayout/components/ProHeader/components/Copy/index.js +1 -1
  334. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +1 -1
  335. package/lib/ProLayout/components/ProHeader/components/index.js +2 -2
  336. package/lib/ProLayout/components/ProHeader/index.js +41 -27
  337. package/lib/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
  338. package/lib/ProLayout/components/TabsManager/components/TabContextMenu.js +106 -0
  339. package/lib/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
  340. package/lib/ProLayout/components/TabsManager/components/TabItem.js +67 -0
  341. package/lib/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
  342. package/lib/ProLayout/components/TabsManager/components/TabsContext.js +11 -0
  343. package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
  344. package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.js +20 -0
  345. package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
  346. package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +31 -0
  347. package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
  348. package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.js +103 -0
  349. package/lib/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
  350. package/lib/ProLayout/components/TabsManager/hooks/useTabsState.js +370 -0
  351. package/lib/ProLayout/components/TabsManager/index.d.ts +8 -0
  352. package/lib/ProLayout/components/TabsManager/index.js +183 -0
  353. package/lib/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
  354. package/lib/ProLayout/components/TabsManager/propTypes.js +22 -0
  355. package/lib/ProLayout/components/TabsManager/style/index.less +179 -0
  356. package/lib/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
  357. package/lib/ProLayout/components/TabsManager/utils/index.js +119 -0
  358. package/lib/ProLayout/components/index.js +2 -2
  359. package/lib/ProLayout/index.d.ts +21 -4
  360. package/lib/ProLayout/index.js +122 -21
  361. package/lib/ProLayout/propTypes.d.ts +139 -1
  362. package/lib/ProLayout/propTypes.js +40 -1
  363. package/lib/ProLayout/utils/index.js +18 -13
  364. package/lib/ProSelect/components/AdaptiveTooltip.js +7 -3
  365. package/lib/ProSelect/index.js +23 -12
  366. package/lib/ProSelect/utils/index.js +8 -8
  367. package/lib/ProStep/components/Anchor/index.js +1 -1
  368. package/lib/ProStep/components/Item/index.js +15 -9
  369. package/lib/ProStep/components/Listener/index.js +15 -9
  370. package/lib/ProStep/components/Step/index.js +17 -7
  371. package/lib/ProStep/index.js +30 -19
  372. package/lib/ProStep/utils/index.js +6 -3
  373. package/lib/ProStepTab/index.js +33 -22
  374. package/lib/ProTable/components/FormatColumn/index.js +22 -16
  375. package/lib/ProTable/components/RcTable/components/BaseTable/index.js +9 -5
  376. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +22 -16
  377. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -5
  378. package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +11 -6
  379. package/lib/ProTable/components/RcTable/index.js +2 -2
  380. package/lib/ProTable/components/RenderColumn/index.js +17 -8
  381. package/lib/ProTable/components/RenderTabs/index.js +16 -7
  382. package/lib/ProTable/components/TableResizable/index.js +19 -9
  383. package/lib/ProTable/components/TooltipTitle/index.js +3 -6
  384. package/lib/ProTable/components/index.js +2 -2
  385. package/lib/ProTable/hooks/useAntdTable.js +94 -60
  386. package/lib/ProTable/index.js +41 -29
  387. package/lib/ProTable/style/index.less +3 -0
  388. package/lib/ProTable/utils/index.js +7 -3
  389. package/lib/ProTabs/components/index.js +2 -2
  390. package/lib/ProTabs/index.js +23 -12
  391. package/lib/ProThemeTools/component/ProTools/index.js +21 -11
  392. package/lib/ProThemeTools/component/index.js +2 -2
  393. package/lib/ProThemeTools/context/ThemeContext.js +20 -16
  394. package/lib/ProThemeTools/index.js +22 -12
  395. package/lib/ProThemeTools/utils/index.js +6 -3
  396. package/lib/ProTooltip/index.js +30 -20
  397. package/lib/ProTree/components/CloseIcon.js +6 -3
  398. package/lib/ProTree/components/List.js +10 -5
  399. package/lib/ProTree/components/ProTree.js +23 -12
  400. package/lib/ProTree/components/ProTreeSelect/index.js +138 -93
  401. package/lib/ProTree/components/SearchTitle.js +1 -1
  402. package/lib/ProTree/components/Tree.js +28 -16
  403. package/lib/ProTree/components/index.js +2 -2
  404. package/lib/ProTree/index.js +9 -5
  405. package/lib/ProTree/utils.js +16 -11
  406. package/lib/ProTreeModal/components/Cascader.js +14 -5
  407. package/lib/ProTreeModal/components/CloseIcon.js +6 -3
  408. package/lib/ProTreeModal/components/List.js +11 -7
  409. package/lib/ProTreeModal/components/SortableItem.js +10 -6
  410. package/lib/ProTreeModal/components/Tree.js +24 -13
  411. package/lib/ProTreeModal/components/Trigger.js +19 -9
  412. package/lib/ProTreeModal/components/index.js +2 -2
  413. package/lib/ProTreeModal/index.js +16 -6
  414. package/lib/ProTreeModal/style/index.less +6 -0
  415. package/lib/ProTreeModal/utils.js +17 -14
  416. package/lib/ProUpload/components/ButtonRender.js +14 -9
  417. package/lib/ProUpload/components/DragRender.d.ts +1 -0
  418. package/lib/ProUpload/components/DragRender.js +13 -5
  419. package/lib/ProUpload/components/DraggableUploadListItem.js +7 -3
  420. package/lib/ProUpload/components/Example.js +16 -6
  421. package/lib/ProUpload/components/FileItem.js +1 -1
  422. package/lib/ProUpload/components/ImageRender.js +20 -10
  423. package/lib/ProUpload/index.js +31 -18
  424. package/lib/ProUpload/propsType.d.ts +5 -0
  425. package/lib/ProViewer/index.js +22 -14
  426. package/lib/ProWaterMark/index.js +7 -3
  427. package/lib/index.d.ts +1 -2
  428. package/lib/index.js +4 -3
  429. package/lib/locale/en_US.d.ts +9 -0
  430. package/lib/locale/en_US.js +9 -0
  431. package/lib/locale/index.js +1 -1
  432. package/lib/locale/zh_CN.d.ts +9 -0
  433. package/lib/locale/zh_CN.js +9 -0
  434. package/lib/style/theme/antd.less +11 -35
  435. package/lib/utils/index.js +9 -4
  436. package/package.json +14 -17
  437. package/package.json.backup-antd5 +159 -0
  438. package/es/ProForm/components/combination/Group/utils.d.ts +0 -54
  439. package/es/ProForm/components/combination/Group/utils.js +0 -196
  440. package/es/assets/tip.svg +0 -1
  441. package/lib/ProForm/components/combination/Group/utils.d.ts +0 -54
  442. package/lib/ProForm/components/combination/Group/utils.js +0 -210
  443. package/lib/assets/tip.svg +0 -1
@@ -1,7 +1,13 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView", "viewRender"];
1
+ var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView", "viewRender", "formItemClassName", "formItemStyle", "dependencies", "name"];
2
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
9
  import React from 'react';
10
+ import { Form } from 'antd';
5
11
  import { omit } from 'lodash';
6
12
  import ConfirmWrapper from "../../../../components/render/ConfirmWrapper";
7
13
  import { FieldProvider } from "../../../../utils/useFieldProps";
@@ -49,6 +55,10 @@ var ComRender = props => {
49
55
  valueType = props.valueType,
50
56
  isView = props.isView,
51
57
  viewRender = props.viewRender,
58
+ formItemClassName = props.formItemClassName,
59
+ formItemStyle = props.formItemStyle,
60
+ dependencies = props.dependencies,
61
+ name = props.name,
52
62
  rest = _objectWithoutProperties(props, _excluded);
53
63
  var TypeComponent = componentMap[type];
54
64
  var mergedGetValueProps = getValueProps || (val => ({
@@ -75,6 +85,63 @@ var ComRender = props => {
75
85
  }
76
86
  var Component = component ? ( /*#__PURE__*/React.cloneElement(component, _objectSpread({}, componentProps))) : /*#__PURE__*/_jsx(TypeComponent, _objectSpread({}, componentProps));
77
87
  var renderComponent = getComRender(Component, props, componentProps);
88
+
89
+ // 传统模式 compact 模式:需要 Form.Item 包装并应用宽度样式
90
+ // 通过 formItemClassName 和 formItemStyle 来判断是否需要 Form.Item 包装
91
+ if (formItemClassName && name) {
92
+ // 如果有依赖字段,使用 shouldUpdate 来实时更新错误状态
93
+ if (dependencies && dependencies.length > 0) {
94
+ return /*#__PURE__*/_jsx(Form.Item, {
95
+ shouldUpdate: (prevValues, currentValues) => {
96
+ // 检查当前字段和依赖字段是否有变化
97
+ var currentFieldChanged = (prevValues === null || prevValues === void 0 ? void 0 : prevValues[name]) !== (currentValues === null || currentValues === void 0 ? void 0 : currentValues[name]);
98
+ var dependenciesChanged = dependencies.some(dep => {
99
+ var prevValue = prevValues === null || prevValues === void 0 ? void 0 : prevValues[dep];
100
+ var currentValue = currentValues === null || currentValues === void 0 ? void 0 : currentValues[dep];
101
+ return prevValue !== currentValue;
102
+ });
103
+ var hasChanged = currentFieldChanged || dependenciesChanged;
104
+ // 当检测到变化时,触发字段校验以更新错误状态
105
+ if (hasChanged && contextProps !== null && contextProps !== void 0 && contextProps.form && name) {
106
+ setTimeout(() => {
107
+ contextProps.form.validateFields([name]).catch(() => {});
108
+ }, 0);
109
+ }
110
+ return hasChanged;
111
+ },
112
+ noStyle: true,
113
+ children: () => /*#__PURE__*/_jsx(Form.Item, {
114
+ name: name,
115
+ className: formItemClassName,
116
+ style: formItemStyle,
117
+ children: /*#__PURE__*/_jsx(FieldProvider, {
118
+ value: _objectSpread(_objectSpread({}, contextProps), {}, {
119
+ valueType,
120
+ type,
121
+ isView
122
+ }),
123
+ children: renderComponent
124
+ })
125
+ })
126
+ });
127
+ }
128
+ // 没有依赖字段,直接渲染 Form.Item
129
+ return /*#__PURE__*/_jsx(Form.Item, {
130
+ name: name,
131
+ className: formItemClassName,
132
+ style: formItemStyle,
133
+ children: /*#__PURE__*/_jsx(FieldProvider, {
134
+ value: _objectSpread(_objectSpread({}, contextProps), {}, {
135
+ valueType,
136
+ type,
137
+ isView
138
+ }),
139
+ children: renderComponent
140
+ })
141
+ });
142
+ }
143
+
144
+ // 非传统模式 compact 模式:直接渲染组件
78
145
  return /*#__PURE__*/_jsx(FieldProvider, {
79
146
  value: _objectSpread(_objectSpread({}, contextProps), {}, {
80
147
  valueType,
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { GroupType, FlexibleGroupColumnType } from '../propsType';
3
+ interface FlexibleGroupProps extends Omit<GroupType, 'children'> {
4
+ children: FlexibleGroupColumnType[];
5
+ }
6
+ /**
7
+ * FlexibleGroup主组件
8
+ */
9
+ declare const FlexibleGroup: React.FC<FlexibleGroupProps>;
10
+ export default FlexibleGroup;
@@ -0,0 +1,351 @@
1
+ var _excluded = ["width"];
2
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ import React from 'react';
10
+ import { Space, Form } from 'antd';
11
+ import classnames from 'classnames';
12
+ import { isEmpty, isFunction } from 'lodash';
13
+ import { FieldProvider } from "../../../../utils/useFieldProps";
14
+ import ProForm from "../../../../../ProForm";
15
+ import Render from "../../../render/Render";
16
+ import * as componentMap from "../../../../../index";
17
+ import * as utils from "../utils";
18
+ import { useResetProEditTable, checkShouldShow } from "../hooks";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ /**
21
+ * 错误提示组件
22
+ */
23
+ var ErrorTip = () => /*#__PURE__*/_jsx("div", {
24
+ className: "pro-group-error-tip",
25
+ children: "Group\u914D\u7F6E\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u63A7\u5236\u53F0\u8B66\u544A\u4FE1\u606F"
26
+ });
27
+
28
+ /**
29
+ * FlexibleGroup渲染组件
30
+ */
31
+ var FlexibleGroupRender = props => {
32
+ var _fieldProps, _ref;
33
+ var propsChildren = props.children,
34
+ _props$space = props.space,
35
+ space = _props$space === void 0 ? {
36
+ size: 12
37
+ } : _props$space,
38
+ className = props.className,
39
+ isParentView = props.isView,
40
+ separator = props.separator,
41
+ split = props.split,
42
+ groupDisabled = props.disabled,
43
+ otherProps = props.otherProps,
44
+ id = props.id;
45
+
46
+ // children可能在props.children或props.fieldProps.children中
47
+ var children = propsChildren || ((_fieldProps = props.fieldProps) === null || _fieldProps === void 0 ? void 0 : _fieldProps.children) || [];
48
+
49
+ // 向后兼容处理:优先使用 separator,如果没有则使用 split,最后使用默认值
50
+ var finalSeparator = (_ref = separator !== null && separator !== void 0 ? separator : split) !== null && _ref !== void 0 ? _ref : '/';
51
+ var contextProps = ProForm.useFieldProps() || {};
52
+ var form = contextProps.form,
53
+ contextIsView = contextProps.isView;
54
+ var isView = isParentView || contextIsView || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
55
+
56
+ // 使用 hook 处理 ProEditTable 场景下的字段重置逻辑
57
+ useResetProEditTable({
58
+ children,
59
+ form,
60
+ namePath: contextProps.namePath,
61
+ source: otherProps === null || otherProps === void 0 ? void 0 : otherProps.source
62
+ });
63
+ var renderFormItem = (child, index) => {
64
+ var _child$fieldProps, _child$fieldProps2;
65
+ // 计算样式(宽度处理)
66
+ var childWidth = (_child$fieldProps = child.fieldProps) === null || _child$fieldProps === void 0 || (_child$fieldProps = _child$fieldProps.style) === null || _child$fieldProps === void 0 ? void 0 : _child$fieldProps.width;
67
+ var formItemStyle = childWidth ? {
68
+ width: childWidth
69
+ } : undefined;
70
+ var formItemClassName = childWidth ? 'pro-group-form-item pro-group-form-item-has-width' : 'pro-group-form-item';
71
+
72
+ // 如果子组件有自定义宽度,从 fieldProps.style 中移除 width,让组件保持默认宽度
73
+ // 宽度只应用到 Form.Item,不透传到组件本身
74
+ var adjustedFieldProps = childWidth && (_child$fieldProps2 = child.fieldProps) !== null && _child$fieldProps2 !== void 0 && _child$fieldProps2.style ? _objectSpread(_objectSpread({}, child.fieldProps), {}, {
75
+ style: (() => {
76
+ var _child$fieldProps$sty = child.fieldProps.style,
77
+ width = _child$fieldProps$sty.width,
78
+ restStyle = _objectWithoutProperties(_child$fieldProps$sty, _excluded);
79
+ return restStyle;
80
+ })()
81
+ }) : child.fieldProps;
82
+
83
+ // 检查 child 是否来自 FormList 的处理(已有处理过的参数)
84
+ var isFromFormList = (child === null || child === void 0 ? void 0 : child.source) === 'FormList';
85
+ var childNamePath = child.namePath || contextProps.namePath;
86
+ var childIndex = child.index;
87
+ var childListName = child.listName;
88
+
89
+ // 需要判断childNamePath来源是FormList还是ProEditTable
90
+ var fullName = (() => {
91
+ if (isFromFormList) {
92
+ return child.name;
93
+ }
94
+ if (childNamePath && Array.isArray(child.name) && child.name.length > 1) {
95
+ return [...childNamePath, ...child.name];
96
+ }
97
+ if (childNamePath) {
98
+ return [...childNamePath, child.name];
99
+ }
100
+ return child.name;
101
+ })();
102
+
103
+ // 处理依赖关系 - 支持相对路径和绝对路径
104
+ var safeDependencies = Array.isArray(child.dependencies) ? child.dependencies : [];
105
+ var processedDependencies = safeDependencies.map(dep => {
106
+ if (typeof dep === 'string') {
107
+ // 相对路径:同Group内的其他字段
108
+ return childNamePath ? [...childNamePath, dep] : dep;
109
+ }
110
+ return dep; // 绝对路径保持不变
111
+ });
112
+
113
+ // 获取组件类型
114
+ var type = child.type || 'Input';
115
+ var TargetComponent = componentMap[type];
116
+
117
+ // 处理 disabled(可能是函数)
118
+ var childDisabled = typeof child.disabled === 'function' ? false : child.disabled;
119
+ var finalDisabled = groupDisabled || childDisabled;
120
+
121
+ // 构建 formItemProps
122
+ var formItemProps = {
123
+ name: fullName,
124
+ label: child.label,
125
+ rules: child.rules,
126
+ dependencies: processedDependencies,
127
+ extra: child.extra,
128
+ before: child.before,
129
+ after: child.after,
130
+ required: child.required,
131
+ disabled: finalDisabled,
132
+ validateFirst: child.validateFirst
133
+ };
134
+
135
+ // 如果 child 来自 FormList 的处理,传递 index、namePath、listName
136
+ if (childIndex !== undefined) {
137
+ formItemProps.index = childIndex;
138
+ }
139
+ if (childNamePath) {
140
+ formItemProps.namePath = childNamePath;
141
+ }
142
+ if (childListName) {
143
+ formItemProps.listName = childListName;
144
+ }
145
+
146
+ // 处理 tooltip(类型兼容)
147
+ if (child.tooltip) {
148
+ formItemProps.tooltip = child.tooltip;
149
+ }
150
+
151
+ // 构建 otherProps
152
+ var renderOtherProps = {
153
+ label: child.label,
154
+ name: fullName,
155
+ disabled: finalDisabled,
156
+ isView,
157
+ viewEmpty: otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewEmpty,
158
+ valueType: child.valueType,
159
+ form,
160
+ type,
161
+ colProps: {
162
+ span: 24
163
+ },
164
+ // 灵活模式不需要 Col,但需要传递 colProps
165
+ namePath: childNamePath || contextProps.namePath,
166
+ formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
167
+ globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
168
+ // 灵活模式样式属性
169
+ flexibleGroupProps: {
170
+ className: formItemClassName,
171
+ style: formItemStyle
172
+ }
173
+ };
174
+
175
+ // 如果 child 来自 FormList 的处理,传递 listName
176
+ if (childListName) {
177
+ renderOtherProps.listName = childListName;
178
+ }
179
+ return /*#__PURE__*/_jsx(FieldProvider, {
180
+ value: renderOtherProps,
181
+ children: /*#__PURE__*/_jsx(Render, {
182
+ show: child.show,
183
+ form: form,
184
+ disabled: child.disabled,
185
+ formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
186
+ type: type,
187
+ originComponent: child.component,
188
+ component: TargetComponent,
189
+ formItemProps: formItemProps,
190
+ confirm: child.confirm,
191
+ colProps: {
192
+ span: 24
193
+ },
194
+ componentProps: adjustedFieldProps || {},
195
+ otherProps: renderOtherProps,
196
+ fieldProps: child.fieldProps,
197
+ isSelect: false // 由 Render 内部计算
198
+ ,
199
+ diffConfig: otherProps === null || otherProps === void 0 ? void 0 : otherProps.diffConfig,
200
+ requiredOnView: otherProps === null || otherProps === void 0 ? void 0 : otherProps.requiredOnView,
201
+ globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
202
+ viewRender: child.viewRender,
203
+ shouldUpdateDebounce: otherProps === null || otherProps === void 0 ? void 0 : otherProps.shouldUpdateDebounce
204
+ })
205
+ }, child.name || `item-${index}`);
206
+ };
207
+
208
+ // 非compact模式:正常的表单项渲染
209
+ var renderChildren = () => {
210
+ var elements = [];
211
+ var visibleChildren = [];
212
+
213
+ // 先过滤出可见的子项
214
+ children.forEach(child => {
215
+ var childNamePath = child.namePath || contextProps.namePath;
216
+ var childIndex = child.index;
217
+ if (checkShouldShow(child, form, childNamePath, childIndex)) {
218
+ visibleChildren.push(child);
219
+ }
220
+ });
221
+
222
+ // 只渲染可见的子项
223
+ visibleChildren.forEach((child, index) => {
224
+ // 找到原始索引,用于获取正确的 child 对象和分隔符索引计算
225
+ var originalIndex = children.findIndex(c => c === child);
226
+
227
+ // 渲染表单项
228
+ var formElement = renderFormItem(child, originalIndex);
229
+ elements.push(formElement);
230
+
231
+ // 添加分隔符(除最后一个元素外)
232
+ if (index < visibleChildren.length - 1 && space !== null && space !== void 0 && space.separator) {
233
+ // 检查是否在指定位置添加分隔符
234
+ var shouldAddSeparator = space.separatorIndex ? Array.isArray(space.separatorIndex) ? space.separatorIndex.includes(originalIndex) : space.separatorIndex === originalIndex : true; // 默认每个元素后都加分隔符
235
+
236
+ if (shouldAddSeparator) {
237
+ elements.push( /*#__PURE__*/_jsx("span", {
238
+ className: "pro-group-separator-space",
239
+ children: space.separator
240
+ }, child.name ? `separator-${child.name}` : `separator-${originalIndex}`));
241
+ }
242
+ }
243
+ });
244
+ return elements;
245
+ };
246
+
247
+ // compact模式专用:为每个字段创建可见的Form.Item,并使用CSS实现compact视觉效果
248
+ var renderCompactFormItems = () => {
249
+ var elements = [];
250
+ var visibleChildren = [];
251
+
252
+ // 先过滤出可见的子项
253
+ children.forEach(child => {
254
+ var childNamePath = child.namePath || contextProps.namePath;
255
+ var childIndex = child.index;
256
+ if (checkShouldShow(child, form, childNamePath, childIndex)) {
257
+ visibleChildren.push(child);
258
+ }
259
+ });
260
+
261
+ // 只渲染可见的子项
262
+ visibleChildren.forEach((child, index) => {
263
+ // 找到原始索引,用于获取正确的 child 对象和分隔符索引计算
264
+ var originalIndex = children.findIndex(c => c === child);
265
+
266
+ // 为每个字段创建独立的Form.Item,确保表单校验正常工作
267
+ var formElement = renderFormItem(child, originalIndex);
268
+ elements.push(formElement);
269
+
270
+ // 添加分隔符
271
+ if (index < visibleChildren.length - 1 && space !== null && space !== void 0 && space.separator) {
272
+ var shouldAddSeparator = space.separatorIndex ? Array.isArray(space.separatorIndex) ? space.separatorIndex.includes(originalIndex) : space.separatorIndex === originalIndex : true;
273
+ if (shouldAddSeparator) {
274
+ elements.push( /*#__PURE__*/_jsx("span", {
275
+ className: "pro-group-separator-compact",
276
+ children: space.separator
277
+ }, child.name ? `separator-${child.name}` : `separator-${originalIndex}`));
278
+ }
279
+ }
280
+ });
281
+ return /*#__PURE__*/_jsx("div", {
282
+ className: "ant-space ant-space-horizontal ant-space-compact pro-group-compact-container",
283
+ children: elements
284
+ });
285
+ };
286
+ var nextClassName = classnames({
287
+ 'pro-group': true,
288
+ 'pro-group-flexible': true,
289
+ 'pro-group-diy-width': children.some(item => {
290
+ var _item$fieldProps;
291
+ return item === null || item === void 0 || (_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 || (_item$fieldProps = _item$fieldProps.style) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.width;
292
+ }),
293
+ 'pro-group-width-auto': children.some(item => ['Radio', 'Checkbox', 'Switch'].includes(item.type)),
294
+ 'pro-group-view': isView,
295
+ [`${className}`]: className
296
+ });
297
+
298
+ // 检查是否有子项包含 show 函数,如果有则需要响应式更新
299
+ var hasShowFunction = children.some(child => isFunction(child.show));
300
+
301
+ // 查看模式下空值处理
302
+ if (isView && isEmpty(children)) {
303
+ return (otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewEmpty) || '-';
304
+ }
305
+
306
+ // 渲染内容
307
+ var renderContent = () => {
308
+ return /*#__PURE__*/_jsx("div", {
309
+ className: nextClassName,
310
+ id: id,
311
+ children: space.compact ?
312
+ // compact模式:使用Form.Item确保表单校验正常工作
313
+ renderCompactFormItems() : /*#__PURE__*/_jsx(Space, {
314
+ align: "start",
315
+ size: space.size || 12,
316
+ separator: isView ? finalSeparator : null,
317
+ children: renderChildren()
318
+ })
319
+ });
320
+ };
321
+
322
+ // 如果有 show 函数,使用 Form.Item 的 shouldUpdate 来监听表单值变化
323
+ if (hasShowFunction && form) {
324
+ return /*#__PURE__*/_jsx(Form.Item, {
325
+ shouldUpdate: () => true,
326
+ noStyle: true,
327
+ children: renderContent
328
+ });
329
+ }
330
+ return renderContent();
331
+ };
332
+
333
+ /**
334
+ * FlexibleGroup主组件
335
+ */
336
+ var FlexibleGroup = props => {
337
+ var _fieldProps2;
338
+ var propsChildren = props.children;
339
+
340
+ // children可能在props.children或props.fieldProps.children中
341
+ var children = propsChildren || ((_fieldProps2 = props.fieldProps) === null || _fieldProps2 === void 0 ? void 0 : _fieldProps2.children) || [];
342
+
343
+ // 配置验证
344
+ if (!utils.validateChildren(children)) {
345
+ return /*#__PURE__*/_jsx(ErrorTip, {});
346
+ }
347
+ return /*#__PURE__*/_jsx(FlexibleGroupRender, _objectSpread(_objectSpread({}, props), {}, {
348
+ children: children
349
+ }));
350
+ };
351
+ export default FlexibleGroup;
@@ -1,6 +1,6 @@
1
1
  import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
2
2
  import { FormInstance } from 'antd';
3
- import type { GroupColumnType, GroupType } from '../propsType';
3
+ import type { GroupColumnType, GroupType, FlexibleGroupColumnType } from '../propsType';
4
4
  export type EventArgs = any[];
5
5
  interface ColumnsTransformerParams {
6
6
  columns: GroupColumnType[];
@@ -16,4 +16,19 @@ interface ColumnsTransformerParams {
16
16
  }
17
17
  /** 转换columns */
18
18
  export declare const useTransformColumns: (params: ColumnsTransformerParams) => any[];
19
+ /**
20
+ * 检查子项是否应该显示(纯函数,不执行副作用)
21
+ */
22
+ export declare const checkShouldShow: (child: FlexibleGroupColumnType, form: FormInstance, namePath?: NamePath, index?: number) => boolean;
23
+ interface UseResetProEditTableParams {
24
+ children: FlexibleGroupColumnType[];
25
+ form: FormInstance;
26
+ namePath?: NamePath;
27
+ source?: 'FormList' | 'ProEditTable';
28
+ }
29
+ /**
30
+ * ProEditTable 场景下,当字段的 show 从 true 变为 false 时,自动重置字段值
31
+ * 使用 useEffect 在副作用中执行重置,避免在渲染过程中调用 setState
32
+ */
33
+ export declare const useResetProEditTable: (params: UseResetProEditTableParams) => void;
19
34
  export {};
@@ -1,7 +1,11 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2
6
  /* eslint-disable no-lonely-if */
3
- import { useRef } from 'react';
4
- import { cloneDeep, isEqual } from 'lodash';
7
+ import { useRef, useEffect } from 'react';
8
+ import { cloneDeep, isEqual, isFunction } from 'lodash';
5
9
  import { useDeepCompareMemo } from "../../../../utils/useDeepCompareMemo";
6
10
  import { difference } from "../../../../../ProEditTable/utils/tools";
7
11
  import { getReactiveProps, getValueTypeTrans, valueFromEventWrapper } from "../utils";
@@ -123,7 +127,6 @@ export var useTransformColumns = params => {
123
127
  form,
124
128
  option: args === null || args === void 0 ? void 0 : args[1]
125
129
  });
126
-
127
130
  // 如果是在可编辑表格或formList内部, 储存当前行的值, 并在变更后更新到表单里
128
131
  if (namePath !== null && namePath !== void 0 && namePath.length && !isEqual(originRow, values)) {
129
132
  var _Object$keys, _Object$keys$map;
@@ -170,4 +173,104 @@ export var useTransformColumns = params => {
170
173
  })
171
174
  });
172
175
  });
176
+ };
177
+
178
+ /**
179
+ * 检查子项是否应该显示(纯函数,不执行副作用)
180
+ */
181
+ export var checkShouldShow = (child, form, namePath, index) => {
182
+ var show = child.show;
183
+
184
+ // 如果没有配置 show,默认显示
185
+ if (show === undefined || show === true) {
186
+ return true;
187
+ }
188
+
189
+ // 如果 show 是 false,不显示
190
+ if (show === false) {
191
+ return false;
192
+ }
193
+
194
+ // 如果 show 是函数,需要获取表单值来评估
195
+ if (isFunction(show)) {
196
+ var values = {};
197
+ if (namePath) {
198
+ // FormList 场景:取当前行数据
199
+ values = form.getFieldValue(namePath) || {};
200
+ } else {
201
+ // 普通场景:取整个表单值
202
+ values = form.getFieldsValue(true);
203
+ }
204
+ return Boolean(show(values, {
205
+ form,
206
+ index,
207
+ namePath
208
+ }));
209
+ }
210
+ return true;
211
+ };
212
+ /**
213
+ * ProEditTable 场景下,当字段的 show 从 true 变为 false 时,自动重置字段值
214
+ * 使用 useEffect 在副作用中执行重置,避免在渲染过程中调用 setState
215
+ */
216
+ export var useResetProEditTable = params => {
217
+ var children = params.children,
218
+ form = params.form,
219
+ namePath = params.namePath,
220
+ source = params.source;
221
+
222
+ // 用于跟踪每个子项的显示状态
223
+ var showStateRef = useRef(new Map());
224
+ // 用于存储重置定时器
225
+ var resetTimersRef = useRef(new Map());
226
+ useEffect(() => {
227
+ // 只在 ProEditTable 场景下执行重置逻辑
228
+ if (source !== 'ProEditTable') {
229
+ return;
230
+ }
231
+
232
+ // 检查每个子项的显示状态
233
+ children.forEach(child => {
234
+ var childNamePath = child.namePath || namePath;
235
+ var childIndex = child.index;
236
+
237
+ // 生成唯一 key 用于跟踪状态
238
+ var childKey = child.name ? Array.isArray(child.name) ? `${JSON.stringify(childNamePath)}-${JSON.stringify(child.name)}` : `${JSON.stringify(childNamePath)}-${child.name}` : `child-${children.indexOf(child)}`;
239
+
240
+ // 计算当前显示状态
241
+ var currentShow = checkShouldShow(child, form, childNamePath, childIndex);
242
+ var previousShow = showStateRef.current.get(childKey);
243
+
244
+ // 如果状态发生变化,且从显示变为隐藏,执行重置
245
+ if (previousShow !== undefined && previousShow === true && currentShow === false) {
246
+ // 清除之前的定时器
247
+ var existingTimer = resetTimersRef.current.get(childKey);
248
+ if (existingTimer) {
249
+ clearTimeout(existingTimer);
250
+ }
251
+
252
+ // 延迟执行重置,避免在渲染过程中调用
253
+ var timer = setTimeout(() => {
254
+ if (Array.isArray(child.name)) {
255
+ form.resetFields([[...childNamePath, ...child.name]]);
256
+ } else {
257
+ form.resetFields([[...childNamePath, child.name]]);
258
+ }
259
+ resetTimersRef.current.delete(childKey);
260
+ }, 300);
261
+ resetTimersRef.current.set(childKey, timer);
262
+ }
263
+
264
+ // 更新显示状态
265
+ showStateRef.current.set(childKey, currentShow);
266
+ });
267
+
268
+ // 清理函数:组件卸载时清除所有定时器
269
+ return () => {
270
+ resetTimersRef.current.forEach(timer => {
271
+ clearTimeout(timer);
272
+ });
273
+ resetTimersRef.current.clear();
274
+ };
275
+ }, [children, namePath, source, form]);
173
276
  };
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { GroupType } from './propsType';
3
3
  /**
4
- * 1. 外层过滤FormItem相关属性, 但是子元素上的 required [disabled] [show] rules [fieldProps] [component] 需要取到并
5
- * 2.
6
- *
7
- * render内部能力 show, component, value, onChange, disabled, clearNotShow, fieldProps
4
+ * Group组件 - 支持传统模式和灵活模式
5
+ * - 有names属性 → 传统数组模式(保持向后兼容)
6
+ * - 无names属性 → 新的灵活模式(子组件必须配置name)
8
7
  */
9
8
  declare const Group: React.FC<GroupType>;
10
9
  export default Group;