@zat-design/sisyphus-react 3.13.19-beta.1 → 3.13.19-beta.11

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 (422) hide show
  1. package/dist/index.esm.css +1 -6344
  2. package/dist/index.min.js +1 -0
  3. package/dist/less.esm.css +1 -5768
  4. package/dist/less.min.js +1 -0
  5. package/es/FormsProvider/index.js +9 -7
  6. package/es/ProAction/components/CheckModalContent/index.js +14 -14
  7. package/es/ProAction/index.js +46 -47
  8. package/es/ProConfigProvider/index.js +26 -20
  9. package/es/ProDownload/index.js +66 -73
  10. package/es/ProDownload/utils.js +26 -23
  11. package/es/ProDrawerForm/components/ProDrawer/index.js +43 -39
  12. package/es/ProDrawerForm/components/ProModal/index.js +25 -23
  13. package/es/ProDrawerForm/components/index.js +2 -2
  14. package/es/ProDrawerForm/index.js +19 -21
  15. package/es/ProDrawerForm/utils/index.js +1 -1
  16. package/es/ProEditLabel/components/RenderProForm.js +30 -26
  17. package/es/ProEditLabel/index.js +49 -36
  18. package/es/ProEditLabel/utils/index.js +4 -3
  19. package/es/ProEditTable/components/ActionButton/index.js +83 -76
  20. package/es/ProEditTable/components/RcTable/BaseTable.js +24 -24
  21. package/es/ProEditTable/components/RcTable/DraggableTable.js +34 -41
  22. package/es/ProEditTable/components/RcTable/VirtualTable.js +4 -3
  23. package/es/ProEditTable/components/RcTable/index.js +3 -3
  24. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +61 -57
  25. package/es/ProEditTable/components/RenderField/index.js +151 -145
  26. package/es/ProEditTable/components/RenderToolbar/index.js +37 -42
  27. package/es/ProEditTable/components/Summary/index.js +22 -21
  28. package/es/ProEditTable/components/Validator/index.js +11 -10
  29. package/es/ProEditTable/components/index.js +5 -5
  30. package/es/ProEditTable/index.d.ts +1 -1
  31. package/es/ProEditTable/index.js +170 -173
  32. package/es/ProEditTable/utils/config.js +42 -46
  33. package/es/ProEditTable/utils/diffOriginal.js +34 -19
  34. package/es/ProEditTable/utils/getDefaultProps.js +12 -13
  35. package/es/ProEditTable/utils/index.js +102 -99
  36. package/es/ProEditTable/utils/tools.js +88 -91
  37. package/es/ProEditTable/utils/transform.js +7 -11
  38. package/es/ProEditTable/utils/useEditTableError.js +22 -13
  39. package/es/ProEnum/components/Group.js +23 -27
  40. package/es/ProEnum/components/Tag.js +14 -16
  41. package/es/ProEnum/hooks/useEnum.js +32 -14
  42. package/es/ProEnum/hooks/useEnumRequest.js +42 -42
  43. package/es/ProEnum/hooks/useFrequentEnumRequest.js +17 -19
  44. package/es/ProEnum/index.js +80 -89
  45. package/es/ProEnum/utils/eventCenter.js +23 -32
  46. package/es/ProEnum/utils/frequentEnum.js +16 -4
  47. package/es/ProEnum/utils/getEnumLabel.js +16 -21
  48. package/es/ProEnum/utils/index.js +12 -7
  49. package/es/ProForm/components/Container.js +8 -6
  50. package/es/ProForm/components/FormFooter/index.js +21 -19
  51. package/es/ProForm/components/base/Checkbox/index.js +16 -15
  52. package/es/ProForm/components/base/DatePicker/index.js +23 -20
  53. package/es/ProForm/components/base/Input/index.js +20 -18
  54. package/es/ProForm/components/base/InputNumber/index.js +57 -53
  55. package/es/ProForm/components/base/Radio/index.js +15 -15
  56. package/es/ProForm/components/base/RangePicker/index.js +24 -29
  57. package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
  58. package/es/ProForm/components/base/Select/index.js +17 -15
  59. package/es/ProForm/components/base/Switch/index.js +16 -15
  60. package/es/ProForm/components/base/SwitchCheckbox/index.js +19 -18
  61. package/es/ProForm/components/base/TextArea/index.js +18 -17
  62. package/es/ProForm/components/base/TimePicker/index.js +10 -9
  63. package/es/ProForm/components/combination/Container/index.js +25 -23
  64. package/es/ProForm/components/combination/FormList/components/ActionButton.js +80 -92
  65. package/es/ProForm/components/combination/FormList/components/BlockFields.js +21 -19
  66. package/es/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
  67. package/es/ProForm/components/combination/FormList/components/Empty.js +21 -20
  68. package/es/ProForm/components/combination/FormList/components/LineFields.js +19 -18
  69. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +45 -51
  70. package/es/ProForm/components/combination/FormList/index.js +43 -51
  71. package/es/ProForm/components/combination/FormList/utils.js +9 -9
  72. package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +8 -6
  73. package/es/ProForm/components/combination/Group/component/ComRender.js +33 -29
  74. package/es/ProForm/components/combination/Group/hooks/index.js +49 -47
  75. package/es/ProForm/components/combination/Group/index.js +38 -37
  76. package/es/ProForm/components/combination/Group/utils.js +56 -50
  77. package/es/ProForm/components/combination/ProCascader/index.js +81 -85
  78. package/es/ProForm/components/combination/ProCascader/utils/index.js +6 -6
  79. package/es/ProForm/components/combination/ProCombination/index.js +41 -37
  80. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +31 -25
  81. package/es/ProForm/components/combination/ProModalSelect/index.js +166 -173
  82. package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
  83. package/es/ProForm/components/combination/ProNumberRange/index.js +46 -51
  84. package/es/ProForm/components/combination/ProRangeLimit/index.js +39 -39
  85. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
  86. package/es/ProForm/components/combination/ProTimeLimit/index.js +43 -40
  87. package/es/ProForm/components/index.d.ts +1 -0
  88. package/es/ProForm/components/index.js +40 -35
  89. package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +30 -28
  90. package/es/ProForm/components/old/EnumSelect/index.js +55 -62
  91. package/es/ProForm/components/old/InputRange/index.js +17 -16
  92. package/es/ProForm/components/old/InputWithSuffix/index.js +6 -5
  93. package/es/ProForm/components/old/ProAddress/index.js +53 -75
  94. package/es/ProForm/components/old/ProCertNo/index.js +17 -17
  95. package/es/ProForm/components/old/ProCertValidity/index.js +19 -21
  96. package/es/ProForm/components/old/ProRangeBox/index.js +25 -24
  97. package/es/ProForm/components/render/ChangedWrapper.js +34 -33
  98. package/es/ProForm/components/render/ConfirmWrapper.js +16 -18
  99. package/es/ProForm/components/render/Render.js +150 -135
  100. package/es/ProForm/components/render/RenderFields.js +65 -50
  101. package/es/ProForm/components/render/propsType.js +25 -0
  102. package/es/ProForm/index.js +83 -70
  103. package/es/ProForm/propsType.d.ts +1 -1
  104. package/es/ProForm/propsType.js +5 -1
  105. package/es/ProForm/utils/diffOriginal.js +30 -16
  106. package/es/ProForm/utils/getDefaultProps.js +10 -10
  107. package/es/ProForm/utils/index.js +105 -110
  108. package/es/ProForm/utils/processDependencies.js +15 -5
  109. package/es/ProForm/utils/rulesCreator.js +21 -22
  110. package/es/ProForm/utils/transformNames.js +7 -6
  111. package/es/ProForm/utils/transformValue.js +16 -13
  112. package/es/ProForm/utils/useDeepCompareMemo.js +6 -4
  113. package/es/ProForm/utils/useFieldProps.js +1 -3
  114. package/es/ProForm/utils/useForm.js +36 -34
  115. package/es/ProForm/utils/useRules.js +28 -31
  116. package/es/ProForm/utils/useShouldUpdate.js +83 -86
  117. package/es/ProForm/utils/useWatch.js +36 -14
  118. package/es/ProForm/utils/valueType.js +51 -52
  119. package/es/ProIcon/config/index.js +2 -0
  120. package/es/ProIcon/index.js +53 -49
  121. package/es/ProIcon/utils/index.js +8 -9
  122. package/es/ProLayout/components/Layout/Header/index.js +13 -11
  123. package/es/ProLayout/components/Layout/Icon/Icon.js +7 -7
  124. package/es/ProLayout/components/Layout/Icon/index.js +1 -1
  125. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +42 -40
  126. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +51 -52
  127. package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +10 -9
  128. package/es/ProLayout/components/Layout/Menu/index.js +20 -18
  129. package/es/ProLayout/components/Layout/Notice/index.js +12 -11
  130. package/es/ProLayout/components/Layout/index.js +4 -4
  131. package/es/ProLayout/components/ProCollapse/index.js +35 -32
  132. package/es/ProLayout/components/ProFooter/index.js +13 -15
  133. package/es/ProLayout/components/ProHeader/components/Copy/index.js +9 -9
  134. package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +8 -7
  135. package/es/ProLayout/components/ProHeader/components/index.js +2 -2
  136. package/es/ProLayout/components/ProHeader/index.js +129 -118
  137. package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
  138. package/es/ProLayout/components/index.js +3 -3
  139. package/es/ProLayout/index.d.ts +1 -1
  140. package/es/ProLayout/index.js +28 -25
  141. package/es/ProLayout/utils/index.js +37 -35
  142. package/es/ProSelect/components/AdaptiveTooltip.js +10 -11
  143. package/es/ProSelect/index.js +87 -99
  144. package/es/ProSelect/utils/index.js +27 -33
  145. package/es/ProStep/components/Anchor/index.d.ts +1 -0
  146. package/es/ProStep/components/Anchor/index.js +26 -25
  147. package/es/ProStep/components/Item/index.d.ts +1 -0
  148. package/es/ProStep/components/Item/index.js +26 -22
  149. package/es/ProStep/components/Listener/index.js +11 -15
  150. package/es/ProStep/components/Step/index.js +24 -25
  151. package/es/ProStep/index.js +51 -53
  152. package/es/ProStep/utils/index.js +13 -12
  153. package/es/ProStepTab/index.js +59 -37
  154. package/es/ProTable/components/FormatColumn/index.js +106 -110
  155. package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -9
  156. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -50
  157. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +24 -24
  158. package/es/ProTable/components/RcTable/components/DraggableTable/index.js +8 -10
  159. package/es/ProTable/components/RcTable/index.js +2 -2
  160. package/es/ProTable/components/RenderColumn/index.js +51 -51
  161. package/es/ProTable/components/RenderEmptyText/index.js +8 -7
  162. package/es/ProTable/components/RenderFooter/index.js +3 -3
  163. package/es/ProTable/components/RenderSummary/index.js +13 -13
  164. package/es/ProTable/components/RenderTableHeader/index.js +16 -14
  165. package/es/ProTable/components/RenderTabs/index.js +28 -33
  166. package/es/ProTable/components/TableResizable/index.js +17 -16
  167. package/es/ProTable/components/TooltipTitle/index.js +7 -6
  168. package/es/ProTable/components/index.js +11 -6
  169. package/es/ProTable/hooks/useAntdTable.js +106 -119
  170. package/es/ProTable/index.js +158 -176
  171. package/es/ProTable/utils/index.js +25 -21
  172. package/es/ProTabs/components/Card/index.js +15 -14
  173. package/es/ProTabs/components/index.js +1 -1
  174. package/es/ProTabs/index.js +24 -25
  175. package/es/ProThemeTools/component/ProTools/index.js +69 -68
  176. package/es/ProThemeTools/component/index.js +1 -1
  177. package/es/ProThemeTools/index.js +47 -33
  178. package/es/ProThemeTools/utils/index.js +20 -17
  179. package/es/ProTooltip/index.js +44 -46
  180. package/es/ProTree/components/AdaptiveTooltip.js +5 -7
  181. package/es/ProTree/components/CloseIcon.js +5 -5
  182. package/es/ProTree/components/List.js +22 -24
  183. package/es/ProTree/components/ProTree.js +84 -102
  184. package/es/ProTree/components/ProTreeSelect/index.js +128 -119
  185. package/es/ProTree/components/SearchTitle.js +10 -9
  186. package/es/ProTree/components/Tree.js +57 -58
  187. package/es/ProTree/components/index.js +4 -4
  188. package/es/ProTree/index.js +6 -6
  189. package/es/ProTree/utils.js +29 -22
  190. package/es/ProTreeModal/components/Cascader.js +31 -33
  191. package/es/ProTreeModal/components/CloseIcon.js +5 -5
  192. package/es/ProTreeModal/components/List.js +74 -93
  193. package/es/ProTreeModal/components/SearchTitle.js +5 -4
  194. package/es/ProTreeModal/components/SortableItem.js +14 -14
  195. package/es/ProTreeModal/components/Tree.js +49 -53
  196. package/es/ProTreeModal/components/Trigger.js +29 -28
  197. package/es/ProTreeModal/components/index.js +6 -6
  198. package/es/ProTreeModal/index.js +166 -206
  199. package/es/ProTreeModal/utils.js +37 -33
  200. package/es/ProUpload/components/ButtonRender.js +33 -36
  201. package/es/ProUpload/components/DragRender.js +54 -51
  202. package/es/ProUpload/components/DraggableUploadListItem.js +5 -4
  203. package/es/ProUpload/components/Example.js +13 -12
  204. package/es/ProUpload/components/FileItem.js +63 -58
  205. package/es/ProUpload/components/ImageRender.js +98 -100
  206. package/es/ProUpload/index.js +75 -82
  207. package/es/ProUpload/uitls.js +3 -3
  208. package/es/ProUtils/utils/index.js +10 -14
  209. package/es/ProViewer/index.js +29 -25
  210. package/es/ProViewer/propsType.js +0 -1
  211. package/es/ProWaterMark/index.js +5 -4
  212. package/es/index.d.ts +1 -1
  213. package/es/index.js +38 -29
  214. package/es/locale/index.js +7 -4
  215. package/es/old/ProCertValidity/index.js +19 -21
  216. package/es/old/ProEditableTable/index.js +156 -156
  217. package/es/old/ProEditableTable/utils.js +61 -63
  218. package/es/tokens.js +1 -0
  219. package/es/utils/index.js +12 -12
  220. package/lib/FormsProvider/index.js +11 -7
  221. package/lib/ProAction/components/CheckModalContent/index.js +11 -13
  222. package/lib/ProAction/index.js +40 -43
  223. package/lib/ProConfigProvider/index.js +24 -17
  224. package/lib/ProDownload/index.js +65 -71
  225. package/lib/ProDownload/utils.js +25 -22
  226. package/lib/ProDrawerForm/components/ProDrawer/index.js +39 -38
  227. package/lib/ProDrawerForm/components/ProModal/index.js +23 -22
  228. package/lib/ProDrawerForm/index.js +18 -18
  229. package/lib/ProDrawerForm/utils/index.js +3 -2
  230. package/lib/ProEditLabel/components/RenderProForm.js +26 -24
  231. package/lib/ProEditLabel/index.js +46 -35
  232. package/lib/ProEditLabel/utils/index.js +6 -5
  233. package/lib/ProEditTable/components/ActionButton/index.js +79 -74
  234. package/lib/ProEditTable/components/RcTable/BaseTable.js +21 -23
  235. package/lib/ProEditTable/components/RcTable/DraggableTable.js +32 -40
  236. package/lib/ProEditTable/components/RcTable/VirtualTable.js +3 -3
  237. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +62 -59
  238. package/lib/ProEditTable/components/RenderField/index.js +137 -132
  239. package/lib/ProEditTable/components/RenderToolbar/index.js +34 -41
  240. package/lib/ProEditTable/components/Summary/index.js +20 -20
  241. package/lib/ProEditTable/components/Validator/index.js +10 -10
  242. package/lib/ProEditTable/index.d.ts +1 -1
  243. package/lib/ProEditTable/index.js +159 -164
  244. package/lib/ProEditTable/utils/config.js +40 -44
  245. package/lib/ProEditTable/utils/diffOriginal.js +36 -21
  246. package/lib/ProEditTable/utils/getDefaultProps.js +14 -15
  247. package/lib/ProEditTable/utils/index.js +97 -97
  248. package/lib/ProEditTable/utils/tools.js +96 -91
  249. package/lib/ProEditTable/utils/transform.js +7 -11
  250. package/lib/ProEditTable/utils/useEditTableError.js +22 -13
  251. package/lib/ProEnum/components/Group.js +23 -27
  252. package/lib/ProEnum/components/Tag.js +14 -16
  253. package/lib/ProEnum/hooks/useEnum.js +30 -12
  254. package/lib/ProEnum/hooks/useEnumRequest.js +39 -39
  255. package/lib/ProEnum/hooks/useFrequentEnumRequest.js +16 -18
  256. package/lib/ProEnum/index.js +68 -78
  257. package/lib/ProEnum/utils/eventCenter.js +23 -32
  258. package/lib/ProEnum/utils/frequentEnum.js +14 -3
  259. package/lib/ProEnum/utils/getEnumLabel.js +15 -21
  260. package/lib/ProEnum/utils/index.js +12 -7
  261. package/lib/ProForm/components/Container.js +7 -5
  262. package/lib/ProForm/components/FormFooter/index.js +19 -17
  263. package/lib/ProForm/components/base/Checkbox/index.js +14 -13
  264. package/lib/ProForm/components/base/DatePicker/index.js +20 -17
  265. package/lib/ProForm/components/base/Input/index.js +15 -15
  266. package/lib/ProForm/components/base/InputNumber/index.js +51 -48
  267. package/lib/ProForm/components/base/Radio/index.js +13 -13
  268. package/lib/ProForm/components/base/RangePicker/index.js +19 -22
  269. package/lib/ProForm/components/base/RangePicker/useDateRange.js +5 -4
  270. package/lib/ProForm/components/base/Select/index.js +14 -12
  271. package/lib/ProForm/components/base/Switch/index.js +11 -11
  272. package/lib/ProForm/components/base/SwitchCheckbox/index.js +16 -15
  273. package/lib/ProForm/components/base/TextArea/index.js +14 -13
  274. package/lib/ProForm/components/base/TimePicker/index.js +6 -5
  275. package/lib/ProForm/components/combination/Container/index.js +22 -21
  276. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +77 -89
  277. package/lib/ProForm/components/combination/FormList/components/BlockFields.js +17 -15
  278. package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
  279. package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -18
  280. package/lib/ProForm/components/combination/FormList/components/LineFields.js +14 -14
  281. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +43 -48
  282. package/lib/ProForm/components/combination/FormList/index.js +35 -43
  283. package/lib/ProForm/components/combination/FormList/utils.js +11 -10
  284. package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
  285. package/lib/ProForm/components/combination/Group/component/ComRender.js +30 -28
  286. package/lib/ProForm/components/combination/Group/hooks/index.js +48 -45
  287. package/lib/ProForm/components/combination/Group/index.js +34 -35
  288. package/lib/ProForm/components/combination/Group/utils.js +62 -50
  289. package/lib/ProForm/components/combination/ProCascader/index.js +75 -80
  290. package/lib/ProForm/components/combination/ProCascader/utils/index.js +8 -7
  291. package/lib/ProForm/components/combination/ProCombination/index.js +35 -31
  292. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +30 -24
  293. package/lib/ProForm/components/combination/ProModalSelect/index.js +171 -180
  294. package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +3 -2
  295. package/lib/ProForm/components/combination/ProNumberRange/index.js +42 -48
  296. package/lib/ProForm/components/combination/ProRangeLimit/index.js +35 -35
  297. package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
  298. package/lib/ProForm/components/combination/ProTimeLimit/index.js +37 -34
  299. package/lib/ProForm/components/index.d.ts +1 -0
  300. package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +35 -33
  301. package/lib/ProForm/components/old/EnumSelect/index.js +50 -58
  302. package/lib/ProForm/components/old/InputRange/index.js +16 -16
  303. package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -4
  304. package/lib/ProForm/components/old/ProAddress/index.js +53 -75
  305. package/lib/ProForm/components/old/ProCertNo/index.js +16 -17
  306. package/lib/ProForm/components/old/ProCertValidity/index.js +17 -18
  307. package/lib/ProForm/components/old/ProRangeBox/index.js +24 -24
  308. package/lib/ProForm/components/render/ChangedWrapper.js +35 -35
  309. package/lib/ProForm/components/render/ConfirmWrapper.js +14 -17
  310. package/lib/ProForm/components/render/Render.js +138 -125
  311. package/lib/ProForm/components/render/RenderFields.js +57 -43
  312. package/lib/ProForm/components/render/propsType.js +26 -1
  313. package/lib/ProForm/index.js +74 -61
  314. package/lib/ProForm/propsType.d.ts +1 -1
  315. package/lib/ProForm/propsType.js +5 -1
  316. package/lib/ProForm/utils/diffOriginal.js +30 -17
  317. package/lib/ProForm/utils/getDefaultProps.js +12 -12
  318. package/lib/ProForm/utils/index.js +127 -106
  319. package/lib/ProForm/utils/processDependencies.js +15 -6
  320. package/lib/ProForm/utils/rulesCreator.js +21 -21
  321. package/lib/ProForm/utils/transformNames.js +6 -6
  322. package/lib/ProForm/utils/transformValue.js +14 -11
  323. package/lib/ProForm/utils/useDeepCompareMemo.js +7 -6
  324. package/lib/ProForm/utils/useFieldProps.js +2 -3
  325. package/lib/ProForm/utils/useForm.js +33 -31
  326. package/lib/ProForm/utils/useRules.js +25 -28
  327. package/lib/ProForm/utils/useShouldUpdate.js +82 -85
  328. package/lib/ProForm/utils/useWatch.js +36 -14
  329. package/lib/ProForm/utils/valueType.js +52 -52
  330. package/lib/ProIcon/config/index.js +2 -0
  331. package/lib/ProIcon/index.js +47 -44
  332. package/lib/ProIcon/utils/index.js +10 -8
  333. package/lib/ProLayout/components/Layout/Header/index.js +10 -10
  334. package/lib/ProLayout/components/Layout/Icon/Icon.js +8 -7
  335. package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +37 -36
  336. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +49 -52
  337. package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +8 -8
  338. package/lib/ProLayout/components/Layout/Menu/index.js +17 -16
  339. package/lib/ProLayout/components/Layout/Notice/index.js +8 -8
  340. package/lib/ProLayout/components/ProCollapse/index.js +32 -30
  341. package/lib/ProLayout/components/ProFooter/index.js +14 -16
  342. package/lib/ProLayout/components/ProHeader/components/Copy/index.js +7 -7
  343. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -7
  344. package/lib/ProLayout/components/ProHeader/index.js +131 -120
  345. package/lib/ProLayout/components/ProHeader/utils/index.js +3 -2
  346. package/lib/ProLayout/index.d.ts +1 -1
  347. package/lib/ProLayout/index.js +22 -21
  348. package/lib/ProLayout/utils/index.js +42 -33
  349. package/lib/ProSelect/components/AdaptiveTooltip.js +9 -11
  350. package/lib/ProSelect/index.js +82 -93
  351. package/lib/ProSelect/utils/index.js +29 -34
  352. package/lib/ProStep/components/Anchor/index.d.ts +1 -0
  353. package/lib/ProStep/components/Anchor/index.js +25 -24
  354. package/lib/ProStep/components/Item/index.d.ts +1 -0
  355. package/lib/ProStep/components/Item/index.js +24 -20
  356. package/lib/ProStep/components/Listener/index.js +9 -13
  357. package/lib/ProStep/components/Step/index.js +20 -21
  358. package/lib/ProStep/index.js +45 -49
  359. package/lib/ProStep/utils/index.js +16 -12
  360. package/lib/ProStepTab/index.js +60 -38
  361. package/lib/ProTable/components/FormatColumn/index.js +100 -104
  362. package/lib/ProTable/components/RcTable/components/BaseTable/index.js +5 -7
  363. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +34 -48
  364. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +25 -23
  365. package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +5 -7
  366. package/lib/ProTable/components/RenderColumn/index.js +46 -48
  367. package/lib/ProTable/components/RenderEmptyText/index.js +6 -6
  368. package/lib/ProTable/components/RenderFooter/index.js +3 -3
  369. package/lib/ProTable/components/RenderSummary/index.js +11 -12
  370. package/lib/ProTable/components/RenderTableHeader/index.js +14 -13
  371. package/lib/ProTable/components/RenderTabs/index.js +27 -32
  372. package/lib/ProTable/components/TableResizable/index.js +16 -15
  373. package/lib/ProTable/components/TooltipTitle/index.js +5 -5
  374. package/lib/ProTable/hooks/useAntdTable.js +103 -116
  375. package/lib/ProTable/index.js +149 -169
  376. package/lib/ProTable/utils/index.js +33 -22
  377. package/lib/ProTabs/components/Card/index.js +14 -14
  378. package/lib/ProTabs/index.js +24 -24
  379. package/lib/ProThemeTools/component/ProTools/index.js +66 -65
  380. package/lib/ProThemeTools/index.js +43 -29
  381. package/lib/ProThemeTools/utils/index.js +25 -18
  382. package/lib/ProTooltip/index.js +44 -46
  383. package/lib/ProTree/components/AdaptiveTooltip.js +5 -7
  384. package/lib/ProTree/components/CloseIcon.js +5 -5
  385. package/lib/ProTree/components/List.js +18 -22
  386. package/lib/ProTree/components/ProTree.js +77 -96
  387. package/lib/ProTree/components/ProTreeSelect/index.js +126 -116
  388. package/lib/ProTree/components/SearchTitle.js +8 -8
  389. package/lib/ProTree/components/Tree.js +53 -55
  390. package/lib/ProTree/index.js +4 -4
  391. package/lib/ProTree/utils.js +34 -25
  392. package/lib/ProTreeModal/components/Cascader.js +28 -32
  393. package/lib/ProTreeModal/components/CloseIcon.js +5 -5
  394. package/lib/ProTreeModal/components/List.js +69 -89
  395. package/lib/ProTreeModal/components/SearchTitle.js +4 -4
  396. package/lib/ProTreeModal/components/SortableItem.js +11 -12
  397. package/lib/ProTreeModal/components/Tree.js +44 -49
  398. package/lib/ProTreeModal/components/Trigger.js +26 -26
  399. package/lib/ProTreeModal/index.js +157 -199
  400. package/lib/ProTreeModal/utils.js +43 -35
  401. package/lib/ProUpload/components/ButtonRender.js +29 -33
  402. package/lib/ProUpload/components/DragRender.js +50 -48
  403. package/lib/ProUpload/components/DraggableUploadListItem.js +7 -5
  404. package/lib/ProUpload/components/Example.js +13 -11
  405. package/lib/ProUpload/components/FileItem.js +58 -50
  406. package/lib/ProUpload/components/ImageRender.js +89 -93
  407. package/lib/ProUpload/index.js +68 -76
  408. package/lib/ProUpload/uitls.js +5 -3
  409. package/lib/ProUtils/utils/index.js +10 -14
  410. package/lib/ProViewer/index.js +26 -24
  411. package/lib/ProViewer/propsType.js +1 -5
  412. package/lib/ProWaterMark/index.js +5 -4
  413. package/lib/index.d.ts +1 -1
  414. package/lib/locale/index.js +6 -2
  415. package/lib/old/ProCertValidity/index.js +17 -18
  416. package/lib/old/ProEditableTable/index.js +153 -156
  417. package/lib/old/ProEditableTable/utils.js +61 -62
  418. package/lib/tokens.js +1 -0
  419. package/lib/utils/index.js +16 -13
  420. package/package.json +8 -8
  421. package/dist/index.esm.js +0 -3
  422. package/dist/less.esm.js +0 -3
@@ -1,43 +1,36 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
- import _get from "lodash/get";
6
- import _isBoolean from "lodash/isBoolean";
7
- import _isFunction from "lodash/isFunction";
8
- import _transform from "lodash/transform";
9
- import _isEqual from "lodash/isEqual";
10
- import _isObject from "lodash/isObject";
11
- import _isString from "lodash/isString";
12
- import _cloneDeepWith from "lodash/cloneDeepWith";
13
- import _cloneDeep from "lodash/cloneDeep";
14
4
  /* eslint-disable no-await-in-loop */
15
5
  /* eslint-disable no-restricted-syntax */
16
6
  import React from 'react';
17
7
  import { tools, validate } from '@zat-design/utils';
8
+ import { cloneDeep, cloneDeepWith, isString, isObject, isEqual, transform, isFunction, isBoolean, get } from 'lodash';
18
9
  /**
19
10
  * 生成随机字符串
20
11
  * @returns 随机字符串
21
12
  */
22
- export var getRandom = function getRandom() {
13
+ export var getRandom = () => {
23
14
  return Math.random().toString(36).slice(-6);
24
15
  };
16
+
25
17
  /**
26
18
  * 深层次对比两个对象且取出来差异值
27
19
  * @param object 比较对象
28
20
  * @param base 基准对象
29
21
  * @returns 差异对象
30
22
  */
31
- export var difference = function difference(object, base) {
32
- var _changes = function changes(object, base) {
33
- return _transform(object, function (result, value, key) {
34
- if (!_isEqual(value, base === null || base === void 0 ? void 0 : base[key])) {
35
- result[key] = _isObject(value) && _isObject(base === null || base === void 0 ? void 0 : base[key]) ? _changes(value, base === null || base === void 0 ? void 0 : base[key]) : value;
23
+ export var difference = (object, base) => {
24
+ var changes = (object, base) => {
25
+ return transform(object, (result, value, key) => {
26
+ if (!isEqual(value, base === null || base === void 0 ? void 0 : base[key])) {
27
+ result[key] = isObject(value) && isObject(base === null || base === void 0 ? void 0 : base[key]) ? changes(value, base === null || base === void 0 ? void 0 : base[key]) : value;
36
28
  }
37
29
  });
38
30
  };
39
- return _changes(object, base);
31
+ return changes(object, base);
40
32
  };
33
+
41
34
  /**
42
35
  * 数组字段循环校验,解决validateFields无法批量校验的问题
43
36
  * @param validateKeys 校验键数组
@@ -45,74 +38,74 @@ export var difference = function difference(object, base) {
45
38
  * @param rowName 行名称路径
46
39
  * @returns 校验结果Promise
47
40
  */
48
- export var customValidate = function customValidate(validateKeys, form, rowName) {
41
+ export var customValidate = (validateKeys, form, rowName) => {
49
42
  var array = [];
50
- validateKeys.forEach(function (key) {
51
- array.push([].concat(_toConsumableArray(Array.isArray(rowName) ? rowName : [rowName]), [key]));
43
+ validateKeys.forEach(key => {
44
+ array.push([...(Array.isArray(rowName) ? rowName : [rowName]), key]);
52
45
  });
53
46
  return form.validateFields(array);
54
47
  };
48
+
55
49
  /**
56
50
  * 拆解数组names
57
51
  * @param names 名称数组
58
52
  * @returns 拆解后的字符串
59
53
  */
60
- export var splitNames = function splitNames(names) {
54
+ export var splitNames = names => {
61
55
  var result;
62
56
  var resultArray = [];
63
- if (_isString(names[0])) {
57
+ if (isString(names[0])) {
64
58
  result = names.join('-');
65
59
  return result;
66
60
  }
67
- names.forEach(function (item) {
68
- if (_isString(item[0])) {
69
- resultArray.push("".concat(item[0], "_").concat(item[1]));
61
+ names.forEach(item => {
62
+ if (isString(item[0])) {
63
+ resultArray.push(`${item[0]}_${item[1]}`);
70
64
  }
71
65
  });
72
66
  result = resultArray.join('-');
73
67
  return result;
74
68
  };
69
+
75
70
  /**
76
71
  * 获取中间formItem的name
77
72
  * @param name 名称路径
78
73
  * @param virtualKey 虚拟键
79
74
  * @returns 完整名称路径数组
80
75
  */
81
- export var getNamePath = function getNamePath(name, virtualKey) {
82
- var nextName = _cloneDeep(Array.isArray(name) ? name : [name]);
76
+ export var getNamePath = (name, virtualKey) => {
77
+ var nextName = cloneDeep(Array.isArray(name) ? name : [name]);
83
78
  var lastIndex = nextName.length - 1;
84
79
  // 确保最后一个元素是字符串类型
85
- nextName[lastIndex] = "".concat(nextName[lastIndex]).concat(virtualKey ? "-".concat(virtualKey) : '');
80
+ nextName[lastIndex] = `${nextName[lastIndex]}${virtualKey ? `-${virtualKey}` : ''}`;
86
81
  return nextName;
87
82
  };
83
+
88
84
  /**
89
85
  * 删除操作
90
86
  * @param params 删除参数
91
87
  */
92
- export var onDelete = function onDelete(_ref) {
88
+ export var onDelete = _ref => {
93
89
  var name = _ref.name,
94
90
  form = _ref.form,
95
91
  virtualKey = _ref.virtualKey,
96
92
  selectedRowKeys = _ref.selectedRowKeys;
97
93
  // 正常的form数据流处理
98
94
  var dataSource = form.getFieldValue(name);
99
- dataSource = dataSource.filter(function (row) {
100
- return !selectedRowKeys.includes(row.rowKey);
101
- });
95
+ dataSource = dataSource.filter(row => !selectedRowKeys.includes(row.rowKey));
102
96
  form.setFieldValue(name, dataSource);
103
97
  // 单行模式数据流处理 重置中间正在编辑状态单行数据
104
98
  if (virtualKey) {
105
99
  var _virtualList;
106
100
  var namePath = getNamePath(name, virtualKey);
107
101
  var virtualList = form.getFieldValue(namePath);
108
- if ((_virtualList = virtualList) === null || _virtualList === void 0 ? void 0 : _virtualList.length) {
109
- virtualList = virtualList.filter(function (row) {
110
- return !selectedRowKeys.includes(row.rowKey);
111
- });
102
+ if ((_virtualList = virtualList) !== null && _virtualList !== void 0 && _virtualList.length) {
103
+ virtualList = virtualList.filter(row => !selectedRowKeys.includes(row.rowKey));
112
104
  form.setFieldValue(namePath, virtualList);
113
105
  }
114
106
  }
115
107
  };
108
+
116
109
  /**
117
110
  * 获取最终的disabled, 两种模式【子级优先,全局优先】
118
111
  * 全局优先:globalControl为true时,全局控制
@@ -120,7 +113,7 @@ export var onDelete = function onDelete(_ref) {
120
113
  * @param params 禁用参数
121
114
  * @returns 是否禁用
122
115
  */
123
- export var getDisabled = function getDisabled(_ref2) {
116
+ export var getDisabled = _ref2 => {
124
117
  var _ref3, _column$disabled;
125
118
  var globalControl = _ref2.globalControl,
126
119
  formDisabled = _ref2.formDisabled,
@@ -129,7 +122,7 @@ export var getDisabled = function getDisabled(_ref2) {
129
122
  columnFieldProps = _ref2.columnFieldProps,
130
123
  params = _ref2.params,
131
124
  rowDisabled = _ref2.rowDisabled;
132
- var convertToBoolean = function convertToBoolean(value) {
125
+ var convertToBoolean = value => {
133
126
  if (Array.isArray(value)) {
134
127
  return Boolean(value.length);
135
128
  }
@@ -141,16 +134,17 @@ export var getDisabled = function getDisabled(_ref2) {
141
134
  }
142
135
  return Boolean(value);
143
136
  };
137
+
144
138
  // 判断是否有column的disabled属性
145
- var noColumnDisabled = function noColumnDisabled() {
146
- if (_isFunction(column === null || column === void 0 ? void 0 : column.disabled) || _isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || _isBoolean(column === null || column === void 0 ? void 0 : column.disabled) || _isBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
139
+ var noColumnDisabled = () => {
140
+ if (isFunction(column === null || column === void 0 ? void 0 : column.disabled) || isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || isBoolean(column === null || column === void 0 ? void 0 : column.disabled) || isBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
147
141
  return false;
148
142
  }
149
143
  // 判断FieldProps是否有disabled属性
150
- if (_isFunction(columnFieldProps)) {
151
- var _columnFieldProps = columnFieldProps.apply(void 0, _toConsumableArray(params)),
144
+ if (isFunction(columnFieldProps)) {
145
+ var _columnFieldProps = columnFieldProps(...params),
152
146
  disabled = _columnFieldProps.disabled;
153
- if (_isFunction(disabled) || _isBoolean(disabled)) {
147
+ if (isFunction(disabled) || isBoolean(disabled)) {
154
148
  return false;
155
149
  }
156
150
  }
@@ -162,6 +156,7 @@ export var getDisabled = function getDisabled(_ref2) {
162
156
  if (rowDisabled === 'empty') {
163
157
  return false;
164
158
  }
159
+
165
160
  // 日期范围选择器和数字范围选择器
166
161
  if (['RangePicker', 'ProNumberRange', 'Group'].includes(column.type)) {
167
162
  if (Array.isArray(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
@@ -170,38 +165,41 @@ export var getDisabled = function getDisabled(_ref2) {
170
165
  if (Array.isArray(column === null || column === void 0 ? void 0 : column.disabled)) {
171
166
  return column.disabled;
172
167
  }
173
- if (_isFunction(column === null || column === void 0 ? void 0 : column.disabled)) {
174
- return column === null || column === void 0 ? void 0 : column.disabled.apply(column, _toConsumableArray(params));
168
+ if (isFunction(column === null || column === void 0 ? void 0 : column.disabled)) {
169
+ return column === null || column === void 0 ? void 0 : column.disabled(...params);
175
170
  }
176
171
  }
172
+
177
173
  // 当表单含有diabled属性时,优先使用表单的disabled
178
- if (_isFunction(rowDisabled) && noColumnDisabled()) {
174
+ if (isFunction(rowDisabled) && noColumnDisabled()) {
179
175
  return rowDisabled(params[1]);
180
176
  }
181
- if (_isFunction(column === null || column === void 0 ? void 0 : column.disabled)) {
182
- return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled.apply(column, _toConsumableArray(params)));
177
+ if (isFunction(column === null || column === void 0 ? void 0 : column.disabled)) {
178
+ return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled(...params));
183
179
  }
180
+
184
181
  // 表单FieldProps为函数时
185
- if (_isFunction(columnFieldProps)) {
186
- var _columnFieldProps2 = columnFieldProps.apply(void 0, _toConsumableArray(params)),
182
+ if (isFunction(columnFieldProps)) {
183
+ var _columnFieldProps2 = columnFieldProps(...params),
187
184
  disabled = _columnFieldProps2.disabled;
188
- if (_isFunction(disabled)) {
189
- return convertToBoolean(disabled.apply(void 0, _toConsumableArray(params)));
185
+ if (isFunction(disabled)) {
186
+ return convertToBoolean(disabled(...params));
190
187
  }
191
- if (_isBoolean(disabled)) {
188
+ if (isBoolean(disabled)) {
192
189
  return convertToBoolean(disabled);
193
190
  }
194
191
  }
195
- if (_isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
196
- return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled.apply(columnFieldProps, _toConsumableArray(params)));
192
+ if (isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
193
+ return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled(...params));
197
194
  }
198
195
  return convertToBoolean((_ref3 = (_column$disabled = column === null || column === void 0 ? void 0 : column.disabled) !== null && _column$disabled !== void 0 ? _column$disabled : columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : tabledDisabled);
199
196
  };
197
+
200
198
  /**
201
199
  * 表格自动滚动到报错位置
202
200
  */
203
- export var handleScrollToError = function handleScrollToError() {
204
- setTimeout(function () {
201
+ export var handleScrollToError = () => {
202
+ setTimeout(() => {
205
203
  var errorDom = document.querySelector('[class*="form-item-has-error"]');
206
204
  if (errorDom) {
207
205
  var tableBody = errorDom.closest('[class*="table-content"]') || errorDom.closest('[class*="table-body"]');
@@ -214,27 +212,27 @@ export var handleScrollToError = function handleScrollToError() {
214
212
  var childOffsetTop = 0;
215
213
  while (previousSibling) {
216
214
  if (previousSibling.nodeType === 1) {
217
- var _previousSibling, _previousSibling$clas, _previousSibling$clas2, _previousSibling$clas3;
215
+ var _previousSibling, _previousSibling$cont, _previousSibling2;
218
216
  var _ref4 = previousSibling.getBoundingClientRect() || {},
219
217
  _ref4$width = _ref4.width,
220
218
  width = _ref4$width === void 0 ? 0 : _ref4$width;
221
219
  childOffsetLeft += width;
222
- if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 = (_previousSibling$clas3 = _previousSibling$clas).contains) === null || _previousSibling$clas2 === void 0 ? void 0 : _previousSibling$clas2.call(_previousSibling$clas3, 'ant-table-cell-fix-left')) {
220
+ if ((_previousSibling = previousSibling) !== null && _previousSibling !== void 0 && (_previousSibling = _previousSibling.classList) !== null && _previousSibling !== void 0 && (_previousSibling$cont = (_previousSibling2 = _previousSibling).contains) !== null && _previousSibling$cont !== void 0 && _previousSibling$cont.call(_previousSibling2, 'ant-table-cell-fix-left')) {
223
221
  childFixedLeft += width;
224
222
  }
225
223
  }
226
224
  previousSibling = previousSibling.previousElementSibling;
227
225
  }
228
226
  if (tableRow) {
229
- var _previousSibling2 = tableRow.previousElementSibling;
230
- while (_previousSibling2) {
231
- if (_previousSibling2.nodeType === 1) {
232
- var _ref5 = _previousSibling2.getBoundingClientRect() || {},
227
+ var _previousSibling3 = tableRow.previousElementSibling;
228
+ while (_previousSibling3) {
229
+ if (_previousSibling3.nodeType === 1) {
230
+ var _ref5 = _previousSibling3.getBoundingClientRect() || {},
233
231
  _ref5$height = _ref5.height,
234
232
  height = _ref5$height === void 0 ? 0 : _ref5$height;
235
233
  childOffsetTop += height;
236
234
  }
237
- _previousSibling2 = _previousSibling2.previousElementSibling;
235
+ _previousSibling3 = _previousSibling3.previousElementSibling;
238
236
  }
239
237
  }
240
238
  tableBody.scrollTo({
@@ -246,33 +244,33 @@ export var handleScrollToError = function handleScrollToError() {
246
244
  }
247
245
  }, 0);
248
246
  };
247
+
249
248
  /**
250
249
  * 深copy一个对象,并过滤掉其中的React节点
251
250
  * @param value 需要深拷贝的对象
252
251
  * @returns 深拷贝后的对象,其中的React节点会被保留
253
252
  */
254
253
  export function cloneDeepFilterNode(value) {
255
- return _cloneDeepWith(value, function (val) {
256
- if (/*#__PURE__*/React.isValidElement(val)) {
254
+ return cloneDeepWith(value, val => {
255
+ if ( /*#__PURE__*/React.isValidElement(val)) {
257
256
  return val;
258
257
  }
259
258
  });
260
259
  }
260
+
261
261
  /**
262
262
  * 判断值是否为空
263
263
  * @param value 需要判断的值
264
264
  * @returns 是否为空
265
265
  */
266
- var _isNull = function isNull(value) {
266
+ var isNull = value => {
267
267
  if (Array.isArray(value) && value.length) {
268
- return value.some(function (item) {
269
- return _isNull(item);
270
- });
268
+ return value.some(item => isNull(item));
271
269
  }
272
270
  return value === '' || value === undefined || value === null || Array.isArray(value) && value.length === 0;
273
271
  };
274
272
  var handleCheckCellValue = /*#__PURE__*/function () {
275
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(column, record) {
273
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(column, record) {
276
274
  var _column$names, _column$names2, _rules2;
277
275
  var value, _required, _rules, _labelRequired, res, _iterator, _step, rule;
278
276
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -280,38 +278,38 @@ var handleCheckCellValue = /*#__PURE__*/function () {
280
278
  case 0:
281
279
  value = null;
282
280
  if (column.name) {
283
- value = _get(record, column.name);
281
+ value = get(record, column.name);
284
282
  }
285
- if ((_column$names = column.names) === null || _column$names === void 0 ? void 0 : _column$names.length) {
286
- value = column.names.map(function (key) {
287
- return _get(record, key);
283
+ if ((_column$names = column.names) !== null && _column$names !== void 0 && _column$names.length) {
284
+ value = column.names.map(key => {
285
+ return get(record, key);
288
286
  });
289
287
  }
290
288
  _required = column.required;
291
289
  _rules = column.rules;
292
290
  _labelRequired = column.labelRequired;
293
- if (_isFunction(column.required)) {
291
+ if (isFunction(column.required)) {
294
292
  _required = column.required(value, record);
295
293
  }
296
- if (_isFunction(column.rules)) {
294
+ if (isFunction(column.rules)) {
297
295
  _rules = column.rules(value, record);
298
296
  }
299
- if (_isFunction(column.labelRequired)) {
297
+ if (isFunction(column.labelRequired)) {
300
298
  _labelRequired = column.labelRequired(value, record);
301
299
  }
302
- if (!(((_column$names2 = column.names) === null || _column$names2 === void 0 ? void 0 : _column$names2.length) && _labelRequired !== null && _labelRequired !== undefined && _isNull(value))) {
300
+ if (!((_column$names2 = column.names) !== null && _column$names2 !== void 0 && _column$names2.length && _labelRequired !== null && _labelRequired !== undefined && isNull(value))) {
303
301
  _context.next = 11;
304
302
  break;
305
303
  }
306
304
  return _context.abrupt("return", false);
307
305
  case 11:
308
- if (!(_required && _isNull(value))) {
306
+ if (!(_required && isNull(value))) {
309
307
  _context.next = 13;
310
308
  break;
311
309
  }
312
310
  return _context.abrupt("return", false);
313
311
  case 13:
314
- if (!((_rules2 = _rules) === null || _rules2 === void 0 ? void 0 : _rules2.length)) {
312
+ if (!((_rules2 = _rules) !== null && _rules2 !== void 0 && _rules2.length)) {
315
313
  _context.next = 44;
316
314
  break;
317
315
  }
@@ -331,10 +329,10 @@ var handleCheckCellValue = /*#__PURE__*/function () {
331
329
  }
332
330
  return _context.abrupt("break", 35);
333
331
  case 22:
334
- if (rule.required && _isNull(value)) {
332
+ if (rule.required && isNull(value)) {
335
333
  res = false;
336
334
  }
337
- if (!_isFunction(rule.validator)) {
335
+ if (!isFunction(rule.validator)) {
338
336
  _context.next = 32;
339
337
  break;
340
338
  }
@@ -380,12 +378,13 @@ var handleCheckCellValue = /*#__PURE__*/function () {
380
378
  return _ref6.apply(this, arguments);
381
379
  };
382
380
  }();
381
+
383
382
  /**
384
383
  * 分页校验
385
384
  */
386
385
  export var onPageCheck = /*#__PURE__*/function () {
387
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref7) {
388
- var form, name, value, columns, setState, page, pagination, isView, disabled, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, record, _iterator3, _step3, column, result, nextState;
386
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref7) {
387
+ var form, name, value, columns, setState, page, pagination, isView, disabled, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, _record, _iterator3, _step3, column, result, nextState;
389
388
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
390
389
  while (1) switch (_context2.prev = _context2.next) {
391
390
  case 0:
@@ -397,9 +396,7 @@ export var onPageCheck = /*#__PURE__*/function () {
397
396
  pageNum = page.pageNum, pageSize = page.pageSize;
398
397
  pageArr = Array.from({
399
398
  length: Math.ceil(tools.calc(value.length, '/', pageSize))
400
- }, function (_, i) {
401
- return i + 1;
402
- });
399
+ }, (_, i) => i + 1);
403
400
  flag = false;
404
401
  errorNum = 0;
405
402
  errorPageNum = 0;
@@ -430,7 +427,7 @@ export var onPageCheck = /*#__PURE__*/function () {
430
427
  _context2.next = 48;
431
428
  break;
432
429
  }
433
- record = _step2.value;
430
+ _record = _step2.value;
434
431
  _iterator3 = _createForOfIteratorHelper(columns);
435
432
  _context2.prev = 22;
436
433
  _iterator3.s();
@@ -442,7 +439,7 @@ export var onPageCheck = /*#__PURE__*/function () {
442
439
  column = _step3.value;
443
440
  _context2.prev = 26;
444
441
  _context2.next = 29;
445
- return handleCheckCellValue(column, record);
442
+ return handleCheckCellValue(column, _record);
446
443
  case 29:
447
444
  result = _context2.sent;
448
445
  if (!result) {
@@ -502,7 +499,7 @@ export var onPageCheck = /*#__PURE__*/function () {
502
499
  if (pageNum !== errorPageNum) {
503
500
  nextState.page = {
504
501
  pageNum: errorPageNum,
505
- pageSize: pageSize
502
+ pageSize
506
503
  };
507
504
  }
508
505
  setState(nextState);
@@ -1,15 +1,11 @@
1
1
  import { transforms } from '@zat-design/utils';
2
2
  var transformDate = transforms.transformDate;
3
3
  export default {
4
- RangePicker: function RangePicker() {
5
- return transformDate({
6
- type: 'RangePicker',
7
- keys: ['form', 'to']
8
- });
9
- },
10
- DatePicker: function DatePicker() {
11
- return transformDate({
12
- type: 'DatePicker'
13
- });
14
- }
4
+ RangePicker: () => transformDate({
5
+ type: 'RangePicker',
6
+ keys: ['form', 'to']
7
+ }),
8
+ DatePicker: () => transformDate({
9
+ type: 'DatePicker'
10
+ })
15
11
  };
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import _debounce from "lodash/debounce";
3
2
  import { useState, useEffect } from 'react';
4
- var useEditTableError = function useEditTableError(_ref) {
3
+ import { debounce } from 'lodash';
4
+ var useEditTableError = _ref => {
5
5
  var containerNode = _ref.containerNode,
6
6
  className = _ref.className,
7
7
  isEnabled = _ref.isEnabled;
@@ -9,28 +9,30 @@ var useEditTableError = function useEditTableError(_ref) {
9
9
  _useState2 = _slicedToArray(_useState, 2),
10
10
  errorLength = _useState2[0],
11
11
  setErrorLength = _useState2[1];
12
- useEffect(function () {
12
+ useEffect(() => {
13
13
  // 如果 isEnabled 为 false 或容器节点不存在,直接跳过监听
14
14
  if (!isEnabled || !containerNode) {
15
15
  return; // 如果未启用监听或容器节点不存在,直接返回
16
16
  }
17
+
17
18
  // 防抖处理:将 setErrorLength 函数进行防抖
18
- var debouncedSetErrorLength = _debounce(function (errorCount) {
19
+ var debouncedSetErrorLength = debounce(errorCount => {
19
20
  setErrorLength(errorCount); // 更新错误数量
20
21
  }, 300); // 300ms 后更新状态
21
- var observer = new MutationObserver(function (mutations) {
22
- mutations.forEach(function (mutation) {
22
+
23
+ var observer = new MutationObserver(mutations => {
24
+ mutations.forEach(mutation => {
23
25
  // 只处理节点的 class 属性变化
24
26
  if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
25
27
  var target = mutation.target;
28
+
26
29
  // 检查目标节点是否包含指定的类
27
30
  if (target.classList.contains(className)) {
28
31
  // 查找所有包含 className 的节点
29
- var errorNodes = containerNode.querySelectorAll(".".concat(className));
32
+ var errorNodes = containerNode.querySelectorAll(`.${className}`);
33
+
30
34
  // 过滤这些节点,只保留那些类名完全为 `ant-form-item-explain-error` 的节点
31
- var validErrorNodes = Array.from(errorNodes).filter(function (node) {
32
- return node.classList.length === 1 && node.classList.contains('ant-form-item-explain-error');
33
- });
35
+ var validErrorNodes = Array.from(errorNodes).filter(node => node.classList.length === 1 && node.classList.contains('ant-form-item-explain-error'));
34
36
  if (errorLength === 0) {
35
37
  debouncedSetErrorLength(0);
36
38
  }
@@ -41,13 +43,14 @@ var useEditTableError = function useEditTableError(_ref) {
41
43
  debouncedSetErrorLength(validErrorNodes.length);
42
44
  }
43
45
  }
46
+
44
47
  // 监听子节点的添加或删除
45
48
  if (mutation.type === 'childList') {
46
49
  // 检查删除的节点是否包含指定的类名
47
- mutation.removedNodes.forEach(function (removedNode) {
50
+ mutation.removedNodes.forEach(removedNode => {
48
51
  if (removedNode instanceof HTMLElement && removedNode.classList.contains('ant-table-row')) {
49
52
  // 更新错误数量
50
- var _errorNodes = containerNode.querySelectorAll(".".concat(className));
53
+ var _errorNodes = containerNode.querySelectorAll(`.${className}`);
51
54
  if (errorLength === 0) {
52
55
  debouncedSetErrorLength(0);
53
56
  }
@@ -63,18 +66,24 @@ var useEditTableError = function useEditTableError(_ref) {
63
66
  });
64
67
  var config = {
65
68
  attributes: true,
69
+ // 监听属性的变化
66
70
  subtree: true,
71
+ // 监听子节点的变化
67
72
  attributeFilter: ['class'],
73
+ // 只监听 class 属性变化
68
74
  childList: true
69
75
  };
76
+
70
77
  // 启动 MutationObserver
71
78
  observer.observe(containerNode.querySelector('tbody'), config);
79
+
72
80
  // 清理 MutationObserver 和防抖定时器
73
- return function () {
81
+ return () => {
74
82
  observer.disconnect();
75
83
  debouncedSetErrorLength.cancel(); // 取消防抖定时器
76
84
  };
77
85
  }, [containerNode, className, isEnabled]); // 当 isEnabled 改变时会重新启动或取消监听
86
+
78
87
  return [errorLength];
79
88
  };
80
89
  export default useEditTableError;
@@ -1,8 +1,8 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import classNames from 'classnames';
4
3
  import { useEffect, useRef, useState } from 'react';
5
- var Group = function Group(props) {
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ var Group = props => {
6
6
  var value = props.value,
7
7
  onChange = props.onChange,
8
8
  dataSource = props.dataSource,
@@ -17,52 +17,48 @@ var Group = function Group(props) {
17
17
  refresh = _useState2[0],
18
18
  setRefresh = _useState2[1];
19
19
  var idx = useRef(-1);
20
- useEffect(function () {
21
- var index = dataSource.findIndex(function (item) {
22
- return item[fieldValue] === value;
23
- });
20
+ useEffect(() => {
21
+ var index = dataSource.findIndex(item => item[fieldValue] === value);
24
22
  idx.current = index;
25
23
  setRefresh(!refresh);
26
24
  }, [value]);
27
- var handleClick = function handleClick(val, index) {
25
+ var handleClick = (val, index) => {
28
26
  if (value === val) {
29
27
  if (!allowClear) {
30
28
  return false;
31
29
  }
32
- onChange === null || onChange === void 0 ? void 0 : onChange('');
30
+ onChange === null || onChange === void 0 || onChange('');
33
31
  idx.current = -1;
34
32
  } else {
35
33
  idx.current = index;
36
- onChange === null || onChange === void 0 ? void 0 : onChange(val);
34
+ onChange === null || onChange === void 0 || onChange(val);
37
35
  }
38
36
  };
39
37
  if (dataSource.length === 0) {
40
- return _jsx("span", {
38
+ return /*#__PURE__*/_jsx("span", {
41
39
  children: "-"
42
40
  });
43
41
  }
44
- return _jsx("div", {
42
+ return /*#__PURE__*/_jsx("div", {
45
43
  id: id,
46
44
  className: classNames({
47
45
  'pro-enum-group-root': true,
48
46
  'pro-enum-group-root-disabled': disabled
49
47
  }),
50
- children: dataSource.map(function (item, index) {
51
- return _jsx("div", {
52
- onClick: function onClick() {
53
- if (!item.disabled && !disabled) {
54
- handleClick(item[fieldValue], index);
55
- }
56
- },
57
- className: classNames({
58
- 'pro-enum-group-item': true,
59
- 'pro-enum-group-item-selected': value === item[fieldValue],
60
- 'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
61
- 'pro-enum-group-item-disabled': item.disabled
62
- }),
63
- children: item[fieldLabel]
64
- }, item[fieldValue]);
65
- })
48
+ children: dataSource.map((item, index) => /*#__PURE__*/_jsx("div", {
49
+ onClick: () => {
50
+ if (!item.disabled && !disabled) {
51
+ handleClick(item[fieldValue], index);
52
+ }
53
+ },
54
+ className: classNames({
55
+ 'pro-enum-group-item': true,
56
+ 'pro-enum-group-item-selected': value === item[fieldValue],
57
+ 'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
58
+ 'pro-enum-group-item-disabled': item.disabled
59
+ }),
60
+ children: item[fieldLabel]
61
+ }, item[fieldValue]))
66
62
  });
67
63
  };
68
64
  export default Group;