@zat-design/sisyphus-react 4.0.0-beta.9 → 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 (434) 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 +7 -2
  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 +22 -1
  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.js +10 -4
  55. package/es/ProForm/components/combination/FormList/components/Empty.js +3 -2
  56. package/es/ProForm/components/combination/FormList/components/LineFields.js +5 -1
  57. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +10 -4
  58. package/es/ProForm/components/combination/FormList/index.js +41 -4
  59. package/es/ProForm/components/combination/FormList/style/index.less +1 -1
  60. package/es/ProForm/components/combination/FormList/utils.d.ts +6 -0
  61. package/es/ProForm/components/combination/FormList/utils.js +17 -0
  62. package/es/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
  63. package/es/ProForm/components/combination/Group/component/ComRender.js +70 -3
  64. package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
  65. package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +351 -0
  66. package/es/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
  67. package/es/ProForm/components/combination/Group/hooks/index.js +107 -4
  68. package/es/ProForm/components/combination/Group/index.d.ts +3 -4
  69. package/es/ProForm/components/combination/Group/index.js +108 -24
  70. package/es/ProForm/components/combination/Group/propsType.d.ts +44 -1
  71. package/es/ProForm/components/combination/Group/style/index.less +425 -3
  72. package/es/ProForm/components/combination/Group/utils/index.d.ts +154 -0
  73. package/es/ProForm/components/combination/Group/utils/index.js +428 -0
  74. package/es/ProForm/components/combination/ProCascader/index.js +13 -3
  75. package/es/ProForm/components/combination/ProCascader/utils/index.js +7 -2
  76. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +14 -4
  77. package/es/ProForm/components/combination/ProModalSelect/index.js +16 -5
  78. package/es/ProForm/components/combination/ProNumberRange/index.js +24 -12
  79. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
  80. package/es/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
  81. package/es/ProForm/components/combination/ProRangeLimit/index.js +13 -3
  82. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +6 -1
  83. package/es/ProForm/components/combination/ProTimeLimit/index.js +13 -3
  84. package/es/ProForm/components/render/ChangedWrapper.js +7 -2
  85. package/es/ProForm/components/render/ConfirmWrapper.js +10 -4
  86. package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
  87. package/es/ProForm/components/render/CustomComponentViewWrapper.js +120 -0
  88. package/es/ProForm/components/render/Render.js +71 -16
  89. package/es/ProForm/components/render/RenderFields.js +7 -2
  90. package/es/ProForm/index.js +13 -3
  91. package/es/ProForm/propsType.d.ts +7 -0
  92. package/es/ProForm/style/index.less +11 -2
  93. package/es/ProForm/utils/index.js +7 -2
  94. package/es/ProForm/utils/rulesCreator.js +5 -1
  95. package/es/ProForm/utils/transformValue.js +5 -1
  96. package/es/ProForm/utils/useForm.js +15 -5
  97. package/es/ProForm/utils/useShouldUpdate.js +93 -35
  98. package/es/ProForm/utils/useWatch.js +6 -1
  99. package/es/ProForm/utils/valueType.js +11 -2
  100. package/es/ProIcon/index.js +13 -3
  101. package/es/ProIcon/utils/index.js +5 -1
  102. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +27 -32
  103. package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
  104. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +54 -35
  105. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
  106. package/es/ProLayout/components/Layout/Notice/style/index.less +4 -0
  107. package/es/ProLayout/components/ProCollapse/index.js +5 -1
  108. package/es/ProLayout/components/ProCollapse/style/index.less +9 -9
  109. package/es/ProLayout/components/ProFooter/index.js +6 -2
  110. package/es/ProLayout/components/ProHeader/index.js +14 -4
  111. package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
  112. package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +100 -0
  113. package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
  114. package/es/ProLayout/components/TabsManager/components/TabItem.js +61 -0
  115. package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
  116. package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -0
  117. package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
  118. package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +14 -0
  119. package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
  120. package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +26 -0
  121. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
  122. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +96 -0
  123. package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
  124. package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +364 -0
  125. package/es/ProLayout/components/TabsManager/index.d.ts +8 -0
  126. package/es/ProLayout/components/TabsManager/index.js +180 -0
  127. package/es/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
  128. package/es/ProLayout/components/TabsManager/propTypes.js +16 -0
  129. package/es/ProLayout/components/TabsManager/style/index.less +179 -0
  130. package/es/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
  131. package/es/ProLayout/components/TabsManager/utils/index.js +106 -0
  132. package/es/ProLayout/index.d.ts +21 -4
  133. package/es/ProLayout/index.js +107 -14
  134. package/es/ProLayout/propTypes.d.ts +139 -1
  135. package/es/ProLayout/propTypes.js +37 -1
  136. package/es/ProLayout/utils/index.js +16 -7
  137. package/es/ProSelect/components/AdaptiveTooltip.js +6 -1
  138. package/es/ProSelect/index.js +13 -3
  139. package/es/ProSelect/utils/index.js +3 -1
  140. package/es/ProStep/components/Item/index.js +8 -2
  141. package/es/ProStep/components/Listener/index.js +10 -4
  142. package/es/ProStep/components/Step/index.js +11 -2
  143. package/es/ProStep/index.js +16 -5
  144. package/es/ProStep/utils/index.js +5 -1
  145. package/es/ProStepTab/index.js +19 -8
  146. package/es/ProTable/components/FormatColumn/index.js +7 -2
  147. package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -2
  148. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +10 -4
  149. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +5 -1
  150. package/es/ProTable/components/RcTable/components/DraggableTable/index.js +7 -2
  151. package/es/ProTable/components/RenderColumn/index.js +11 -2
  152. package/es/ProTable/components/RenderTabs/index.js +11 -2
  153. package/es/ProTable/components/TableResizable/index.js +13 -3
  154. package/es/ProTable/components/TooltipTitle/index.js +3 -5
  155. package/es/ProTable/hooks/useAntdTable.js +17 -6
  156. package/es/ProTable/index.js +16 -5
  157. package/es/ProTable/style/index.less +3 -0
  158. package/es/ProTable/utils/index.js +6 -1
  159. package/es/ProTabs/index.js +13 -3
  160. package/es/ProThemeTools/component/ProTools/index.js +11 -2
  161. package/es/ProThemeTools/context/ThemeContext.js +11 -2
  162. package/es/ProThemeTools/index.js +13 -3
  163. package/es/ProThemeTools/utils/index.js +5 -1
  164. package/es/ProTooltip/index.js +13 -3
  165. package/es/ProTree/components/CloseIcon.js +5 -1
  166. package/es/ProTree/components/List.js +7 -2
  167. package/es/ProTree/components/ProTree.js +16 -5
  168. package/es/ProTree/components/ProTreeSelect/index.js +119 -75
  169. package/es/ProTree/components/Tree.js +16 -5
  170. package/es/ProTree/index.js +5 -1
  171. package/es/ProTree/utils.js +8 -2
  172. package/es/ProTreeModal/components/Cascader.js +11 -2
  173. package/es/ProTreeModal/components/CloseIcon.js +5 -1
  174. package/es/ProTreeModal/components/List.js +6 -1
  175. package/es/ProTreeModal/components/SortableItem.js +5 -1
  176. package/es/ProTreeModal/components/Tree.js +13 -3
  177. package/es/ProTreeModal/components/Trigger.js +11 -2
  178. package/es/ProTreeModal/index.js +11 -2
  179. package/es/ProTreeModal/style/index.less +6 -0
  180. package/es/ProTreeModal/utils.js +8 -2
  181. package/es/ProUpload/components/ButtonRender.js +8 -3
  182. package/es/ProUpload/components/DragRender.d.ts +1 -0
  183. package/es/ProUpload/components/DragRender.js +10 -2
  184. package/es/ProUpload/components/DraggableUploadListItem.js +5 -1
  185. package/es/ProUpload/components/Example.js +11 -2
  186. package/es/ProUpload/components/ImageRender.js +14 -4
  187. package/es/ProUpload/index.js +17 -5
  188. package/es/ProUpload/propsType.d.ts +5 -0
  189. package/es/ProViewer/index.js +14 -4
  190. package/es/ProWaterMark/index.js +5 -1
  191. package/es/index.d.ts +1 -2
  192. package/es/index.js +1 -0
  193. package/es/locale/en_US.d.ts +9 -0
  194. package/es/locale/en_US.js +9 -0
  195. package/es/locale/zh_CN.d.ts +9 -0
  196. package/es/locale/zh_CN.js +9 -0
  197. package/es/style/theme/antd.less +11 -35
  198. package/es/utils/index.js +6 -1
  199. package/jest.config.js +3 -1
  200. package/lib/FormsProvider/index.js +2 -1
  201. package/lib/ProAction/index.js +20 -10
  202. package/lib/ProConfigProvider/index.js +29 -19
  203. package/lib/ProDownload/index.js +29 -17
  204. package/lib/ProDownload/utils.js +14 -12
  205. package/lib/ProDrawerForm/components/ProDrawer/index.js +27 -16
  206. package/lib/ProDrawerForm/components/ProModal/index.js +21 -10
  207. package/lib/ProDrawerForm/components/index.js +2 -2
  208. package/lib/ProDrawerForm/index.js +20 -9
  209. package/lib/ProEditLabel/components/RenderProForm.js +9 -6
  210. package/lib/ProEditLabel/index.js +30 -18
  211. package/lib/ProEditTable/components/ActionButton/index.js +14 -11
  212. package/lib/ProEditTable/components/RcTable/BaseTable.js +19 -9
  213. package/lib/ProEditTable/components/RcTable/DraggableTable.js +19 -13
  214. package/lib/ProEditTable/components/RcTable/index.js +2 -2
  215. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +16 -10
  216. package/lib/ProEditTable/components/RenderField/index.js +76 -50
  217. package/lib/ProEditTable/components/RenderToolbar/index.js +18 -12
  218. package/lib/ProEditTable/components/index.js +2 -2
  219. package/lib/ProEditTable/index.js +33 -21
  220. package/lib/ProEditTable/propsType.d.ts +12 -6
  221. package/lib/ProEditTable/style/index.less +22 -1
  222. package/lib/ProEditTable/utils/config.js +20 -15
  223. package/lib/ProEditTable/utils/index.js +22 -18
  224. package/lib/ProEditTable/utils/tools.js +30 -21
  225. package/lib/ProEditTable/utils/useEditTableError.js +7 -3
  226. package/lib/ProEditTable/utils/useShouldUpdateForTable.js +17 -9
  227. package/lib/ProEnum/components/Group.js +8 -3
  228. package/lib/ProEnum/components/Tag.js +8 -3
  229. package/lib/ProEnum/hooks/useEnum.d.ts +8 -0
  230. package/lib/ProEnum/hooks/useEnum.js +76 -4
  231. package/lib/ProEnum/hooks/useEnumRequest.js +23 -18
  232. package/lib/ProEnum/hooks/useFrequentEnumRequest.js +12 -8
  233. package/lib/ProEnum/index.js +37 -26
  234. package/lib/ProEnum/utils/eventCenter.js +4 -3
  235. package/lib/ProEnum/utils/frequentEnum.js +6 -3
  236. package/lib/ProEnum/utils/index.js +3 -3
  237. package/lib/ProForm/components/Container.js +1 -1
  238. package/lib/ProForm/components/FormFooter/index.js +11 -6
  239. package/lib/ProForm/components/base/Checkbox/index.js +13 -7
  240. package/lib/ProForm/components/base/DatePicker/index.js +11 -6
  241. package/lib/ProForm/components/base/DatePicker/useDateLimit.js +7 -3
  242. package/lib/ProForm/components/base/Input/index.js +11 -6
  243. package/lib/ProForm/components/base/InputNumber/index.js +21 -10
  244. package/lib/ProForm/components/base/Radio/index.js +10 -5
  245. package/lib/ProForm/components/base/RangePicker/index.d.ts +7 -1
  246. package/lib/ProForm/components/base/RangePicker/index.js +55 -9
  247. package/lib/ProForm/components/base/RangePicker/useDateRange.js +7 -3
  248. package/lib/ProForm/components/base/Select/index.js +10 -5
  249. package/lib/ProForm/components/base/Switch/index.js +10 -5
  250. package/lib/ProForm/components/base/SwitchCheckbox/index.js +12 -6
  251. package/lib/ProForm/components/base/TextArea/index.js +10 -5
  252. package/lib/ProForm/components/base/TimePicker/index.js +10 -5
  253. package/lib/ProForm/components/combination/Container/index.js +11 -6
  254. package/lib/ProForm/components/combination/Container/style/index.less +5 -0
  255. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +26 -19
  256. package/lib/ProForm/components/combination/FormList/components/BlockFields.js +3 -2
  257. package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
  258. package/lib/ProForm/components/combination/FormList/components/Empty.js +6 -5
  259. package/lib/ProForm/components/combination/FormList/components/LineFields.js +7 -3
  260. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +20 -14
  261. package/lib/ProForm/components/combination/FormList/index.js +48 -10
  262. package/lib/ProForm/components/combination/FormList/style/index.less +1 -1
  263. package/lib/ProForm/components/combination/FormList/utils.d.ts +6 -0
  264. package/lib/ProForm/components/combination/FormList/utils.js +20 -2
  265. package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
  266. package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
  267. package/lib/ProForm/components/combination/Group/component/ComRender.js +79 -11
  268. package/lib/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
  269. package/lib/ProForm/components/combination/Group/component/FlexibleGroup.js +360 -0
  270. package/lib/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
  271. package/lib/ProForm/components/combination/Group/hooks/index.js +111 -9
  272. package/lib/ProForm/components/combination/Group/index.d.ts +3 -4
  273. package/lib/ProForm/components/combination/Group/index.js +111 -27
  274. package/lib/ProForm/components/combination/Group/propsType.d.ts +44 -1
  275. package/lib/ProForm/components/combination/Group/style/index.less +425 -3
  276. package/lib/ProForm/components/combination/Group/utils/index.d.ts +154 -0
  277. package/lib/ProForm/components/combination/Group/utils/index.js +444 -0
  278. package/lib/ProForm/components/combination/ProCascader/index.js +20 -10
  279. package/lib/ProForm/components/combination/ProCascader/utils/index.js +9 -5
  280. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +25 -15
  281. package/lib/ProForm/components/combination/ProModalSelect/index.js +53 -41
  282. package/lib/ProForm/components/combination/ProNumberRange/index.js +28 -16
  283. package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
  284. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
  285. package/lib/ProForm/components/combination/ProRangeLimit/index.js +29 -18
  286. package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +8 -3
  287. package/lib/ProForm/components/combination/ProTimeLimit/index.js +26 -15
  288. package/lib/ProForm/components/index.js +2 -2
  289. package/lib/ProForm/components/render/ChangedWrapper.js +16 -10
  290. package/lib/ProForm/components/render/ConfirmWrapper.js +19 -13
  291. package/lib/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
  292. package/lib/ProForm/components/render/CustomComponentViewWrapper.js +127 -0
  293. package/lib/ProForm/components/render/Render.js +93 -37
  294. package/lib/ProForm/components/render/RenderFields.js +15 -9
  295. package/lib/ProForm/index.js +23 -12
  296. package/lib/ProForm/propsType.d.ts +7 -0
  297. package/lib/ProForm/style/index.less +11 -2
  298. package/lib/ProForm/utils/index.js +12 -8
  299. package/lib/ProForm/utils/rulesCreator.js +8 -4
  300. package/lib/ProForm/utils/transformValue.js +6 -3
  301. package/lib/ProForm/utils/useFieldProps.js +2 -1
  302. package/lib/ProForm/utils/useForm.js +21 -12
  303. package/lib/ProForm/utils/useRules.js +1 -1
  304. package/lib/ProForm/utils/useShouldUpdate.js +94 -37
  305. package/lib/ProForm/utils/useWatch.js +8 -3
  306. package/lib/ProForm/utils/valueType.js +15 -6
  307. package/lib/ProIcon/index.js +26 -16
  308. package/lib/ProIcon/utils/index.js +7 -4
  309. package/lib/ProLayout/components/Layout/Header/index.js +1 -1
  310. package/lib/ProLayout/components/Layout/Icon/Icon.js +2 -1
  311. package/lib/ProLayout/components/Layout/Icon/index.js +1 -1
  312. package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +30 -35
  313. package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
  314. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +55 -36
  315. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
  316. package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +1 -1
  317. package/lib/ProLayout/components/Layout/Menu/index.js +1 -1
  318. package/lib/ProLayout/components/Layout/Notice/index.js +1 -1
  319. package/lib/ProLayout/components/Layout/Notice/style/index.less +4 -0
  320. package/lib/ProLayout/components/Layout/index.js +2 -2
  321. package/lib/ProLayout/components/ProCollapse/index.js +10 -6
  322. package/lib/ProLayout/components/ProCollapse/style/index.less +9 -9
  323. package/lib/ProLayout/components/ProFooter/index.js +8 -4
  324. package/lib/ProLayout/components/ProHeader/components/Copy/index.js +1 -1
  325. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +1 -1
  326. package/lib/ProLayout/components/ProHeader/components/index.js +2 -2
  327. package/lib/ProLayout/components/ProHeader/index.js +22 -12
  328. package/lib/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
  329. package/lib/ProLayout/components/TabsManager/components/TabContextMenu.js +106 -0
  330. package/lib/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
  331. package/lib/ProLayout/components/TabsManager/components/TabItem.js +67 -0
  332. package/lib/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
  333. package/lib/ProLayout/components/TabsManager/components/TabsContext.js +11 -0
  334. package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
  335. package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.js +20 -0
  336. package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
  337. package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +31 -0
  338. package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
  339. package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.js +103 -0
  340. package/lib/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
  341. package/lib/ProLayout/components/TabsManager/hooks/useTabsState.js +370 -0
  342. package/lib/ProLayout/components/TabsManager/index.d.ts +8 -0
  343. package/lib/ProLayout/components/TabsManager/index.js +183 -0
  344. package/lib/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
  345. package/lib/ProLayout/components/TabsManager/propTypes.js +22 -0
  346. package/lib/ProLayout/components/TabsManager/style/index.less +179 -0
  347. package/lib/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
  348. package/lib/ProLayout/components/TabsManager/utils/index.js +119 -0
  349. package/lib/ProLayout/components/index.js +2 -2
  350. package/lib/ProLayout/index.d.ts +21 -4
  351. package/lib/ProLayout/index.js +122 -21
  352. package/lib/ProLayout/propTypes.d.ts +139 -1
  353. package/lib/ProLayout/propTypes.js +40 -1
  354. package/lib/ProLayout/utils/index.js +18 -13
  355. package/lib/ProSelect/components/AdaptiveTooltip.js +7 -3
  356. package/lib/ProSelect/index.js +23 -12
  357. package/lib/ProSelect/utils/index.js +8 -8
  358. package/lib/ProStep/components/Anchor/index.js +1 -1
  359. package/lib/ProStep/components/Item/index.js +15 -9
  360. package/lib/ProStep/components/Listener/index.js +15 -9
  361. package/lib/ProStep/components/Step/index.js +17 -7
  362. package/lib/ProStep/index.js +30 -19
  363. package/lib/ProStep/utils/index.js +6 -3
  364. package/lib/ProStepTab/index.js +33 -22
  365. package/lib/ProTable/components/FormatColumn/index.js +22 -16
  366. package/lib/ProTable/components/RcTable/components/BaseTable/index.js +9 -5
  367. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +22 -16
  368. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -5
  369. package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +11 -6
  370. package/lib/ProTable/components/RcTable/index.js +2 -2
  371. package/lib/ProTable/components/RenderColumn/index.js +17 -8
  372. package/lib/ProTable/components/RenderTabs/index.js +16 -7
  373. package/lib/ProTable/components/TableResizable/index.js +19 -9
  374. package/lib/ProTable/components/TooltipTitle/index.js +3 -6
  375. package/lib/ProTable/components/index.js +2 -2
  376. package/lib/ProTable/hooks/useAntdTable.js +42 -31
  377. package/lib/ProTable/index.js +41 -29
  378. package/lib/ProTable/style/index.less +3 -0
  379. package/lib/ProTable/utils/index.js +7 -3
  380. package/lib/ProTabs/components/index.js +2 -2
  381. package/lib/ProTabs/index.js +23 -12
  382. package/lib/ProThemeTools/component/ProTools/index.js +21 -11
  383. package/lib/ProThemeTools/component/index.js +2 -2
  384. package/lib/ProThemeTools/context/ThemeContext.js +20 -16
  385. package/lib/ProThemeTools/index.js +22 -12
  386. package/lib/ProThemeTools/utils/index.js +6 -3
  387. package/lib/ProTooltip/index.js +30 -20
  388. package/lib/ProTree/components/CloseIcon.js +6 -3
  389. package/lib/ProTree/components/List.js +10 -5
  390. package/lib/ProTree/components/ProTree.js +23 -12
  391. package/lib/ProTree/components/ProTreeSelect/index.js +138 -93
  392. package/lib/ProTree/components/SearchTitle.js +1 -1
  393. package/lib/ProTree/components/Tree.js +28 -16
  394. package/lib/ProTree/components/index.js +2 -2
  395. package/lib/ProTree/index.js +9 -5
  396. package/lib/ProTree/utils.js +16 -11
  397. package/lib/ProTreeModal/components/Cascader.js +14 -5
  398. package/lib/ProTreeModal/components/CloseIcon.js +6 -3
  399. package/lib/ProTreeModal/components/List.js +11 -7
  400. package/lib/ProTreeModal/components/SortableItem.js +10 -6
  401. package/lib/ProTreeModal/components/Tree.js +24 -13
  402. package/lib/ProTreeModal/components/Trigger.js +19 -9
  403. package/lib/ProTreeModal/components/index.js +2 -2
  404. package/lib/ProTreeModal/index.js +16 -6
  405. package/lib/ProTreeModal/style/index.less +6 -0
  406. package/lib/ProTreeModal/utils.js +17 -14
  407. package/lib/ProUpload/components/ButtonRender.js +14 -9
  408. package/lib/ProUpload/components/DragRender.d.ts +1 -0
  409. package/lib/ProUpload/components/DragRender.js +13 -5
  410. package/lib/ProUpload/components/DraggableUploadListItem.js +7 -3
  411. package/lib/ProUpload/components/Example.js +16 -6
  412. package/lib/ProUpload/components/FileItem.js +1 -1
  413. package/lib/ProUpload/components/ImageRender.js +20 -10
  414. package/lib/ProUpload/index.js +31 -18
  415. package/lib/ProUpload/propsType.d.ts +5 -0
  416. package/lib/ProViewer/index.js +22 -14
  417. package/lib/ProWaterMark/index.js +7 -3
  418. package/lib/index.d.ts +1 -2
  419. package/lib/index.js +4 -3
  420. package/lib/locale/en_US.d.ts +9 -0
  421. package/lib/locale/en_US.js +9 -0
  422. package/lib/locale/index.js +1 -1
  423. package/lib/locale/zh_CN.d.ts +9 -0
  424. package/lib/locale/zh_CN.js +9 -0
  425. package/lib/style/theme/antd.less +11 -35
  426. package/lib/utils/index.js +9 -4
  427. package/package.json +13 -16
  428. package/package.json.backup-antd5 +159 -0
  429. package/es/ProForm/components/combination/Group/utils.d.ts +0 -54
  430. package/es/ProForm/components/combination/Group/utils.js +0 -196
  431. package/es/assets/tip.svg +0 -1
  432. package/lib/ProForm/components/combination/Group/utils.d.ts +0 -54
  433. package/lib/ProForm/components/combination/Group/utils.js +0 -210
  434. package/lib/assets/tip.svg +0 -1
@@ -0,0 +1,159 @@
1
+ {
2
+ "name": "@zat-design/sisyphus-react",
3
+ "version": "4.0.0-ant6",
4
+ "license": "MIT",
5
+ "main": "lib/index.js",
6
+ "module": "es/index.js",
7
+ "typings": "lib/index.d.ts",
8
+ "homepage": "https://procomponents.zhongan.tech",
9
+ "keywords": [
10
+ "components",
11
+ "design",
12
+ "framework",
13
+ "frontend",
14
+ "react",
15
+ "react-component",
16
+ "ui",
17
+ "zat-design",
18
+ "sisyphus",
19
+ "react-sisyphus",
20
+ "pro-components"
21
+ ],
22
+ "scripts": {
23
+ "analyze": "ANALYZE=1 dumi build",
24
+ "build": "father build && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css",
25
+ "build-es": "father build --format esm",
26
+ "build-lib": "father build --format cjs",
27
+ "build-dist": "father build --format umd",
28
+ "docs": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" dumi build",
29
+ "docs:deploy": "gh-pages -d docs-dist",
30
+ "lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
31
+ "lint-staged": "lint-staged",
32
+ "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.*' --ignore-pattern '**/*.spec.*'",
33
+ "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
34
+ "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
35
+ "lint:prettier": "prettier --check \"**/*\" --end-of-line auto",
36
+ "lint:report": "eslint --ext .jsx,.js src -f checkstyle -o report_zacc_eslint_js.xml & exit 0; stylelint --custom-formatter node_modules/stylelint-checkstyle-formatter src/**/*.{css,scss,less} > report_zacc_stylelint_css.xml & exit 0",
37
+ "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
38
+ "precommit": "lint-staged",
39
+ "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
40
+ "postpublish": "git clean -fd",
41
+ "release": "yarn build && npm publish",
42
+ "release:beta": "yarn build && npm publish --tag=beta",
43
+ "start": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" dumi dev",
44
+ "test": "umi-test",
45
+ "test:coverage": "umi-test --coverage",
46
+ "tsc": "tsc --noEmit"
47
+ },
48
+ "husky": {
49
+ "hooks": {
50
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
51
+ "pre-commit": "npm run lint-staged"
52
+ }
53
+ },
54
+ "lint-staged": {
55
+ "src/**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js"
56
+ },
57
+ "browserslist": [
58
+ "last 2 versions",
59
+ "Firefox ESR",
60
+ "> 1%",
61
+ "ie >= 11",
62
+ "iOS >= 7",
63
+ "Android >= 4"
64
+ ],
65
+ "overrides": {
66
+ "react-resizable": {
67
+ "react-draggable": "<4.5.0"
68
+ }
69
+ },
70
+ "resolutions": {
71
+ "mockjs/commander": "9.2.0",
72
+ "react-draggable": "<4.5.0"
73
+ },
74
+ "dependencies": {
75
+ "@ant-design/icons": "^5.6.1",
76
+ "@babel/runtime": "^7.18.0",
77
+ "@dnd-kit/core": "^6.0.8",
78
+ "@dnd-kit/sortable": "^7.0.2",
79
+ "@dnd-kit/utilities": "^3.2.1",
80
+ "@zat-design/utils": "4.0.0-beta.5",
81
+ "ahooks": "3.9.5",
82
+ "antd": "^5.28.1",
83
+ "big.js": "^6.2.1",
84
+ "classnames": "^2.3.1",
85
+ "dayjs": "^1.11.13",
86
+ "lodash": "^4.17.21",
87
+ "rc-resize-observer": "^1.4.0",
88
+ "react-lazyload": "^3.2.1",
89
+ "react-resizable": "^3.0.5",
90
+ "react-svg": "^15.1.7"
91
+ },
92
+ "peerDependencies": {
93
+ "antd": "^5.26.4",
94
+ "react": "^18",
95
+ "react-dom": "^18",
96
+ "react-router-dom": "^6.0.0"
97
+ },
98
+ "devDependencies": {
99
+ "@commitlint/cli": "^12.1.1",
100
+ "@commitlint/config-conventional": "^12.1.1",
101
+ "@testing-library/jest-dom": "^6.0.0",
102
+ "@testing-library/react": "^14.0.0",
103
+ "@types/classnames": "^2.3.1",
104
+ "@types/jest": "^29.5.11",
105
+ "@types/lodash": "^4.14.171",
106
+ "@types/react": "^18.2.0",
107
+ "@types/react-dom": "^18.2.0",
108
+ "@types/react-lazyload": "^3.2.3",
109
+ "@types/react-resizable": "^3.0.8",
110
+ "@typescript-eslint/eslint-plugin": "4.0.1",
111
+ "@typescript-eslint/parser": "4.0.1",
112
+ "@umijs/fabric": "^2.8.1",
113
+ "@umijs/preset-react": "^1.8.22",
114
+ "@umijs/test": "^3.0.5",
115
+ "@zat-design/login-react": "1.0.25",
116
+ "babel-eslint": "10.0.3",
117
+ "babel-plugin-import": "^1.13.8",
118
+ "babel-plugin-lodash": "^3.3.4",
119
+ "commander": "9.2.0",
120
+ "cross-env": "^7.0.3",
121
+ "dumi": "^1.0.9",
122
+ "eslint": "7.10.0",
123
+ "eslint-config-za": "2.1.0",
124
+ "eslint-plugin-babel": "5.3.0",
125
+ "eslint-plugin-complexity": "^1.0.2",
126
+ "eslint-plugin-import": "^2.22.1",
127
+ "eslint-plugin-jsx-a11y": "6.2.3",
128
+ "eslint-plugin-react": "7.16.0",
129
+ "eslint-plugin-react-hooks": "2.2.0",
130
+ "eslint-plugin-unused-imports": "^3.0.0",
131
+ "father": "^4.6.1",
132
+ "gh-pages": "^3.0.0",
133
+ "husky": "^4.0.7",
134
+ "jest-canvas-mock": "^2.5.2",
135
+ "lint-staged": "^10.0.0",
136
+ "mini-css-extract-plugin": "^2.9.4",
137
+ "minimatch": "^10.1.1",
138
+ "mockjs": "^1.0.0",
139
+ "prettier": "^2.5.0",
140
+ "pretty-quick": "^3.1.3",
141
+ "react": "^18.2.0",
142
+ "react-dom": "^18.2.0",
143
+ "react-json-view": "^1.21.3",
144
+ "slash2": "^2.0.0",
145
+ "stylelint": "13.0.0",
146
+ "stylelint-checkstyle-formatter": "0.1.2",
147
+ "typescript": "^4.9.5",
148
+ "webpack-deadcode-plugin": "^0.1.17",
149
+ "yorkie": "^2.0.0"
150
+ },
151
+ "checkFiles": [
152
+ "src/**/*.js*",
153
+ "src/**/*.ts*",
154
+ "src/**/*.tsx*",
155
+ "src/**/*.less",
156
+ "config/**/*.js*",
157
+ "scripts/**/*.js"
158
+ ]
159
+ }
@@ -1,54 +0,0 @@
1
- /// <reference types="react" />
2
- import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
3
- import { FormInstance } from 'antd';
4
- import type { GroupColumnType, SpaceType } from './propsType';
5
- import type { ProFormColumnType, ReactiveFunction } from '../../render/propsType';
6
- export type EventArgs = any[];
7
- /**
8
- * 插入间隔符
9
- * @param columns 表单配置数组
10
- * @returns
11
- */
12
- export declare const insertSeparator: (columns: GroupColumnType[], space?: SpaceType) => any[];
13
- /** 带出event的组件默认取值方法 */
14
- export declare function defaultGetValueFromEvent(valuePropName: string, ...args: EventArgs): any;
15
- /** 转换names */
16
- export declare const transformNamesString: (arr: (string | string[])[]) => (string | string[])[];
17
- /**
18
- * Input TextArea 小写自动转大写
19
- * @param type 组件类型
20
- * @param upperCase 是否小写转大写
21
- * @returns {}
22
- */
23
- export declare const isUpperCase: (type: string, upperCase: boolean) => any;
24
- interface Params {
25
- form?: FormInstance;
26
- index?: number;
27
- type?: string;
28
- namePath?: InternalNamePath;
29
- disabled?: boolean | ReactiveFunction<any, boolean>;
30
- show?: boolean | ReactiveFunction<any, boolean>;
31
- component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
32
- fieldProps?: boolean | ReactiveFunction<any, boolean>;
33
- name?: NamePath;
34
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
35
- }
36
- /** 计算响应式参数的值 */
37
- export declare const getReactiveProps: (params: Params) => {
38
- disabled: boolean;
39
- show: boolean;
40
- component: import("react").ReactNode;
41
- fieldProps: boolean;
42
- desensitization: [number, number];
43
- };
44
- type ValueTypeGetterParams = Pick<ProFormColumnType, 'valueType' | 'switchValue' | 'toISOString' | 'toCSTString' | 'disabled' | 'desensitization'> & {
45
- type?: any;
46
- mode?: string;
47
- };
48
- /** 获取当前字段的转换函数 */
49
- export declare const getValueTypeTrans: (params: ValueTypeGetterParams) => any;
50
- /** 执行所有中间件 返回处理后的值 */
51
- export declare const getValueMiddleware: (value: any, callbacks?: any[]) => any;
52
- /** 获取中间件处理后的value */
53
- export declare const valueFromEventWrapper: (column: any, args: any) => any;
54
- export {};
@@ -1,196 +0,0 @@
1
- /* eslint-disable no-lonely-if */
2
-
3
- import { isFunction } from 'lodash';
4
- import { validate } from '@zat-design/utils';
5
- import { Button } from 'antd';
6
- import valueTypeMap from "../../../utils/valueType";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- /**
9
- * 插入间隔符
10
- * @param columns 表单配置数组
11
- * @returns
12
- */
13
- export var insertSeparator = (columns, space) => {
14
- if (!(space !== null && space !== void 0 && space.separator)) {
15
- return columns;
16
- }
17
- var separatorIndexs = (() => {
18
- var reuslt = [];
19
- if (validate.isEmpty(space === null || space === void 0 ? void 0 : space.separatorIndex)) {
20
- return reuslt;
21
- }
22
-
23
- // 如果 index 是数字,将其转换为数组
24
- if (typeof (space === null || space === void 0 ? void 0 : space.separatorIndex) === 'number') {
25
- reuslt.push(space.separatorIndex);
26
- }
27
- if (Array.isArray(space.separatorIndex)) {
28
- reuslt = reuslt.concat(space.separatorIndex);
29
- }
30
- return reuslt;
31
- })();
32
- return columns.reduce((result, current, index, array) => {
33
- // 将当前元素添加到结果数组中
34
- result.push(current);
35
- if (separatorIndexs !== null && separatorIndexs !== void 0 && separatorIndexs.length) {
36
- separatorIndexs.forEach(separatorIndex => {
37
- if (index === separatorIndex) {
38
- result.push({
39
- separator: true,
40
- component: /*#__PURE__*/_jsx(Button, {
41
- className: "group-separator",
42
- children: space.separator
43
- }),
44
- fieldProps: {
45
- disabled: true
46
- }
47
- });
48
- }
49
- });
50
- } else {
51
- // 如果当前元素不是最后一个元素,则添加间隔符
52
- if (index < array.length - 1) {
53
- result.push({
54
- separator: true,
55
- component: /*#__PURE__*/_jsx(Button, {
56
- className: "group-separator",
57
- children: space.separator
58
- }),
59
- fieldProps: {
60
- disabled: true
61
- }
62
- });
63
- }
64
- }
65
- return result;
66
- }, []);
67
- };
68
-
69
- /** 带出event的组件默认取值方法 */
70
- export function defaultGetValueFromEvent(valuePropName) {
71
- var event = arguments.length <= 1 ? undefined : arguments[1];
72
- if (event && event.target && typeof event.target === 'object' && valuePropName in event.target) {
73
- return event.target[valuePropName];
74
- }
75
- return event;
76
- }
77
-
78
- /** 转换names */
79
- export var transformNamesString = arr => {
80
- var result = arr.map(subArr => {
81
- if (Array.isArray(subArr)) {
82
- return subArr.join('_');
83
- }
84
- return subArr;
85
- });
86
- return result;
87
- };
88
-
89
- /**
90
- * Input TextArea 小写自动转大写
91
- * @param type 组件类型
92
- * @param upperCase 是否小写转大写
93
- * @returns {}
94
- */
95
- export var isUpperCase = (type, upperCase) => {
96
- var result = {};
97
- if (['Input', 'TextArea'].includes(type) && upperCase) {
98
- result.getValueFromEvent = event => {
99
- var _event$target;
100
- if (Array.isArray(event)) {
101
- return event.map(value => {
102
- var newValue = value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z]/g, '');
103
- return (newValue === null || newValue === void 0 ? void 0 : newValue.toUpperCase()) || '';
104
- });
105
- }
106
- var newValue = (_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.value) === null || _event$target === void 0 ? void 0 : _event$target.replace(/[^a-zA-Z]/g, '');
107
- return newValue.toUpperCase() || '';
108
- };
109
- }
110
- return result;
111
- };
112
- /** 计算响应式参数的值 */
113
- export var getReactiveProps = params => {
114
- var form = params.form,
115
- index = params.index,
116
- namePath = params.namePath,
117
- disabled = params.disabled,
118
- show = params.show,
119
- component = params.component,
120
- fieldProps = params.fieldProps,
121
- desensitization = params.desensitization;
122
- var values = namePath ? form.getFieldValue(namePath) : form.getFieldsValue();
123
- var _disabled = isFunction(disabled) ? disabled(values, {
124
- form,
125
- index,
126
- namePath
127
- }) : disabled;
128
- var _show = isFunction(show) ? show(values, {
129
- form,
130
- index,
131
- namePath
132
- }) : show;
133
- var _component = isFunction(component) ? component(values, {
134
- form,
135
- index,
136
- namePath
137
- }) : component;
138
- var _fieldProps = isFunction(fieldProps) ? fieldProps(values, {
139
- form,
140
- index,
141
- namePath
142
- }) : fieldProps;
143
- var _desensitization = isFunction(desensitization) ? desensitization(values, {
144
- form,
145
- index,
146
- namePath
147
- }) : desensitization;
148
- return {
149
- disabled: _disabled,
150
- show: _show,
151
- component: _component,
152
- fieldProps: _fieldProps,
153
- desensitization: _desensitization
154
- };
155
- };
156
- /** 获取当前字段的转换函数 */
157
- export var getValueTypeTrans = params => {
158
- var _valueTypeMap$valueTy;
159
- var valueType = params.valueType;
160
- var transform = (_valueTypeMap$valueTy = valueTypeMap[valueType]) === null || _valueTypeMap$valueTy === void 0 ? void 0 : _valueTypeMap$valueTy.call(valueTypeMap, params);
161
- return transform;
162
- };
163
- var getTrim = value => {
164
- return (value === null || value === void 0 ? void 0 : value.trim()) || '';
165
- };
166
- var getUpperCase = value => {
167
- var _value = value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z]/g, '');
168
- return _value.toUpperCase() || '';
169
- };
170
-
171
- /** 执行所有中间件 返回处理后的值 */
172
- export var getValueMiddleware = function getValueMiddleware(value) {
173
- var callbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
174
- return callbacks.reduce((preValue, cb) => {
175
- return cb === null || cb === void 0 ? void 0 : cb(preValue);
176
- }, value);
177
- };
178
-
179
- /** 获取中间件处理后的value */
180
- export var valueFromEventWrapper = (column, args) => {
181
- var getValueFromEvent = column.getValueFromEvent,
182
- _column$valuePropName = column.valuePropName,
183
- valuePropName = _column$valuePropName === void 0 ? 'value' : _column$valuePropName,
184
- trim = column.trim,
185
- upperCase = column.upperCase;
186
- var newValue;
187
- if (getValueFromEvent) {
188
- newValue = getValueFromEvent(...args);
189
- } else {
190
- newValue = defaultGetValueFromEvent(valuePropName, ...args);
191
- }
192
- var list = [];
193
- if (trim) list.push(getTrim);
194
- if (upperCase) list.push(getUpperCase);
195
- return getValueMiddleware(newValue, list);
196
- };
package/es/assets/tip.svg DELETED
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1678358862590" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7996" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 19.017143a492.982857 492.982857 0 1 1-0.073143 986.038857A492.982857 492.982857 0 0 1 512 19.090286z m0 48.786286a444.269714 444.269714 0 1 0 0.073143 888.466285A444.269714 444.269714 0 0 0 512 67.803429z m22.016 317.366857c37.449143 3.876571 55.149714 33.792 48.64 66.706285L504.246857 710.948571c-1.024 5.924571 2.048 11.849143 7.314286 13.677715 5.851429 2.048 17.92-5.412571 27.648-16.091429l47.104-56.612571c1.243429 9.508571-0.877714 26.185143-0.877714 32.548571-35.328 53.028571-71.314286 93.988571-131.876572 93.988572-41.325714-6.729143-58.221714-36.352-49.298286-66.56l77.897143-257.828572c1.901714-6.363429-1.243429-13.019429-7.021714-15.067428-5.778286-2.048-17.042286 5.412571-26.770286 16.091428l-47.030857 56.612572c-1.316571-9.508571-0.146286-25.234286-0.146286-31.597715 35.328-53.028571 93.403429-94.939429 132.827429-94.939428z m40.96-144.822857c29.769143 0 53.906286 21.723429 53.906286 53.613714 0 31.963429-24.137143 53.613714-53.906286 53.613714a52.297143 52.297143 0 0 1-53.906286-53.613714c0-31.890286 24.137143-53.613714 53.906286-53.613714z" p-id="7997"></path></svg>
@@ -1,54 +0,0 @@
1
- /// <reference types="react" />
2
- import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
3
- import { FormInstance } from 'antd';
4
- import type { GroupColumnType, SpaceType } from './propsType';
5
- import type { ProFormColumnType, ReactiveFunction } from '../../render/propsType';
6
- export type EventArgs = any[];
7
- /**
8
- * 插入间隔符
9
- * @param columns 表单配置数组
10
- * @returns
11
- */
12
- export declare const insertSeparator: (columns: GroupColumnType[], space?: SpaceType) => any[];
13
- /** 带出event的组件默认取值方法 */
14
- export declare function defaultGetValueFromEvent(valuePropName: string, ...args: EventArgs): any;
15
- /** 转换names */
16
- export declare const transformNamesString: (arr: (string | string[])[]) => (string | string[])[];
17
- /**
18
- * Input TextArea 小写自动转大写
19
- * @param type 组件类型
20
- * @param upperCase 是否小写转大写
21
- * @returns {}
22
- */
23
- export declare const isUpperCase: (type: string, upperCase: boolean) => any;
24
- interface Params {
25
- form?: FormInstance;
26
- index?: number;
27
- type?: string;
28
- namePath?: InternalNamePath;
29
- disabled?: boolean | ReactiveFunction<any, boolean>;
30
- show?: boolean | ReactiveFunction<any, boolean>;
31
- component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
32
- fieldProps?: boolean | ReactiveFunction<any, boolean>;
33
- name?: NamePath;
34
- desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
35
- }
36
- /** 计算响应式参数的值 */
37
- export declare const getReactiveProps: (params: Params) => {
38
- disabled: boolean;
39
- show: boolean;
40
- component: import("react").ReactNode;
41
- fieldProps: boolean;
42
- desensitization: [number, number];
43
- };
44
- type ValueTypeGetterParams = Pick<ProFormColumnType, 'valueType' | 'switchValue' | 'toISOString' | 'toCSTString' | 'disabled' | 'desensitization'> & {
45
- type?: any;
46
- mode?: string;
47
- };
48
- /** 获取当前字段的转换函数 */
49
- export declare const getValueTypeTrans: (params: ValueTypeGetterParams) => any;
50
- /** 执行所有中间件 返回处理后的值 */
51
- export declare const getValueMiddleware: (value: any, callbacks?: any[]) => any;
52
- /** 获取中间件处理后的value */
53
- export declare const valueFromEventWrapper: (column: any, args: any) => any;
54
- export {};
@@ -1,210 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.defaultGetValueFromEvent = defaultGetValueFromEvent;
8
- exports.valueFromEventWrapper = exports.transformNamesString = exports.isUpperCase = exports.insertSeparator = exports.getValueTypeTrans = exports.getValueMiddleware = exports.getReactiveProps = void 0;
9
- var _lodash = require("lodash");
10
- var _utils = require("@zat-design/utils");
11
- var _antd = require("antd");
12
- var _valueType = _interopRequireDefault(require("../../../utils/valueType"));
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /* eslint-disable no-lonely-if */
15
-
16
- /**
17
- * 插入间隔符
18
- * @param columns 表单配置数组
19
- * @returns
20
- */
21
- var insertSeparator = (columns, space) => {
22
- if (!(space !== null && space !== void 0 && space.separator)) {
23
- return columns;
24
- }
25
- var separatorIndexs = (() => {
26
- var reuslt = [];
27
- if (_utils.validate.isEmpty(space === null || space === void 0 ? void 0 : space.separatorIndex)) {
28
- return reuslt;
29
- }
30
-
31
- // 如果 index 是数字,将其转换为数组
32
- if (typeof (space === null || space === void 0 ? void 0 : space.separatorIndex) === 'number') {
33
- reuslt.push(space.separatorIndex);
34
- }
35
- if (Array.isArray(space.separatorIndex)) {
36
- reuslt = reuslt.concat(space.separatorIndex);
37
- }
38
- return reuslt;
39
- })();
40
- return columns.reduce((result, current, index, array) => {
41
- // 将当前元素添加到结果数组中
42
- result.push(current);
43
- if (separatorIndexs !== null && separatorIndexs !== void 0 && separatorIndexs.length) {
44
- separatorIndexs.forEach(separatorIndex => {
45
- if (index === separatorIndex) {
46
- result.push({
47
- separator: true,
48
- component: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
49
- className: "group-separator",
50
- children: space.separator
51
- }),
52
- fieldProps: {
53
- disabled: true
54
- }
55
- });
56
- }
57
- });
58
- } else {
59
- // 如果当前元素不是最后一个元素,则添加间隔符
60
- if (index < array.length - 1) {
61
- result.push({
62
- separator: true,
63
- component: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
64
- className: "group-separator",
65
- children: space.separator
66
- }),
67
- fieldProps: {
68
- disabled: true
69
- }
70
- });
71
- }
72
- }
73
- return result;
74
- }, []);
75
- };
76
-
77
- /** 带出event的组件默认取值方法 */
78
- exports.insertSeparator = insertSeparator;
79
- function defaultGetValueFromEvent(valuePropName) {
80
- var event = arguments.length <= 1 ? undefined : arguments[1];
81
- if (event && event.target && typeof event.target === 'object' && valuePropName in event.target) {
82
- return event.target[valuePropName];
83
- }
84
- return event;
85
- }
86
-
87
- /** 转换names */
88
- var transformNamesString = arr => {
89
- var result = arr.map(subArr => {
90
- if (Array.isArray(subArr)) {
91
- return subArr.join('_');
92
- }
93
- return subArr;
94
- });
95
- return result;
96
- };
97
-
98
- /**
99
- * Input TextArea 小写自动转大写
100
- * @param type 组件类型
101
- * @param upperCase 是否小写转大写
102
- * @returns {}
103
- */
104
- exports.transformNamesString = transformNamesString;
105
- var isUpperCase = (type, upperCase) => {
106
- var result = {};
107
- if (['Input', 'TextArea'].includes(type) && upperCase) {
108
- result.getValueFromEvent = event => {
109
- var _event$target;
110
- if (Array.isArray(event)) {
111
- return event.map(value => {
112
- var newValue = value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z]/g, '');
113
- return (newValue === null || newValue === void 0 ? void 0 : newValue.toUpperCase()) || '';
114
- });
115
- }
116
- var newValue = (_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.value) === null || _event$target === void 0 ? void 0 : _event$target.replace(/[^a-zA-Z]/g, '');
117
- return newValue.toUpperCase() || '';
118
- };
119
- }
120
- return result;
121
- };
122
- exports.isUpperCase = isUpperCase;
123
- /** 计算响应式参数的值 */
124
- var getReactiveProps = params => {
125
- var form = params.form,
126
- index = params.index,
127
- namePath = params.namePath,
128
- disabled = params.disabled,
129
- show = params.show,
130
- component = params.component,
131
- fieldProps = params.fieldProps,
132
- desensitization = params.desensitization;
133
- var values = namePath ? form.getFieldValue(namePath) : form.getFieldsValue();
134
- var _disabled = (0, _lodash.isFunction)(disabled) ? disabled(values, {
135
- form,
136
- index,
137
- namePath
138
- }) : disabled;
139
- var _show = (0, _lodash.isFunction)(show) ? show(values, {
140
- form,
141
- index,
142
- namePath
143
- }) : show;
144
- var _component = (0, _lodash.isFunction)(component) ? component(values, {
145
- form,
146
- index,
147
- namePath
148
- }) : component;
149
- var _fieldProps = (0, _lodash.isFunction)(fieldProps) ? fieldProps(values, {
150
- form,
151
- index,
152
- namePath
153
- }) : fieldProps;
154
- var _desensitization = (0, _lodash.isFunction)(desensitization) ? desensitization(values, {
155
- form,
156
- index,
157
- namePath
158
- }) : desensitization;
159
- return {
160
- disabled: _disabled,
161
- show: _show,
162
- component: _component,
163
- fieldProps: _fieldProps,
164
- desensitization: _desensitization
165
- };
166
- };
167
- exports.getReactiveProps = getReactiveProps;
168
- /** 获取当前字段的转换函数 */
169
- var getValueTypeTrans = params => {
170
- var _valueTypeMap$valueTy;
171
- var valueType = params.valueType;
172
- var transform = (_valueTypeMap$valueTy = _valueType.default[valueType]) === null || _valueTypeMap$valueTy === void 0 ? void 0 : _valueTypeMap$valueTy.call(_valueType.default, params);
173
- return transform;
174
- };
175
- exports.getValueTypeTrans = getValueTypeTrans;
176
- var getTrim = value => {
177
- return (value === null || value === void 0 ? void 0 : value.trim()) || '';
178
- };
179
- var getUpperCase = value => {
180
- var _value = value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z]/g, '');
181
- return _value.toUpperCase() || '';
182
- };
183
-
184
- /** 执行所有中间件 返回处理后的值 */
185
- var getValueMiddleware = exports.getValueMiddleware = function getValueMiddleware(value) {
186
- var callbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
187
- return callbacks.reduce((preValue, cb) => {
188
- return cb === null || cb === void 0 ? void 0 : cb(preValue);
189
- }, value);
190
- };
191
-
192
- /** 获取中间件处理后的value */
193
- var valueFromEventWrapper = (column, args) => {
194
- var getValueFromEvent = column.getValueFromEvent,
195
- _column$valuePropName = column.valuePropName,
196
- valuePropName = _column$valuePropName === void 0 ? 'value' : _column$valuePropName,
197
- trim = column.trim,
198
- upperCase = column.upperCase;
199
- var newValue;
200
- if (getValueFromEvent) {
201
- newValue = getValueFromEvent(...args);
202
- } else {
203
- newValue = defaultGetValueFromEvent(valuePropName, ...args);
204
- }
205
- var list = [];
206
- if (trim) list.push(getTrim);
207
- if (upperCase) list.push(getUpperCase);
208
- return getValueMiddleware(newValue, list);
209
- };
210
- exports.valueFromEventWrapper = valueFromEventWrapper;
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1678358862590" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7996" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 19.017143a492.982857 492.982857 0 1 1-0.073143 986.038857A492.982857 492.982857 0 0 1 512 19.090286z m0 48.786286a444.269714 444.269714 0 1 0 0.073143 888.466285A444.269714 444.269714 0 0 0 512 67.803429z m22.016 317.366857c37.449143 3.876571 55.149714 33.792 48.64 66.706285L504.246857 710.948571c-1.024 5.924571 2.048 11.849143 7.314286 13.677715 5.851429 2.048 17.92-5.412571 27.648-16.091429l47.104-56.612571c1.243429 9.508571-0.877714 26.185143-0.877714 32.548571-35.328 53.028571-71.314286 93.988571-131.876572 93.988572-41.325714-6.729143-58.221714-36.352-49.298286-66.56l77.897143-257.828572c1.901714-6.363429-1.243429-13.019429-7.021714-15.067428-5.778286-2.048-17.042286 5.412571-26.770286 16.091428l-47.030857 56.612572c-1.316571-9.508571-0.146286-25.234286-0.146286-31.597715 35.328-53.028571 93.403429-94.939429 132.827429-94.939428z m40.96-144.822857c29.769143 0 53.906286 21.723429 53.906286 53.613714 0 31.963429-24.137143 53.613714-53.906286 53.613714a52.297143 52.297143 0 0 1-53.906286-53.613714c0-31.890286 24.137143-53.613714 53.906286-53.613714z" p-id="7997"></path></svg>