@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,20 +1,24 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.cloneDeepFilterNode = cloneDeepFilterNode;
8
7
  exports.splitNames = exports.onPageCheck = exports.onDelete = exports.handleScrollToError = exports.getRandom = exports.getNamePath = exports.getDisabled = exports.difference = exports.customValidate = void 0;
9
- var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
10
- var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
11
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
8
  var _react = _interopRequireDefault(require("react"));
13
9
  var _utils = require("@zat-design/utils");
14
10
  var _lodash = require("lodash");
15
- /* eslint-disable no-await-in-loop */
16
- /* eslint-disable no-restricted-syntax */
17
-
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
13
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
14
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
15
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
16
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
21
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable no-await-in-loop */ /* eslint-disable no-restricted-syntax */
18
22
  /**
19
23
  * 生成随机字符串
20
24
  * @returns 随机字符串
@@ -150,6 +154,11 @@ var getDisabled = _ref2 => {
150
154
  return Boolean(value);
151
155
  };
152
156
 
157
+ // 新格式:params = [values, { form, index, namePath }]
158
+ var _params = _slicedToArray(params, 2),
159
+ values = _params[0],
160
+ reactiveParams = _params[1];
161
+
153
162
  // 判断是否有column的disabled属性
154
163
  var noColumnDisabled = () => {
155
164
  if ((0, _lodash.isFunction)(column === null || column === void 0 ? void 0 : column.disabled) || (0, _lodash.isFunction)(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || (0, _lodash.isBoolean)(column === null || column === void 0 ? void 0 : column.disabled) || (0, _lodash.isBoolean)(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
@@ -157,7 +166,7 @@ var getDisabled = _ref2 => {
157
166
  }
158
167
  // 判断FieldProps是否有disabled属性
159
168
  if ((0, _lodash.isFunction)(columnFieldProps)) {
160
- var _columnFieldProps = columnFieldProps(...params),
169
+ var _columnFieldProps = columnFieldProps(values, reactiveParams),
161
170
  disabled = _columnFieldProps.disabled;
162
171
  if ((0, _lodash.isFunction)(disabled) || (0, _lodash.isBoolean)(disabled)) {
163
172
  return false;
@@ -181,31 +190,31 @@ var getDisabled = _ref2 => {
181
190
  return column.disabled;
182
191
  }
183
192
  if ((0, _lodash.isFunction)(column === null || column === void 0 ? void 0 : column.disabled)) {
184
- return column === null || column === void 0 ? void 0 : column.disabled(...params);
193
+ return column === null || column === void 0 ? void 0 : column.disabled(values, reactiveParams);
185
194
  }
186
195
  }
187
196
 
188
197
  // 当表单含有diabled属性时,优先使用表单的disabled
189
198
  if ((0, _lodash.isFunction)(rowDisabled) && noColumnDisabled()) {
190
- return rowDisabled(params[1]);
199
+ return rowDisabled(values);
191
200
  }
192
201
  if ((0, _lodash.isFunction)(column === null || column === void 0 ? void 0 : column.disabled)) {
193
- return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled(...params));
202
+ return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled(values, reactiveParams));
194
203
  }
195
204
 
196
205
  // 表单FieldProps为函数时
197
206
  if ((0, _lodash.isFunction)(columnFieldProps)) {
198
- var _columnFieldProps2 = columnFieldProps(...params),
207
+ var _columnFieldProps2 = columnFieldProps(values, reactiveParams),
199
208
  disabled = _columnFieldProps2.disabled;
200
209
  if ((0, _lodash.isFunction)(disabled)) {
201
- return convertToBoolean(disabled(...params));
210
+ return convertToBoolean(disabled(values, reactiveParams));
202
211
  }
203
212
  if ((0, _lodash.isBoolean)(disabled)) {
204
213
  return convertToBoolean(disabled);
205
214
  }
206
215
  }
207
216
  if ((0, _lodash.isFunction)(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
208
- return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled(...params));
217
+ return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled(values, reactiveParams));
209
218
  }
210
219
  return convertToBoolean((_ref3 = (_column$disabled = column === null || column === void 0 ? void 0 : column.disabled) !== null && _column$disabled !== void 0 ? _column$disabled : columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : tabledDisabled);
211
220
  };
@@ -287,10 +296,10 @@ var isNull = value => {
287
296
  return value === '' || value === undefined || value === null || Array.isArray(value) && value.length === 0;
288
297
  };
289
298
  var handleCheckCellValue = /*#__PURE__*/function () {
290
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(column, record) {
299
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(column, record) {
291
300
  var _column$names, _column$names2, _rules2;
292
301
  var value, _required, _rules, _labelRequired, res, _iterator, _step, rule;
293
- return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
302
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
294
303
  while (1) switch (_context.prev = _context.next) {
295
304
  case 0:
296
305
  value = null;
@@ -331,7 +340,7 @@ var handleCheckCellValue = /*#__PURE__*/function () {
331
340
  break;
332
341
  }
333
342
  res = true;
334
- _iterator = (0, _createForOfIteratorHelper2.default)(_rules);
343
+ _iterator = _createForOfIteratorHelper(_rules);
335
344
  _context.prev = 16;
336
345
  _iterator.s();
337
346
  case 18:
@@ -400,9 +409,9 @@ var handleCheckCellValue = /*#__PURE__*/function () {
400
409
  * 分页校验
401
410
  */
402
411
  var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
403
- var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref7) {
412
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref7) {
404
413
  var form, name, value, columns, setState, page, pagination, isView, disabled, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, _record, _iterator3, _step3, column, result, nextState;
405
- return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
414
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
406
415
  while (1) switch (_context2.prev = _context2.next) {
407
416
  case 0:
408
417
  form = _ref7.form, name = _ref7.name, value = _ref7.value, columns = _ref7.columns, setState = _ref7.setState, page = _ref7.page, pagination = _ref7.pagination, isView = _ref7.isView, disabled = _ref7.disabled;
@@ -436,7 +445,7 @@ var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
436
445
  start = _utils.tools.calc(item - 1, '*', pageSize);
437
446
  end = _utils.tools.calc(start, '+', pageSize);
438
447
  nextValues = value === null || value === void 0 ? void 0 : value.slice(start, end);
439
- _iterator2 = (0, _createForOfIteratorHelper2.default)(nextValues);
448
+ _iterator2 = _createForOfIteratorHelper(nextValues);
440
449
  _context2.prev = 17;
441
450
  _iterator2.s();
442
451
  case 19:
@@ -445,7 +454,7 @@ var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
445
454
  break;
446
455
  }
447
456
  _record = _step2.value;
448
- _iterator3 = (0, _createForOfIteratorHelper2.default)(columns);
457
+ _iterator3 = _createForOfIteratorHelper(columns);
449
458
  _context2.prev = 22;
450
459
  _iterator3.s();
451
460
  case 24:
@@ -1,19 +1,23 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
7
  var _react = require("react");
10
8
  var _lodash = require("lodash");
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
15
  var useEditTableError = _ref => {
12
16
  var containerNode = _ref.containerNode,
13
17
  className = _ref.className,
14
18
  isEnabled = _ref.isEnabled;
15
19
  var _useState = (0, _react.useState)(0),
16
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
20
+ _useState2 = _slicedToArray(_useState, 2),
17
21
  errorLength = _useState2[0],
18
22
  setErrorLength = _useState2[1];
19
23
  (0, _react.useEffect)(() => {
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
7
  var _react = require("react");
10
8
  var _lodash = require("lodash");
11
9
  var _utils = require("../../utils");
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
16
  var useShouldUpdateForTable = props => {
13
17
  var _isEditableRef$curren, _requiredRef$current, _rulesRef$current, _fieldPropsRef$curren, _desensitizationRef$c, _valueTypeRef$current;
14
18
  var rowParams = props.rowParams,
@@ -23,7 +27,7 @@ var useShouldUpdateForTable = props => {
23
27
  var desensitizationRef = (0, _react.useRef)();
24
28
  var valueTypeRef = (0, _react.useRef)();
25
29
  var _useState = (0, _react.useState)({}),
26
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
30
+ _useState2 = _slicedToArray(_useState, 2),
27
31
  reRender = _useState2[1];
28
32
  var debouncedUpdateRef = (0, _react.useRef)(null);
29
33
  var pendingParamsRef = (0, _react.useRef)(null);
@@ -31,10 +35,14 @@ var useShouldUpdateForTable = props => {
31
35
  // 统一处理所有动态属性的更新
32
36
  var processUpdate = params => {
33
37
  var hasChange = false;
38
+ // 新格式:params = [values, { form, index, namePath }]
39
+ var _params = _slicedToArray(params, 2),
40
+ values = _params[0],
41
+ reactiveParams = _params[1];
34
42
 
35
43
  // isEditable 处理
36
44
  if ((0, _lodash.isFunction)(column.isEditable)) {
37
- var newIsEditable = column.isEditable(...params);
45
+ var newIsEditable = column.isEditable(values, reactiveParams);
38
46
  if (isEditableRef.current !== newIsEditable) {
39
47
  isEditableRef.current = newIsEditable;
40
48
  hasChange = true;
@@ -45,7 +53,7 @@ var useShouldUpdateForTable = props => {
45
53
 
46
54
  // required 处理
47
55
  if ((0, _lodash.isFunction)(column.required)) {
48
- var newRequired = column.required(...params);
56
+ var newRequired = column.required(values, reactiveParams);
49
57
  if (requiredRef.current !== newRequired) {
50
58
  requiredRef.current = newRequired;
51
59
  hasChange = true;
@@ -56,7 +64,7 @@ var useShouldUpdateForTable = props => {
56
64
 
57
65
  // rules 处理
58
66
  if ((0, _lodash.isFunction)(column.rules)) {
59
- var newRules = column.rules(...params);
67
+ var newRules = column.rules(values, reactiveParams);
60
68
  if (!(0, _lodash.isEqualWith)(rulesRef.current, newRules, _utils.customEqualForFunction)) {
61
69
  rulesRef.current = newRules;
62
70
  hasChange = true;
@@ -67,7 +75,7 @@ var useShouldUpdateForTable = props => {
67
75
 
68
76
  // fieldProps 处理
69
77
  if ((0, _lodash.isFunction)(column.fieldProps)) {
70
- var newFieldProps = column.fieldProps(...params);
78
+ var newFieldProps = column.fieldProps(values, reactiveParams);
71
79
  if (!(0, _lodash.isEqualWith)(fieldPropsRef.current, newFieldProps, _utils.customEqualForFunction)) {
72
80
  fieldPropsRef.current = newFieldProps;
73
81
  hasChange = true;
@@ -78,7 +86,7 @@ var useShouldUpdateForTable = props => {
78
86
 
79
87
  // desensitization 处理
80
88
  if ((0, _lodash.isFunction)(column.desensitization)) {
81
- var newDesensitization = column.desensitization(...params);
89
+ var newDesensitization = column.desensitization(values, reactiveParams);
82
90
  if (!(0, _lodash.isEqualWith)(desensitizationRef.current, newDesensitization)) {
83
91
  desensitizationRef.current = newDesensitization;
84
92
  hasChange = true;
@@ -87,7 +95,7 @@ var useShouldUpdateForTable = props => {
87
95
  desensitizationRef.current = column.desensitization;
88
96
  }
89
97
 
90
- // valueType 处理
98
+ // valueType 处理(保持旧格式,因为 valueType 可能还在使用旧格式)
91
99
  if ((0, _lodash.isFunction)(column.valueType)) {
92
100
  var newValueType = column.valueType(...params);
93
101
  if (valueTypeRef.current !== newValueType) {
@@ -1,14 +1,19 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
7
  var _classnames = _interopRequireDefault(require("classnames"));
10
8
  var _react = require("react");
11
9
  var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
17
  var Group = props => {
13
18
  var value = props.value,
14
19
  onChange = props.onChange,
@@ -20,7 +25,7 @@ var Group = props => {
20
25
  allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
21
26
  id = props.id;
22
27
  var _useState = (0, _react.useState)(false),
23
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
28
+ _useState2 = _slicedToArray(_useState, 2),
24
29
  refresh = _useState2[0],
25
30
  setRefresh = _useState2[1];
26
31
  var idx = (0, _react.useRef)(-1);
@@ -1,14 +1,19 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
7
  var _classnames = _interopRequireDefault(require("classnames"));
10
8
  var _react = require("react");
11
9
  var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
17
  var ProEnumTag = props => {
13
18
  var value = props.value,
14
19
  onChange = props.onChange,
@@ -17,7 +22,7 @@ var ProEnumTag = props => {
17
22
  fieldLabel = props.fieldLabel,
18
23
  id = props.id;
19
24
  var _useState = (0, _react.useState)(),
20
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
25
+ _useState2 = _slicedToArray(_useState, 2),
21
26
  checked = _useState2[0],
22
27
  setValue = _useState2[1];
23
28
  (0, _react.useEffect)(() => {
@@ -18,4 +18,12 @@ declare function useEnum(codes: string[]): Record<string, DataOption[]>;
18
18
  * @param compose 展示 value-label
19
19
  */
20
20
  declare function useEnum(code: string, value?: string, compose?: boolean): [string, DataOption];
21
+ /**
22
+ * input code、values array output [labels array, options array]
23
+ * @param code
24
+ * @param values 值数组
25
+ * @param compose 展示 value-label
26
+ * @returns [标签数组, 选项数组]
27
+ */
28
+ declare function useEnum(code: string, values: (string | number)[], compose?: boolean): [string[], DataOption[]];
21
29
  export default useEnum;
@@ -8,6 +8,10 @@ var _ProConfigProvider = require("../../ProConfigProvider");
8
8
  var _utils = require("../utils");
9
9
  var _ref;
10
10
  /* eslint-disable no-redeclare */
11
+ 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; }
12
+ 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; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
14
+ 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); }
11
15
  var baseEnumStorage = (_ref = window.localStorage.getItem('zat-design-pro-component-cacheKey') && JSON.parse(window.localStorage.getItem('zat-design-pro-component-cacheKey'))) !== null && _ref !== void 0 ? _ref : null;
12
16
 
13
17
  /**
@@ -29,6 +33,14 @@ var baseEnumStorage = (_ref = window.localStorage.getItem('zat-design-pro-compon
29
33
  * @param compose 展示 value-label
30
34
  */
31
35
 
36
+ /**
37
+ * input code、values array output [labels array, options array]
38
+ * @param code
39
+ * @param values 值数组
40
+ * @param compose 展示 value-label
41
+ * @returns [标签数组, 选项数组]
42
+ */
43
+
32
44
  /**
33
45
  * 根据 code 从枚举缓存取出对应的 options 、以及回显
34
46
  * @param codes
@@ -73,16 +85,76 @@ function useEnum(codes, value, compose) {
73
85
  if (typeof codes === 'string') {
74
86
  var _catchData$data;
75
87
  var options = (catchData === null || catchData === void 0 || (_catchData$data = catchData.data) === null || _catchData$data === void 0 ? void 0 : _catchData$data[codes]) || [];
88
+
89
+ // 获取 children 字段名
90
+ var fieldChildren = 'children';
91
+ if (fieldNames && Object.keys(fieldNames).length && fieldNames.children) {
92
+ fieldChildren = fieldNames.children;
93
+ }
94
+ if (clear) {
95
+ fieldChildren = 'children';
96
+ }
97
+
98
+ // 递归查找函数:在嵌套结构中查找选项
99
+ var findOptionInNested = (opts, targetValue, fValue, fChildren) => {
100
+ // 当前层级查找
101
+ var foundInCurrentLevel = opts.find(option => String(option[fValue]) === String(targetValue));
102
+ if (foundInCurrentLevel) {
103
+ return foundInCurrentLevel;
104
+ }
105
+ // 递归查找子级
106
+ var foundInChildren = opts.reduce((found, option) => {
107
+ if (found) return found;
108
+ if (option[fChildren] && Array.isArray(option[fChildren])) {
109
+ return findOptionInNested(option[fChildren], targetValue, fValue, fChildren);
110
+ }
111
+ return undefined;
112
+ }, undefined);
113
+ return foundInChildren;
114
+ };
115
+
116
+ // 清理选项:移除 children,保留数据源中的其他所有字段(包括 parentCode 等业务字段)
117
+ var cleanOption = option => {
118
+ var _ = option[fieldChildren],
119
+ restOption = _objectWithoutProperties(option, [fieldChildren].map(_toPropertyKey));
120
+ return restOption;
121
+ };
76
122
  var getEnumLabel = (v, composezTow) => {
77
- var option = options.find(item => item[fieldValue] === v);
123
+ var option = findOptionInNested(options, v, fieldValue, fieldChildren);
78
124
  if (option) {
79
125
  return composezTow ? `${v}-${option[fieldLabel]}` : option[fieldLabel];
80
126
  }
127
+ return undefined;
81
128
  };
82
- if (value && Array.isArray(options)) {
83
- var option = options.find(item => item[fieldValue] === value);
129
+
130
+ // 处理数组值的情况
131
+ if (value && Array.isArray(value)) {
132
+ var labels = [];
133
+ var foundOptions = [];
134
+ value.forEach(v => {
135
+ var option = findOptionInNested(options, v, fieldValue, fieldChildren);
136
+ if (option) {
137
+ var cleanedOption = cleanOption(option);
138
+ foundOptions.push(cleanedOption);
139
+ labels.push(compose ? `${v}-${option[fieldLabel]}` : option[fieldLabel]);
140
+ } else {
141
+ var emptyOption = {
142
+ label: '',
143
+ value: ''
144
+ };
145
+ foundOptions.push(emptyOption);
146
+ labels.push('');
147
+ }
148
+ });
149
+ return [labels, foundOptions];
150
+ }
151
+
152
+ // 处理单个值的情况(保持向后兼容)
153
+ if (value && !Array.isArray(value) && Array.isArray(options)) {
154
+ var option = findOptionInNested(options, value, fieldValue, fieldChildren);
84
155
  if (option) {
85
- return [compose ? `${value}-${option[fieldLabel]}` : option[fieldLabel], option];
156
+ var cleanedOption = cleanOption(option);
157
+ return [compose ? `${value}-${option[fieldLabel]}` : option[fieldLabel], cleanedOption];
86
158
  }
87
159
  return [options];
88
160
  }
@@ -1,19 +1,24 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
7
  var _react = require("react");
12
8
  var _ahooks = require("ahooks");
13
9
  var _utils = require("../utils");
14
10
  var _locale = _interopRequireDefault(require("../../locale"));
15
11
  require("../utils/eventCenter");
16
12
  var _ref;
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
15
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
16
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
17
+ 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; }
18
+ 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; }
19
+ 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; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
21
+ 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); }
17
22
  var baseEnumStorage = (_ref = window.localStorage.getItem(_utils.baseCacheKey) && JSON.parse(window.localStorage.getItem(_utils.baseCacheKey))) !== null && _ref !== void 0 ? _ref : null;
18
23
  var useEnumRequest = (props, dispatch) => {
19
24
  var _ref2 = props || {},
@@ -50,16 +55,16 @@ var useEnumRequest = (props, dispatch) => {
50
55
  console.warn('proEnum:', msg);
51
56
  }
52
57
  };
53
- var enumRes = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
58
+ var enumRes = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread(_objectSpread({
54
59
  manual: true,
55
60
  cacheKey,
56
61
  cacheTime: -1,
57
62
  staleTime: 6e4 * 60
58
63
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
59
64
  setCache: function () {
60
- var _setCache = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
65
+ var _setCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
61
66
  var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
62
- return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
67
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
63
68
  while (1) switch (_context.prev = _context.next) {
64
69
  case 0:
65
70
  response = res.data;
@@ -113,13 +118,13 @@ var useEnumRequest = (props, dispatch) => {
113
118
  cacheData = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
114
119
  data: {}
115
120
  }; // 合并缓存数据
116
- res.data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
121
+ res.data = _objectSpread(_objectSpread({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
117
122
  (0, _utils.setEnumData)(storage, cacheKey, res);
118
123
 
119
124
  // 同步数据到全局
120
125
  dispatch({
121
126
  type: 'setProEnumDic',
122
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), res.data)
127
+ payload: _objectSpread(_objectSpread(_objectSpread({}, dics), dataSource), res.data)
123
128
  });
124
129
  if (main) {
125
130
  setTimeout(() => {
@@ -146,7 +151,7 @@ var useEnumRequest = (props, dispatch) => {
146
151
  };
147
152
  dispatch({
148
153
  type: 'setProEnumDic',
149
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), res === null || res === void 0 ? void 0 : res.data)
154
+ payload: _objectSpread(_objectSpread(_objectSpread({}, dics), dataSource), res === null || res === void 0 ? void 0 : res.data)
150
155
  });
151
156
  if (main) {
152
157
  setTimeout(() => {
@@ -168,9 +173,9 @@ var useEnumRequest = (props, dispatch) => {
168
173
  }
169
174
  }));
170
175
  var mergeData = /*#__PURE__*/function () {
171
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
176
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
172
177
  var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
173
- return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
178
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
174
179
  while (1) switch (_context2.prev = _context2.next) {
175
180
  case 0:
176
181
  cacheData = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
@@ -231,12 +236,12 @@ var useEnumRequest = (props, dispatch) => {
231
236
  }
232
237
  });
233
238
  }
234
- cacheData.data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cacheData.data), response);
239
+ cacheData.data = _objectSpread(_objectSpread({}, cacheData.data), response);
235
240
  (0, _utils.setEnumData)(storage, cacheKey, cacheData);
236
241
  // 同步数据到全局
237
242
  dispatch({
238
243
  type: 'setProEnumDic',
239
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), cacheData.data)
244
+ payload: _objectSpread(_objectSpread(_objectSpread({}, dics), dataSource), cacheData.data)
240
245
  });
241
246
  _context2.next = 28;
242
247
  break;
@@ -245,7 +250,7 @@ var useEnumRequest = (props, dispatch) => {
245
250
  // 子系统也可能会有 dataSource
246
251
  dispatch({
247
252
  type: 'setProEnumDic',
248
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource)
253
+ payload: _objectSpread(_objectSpread({}, dics), dataSource)
249
254
  });
250
255
  }
251
256
  case 28:
@@ -277,7 +282,7 @@ var useEnumRequest = (props, dispatch) => {
277
282
  };
278
283
  dispatch({
279
284
  type: 'setProEnumDic',
280
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, dataSource), res === null || res === void 0 ? void 0 : res.data)
285
+ payload: _objectSpread(_objectSpread({}, dataSource), res === null || res === void 0 ? void 0 : res.data)
281
286
  });
282
287
  } else {
283
288
  var _res = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
@@ -285,7 +290,7 @@ var useEnumRequest = (props, dispatch) => {
285
290
  };
286
291
  dispatch({
287
292
  type: 'setProEnumDic',
288
- payload: (0, _objectSpread2.default)({}, _res === null || _res === void 0 ? void 0 : _res.data)
293
+ payload: _objectSpread({}, _res === null || _res === void 0 ? void 0 : _res.data)
289
294
  });
290
295
  }
291
296
  }, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options]);
@@ -296,7 +301,7 @@ var useEnumRequest = (props, dispatch) => {
296
301
  };
297
302
  dispatch({
298
303
  type: 'setProEnumDic',
299
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dataSource), cacheData), storageData)
304
+ payload: _objectSpread(_objectSpread(_objectSpread({}, dataSource), cacheData), storageData)
300
305
  });
301
306
  };
302
307
  (0, _react.useEffect)(() => {