@zat-design/sisyphus-react 4.0.0-beta.9 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. package/README.md +1 -1
  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 +16 -7
  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 -10
  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 +14 -10
  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 +17 -4
  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 +28 -35
  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 +10 -4
  133. package/es/ProLayout/index.js +100 -16
  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 +122 -76
  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 +21 -11
  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 -26
  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 +23 -19
  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 +27 -13
  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 +31 -38
  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 +10 -4
  351. package/lib/ProLayout/index.js +115 -23
  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 +141 -94
  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/es/ProForm/components/combination/Group/utils.d.ts +0 -54
  429. package/es/ProForm/components/combination/Group/utils.js +0 -196
  430. package/es/assets/tip.svg +0 -1
  431. package/lib/ProForm/components/combination/Group/utils.d.ts +0 -54
  432. package/lib/ProForm/components/combination/Group/utils.js +0 -210
  433. package/lib/assets/tip.svg +0 -1
@@ -0,0 +1,444 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createComponentProps = void 0;
7
+ exports.defaultGetValueFromEvent = defaultGetValueFromEvent;
8
+ exports.valueFromEventWrapper = exports.validateChildren = exports.useFormItemProps = exports.transformNamesString = exports.isUpperCase = exports.insertSeparator = exports.getValueTypeTrans = exports.getValueMiddleware = exports.getReactiveProps = void 0;
9
+ var _antd = require("antd");
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _lodash = require("lodash");
12
+ var _utils = require("@zat-design/utils");
13
+ var _valueType = _interopRequireDefault(require("../../../../utils/valueType"));
14
+ var _locale = _interopRequireDefault(require("../../../../../locale"));
15
+ var _utils2 = require("../../../../utils");
16
+ var _rulesCreator = require("../../../../utils/rulesCreator");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ var _excluded = ["name", "label", "rules", "required", "dependencies", "tooltip", "extra", "validateFirst", "disabled", "type", "fieldProps"],
19
+ _excluded2 = ["normalize", "getValueProps"];
20
+ /* eslint-disable no-lonely-if */
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+ 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; }
23
+ 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); } }
24
+ 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); }); }; }
25
+ 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; }
26
+ 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; }
27
+ 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; }
28
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
29
+ 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); }
30
+ 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; }
31
+ 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; }
32
+ /**
33
+ * 插入间隔符
34
+ * @param columns 表单配置数组
35
+ * @returns
36
+ */
37
+ var insertSeparator = (columns, space) => {
38
+ if (!(space !== null && space !== void 0 && space.separator)) {
39
+ return columns;
40
+ }
41
+ var separatorIndexs = (() => {
42
+ var reuslt = [];
43
+ if (_utils.validate.isEmpty(space === null || space === void 0 ? void 0 : space.separatorIndex)) {
44
+ return reuslt;
45
+ }
46
+
47
+ // 如果 index 是数字,将其转换为数组
48
+ if (typeof (space === null || space === void 0 ? void 0 : space.separatorIndex) === 'number') {
49
+ reuslt.push(space.separatorIndex);
50
+ }
51
+ if (Array.isArray(space.separatorIndex)) {
52
+ reuslt = reuslt.concat(space.separatorIndex);
53
+ }
54
+ return reuslt;
55
+ })();
56
+ return columns.reduce((result, current, index, array) => {
57
+ // 将当前元素添加到结果数组中
58
+ result.push(current);
59
+ if (separatorIndexs !== null && separatorIndexs !== void 0 && separatorIndexs.length) {
60
+ separatorIndexs.forEach(separatorIndex => {
61
+ if (index === separatorIndex) {
62
+ result.push({
63
+ separator: true,
64
+ component: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
65
+ className: "group-separator",
66
+ children: space.separator
67
+ }),
68
+ fieldProps: {
69
+ disabled: true
70
+ }
71
+ });
72
+ }
73
+ });
74
+ } else {
75
+ // 如果当前元素不是最后一个元素,则添加间隔符
76
+ if (index < array.length - 1) {
77
+ result.push({
78
+ separator: true,
79
+ component: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
80
+ className: "group-separator",
81
+ children: space.separator
82
+ }),
83
+ fieldProps: {
84
+ disabled: true
85
+ }
86
+ });
87
+ }
88
+ }
89
+ return result;
90
+ }, []);
91
+ };
92
+
93
+ /** 带出event的组件默认取值方法 */
94
+ exports.insertSeparator = insertSeparator;
95
+ function defaultGetValueFromEvent(valuePropName) {
96
+ var event = arguments.length <= 1 ? undefined : arguments[1];
97
+ if (event && event.target && typeof event.target === 'object' && valuePropName in event.target) {
98
+ return event.target[valuePropName];
99
+ }
100
+ return event;
101
+ }
102
+
103
+ /** 转换names */
104
+ var transformNamesString = arr => {
105
+ var result = arr.map(subArr => {
106
+ if (Array.isArray(subArr)) {
107
+ return subArr.join('_');
108
+ }
109
+ return subArr;
110
+ });
111
+ return result;
112
+ };
113
+
114
+ /**
115
+ * Input TextArea 小写自动转大写
116
+ * @param type 组件类型
117
+ * @param upperCase 是否小写转大写
118
+ * @returns {}
119
+ */
120
+ exports.transformNamesString = transformNamesString;
121
+ var isUpperCase = (type, upperCase) => {
122
+ var result = {};
123
+ if (['Input', 'TextArea'].includes(type) && upperCase) {
124
+ result.getValueFromEvent = event => {
125
+ var _event$target;
126
+ if (Array.isArray(event)) {
127
+ return event.map(value => {
128
+ var newValue = value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z]/g, '');
129
+ return (newValue === null || newValue === void 0 ? void 0 : newValue.toUpperCase()) || '';
130
+ });
131
+ }
132
+ 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, '');
133
+ return newValue.toUpperCase() || '';
134
+ };
135
+ }
136
+ return result;
137
+ };
138
+ exports.isUpperCase = isUpperCase;
139
+ /** 计算响应式参数的值 */
140
+ var getReactiveProps = params => {
141
+ var form = params.form,
142
+ index = params.index,
143
+ namePath = params.namePath,
144
+ disabled = params.disabled,
145
+ show = params.show,
146
+ component = params.component,
147
+ fieldProps = params.fieldProps,
148
+ desensitization = params.desensitization;
149
+ var values = namePath ? form.getFieldValue(namePath) : form.getFieldsValue();
150
+ var _disabled = (0, _lodash.isFunction)(disabled) ? disabled(values, {
151
+ form,
152
+ index,
153
+ namePath
154
+ }) : disabled;
155
+ var _show = (0, _lodash.isFunction)(show) ? show(values, {
156
+ form,
157
+ index,
158
+ namePath
159
+ }) : show;
160
+ var _component = (0, _lodash.isFunction)(component) ? component(values, {
161
+ form,
162
+ index,
163
+ namePath
164
+ }) : component;
165
+ var _fieldProps = (0, _lodash.isFunction)(fieldProps) ? fieldProps(values, {
166
+ form,
167
+ index,
168
+ namePath
169
+ }) : fieldProps;
170
+ var _desensitization = (0, _lodash.isFunction)(desensitization) ? desensitization(values, {
171
+ form,
172
+ index,
173
+ namePath
174
+ }) : desensitization;
175
+ return {
176
+ disabled: _disabled,
177
+ show: _show,
178
+ component: _component,
179
+ fieldProps: _fieldProps,
180
+ desensitization: _desensitization
181
+ };
182
+ };
183
+ exports.getReactiveProps = getReactiveProps;
184
+ /** 获取当前字段的转换函数 */
185
+ var getValueTypeTrans = params => {
186
+ var _valueTypeMap$valueTy;
187
+ var valueType = params.valueType;
188
+ var transform = (_valueTypeMap$valueTy = _valueType.default[valueType]) === null || _valueTypeMap$valueTy === void 0 ? void 0 : _valueTypeMap$valueTy.call(_valueType.default, params);
189
+ return transform;
190
+ };
191
+ exports.getValueTypeTrans = getValueTypeTrans;
192
+ var getTrim = value => {
193
+ return (value === null || value === void 0 ? void 0 : value.trim()) || '';
194
+ };
195
+ var getUpperCase = value => {
196
+ var _value = value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z]/g, '');
197
+ return _value.toUpperCase() || '';
198
+ };
199
+
200
+ /** 执行所有中间件 返回处理后的值 */
201
+ var getValueMiddleware = exports.getValueMiddleware = function getValueMiddleware(value) {
202
+ var callbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
203
+ return callbacks.reduce((preValue, cb) => {
204
+ return cb === null || cb === void 0 ? void 0 : cb(preValue);
205
+ }, value);
206
+ };
207
+
208
+ /** 获取中间件处理后的value */
209
+ var valueFromEventWrapper = (column, args) => {
210
+ var getValueFromEvent = column.getValueFromEvent,
211
+ _column$valuePropName = column.valuePropName,
212
+ valuePropName = _column$valuePropName === void 0 ? 'value' : _column$valuePropName,
213
+ trim = column.trim,
214
+ upperCase = column.upperCase;
215
+ var newValue;
216
+ if (getValueFromEvent) {
217
+ newValue = getValueFromEvent(...args);
218
+ } else {
219
+ newValue = defaultGetValueFromEvent(valuePropName, ...args);
220
+ }
221
+ var list = [];
222
+ if (trim) list.push(getTrim);
223
+ if (upperCase) list.push(getUpperCase);
224
+ return getValueMiddleware(newValue, list);
225
+ };
226
+
227
+ // ==================== 原 formItemHelpers.ts 内容 ====================
228
+ exports.valueFromEventWrapper = valueFromEventWrapper;
229
+ /**
230
+ * 创建FormItem属性(Hook版本)
231
+ */
232
+ var useFormItemProps = (column, contextProps, groupProps) => {
233
+ var _ref, _ref2, _groupProps$formDisab;
234
+ // Debug info removed for production
235
+
236
+ var name = column.name,
237
+ label = column.label,
238
+ _column$rules = column.rules,
239
+ rules = _column$rules === void 0 ? [] : _column$rules,
240
+ required = column.required,
241
+ dependencies = column.dependencies,
242
+ tooltip = column.tooltip,
243
+ extra = column.extra,
244
+ _column$validateFirst = column.validateFirst,
245
+ validateFirst = _column$validateFirst === void 0 ? true : _column$validateFirst,
246
+ columnDisabled = column.disabled,
247
+ type = column.type,
248
+ _column$fieldProps = column.fieldProps,
249
+ fieldProps = _column$fieldProps === void 0 ? {} : _column$fieldProps,
250
+ otherFormItemProps = _objectWithoutProperties(column, _excluded);
251
+ var form = contextProps.form,
252
+ namePath = contextProps.namePath;
253
+
254
+ // 构建完整的name路径
255
+ var fullName = namePath ? [...namePath, name] : name;
256
+
257
+ // 处理依赖关系 - 支持相对路径和绝对路径
258
+ var safeDependencies = Array.isArray(dependencies) ? dependencies : [];
259
+ var processedDependencies = safeDependencies.map(dep => {
260
+ if (typeof dep === 'string') {
261
+ // 相对路径:同Group内的其他字段
262
+ return namePath ? [...namePath, dep] : dep;
263
+ }
264
+ return dep; // 绝对路径保持不变
265
+ });
266
+
267
+ // 处理校验规则 - 确保rules是数组
268
+ var safeRules = Array.isArray(rules) ? rules : [];
269
+
270
+ // 先调用 rulesCreator 转换自定义校验类型(如 type: 'isEmail')
271
+ var transformedRules = (0, _rulesCreator.rulesCreator)({
272
+ rules: safeRules,
273
+ label: label,
274
+ isSelect: (0, _utils2.isSelect)({
275
+ dataSource: fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.dataSource,
276
+ type
277
+ }),
278
+ names: undefined,
279
+ // 灵活模式不使用 names
280
+ required
281
+ });
282
+
283
+ // 然后再处理 validator 的增强逻辑(为 validator 提供 form 和当前字段上下文)
284
+ var processedRules = transformedRules.map(rule => {
285
+ if (typeof rule.validator === 'function') {
286
+ var originalValidator = rule.validator;
287
+ return _objectSpread(_objectSpread({}, rule), {}, {
288
+ validator: function () {
289
+ var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ruleObj, value) {
290
+ var enhancedRule;
291
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
292
+ while (1) switch (_context.prev = _context.next) {
293
+ case 0:
294
+ // 为validator提供form和当前字段上下文
295
+ enhancedRule = _objectSpread(_objectSpread({}, ruleObj), {}, {
296
+ form,
297
+ field: fullName,
298
+ getFieldValue: fieldName => {
299
+ // 支持相对路径获取同Group内字段值
300
+ var targetName = namePath ? [...namePath, fieldName] : fieldName;
301
+ return form.getFieldValue(targetName);
302
+ }
303
+ });
304
+ return _context.abrupt("return", originalValidator(enhancedRule, value));
305
+ case 2:
306
+ case "end":
307
+ return _context.stop();
308
+ }
309
+ }, _callee);
310
+ }));
311
+ function validator(_x, _x2) {
312
+ return _validator.apply(this, arguments);
313
+ }
314
+ return validator;
315
+ }()
316
+ });
317
+ }
318
+ return rule;
319
+ });
320
+
321
+ // 处理disabled状态
322
+ var lastDisabled = (_ref = (_ref2 = (_groupProps$formDisab = groupProps.formDisabled) !== null && _groupProps$formDisab !== void 0 ? _groupProps$formDisab : columnDisabled) !== null && _ref2 !== void 0 ? _ref2 : fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) !== null && _ref !== void 0 ? _ref : groupProps.disabled;
323
+
324
+ // 直接处理校验规则,避免在非Hook函数中使用useRules
325
+ var internalRule = {
326
+ rules: processedRules,
327
+ required,
328
+ label: label
329
+ };
330
+ return _objectSpread(_objectSpread({
331
+ name: fullName,
332
+ label,
333
+ dependencies: processedDependencies,
334
+ tooltip,
335
+ extra,
336
+ validateFirst,
337
+ disabled: lastDisabled
338
+ }, otherFormItemProps), internalRule);
339
+ };
340
+
341
+ /**
342
+ * 创建组件属性
343
+ */
344
+ exports.useFormItemProps = useFormItemProps;
345
+ var createComponentProps = (column, formItemProps) => {
346
+ var type = column.type,
347
+ _column$fieldProps2 = column.fieldProps,
348
+ fieldProps = _column$fieldProps2 === void 0 ? {} : _column$fieldProps2,
349
+ valueType = column.valueType,
350
+ switchValue = column.switchValue,
351
+ toISOString = column.toISOString,
352
+ toCSTString = column.toCSTString;
353
+
354
+ // 处理placeholder
355
+ var label = fieldProps.label,
356
+ placeholder = fieldProps.placeholder,
357
+ dataSource = fieldProps.dataSource;
358
+ var formLabel = formItemProps.label;
359
+ var _isSelect = (0, _utils2.isSelect)({
360
+ dataSource,
361
+ type
362
+ });
363
+ var placeholderHandle = () => {
364
+ var _label = (0, _lodash.isString)(label) ? label : '';
365
+ var _formLabel = (0, _lodash.isString)(formLabel) ? formLabel : '';
366
+ return placeholder || `${_isSelect ? `${_locale.default.ProForm.selectPlaceHolder}` : `${_locale.default.ProForm.inputPlaceholder}`}${_label || _formLabel || ''}`;
367
+ };
368
+
369
+ // 值类型转换
370
+ var transform = getValueTypeTrans({
371
+ type,
372
+ valueType,
373
+ switchValue,
374
+ toISOString,
375
+ toCSTString,
376
+ mode: fieldProps.mode
377
+ });
378
+
379
+ // 组件基本属性
380
+ var componentProps = _objectSpread(_objectSpread({
381
+ placeholder: placeholderHandle()
382
+ }, fieldProps), {}, {
383
+ disabled: formItemProps.disabled
384
+ });
385
+
386
+ // 时间范围placeholder特殊处理
387
+ if (type === 'RangePicker' && !(fieldProps !== null && fieldProps !== void 0 && fieldProps.placeholder)) {
388
+ delete componentProps.placeholder;
389
+ }
390
+
391
+ // Switch组件valuePropName处理
392
+ if (['Switch', 'SwitchCheckbox'].includes(type)) {
393
+ formItemProps.valuePropName = 'checked';
394
+ }
395
+
396
+ // 分离 transform 中的 normalize 和 getValueProps(这些应该应用到 Form.Item,而不是组件)
397
+ var _ref3 = transform || {},
398
+ normalize = _ref3.normalize,
399
+ getValueProps = _ref3.getValueProps,
400
+ restTransform = _objectWithoutProperties(_ref3, _excluded2);
401
+
402
+ // formItemTransform 只包含应该应用到 Form.Item 的属性
403
+ var formItemTransform = _objectSpread(_objectSpread({}, normalize && {
404
+ normalize
405
+ }), getValueProps && {
406
+ getValueProps
407
+ });
408
+
409
+ // 过滤掉不应该传递给组件的属性(这些属性只用于转换,不应该出现在 DOM 上)
410
+ var filteredComponentProps = (0, _lodash.omit)(_objectSpread(_objectSpread({}, componentProps), restTransform), ['valueType', 'switchValue', 'toISOString', 'toCSTString', 'format', 'precision', 'clearNotShow', 'dependNames']);
411
+ return {
412
+ componentProps: filteredComponentProps,
413
+ formItemTransform
414
+ };
415
+ };
416
+
417
+ /**
418
+ * 配置验证组件
419
+ */
420
+ exports.createComponentProps = createComponentProps;
421
+ var validateChildren = children => {
422
+ // 确保children是数组
423
+ if (!Array.isArray(children) || children.length === 0) {
424
+ console.warn('[ProForm Group] 灵活模式下children必须是数组且不能为空');
425
+ return false;
426
+ }
427
+ var invalidChildren = children.filter(child => {
428
+ return child.names || !child.name || child.type === 'Group';
429
+ });
430
+ if (invalidChildren.length > 0) {
431
+ console.warn('[ProForm Group] 灵活模式下所有子组件都必须配置name属性。且type不能为Group', '缺少name的组件索引:', invalidChildren.map((_, index) => children.findIndex(child => child === invalidChildren[index])), '\n示例配置:', '\n{\n type: "InputNumber",\n name: "min", // 必需\n rules: [...] // 可选\n}');
432
+ return false;
433
+ }
434
+
435
+ // 检查name重复
436
+ var names = children.map(child => child.name);
437
+ var duplicateNames = names.filter((name, index) => names.indexOf(name) !== index);
438
+ if (duplicateNames.length > 0) {
439
+ console.warn('[ProForm Group] 子组件中发现重复的name属性:', [...new Set(duplicateNames)]);
440
+ return false;
441
+ }
442
+ return true;
443
+ };
444
+ exports.validateChildren = validateChildren;
@@ -1,13 +1,9 @@
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
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
7
  var _react = require("react");
12
8
  var _antd = require("antd");
13
9
  var _lodash = require("lodash");
@@ -21,13 +17,27 @@ var _ = _interopRequireDefault(require("../../.."));
21
17
  var _Container = _interopRequireDefault(require("../../Container"));
22
18
  var _jsxRuntime = require("react/jsx-runtime");
23
19
  var _excluded = ["className", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator", "detailPlaceholder", "scrollFollowParent", "desensitization", "otherProps"];
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
22
+ 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."); }
23
+ 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); }
24
+ 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; }
25
+ 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; } }
26
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
+ 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; }
28
+ 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; }
29
+ 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; }
30
+ 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; }
31
+ 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; }
32
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
33
+ 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); }
24
34
  var defaultFieldNames = {
25
35
  label: 'name',
26
36
  value: 'code',
27
37
  children: 'children'
28
38
  };
29
39
  var filterDataSource = (dataSource, level, fieldNames) => {
30
- return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(item => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
40
+ return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(item => _objectSpread(_objectSpread({}, item), {}, {
31
41
  [(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children']: level === 1 ? [] : filterDataSource(item === null || item === void 0 ? void 0 : item[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], level - 1, fieldNames)
32
42
  }));
33
43
  };
@@ -85,7 +95,7 @@ var ProCascader = props => {
85
95
  scrollFollowParent = props.scrollFollowParent,
86
96
  desensitization = props.desensitization,
87
97
  otherProps = props.otherProps,
88
- restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
98
+ restProps = _objectWithoutProperties(props, _excluded);
89
99
  var _ref3 = _.default.useFieldProps() || {},
90
100
  isViewCon = _ref3.isView,
91
101
  viewEmpty = _ref3.viewEmpty;
@@ -115,11 +125,11 @@ var ProCascader = props => {
115
125
  return disabled;
116
126
  }, [disabled]);
117
127
  var _useState = (0, _react.useState)([]),
118
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
128
+ _useState2 = _slicedToArray(_useState, 2),
119
129
  serviceData = _useState2[0],
120
130
  setServiceData = _useState2[1];
121
131
  var _useState3 = (0, _react.useState)([]),
122
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
132
+ _useState4 = _slicedToArray(_useState3, 2),
123
133
  defaultLabel = _useState4[0],
124
134
  setDefaultLabel = _useState4[1];
125
135
 
@@ -165,7 +175,7 @@ var ProCascader = props => {
165
175
  }, [transformResponse]);
166
176
 
167
177
  // 使用ahooks的useRequest
168
- var fetchFunction = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
178
+ var fetchFunction = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread(_objectSpread({
169
179
  manual: true,
170
180
  debounceWait: 300
171
181
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
@@ -314,7 +324,7 @@ var ProCascader = props => {
314
324
  children: viewValue
315
325
  }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
316
326
  className: `pro-address ${className}`,
317
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Cascader, (0, _objectSpread2.default)({
327
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Cascader, _objectSpread({
318
328
  className: hasDetail ? '' : 'no-detail',
319
329
  placeholder: _locale.default === null || _locale.default === void 0 || (_locale$ProAddressBar = _locale.default.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
320
330
  value: addressValue,
@@ -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.transformDataName = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
7
  var _lodash = require("lodash");
11
8
  var _excluded = ["label", "value", "children"];
9
+ 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; }
10
+ 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; }
11
+ 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; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
13
+ 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); }
14
+ 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; }
15
+ 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; }
12
16
  var transformDataName = (dataSource, fieldNames) => {
13
17
  var label = fieldNames.label,
14
18
  value = fieldNames.value,
15
19
  children = fieldNames.children,
16
- extraFields = (0, _objectWithoutProperties2.default)(fieldNames, _excluded);
20
+ extraFields = _objectWithoutProperties(fieldNames, _excluded);
17
21
  if (!(dataSource !== null && dataSource !== void 0 && dataSource.length) || 'label' in dataSource[0] && 'value' in dataSource[0] && 'children' in dataSource[0]) {
18
22
  return dataSource;
19
23
  }
@@ -29,7 +33,7 @@ var transformDataName = (dataSource, fieldNames) => {
29
33
  if (children && Array.isArray(node[children])) {
30
34
  newNode.children = node[children].map(transformNode);
31
35
  }
32
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, newNode), (0, _lodash.omit)(node, Object.values(fieldNames)));
36
+ return _objectSpread(_objectSpread({}, newNode), (0, _lodash.omit)(node, Object.values(fieldNames)));
33
37
  }
34
38
  var transformData = data => {
35
39
  return data.map(transformNode);