fan-standard-comp 3.2.1 → 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 (380) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/fan-standard-comp.min.css +1 -0
  4. package/dist/fan-standard-comp.min.js +1 -0
  5. package/es/ButtonGroup/PopConfirmTitle.d.ts +1 -1
  6. package/es/ButtonGroup/PopConfirmTitle.js +2 -2
  7. package/es/ButtonGroup/index.d.ts +5 -3
  8. package/es/ButtonGroup/index.js +259 -189
  9. package/es/ButtonGroup/styles/index.d.ts +8 -0
  10. package/es/ButtonGroup/styles/index.js +61 -0
  11. package/es/ButtonGroup/testStyles/index(antd-style).d.ts +11 -0
  12. package/es/ButtonGroup/testStyles/index(antd-style).js +28 -0
  13. package/es/ButtonGroup/testStyles/index(cssinjs).js +133 -0
  14. package/es/ButtonGroup/testStyles/index.d.ts +11 -0
  15. package/es/ButtonGroup/testStyles/index.js +23 -0
  16. package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  17. package/es/CalendarCoordPicker/CalendarMonthPicker.js +32 -0
  18. package/es/CalendarCoordPicker/index.d.ts +7 -0
  19. package/es/CalendarCoordPicker/index.js +314 -0
  20. package/es/CalendarCoordPicker/styles/index.d.ts +6 -0
  21. package/es/CalendarCoordPicker/styles/index.js +28 -0
  22. package/es/CalendarCoordPicker/styles/index.less +37 -0
  23. package/es/ConfigContext/index.d.ts +7 -0
  24. package/es/ConfigContext/index.js +20 -0
  25. package/es/DragContent/DragBar.d.ts +3 -0
  26. package/es/DragContent/DragBar.js +0 -1
  27. package/es/DragContent/index.d.ts +1 -1
  28. package/es/DragContent/index.js +20 -6
  29. package/es/DragContent/styles/index.d.ts +6 -0
  30. package/es/DragContent/styles/index.js +52 -0
  31. package/es/FormComp/ChunkUploader/api.js +11 -11
  32. package/es/FormComp/ChunkUploader/index.js +125 -132
  33. package/es/FormComp/ChunkUploader/lib.js +19 -19
  34. package/es/FormComp/ChunkUploader/upload-queue.class.js +51 -51
  35. package/es/FormComp/EditButton/index.d.ts +1 -1
  36. package/es/FormComp/EditButton/index.js +18 -17
  37. package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  38. package/es/FormComp/FieldComponent/ReUpload.js +45 -37
  39. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +28 -19
  40. package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  41. package/es/FormComp/FieldComponent/UploaderViewer.d.ts +2 -0
  42. package/es/FormComp/FieldComponent/UploaderViewer.js +92 -0
  43. package/es/FormComp/FieldComponent/index.d.ts +1 -1
  44. package/es/FormComp/FieldComponent/index.js +88 -109
  45. package/es/FormComp/FieldComponent/setReadonlyValues.js +21 -15
  46. package/es/FormComp/FieldComponent/style/TreeSelect.d.ts +6 -0
  47. package/es/FormComp/FieldComponent/style/TreeSelect.js +42 -0
  48. package/es/FormComp/FieldComponent/style/UploaderStyle.d.ts +6 -0
  49. package/es/FormComp/FieldComponent/style/UploaderStyle.js +25 -0
  50. package/es/FormComp/FieldComponent/style/index.less +26 -21
  51. package/es/FormComp/RenderItemGroup/index.d.ts +4 -0
  52. package/es/FormComp/RenderItemGroup/index.js +183 -66
  53. package/es/FormComp/RenderItemGroup/style/index.d.ts +6 -0
  54. package/es/FormComp/RenderItemGroup/style/index.js +40 -0
  55. package/es/FormComp/Uploader/index.js +94 -75
  56. package/es/FormComp/Uploader/style/index.less +14 -14
  57. package/es/FormComp/Uploader/util.d.ts +2 -2
  58. package/es/FormComp/VarTemplate/index.js +32 -40
  59. package/es/FormComp/index.js +1 -1
  60. package/es/NavLeafScroll/Main.js +443 -0
  61. package/es/NavLeafScroll/index.d.ts +2 -0
  62. package/es/NavLeafScroll/index.js +21 -395
  63. package/es/NavLeafScroll/style/index.d.ts +6 -0
  64. package/es/NavLeafScroll/style/index.js +56 -0
  65. package/es/NavLeafScroll/style/index.less +22 -22
  66. package/es/RefactorTree/index.d.ts +1 -1
  67. package/es/RefactorTree/index.js +21 -19
  68. package/es/RefactorTree/style/index.js +1 -1
  69. package/es/RefactorTree/style/index.less +22 -22
  70. package/es/RefactorTree/util.d.ts +2 -2
  71. package/es/RefactorTree/util.js +30 -15
  72. package/es/SpecIcon/fonts/demo_index.html +559 -5
  73. package/es/SpecIcon/fonts/iconfont.css +101 -3
  74. package/es/SpecIcon/fonts/iconfont.js +34 -27
  75. package/es/SpecIcon/fonts/iconfont.json +168 -0
  76. package/es/SpecIcon/fonts/iconfont.svg +163 -171
  77. package/es/SpecIcon/fonts/iconfont.ttf +0 -0
  78. package/es/SpecIcon/fonts/iconfont.woff +0 -0
  79. package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
  80. package/es/SpecIcon/index.d.ts +0 -1
  81. package/es/SpecIcon/index.js +33 -12
  82. package/es/SpecIcon/styles/index(antd-style).d.ts +6 -0
  83. package/es/SpecIcon/styles/index(antd-style).js +13 -0
  84. package/es/SpecIcon/styles/index.d.ts +6 -0
  85. package/es/SpecIcon/styles/index.js +93 -0
  86. package/es/StandardContent/SplitterLayout/Pane.js +3 -3
  87. package/es/StandardContent/SplitterLayout/index.js +7 -6
  88. package/es/StandardContent/SplitterLayout/index.less +0 -1
  89. package/es/StandardContent/SubfieldContent.d.ts +3 -2
  90. package/es/StandardContent/SubfieldContent.js +24 -12
  91. package/es/StandardContent/WrapperContent.d.ts +2 -2
  92. package/es/StandardContent/WrapperContent.js +22 -11
  93. package/es/StandardContent/styles/Subfield.d.ts +6 -0
  94. package/es/StandardContent/styles/Subfield.js +30 -0
  95. package/es/StandardContent/styles/Wrapper.d.ts +6 -0
  96. package/es/StandardContent/styles/Wrapper.js +28 -0
  97. package/es/StandardContent/styles/index.less +67 -0
  98. package/es/StandardDragModal/ChangeStandardModal.d.ts +2 -2
  99. package/es/StandardDragModal/ChangeStandardModal.js +84 -71
  100. package/es/StandardDragModal/DraggableModal.js +7 -4
  101. package/es/StandardDragModal/DraggableModalContext.d.ts +1 -1
  102. package/es/StandardDragModal/DraggableModalInner.d.ts +2 -2
  103. package/es/StandardDragModal/DraggableModalInner.js +31 -21
  104. package/es/StandardDragModal/DraggableModalProvider.js +5 -5
  105. package/es/StandardDragModal/Modal.d.ts +1 -1
  106. package/es/StandardDragModal/Modal.js +8 -5
  107. package/es/StandardDragModal/ResizeHandle.js +2 -1
  108. package/es/StandardDragModal/draggableModalReducer.d.ts +4 -4
  109. package/es/StandardDragModal/draggableModalReducer.js +31 -22
  110. package/es/StandardDragModal/index.js +3 -3
  111. package/es/StandardDragModal/useDrag.js +2 -2
  112. package/es/StandardDragModal/useResize.js +2 -2
  113. package/es/StandardFilter/index.d.ts +8 -17
  114. package/es/StandardFilter/index.js +279 -206
  115. package/es/StandardFilter/style/FilterStyle.d.ts +6 -0
  116. package/es/StandardFilter/style/FilterStyle.js +50 -0
  117. package/es/StandardFilter/style/index.less +85 -36
  118. package/es/StandardForm/ActionList.d.ts +9 -0
  119. package/es/StandardForm/ActionList.js +5 -5
  120. package/es/StandardForm/StepForm.d.ts +1 -1
  121. package/es/StandardForm/StepForm.js +47 -40
  122. package/es/StandardForm/TabForm.d.ts +2 -1
  123. package/es/StandardForm/TabForm.js +50 -41
  124. package/es/StandardForm/index.d.ts +2 -1
  125. package/es/StandardForm/index.js +40 -22
  126. package/es/StandardForm/style/index.d.ts +6 -0
  127. package/es/StandardForm/style/index.js +49 -0
  128. package/es/StandardForm/style/index.less +23 -12
  129. package/es/StandardModal/UpdateFormRef.js +0 -1
  130. package/es/StandardModal/index.d.ts +4 -3
  131. package/es/StandardModal/index.js +153 -133
  132. package/es/StandardModal/style/index.d.ts +6 -0
  133. package/es/StandardModal/style/index.js +46 -0
  134. package/es/StandardModal/style/index.less +29 -29
  135. package/es/StandardPanel/index.d.ts +1 -1
  136. package/es/StandardPanel/index.js +28 -17
  137. package/es/StandardPanel/style/index.d.ts +6 -0
  138. package/es/StandardPanel/style/index.js +87 -0
  139. package/es/StandardPanel/style/index.less +30 -32
  140. package/es/StandardTable/index.d.ts +6 -1
  141. package/es/StandardTable/index.js +92 -40
  142. package/es/StandardTable/style/index.d.ts +6 -1
  143. package/es/StandardTable/style/index.js +113 -1
  144. package/es/StandardTable/style/index.less +89 -80
  145. package/es/components/IconNode/index.d.ts +1 -1
  146. package/es/components/IconNode/index.js +12 -1
  147. package/es/components/index.js +1 -1
  148. package/es/data/func.code.d.ts +16 -0
  149. package/es/data/general.config.d.ts +191 -0
  150. package/es/data/general.config.js +32 -1
  151. package/es/data/index.d.ts +3 -0
  152. package/es/data/index.js +2 -2
  153. package/es/index.d.ts +7 -6
  154. package/es/index.js +32 -26
  155. package/es/theme/index.d.ts +27 -0
  156. package/es/theme/index.js +29 -0
  157. package/es/theme/utils/genStyleHook.d.ts +1 -0
  158. package/es/theme/utils/genStyleHook.js +32 -0
  159. package/es/utils/ValueFormat.d.ts +3 -0
  160. package/es/utils/ValueFormat.js +17 -4
  161. package/es/utils/dictSelectUtil.d.ts +36 -0
  162. package/es/utils/dictSelectUtil.js +3 -3
  163. package/es/utils/filterPermission.d.ts +5 -0
  164. package/es/utils/filterPermission.js +4 -6
  165. package/es/utils/getParentNodes.d.ts +79 -0
  166. package/es/utils/getParentNodes.js +89 -13
  167. package/es/utils/index.d.ts +5 -0
  168. package/es/utils/index.js +5 -4
  169. package/es/utils/transferFile.d.ts +4 -0
  170. package/es/utils/transferFile.js +56 -0
  171. package/es/utils/urlUtils.d.ts +14 -0
  172. package/es/utils/urlUtils.js +77 -0
  173. package/lib/ButtonGroup/PopConfirmTitle.d.ts +1 -1
  174. package/lib/ButtonGroup/PopConfirmTitle.js +3 -4
  175. package/lib/ButtonGroup/index.d.ts +5 -3
  176. package/lib/ButtonGroup/index.js +261 -194
  177. package/lib/ButtonGroup/styles/index.d.ts +8 -0
  178. package/lib/ButtonGroup/styles/index.js +68 -0
  179. package/lib/ButtonGroup/testStyles/index(antd-style).d.ts +11 -0
  180. package/lib/ButtonGroup/testStyles/index(antd-style).js +34 -0
  181. package/lib/ButtonGroup/testStyles/index(cssinjs).js +134 -0
  182. package/lib/ButtonGroup/testStyles/index.d.ts +11 -0
  183. package/lib/ButtonGroup/testStyles/index.js +29 -0
  184. package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
  185. package/lib/CalendarCoordPicker/CalendarMonthPicker.js +41 -0
  186. package/lib/CalendarCoordPicker/index.d.ts +7 -0
  187. package/lib/CalendarCoordPicker/index.js +323 -0
  188. package/lib/CalendarCoordPicker/styles/index.d.ts +6 -0
  189. package/lib/CalendarCoordPicker/styles/index.js +34 -0
  190. package/lib/CalendarCoordPicker/styles/index.less +37 -0
  191. package/lib/ConfigContext/index.d.ts +7 -0
  192. package/lib/ConfigContext/index.js +25 -0
  193. package/lib/DragContent/DragBar.d.ts +3 -0
  194. package/lib/DragContent/DragBar.js +1 -3
  195. package/lib/DragContent/index.d.ts +1 -1
  196. package/lib/DragContent/index.js +22 -9
  197. package/lib/DragContent/styles/index.d.ts +6 -0
  198. package/lib/DragContent/styles/index.js +58 -0
  199. package/lib/FormComp/ChunkUploader/api.js +11 -11
  200. package/lib/FormComp/ChunkUploader/index.js +123 -130
  201. package/lib/FormComp/ChunkUploader/lib.js +19 -19
  202. package/lib/FormComp/ChunkUploader/upload-queue.class.js +52 -53
  203. package/lib/FormComp/EditButton/index.d.ts +1 -1
  204. package/lib/FormComp/EditButton/index.js +22 -22
  205. package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
  206. package/lib/FormComp/FieldComponent/ReUpload.js +47 -41
  207. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +29 -21
  208. package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
  209. package/lib/FormComp/FieldComponent/TitleNode.js +1 -2
  210. package/lib/FormComp/FieldComponent/UploaderViewer.d.ts +2 -0
  211. package/lib/FormComp/FieldComponent/UploaderViewer.js +102 -0
  212. package/lib/FormComp/FieldComponent/index.d.ts +1 -1
  213. package/lib/FormComp/FieldComponent/index.js +83 -107
  214. package/lib/FormComp/FieldComponent/setReadonlyValues.js +29 -28
  215. package/lib/FormComp/FieldComponent/style/TreeSelect.d.ts +6 -0
  216. package/lib/FormComp/FieldComponent/style/TreeSelect.js +48 -0
  217. package/lib/FormComp/FieldComponent/style/UploaderStyle.d.ts +6 -0
  218. package/lib/FormComp/FieldComponent/style/UploaderStyle.js +31 -0
  219. package/lib/FormComp/FieldComponent/style/index.less +26 -21
  220. package/lib/FormComp/RenderItemGroup/index.d.ts +4 -0
  221. package/lib/FormComp/RenderItemGroup/index.js +182 -65
  222. package/lib/FormComp/RenderItemGroup/style/index.d.ts +6 -0
  223. package/lib/FormComp/RenderItemGroup/style/index.js +46 -0
  224. package/lib/FormComp/Uploader/index.js +95 -80
  225. package/lib/FormComp/Uploader/style/index.less +14 -14
  226. package/lib/FormComp/Uploader/util.d.ts +2 -2
  227. package/lib/FormComp/VarTemplate/index.js +38 -48
  228. package/lib/NavLeafScroll/Main.js +451 -0
  229. package/lib/NavLeafScroll/index.d.ts +2 -0
  230. package/lib/NavLeafScroll/index.js +21 -398
  231. package/lib/NavLeafScroll/style/index.d.ts +6 -0
  232. package/lib/NavLeafScroll/style/index.js +62 -0
  233. package/lib/NavLeafScroll/style/index.less +22 -22
  234. package/lib/RefactorTree/index.d.ts +1 -1
  235. package/lib/RefactorTree/index.js +21 -21
  236. package/lib/RefactorTree/style/index.less +22 -22
  237. package/lib/RefactorTree/util.d.ts +2 -2
  238. package/lib/RefactorTree/util.js +30 -15
  239. package/lib/SpecIcon/fonts/demo_index.html +559 -5
  240. package/lib/SpecIcon/fonts/iconfont.css +101 -3
  241. package/lib/SpecIcon/fonts/iconfont.js +34 -27
  242. package/lib/SpecIcon/fonts/iconfont.json +168 -0
  243. package/lib/SpecIcon/fonts/iconfont.svg +163 -171
  244. package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
  245. package/lib/SpecIcon/fonts/iconfont.woff +0 -0
  246. package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
  247. package/lib/SpecIcon/index.d.ts +0 -1
  248. package/lib/SpecIcon/index.js +34 -14
  249. package/lib/SpecIcon/styles/index(antd-style).d.ts +6 -0
  250. package/lib/SpecIcon/styles/index(antd-style).js +19 -0
  251. package/lib/SpecIcon/styles/index.d.ts +6 -0
  252. package/lib/SpecIcon/styles/index.js +100 -0
  253. package/lib/StandardContent/SplitterLayout/Pane.js +3 -4
  254. package/lib/StandardContent/SplitterLayout/index.js +6 -6
  255. package/lib/StandardContent/SplitterLayout/index.less +0 -1
  256. package/lib/StandardContent/SubfieldContent.d.ts +3 -2
  257. package/lib/StandardContent/SubfieldContent.js +24 -13
  258. package/lib/StandardContent/WrapperContent.d.ts +2 -2
  259. package/lib/StandardContent/WrapperContent.js +23 -13
  260. package/lib/StandardContent/styles/Subfield.d.ts +6 -0
  261. package/lib/StandardContent/styles/Subfield.js +36 -0
  262. package/lib/StandardContent/styles/Wrapper.d.ts +6 -0
  263. package/lib/StandardContent/styles/Wrapper.js +34 -0
  264. package/lib/StandardContent/styles/index.less +67 -0
  265. package/lib/StandardDragModal/ChangeStandardModal.d.ts +2 -2
  266. package/lib/StandardDragModal/ChangeStandardModal.js +85 -72
  267. package/lib/StandardDragModal/DraggableModal.js +11 -8
  268. package/lib/StandardDragModal/DraggableModalContext.d.ts +1 -1
  269. package/lib/StandardDragModal/DraggableModalContext.js +3 -4
  270. package/lib/StandardDragModal/DraggableModalInner.d.ts +2 -2
  271. package/lib/StandardDragModal/DraggableModalInner.js +38 -30
  272. package/lib/StandardDragModal/DraggableModalProvider.js +10 -10
  273. package/lib/StandardDragModal/Modal.d.ts +1 -1
  274. package/lib/StandardDragModal/Modal.js +7 -5
  275. package/lib/StandardDragModal/ResizeHandle.js +6 -6
  276. package/lib/StandardDragModal/clamp.js +2 -3
  277. package/lib/StandardDragModal/draggableModalReducer.d.ts +4 -4
  278. package/lib/StandardDragModal/draggableModalReducer.js +34 -29
  279. package/lib/StandardDragModal/getWindowSize.js +2 -3
  280. package/lib/StandardDragModal/useDrag.js +4 -5
  281. package/lib/StandardDragModal/usePrevious.js +2 -3
  282. package/lib/StandardDragModal/useResize.js +4 -5
  283. package/lib/StandardFilter/index.d.ts +8 -17
  284. package/lib/StandardFilter/index.js +281 -207
  285. package/lib/StandardFilter/style/FilterStyle.d.ts +6 -0
  286. package/lib/StandardFilter/style/FilterStyle.js +56 -0
  287. package/lib/StandardFilter/style/index.less +85 -36
  288. package/lib/StandardForm/ActionList.d.ts +9 -0
  289. package/lib/StandardForm/ActionList.js +6 -7
  290. package/lib/StandardForm/StepForm.d.ts +1 -1
  291. package/lib/StandardForm/StepForm.js +46 -41
  292. package/lib/StandardForm/TabForm.d.ts +2 -1
  293. package/lib/StandardForm/TabForm.js +48 -41
  294. package/lib/StandardForm/index.d.ts +2 -1
  295. package/lib/StandardForm/index.js +39 -23
  296. package/lib/StandardForm/style/index.d.ts +6 -0
  297. package/lib/StandardForm/style/index.js +55 -0
  298. package/lib/StandardForm/style/index.less +23 -12
  299. package/lib/StandardModal/UpdateFormRef.js +3 -4
  300. package/lib/StandardModal/index.d.ts +4 -3
  301. package/lib/StandardModal/index.js +152 -133
  302. package/lib/StandardModal/style/index.d.ts +6 -0
  303. package/lib/StandardModal/style/index.js +52 -0
  304. package/lib/StandardModal/style/index.less +29 -29
  305. package/lib/StandardPanel/index.d.ts +1 -1
  306. package/lib/StandardPanel/index.js +29 -20
  307. package/lib/StandardPanel/style/index.d.ts +6 -0
  308. package/lib/StandardPanel/style/index.js +93 -0
  309. package/lib/StandardPanel/style/index.less +30 -32
  310. package/lib/StandardTable/index.d.ts +6 -1
  311. package/lib/StandardTable/index.js +93 -40
  312. package/lib/StandardTable/style/index.d.ts +6 -1
  313. package/lib/StandardTable/style/index.js +117 -1
  314. package/lib/StandardTable/style/index.less +89 -80
  315. package/lib/components/IconNode/index.d.ts +1 -1
  316. package/lib/components/IconNode/index.js +13 -3
  317. package/lib/data/func.code.d.ts +16 -0
  318. package/lib/data/func.code.js +2 -3
  319. package/lib/data/general.config.d.ts +191 -0
  320. package/lib/data/general.config.js +34 -4
  321. package/lib/data/index.d.ts +3 -0
  322. package/lib/index.d.ts +7 -6
  323. package/lib/index.js +24 -12
  324. package/lib/theme/index.d.ts +27 -0
  325. package/lib/theme/index.js +35 -0
  326. package/lib/theme/utils/genStyleHook.d.ts +1 -0
  327. package/lib/theme/utils/genStyleHook.js +38 -0
  328. package/lib/utils/ValueFormat.d.ts +3 -0
  329. package/lib/utils/ValueFormat.js +20 -6
  330. package/lib/utils/dictSelectUtil.d.ts +36 -0
  331. package/lib/utils/dictSelectUtil.js +3 -3
  332. package/lib/utils/filterPermission.d.ts +5 -0
  333. package/lib/utils/filterPermission.js +9 -16
  334. package/lib/utils/getParentNodes.d.ts +79 -0
  335. package/lib/utils/getParentNodes.js +91 -16
  336. package/lib/utils/index.d.ts +5 -0
  337. package/lib/utils/index.js +42 -32
  338. package/lib/utils/transferFile.d.ts +4 -0
  339. package/lib/utils/transferFile.js +63 -0
  340. package/lib/utils/urlUtils.d.ts +14 -0
  341. package/lib/utils/urlUtils.js +84 -0
  342. package/package.json +80 -33
  343. package/Readme.md +0 -49
  344. package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
  345. package/dist/fan-standard-comp.umd.js +0 -602
  346. package/dist/fonts/iconfont.eot +0 -0
  347. package/dist/fonts/iconfont.ttf +0 -0
  348. package/dist/fonts/iconfont.woff +0 -0
  349. package/es/ButtonGroup/ButtonList.d.ts +0 -2
  350. package/es/ButtonGroup/ButtonList.js +0 -34
  351. package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
  352. package/es/ButtonGroup/ButtonMenu.js +0 -35
  353. package/es/ButtonGroup/style/index.less +0 -36
  354. package/es/RefactorTree/indexTreeNode.d.ts +0 -39
  355. package/es/RefactorTree/indexTreeNode.js +0 -204
  356. package/es/SpecIcon/style/iconfont.less +0 -213
  357. package/es/SpecIcon/style/index.less +0 -98
  358. package/es/SplitterLayout/Pane.d.ts +0 -13
  359. package/es/SplitterLayout/Pane.js +0 -33
  360. package/es/SplitterLayout/index.js +0 -325
  361. package/es/SplitterLayout/index.less +0 -58
  362. package/es/StandardContent/style/index.less +0 -80
  363. package/es/theme/spec-variable.less +0 -48
  364. package/lib/ButtonGroup/ButtonList.d.ts +0 -2
  365. package/lib/ButtonGroup/ButtonList.js +0 -43
  366. package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
  367. package/lib/ButtonGroup/ButtonMenu.js +0 -44
  368. package/lib/ButtonGroup/style/index.less +0 -36
  369. package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
  370. package/lib/RefactorTree/indexTreeNode.js +0 -214
  371. package/lib/SpecIcon/style/iconfont.less +0 -213
  372. package/lib/SpecIcon/style/index.less +0 -98
  373. package/lib/SplitterLayout/Pane.d.ts +0 -13
  374. package/lib/SplitterLayout/Pane.js +0 -41
  375. package/lib/SplitterLayout/index.js +0 -332
  376. package/lib/SplitterLayout/index.less +0 -58
  377. package/lib/StandardContent/style/index.less +0 -80
  378. package/lib/theme/spec-variable.less +0 -48
  379. /package/es/{styles/index.less → ButtonGroup/testStyles/index(cssinjs).d.ts} +0 -0
  380. /package/lib/{styles/index.less → ButtonGroup/testStyles/index(cssinjs).d.ts} +0 -0
@@ -1,9 +1,15 @@
1
- import "antd/es/popconfirm/style";
2
- import _Popconfirm from "antd/es/popconfirm";
3
- import "antd/es/button/style";
4
- import _Button from "antd/es/button";
5
- import "antd/es/dropdown/style";
6
- import _Dropdown from "antd/es/dropdown";
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["code", "fn", "exName", "name", "children", "icon"],
3
+ _excluded2 = ["exName", "name", "type", "icon", "ghost", "danger", "disabled", "loading", "fn", "code", "rowParams"],
4
+ _excluded3 = ["code", "fn", "exName", "name", "children", "icon", "confirmText", "confirmConfig"];
5
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
+ 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; }
7
+ 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; }
8
+ 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; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
12
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
13
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
14
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
15
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -11,18 +17,22 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
11
17
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
18
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
19
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
20
+ 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; }
21
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
22
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
- import { __rest } from "tslib";
18
23
  import React, { useState, useEffect } from "react";
19
- import { IconNode } from "../components/index";
20
- import SpecIcon from "../SpecIcon/index";
21
- import PopConfirmTitle from './PopConfirmTitle';
24
+ import { IconNode } from "../components";
25
+ import SpecIcon from "../SpecIcon";
26
+ import PopConfirmTitle from "./PopConfirmTitle";
27
+ import { Button, Dropdown, Menu, Popconfirm } from "antd";
22
28
  import { funcCode } from "../data/index";
23
29
  import { DownOutlined, QuestionCircleOutlined } from "@ant-design/icons";
24
- import { removeNoPermission, btnIsDisabled } from '../utils/filterPermission';
25
- import './style/index.less';
30
+ import { removeNoPermission, btnIsDisabled } from "../utils/filterPermission";
31
+ import useStyle from "./styles";
32
+ import classNames from "classnames";
33
+
34
+ // 参数API
35
+
26
36
  var ButtonGroup = function ButtonGroup(props) {
27
37
  var _props$type = props.type,
28
38
  type = _props$type === void 0 ? 'button' : _props$type,
@@ -36,12 +46,14 @@ var ButtonGroup = function ButtonGroup(props) {
36
46
  codes = _props$codes === void 0 ? funcCode.btnFuncCodes : _props$codes,
37
47
  permissionCodes = props.permissionCodes,
38
48
  _props$dropdownConfig = props.dropdownConfig,
39
- dropdownConfig = _props$dropdownConfig === void 0 ? {} : _props$dropdownConfig;
49
+ dropdownConfig = _props$dropdownConfig === void 0 ? {} : _props$dropdownConfig,
50
+ _props$moreText = props.moreText,
51
+ moreText = _props$moreText === void 0 ? '更多' : _props$moreText,
52
+ moreIcon = props.moreIcon;
40
53
  var _props$options = props.options,
41
54
  options = _props$options === void 0 ? [] : _props$options,
42
55
  _props$min = props.min,
43
56
  min = _props$min === void 0 ? 3 : _props$min; // 最小展示长度不能小于2
44
- var moreText = '更多';
45
57
  if (!options) return null; // 没有配置list返回null
46
58
  var _useState = useState(-1),
47
59
  _useState2 = _slicedToArray(_useState, 2),
@@ -57,6 +69,7 @@ var ButtonGroup = function ButtonGroup(props) {
57
69
  setResetList = _useState6[1];
58
70
  useEffect(function () {
59
71
  // 重组选项options集合数据,排除:无权限(有配置code,并且不包含permissionCodes内)的数据及,isHide 为true的数据
72
+ // @ts-ignore
60
73
  setResetList(_toConsumableArray(removeNoPermission(options, permissionCodes, codes, rowParams)) || []);
61
74
  return function () {
62
75
  setResetList([]);
@@ -65,79 +78,7 @@ var ButtonGroup = function ButtonGroup(props) {
65
78
  useEffect(function () {
66
79
  setPopVisibleIndex(-1);
67
80
  }, [rowParams]);
68
- /* // 渲染按钮多层级形式 (用于筛选)
69
- const buttonMenu = (group: any) => {
70
- return (<Menu>
71
- {
72
- group.map((item: any, index: number) => {
73
- if (item.children) {
74
- return <Menu.SubMenu title={item.exName || item.name} key={index}>
75
- {
76
- item.children.map((child: any, childIndex: number) => {
77
- return (<Menu.Item key={childIndex}>
78
- <a onClick={child.fn ? () => child.fn(child) : null}
79
- >
80
- <IconNode icon={child.icon}/> {child.exName || child.name}
81
- </a>
82
- </Menu.Item>)
83
- })
84
- }
85
- </Menu.SubMenu>
86
- }
87
- return (
88
- <Menu.Item key={index}>
89
- <a onClick={item.fn ? () => item.fn(item) : null}>
90
- <IconNode icon={item.icon}/> {item.exName || item.name}
91
- </a>
92
- </Menu.Item>
93
- )
94
- })
95
- }
96
- </Menu>)
97
- };
98
- // 渲染文本形式多级菜单列表(用于表格)
99
- const textMenu = (group: any[]) => {
100
- return (
101
- <Menu className="spec-button-text-dropdown">
102
- {
103
- group.map((gItem: any, gIndex: number) => {
104
-
105
- if (gItem.children) {
106
- return <Menu.SubMenu title={gItem.exName || gItem.name} key={gItem}>
107
- {
108
- gItem.children.map((child: any, childIndex: number) => <Menu.Item key={childIndex}>
109
- <a onClick={child.fn ? () => child.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}>
110
- {child.render ? child.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (child.exName || child.name)}
111
- </a>
112
- </Menu.Item>)
113
- }
114
- </Menu.SubMenu>
115
- }
116
- return <Menu.Item key={gIndex}
117
- disabled={btnIsDisabled(gItem.disabled, rowParams)}>
118
- {
119
- gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
120
- // @ts-ignore
121
- <a disabled={btnIsDisabled(gItem.disabled, rowParams)}
122
- onClick={gItem.fn ? () => {
123
- setPopVisibleIndex(rowParams.rowIndex)
124
- setPopRow(gItem)
125
- } : null}>
126
- {gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
127
- </a>
128
- : <a className="spec-button-group-text"
129
- onClick={gItem.fn ? () => gItem.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}
130
- // @ts-ignore
131
- disabled={btnIsDisabled(gItem.disabled, rowParams)}>
132
- {gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
133
- </a>
134
- }
135
- </Menu.Item>
136
- })
137
- }
138
- </Menu>
139
- )
140
- };*/
81
+
141
82
  // 递归转换原来的数组结构
142
83
  var deepTransButtonMenus = function deepTransButtonMenus(groupArray) {
143
84
  if (!Array.isArray(groupArray)) {
@@ -150,12 +91,12 @@ var ButtonGroup = function ButtonGroup(props) {
150
91
  name = vItem.name,
151
92
  children = vItem.children,
152
93
  icon = vItem.icon,
153
- others = __rest(vItem, ["code", "fn", "exName", "name", "children", "icon"]);
154
- return Object.assign(Object.assign({}, others), {
94
+ others = _objectWithoutProperties(vItem, _excluded);
95
+ return _objectSpread(_objectSpread({}, others), {}, {
155
96
  key: code ? code + i : i,
156
- icon: /*#__PURE__*/React.createElement(IconNode, {
97
+ icon: icon ? /*#__PURE__*/React.createElement(IconNode, {
157
98
  icon: icon
158
- }),
99
+ }) : null,
159
100
  label: /*#__PURE__*/React.createElement("a", {
160
101
  onClick: function onClick() {
161
102
  return fn && fn(vItem);
@@ -165,12 +106,36 @@ var ButtonGroup = function ButtonGroup(props) {
165
106
  });
166
107
  });
167
108
  };
168
- // {gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
169
- // 自定义渲染显示的文本
170
- var renderCustomLabel = function renderCustomLabel(gItem) {
171
- return gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
172
- return rowParams[pItem];
173
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null, gItem.icon ? ' ' : '', gItem.exName || gItem.name);
109
+
110
+ // 渲染按钮多层级形式 (用于筛选)
111
+ var buttonMenu = function buttonMenu(group) {
112
+ return /*#__PURE__*/React.createElement(Menu, null, group.map(function (item, index) {
113
+ if (item.children) {
114
+ return /*#__PURE__*/React.createElement(Menu.SubMenu, {
115
+ title: item.exName || item.name,
116
+ key: index
117
+ }, item.children.map(function (child, childIndex) {
118
+ return /*#__PURE__*/React.createElement(Menu.Item, {
119
+ key: child.name + childIndex
120
+ }, /*#__PURE__*/React.createElement("a", {
121
+ onClick: child.fn ? function () {
122
+ return child.fn(child);
123
+ } : undefined
124
+ }, /*#__PURE__*/React.createElement(IconNode, {
125
+ icon: child.icon
126
+ }), " ", child.exName || child.name));
127
+ }));
128
+ }
129
+ return /*#__PURE__*/React.createElement(Menu.Item, {
130
+ key: item.name + index
131
+ }, /*#__PURE__*/React.createElement("a", {
132
+ onClick: item.fn ? function () {
133
+ return item.fn(item);
134
+ } : undefined
135
+ }, /*#__PURE__*/React.createElement(IconNode, {
136
+ icon: item.icon
137
+ }), " ", item.exName || item.name));
138
+ }));
174
139
  };
175
140
  // 渲染按钮形式 (用于筛选)
176
141
  var RenderButtonList = function RenderButtonList(item) {
@@ -185,33 +150,124 @@ var ButtonGroup = function ButtonGroup(props) {
185
150
  fn = item.fn,
186
151
  code = item.code,
187
152
  rowParams = item.rowParams,
188
- others = __rest(item, ["exName", "name", "type", "icon", "ghost", "danger", "disabled", "loading", "fn", "code", "rowParams"]);
153
+ others = _objectWithoutProperties(item, _excluded2);
189
154
  if (Array.isArray(item.children) && item.children.length > 0) {
190
155
  // overlay={buttonMenu(item.children)}
191
- return /*#__PURE__*/React.createElement(_Dropdown, Object.assign({
156
+ return /*#__PURE__*/React.createElement(Dropdown, _extends({
192
157
  menu: {
193
158
  items: deepTransButtonMenus(item.children)
194
159
  },
195
160
  placement: "bottomRight"
196
- }, (item === null || item === void 0 ? void 0 : item.dropdownConfig) || dropdownConfig || {}), /*#__PURE__*/React.createElement(_Button, {
161
+ }, (item === null || item === void 0 ? void 0 : item.dropdownConfig) || dropdownConfig || {}), /*#__PURE__*/React.createElement(Button, {
197
162
  type: "primary"
198
- }, item.exName || item.name || item.label, " ", /*#__PURE__*/React.createElement(SpecIcon, {
163
+ }, item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
199
164
  name: "down"
200
165
  })));
201
166
  }
202
- return /*#__PURE__*/React.createElement(_Button, Object.assign({
167
+ return /*#__PURE__*/React.createElement(Button, _extends({
203
168
  type: type || 'primary',
204
169
  danger: danger,
205
170
  ghost: ghost,
171
+ loading: loading,
206
172
  onClick: fn ? function () {
207
173
  return fn(item);
208
174
  } : null
209
175
  }, others, {
210
- icon: /*#__PURE__*/React.createElement(IconNode, {
176
+ icon: icon ? /*#__PURE__*/React.createElement(IconNode, {
211
177
  icon: icon
212
- }),
178
+ }) : null,
213
179
  disabled: btnIsDisabled(disabled, rowParams)
214
- }), exName || name || others.label);
180
+ }), exName || name);
181
+ };
182
+ /*const textMenuItems = (group) => {
183
+ return (group || []).map((gItem: any, gIndex) => {
184
+ return {
185
+ disabled: btnIsDisabled(gItem.disabled, rowParams),
186
+ label: gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
187
+ // @ts-ignore
188
+ <a disabled={btnIsDisabled(gItem.disabled, rowParams)}
189
+ onClick={gItem.fn ? () => {
190
+ setPopVisibleIndex(rowParams.rowIndex)
191
+ setPopRow(gItem)
192
+ } : null}>
193
+ {gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
194
+ </a>
195
+ : <a className="spec-button-group-text"
196
+ onClick={gItem.fn ? () => gItem.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}
197
+ // @ts-ignore
198
+ disabled={btnIsDisabled(gItem.disabled, rowParams)}>
199
+ {gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
200
+ </a>,
201
+ key: gIndex + (gItem.exName || gItem.name),
202
+ children: gItem.children ? (gItem.children || []).map((child: any, childIndex: number) => {
203
+ return {
204
+ label: <a onClick={child.fn ? () => child.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}>
205
+ {child.render ? child.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (child.exName || child.name)}
206
+ </a>,
207
+ key: childIndex
208
+ }
209
+ }) : undefined
210
+ }
211
+ })
212
+ }*/
213
+ // 渲染文本形式多级菜单列表(用于表格)
214
+ var textMenu = function textMenu(group) {
215
+ return /*#__PURE__*/React.createElement(Menu, {
216
+ className: "spec-button-text-dropdown"
217
+ }, group.map(function (gItem, gIndex) {
218
+ if (gItem.children) {
219
+ return /*#__PURE__*/React.createElement(Menu.SubMenu, {
220
+ title: gItem.exName || gItem.name,
221
+ key: gItem.name + gIndex
222
+ }, gItem.children.map(function (child, childIndex) {
223
+ return /*#__PURE__*/React.createElement(Menu.Item, {
224
+ key: child.name + childIndex
225
+ }, /*#__PURE__*/React.createElement("a", {
226
+ onClick: child.fn ? function () {
227
+ return child.fn.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
228
+ return rowParams[pItem];
229
+ })));
230
+ } : undefined
231
+ }, child.render ? child.render.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
232
+ return rowParams[pItem];
233
+ }))) : child.exName || child.name));
234
+ }));
235
+ }
236
+ return /*#__PURE__*/React.createElement(Menu.Item, {
237
+ key: gIndex,
238
+ disabled: btnIsDisabled(gItem.disabled, rowParams)
239
+ }, gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
240
+ /*#__PURE__*/
241
+ // @ts-ignore
242
+ React.createElement("a", {
243
+ disabled: btnIsDisabled(gItem.disabled, rowParams),
244
+ onClick: gItem.fn ? function () {
245
+ // @ts-ignore
246
+ setPopVisibleIndex(rowParams === null || rowParams === void 0 ? void 0 : rowParams.rowIndex);
247
+ setPopRow(gItem);
248
+ } : undefined
249
+ }, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
250
+ return rowParams[pItem];
251
+ }))) : gItem.exName || gItem.name) : /*#__PURE__*/React.createElement("a", {
252
+ className: 'spec-button-group-text',
253
+ onClick: gItem.fn ? function () {
254
+ return gItem.fn.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
255
+ return rowParams[pItem];
256
+ })));
257
+ } : undefined
258
+ // @ts-ignore
259
+ ,
260
+ disabled: btnIsDisabled(gItem.disabled, rowParams)
261
+ }, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
262
+ return rowParams[pItem];
263
+ }))) : gItem.exName || gItem.name));
264
+ }));
265
+ };
266
+ // 自定义渲染显示的文本
267
+ var renderCustomLabel = function renderCustomLabel(gItem) {
268
+ return gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
269
+ return rowParams[pItem];
270
+ }))) : /*#__PURE__*/React.createElement(React.Fragment, null, gItem.icon ? ' ' : '', gItem.exName || gItem.name);
215
271
  };
216
272
  // 递归转换原来的数组结构
217
273
  var deepTransTextMenus = function deepTransTextMenus(groupArray) {
@@ -227,7 +283,7 @@ var ButtonGroup = function ButtonGroup(props) {
227
283
  icon = vItem.icon,
228
284
  confirmText = vItem.confirmText,
229
285
  confirmConfig = vItem.confirmConfig,
230
- others = __rest(vItem, ["code", "fn", "exName", "name", "children", "icon", "confirmText", "confirmConfig"]);
286
+ others = _objectWithoutProperties(vItem, _excluded3);
231
287
  return {
232
288
  danger: others.danger,
233
289
  disabled: btnIsDisabled(others.disabled, rowParams),
@@ -237,6 +293,7 @@ var ButtonGroup = function ButtonGroup(props) {
237
293
  onClick: function onClick() {
238
294
  // 配置二次确认
239
295
  if (vItem.hasOwnProperty('confirmText') || vItem.hasOwnProperty('confirmConfig')) {
296
+ // @ts-ignore
240
297
  fn ? (setPopVisibleIndex(rowParams.rowIndex), setPopRow(vItem)) : null;
241
298
  } else {
242
299
  fn && fn.apply(void 0, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
@@ -250,28 +307,29 @@ var ButtonGroup = function ButtonGroup(props) {
250
307
  };
251
308
  });
252
309
  };
310
+
253
311
  // 渲染文本形式 列表(用于表格)
254
312
  var RenderTextList = function RenderTextList(item) {
255
313
  if (Array.isArray(item.children) && item.children.length > 0) {
256
- // overlay={textMenu(item.children)}
257
- return /*#__PURE__*/React.createElement(_Dropdown, Object.assign({
314
+ return /*#__PURE__*/React.createElement(Dropdown, _extends({
258
315
  menu: {
259
316
  items: deepTransTextMenus(item.children)
260
317
  },
261
318
  placement: "bottomRight"
262
319
  }, (item === null || item === void 0 ? void 0 : item.dropdownConfig) || dropdownConfig || {}), /*#__PURE__*/React.createElement("a", {
263
- className: "spec-button-group-text"
320
+ className: 'spec-button-group-text'
264
321
  }, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
265
322
  return rowParams[pItem];
266
323
  }))) : item.exName || item.name, " ", /*#__PURE__*/React.createElement(SpecIcon, {
267
324
  name: "down"
268
325
  })));
269
326
  }
270
- return /*#__PURE__*/React.createElement(React.Fragment, null, item.hasOwnProperty('confirmText') || item.hasOwnProperty('confirmConfig') ? /*#__PURE__*/React.createElement(_Popconfirm, Object.assign({
327
+ return /*#__PURE__*/React.createElement(React.Fragment, null, item.hasOwnProperty('confirmText') || item.hasOwnProperty('confirmConfig') ? /*#__PURE__*/React.createElement(Popconfirm, _extends({
271
328
  placement: "topRight",
272
329
  icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)
273
330
  }, item.hasOwnProperty('confirmConfig') ? item.confirmConfig : {}, {
274
- title: /*#__PURE__*/React.createElement(PopConfirmTitle, Object.assign({}, item, {
331
+ // 弹出扩展配置
332
+ title: /*#__PURE__*/React.createElement(PopConfirmTitle, _extends({}, item, {
275
333
  extraRow: rowParams
276
334
  })),
277
335
  onCancel: function onCancel() {
@@ -295,23 +353,29 @@ var ButtonGroup = function ButtonGroup(props) {
295
353
  }
296
354
  }
297
355
  }), /*#__PURE__*/React.createElement("a", {
298
- className: "spec-button-group-text",
356
+ className: 'spec-button-group-text',
299
357
  key: item.index,
300
- title: item.exName || item.name,
358
+ title: item.exName || item.name
301
359
  // @ts-ignore
360
+ ,
302
361
  disabled: btnIsDisabled(item.disabled, rowParams)
303
- }, renderCustomLabel(item))) : /*#__PURE__*/React.createElement("a", {
304
- className: "spec-button-group-text",
362
+ }, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
363
+ return rowParams[pItem];
364
+ }))) : item.exName || item.name)) : /*#__PURE__*/React.createElement("a", {
365
+ className: 'spec-button-group-text',
305
366
  title: item.exName || item.name,
306
- key: item.index,
367
+ key: item.index
307
368
  // @ts-ignore
369
+ ,
308
370
  disabled: btnIsDisabled(item.disabled, rowParams),
309
371
  onClick: item.fn ? function () {
310
372
  return item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
311
373
  return rowParams[pItem];
312
374
  })));
313
- } : null
314
- }, renderCustomLabel(item)));
375
+ } : undefined
376
+ }, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
377
+ return rowParams[pItem];
378
+ }))) : item.exName || item.name));
315
379
  };
316
380
  // 渲染展示的按钮列表
317
381
  var renderDisplayButton = function renderDisplayButton(item, index) {
@@ -323,85 +387,91 @@ var ButtonGroup = function ButtonGroup(props) {
323
387
  }
324
388
  /*渲染按钮形式*/
325
389
  if (type === 'button') {
326
- return /*#__PURE__*/React.createElement(RenderButtonList, Object.assign({
390
+ return /*#__PURE__*/React.createElement(RenderButtonList, _extends({
327
391
  key: index
328
392
  }, item, {
329
393
  rowParams: rowParams
330
394
  }));
331
395
  }
332
396
  /*渲染文本形式*/
333
- return /*#__PURE__*/React.createElement(RenderTextList, Object.assign({
397
+ return /*#__PURE__*/React.createElement(RenderTextList, _extends({
334
398
  key: index
335
399
  }, item));
336
400
  };
337
401
  if (min < 2) min = 2;
338
- if (resetList.length === 0) {
339
- return /*#__PURE__*/React.createElement(React.Fragment, null, type !== 'button' ? '-' : null);
340
- }
341
- // 数量超出时渲染
342
- if (resetList.length > min) {
343
- var forGroup = resetList.slice(0, min - 1); // 平铺组合内
344
- var forDrop = resetList.slice(min - 1); // 下拉组合内
345
- return /*#__PURE__*/React.createElement("span", {
346
- className: "spec-button-group"
347
- }, forGroup.map(function (item, index) {
348
- return index < min - 1 ? renderDisplayButton(item, index) : null;
349
- }), type === 'button' ? /*#__PURE__*/React.createElement(_Dropdown, Object.assign({
350
- menu: {
351
- items: deepTransButtonMenus(forDrop)
352
- },
353
- placement: "bottomRight"
354
- }, dropdownConfig), /*#__PURE__*/React.createElement(_Button, {
355
- type: "primary"
356
- }, moreText, " ", /*#__PURE__*/React.createElement(SpecIcon, {
357
- name: "down"
358
- }))) : /*#__PURE__*/React.createElement(_Popconfirm, Object.assign({
359
- placement: "topRight",
360
- open: popVisibleIndex === rowParams.rowIndex,
361
- icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null),
362
- trigger: "click"
363
- }, popRow.hasOwnProperty('confirmConfig') ? popRow.confirmConfig : {}, {
364
- title: /*#__PURE__*/React.createElement(PopConfirmTitle, Object.assign({}, popRow, {
365
- extraRow: rowParams
366
- })),
367
- onCancel: function onCancel() {
368
- setPopVisibleIndex(-1);
369
- // 优先调用其 confirmConfig 配置的 onCancel 事件
370
- if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onCancel) {
371
- var _popRow$confirmConfig;
372
- (_popRow$confirmConfig = popRow.confirmConfig).onCancel.apply(_popRow$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
373
- return rowParams[pItem];
374
- })));
375
- }
376
- },
377
- onConfirm: function onConfirm() {
378
- setPopVisibleIndex(-1);
379
- // 优先调用其 confirmConfig 配置的 onConfirm 事件
380
- if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onConfirm) {
381
- var _popRow$confirmConfig2;
382
- (_popRow$confirmConfig2 = popRow.confirmConfig).onConfirm.apply(_popRow$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
383
- return rowParams[pItem];
384
- })));
385
- } else if (popRow.fn) {
386
- popRow.fn.apply(popRow, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
387
- return rowParams[pItem];
388
- })));
402
+ var componentName = 'spec-button-group';
403
+ var _useStyle = useStyle(componentName),
404
+ _useStyle2 = _slicedToArray(_useStyle, 2),
405
+ wrapSSR = _useStyle2[0],
406
+ hashId = _useStyle2[1];
407
+ var ButtonGroupGroupNode = function ButtonGroupGroupNode() {
408
+ if (resetList.length === 0) {
409
+ return /*#__PURE__*/React.createElement(React.Fragment, null, type !== 'button' ? '-' : null);
410
+ }
411
+ // 数量超出时渲染
412
+ if (resetList.length > min) {
413
+ var forGroup = resetList.slice(0, min - 1);
414
+ var forDrop = resetList.slice(min - 1);
415
+ return /*#__PURE__*/React.createElement("span", {
416
+ className: classNames(componentName, hashId)
417
+ }, forGroup.map(function (item, index) {
418
+ return index < min - 1 ? renderDisplayButton(item, index) : null;
419
+ }), type === 'button' ? /*#__PURE__*/React.createElement(Dropdown, _extends({
420
+ menu: {
421
+ items: deepTransButtonMenus(forDrop)
422
+ },
423
+ placement: "bottomRight"
424
+ }, dropdownConfig), /*#__PURE__*/React.createElement(Button, {
425
+ type: "primary"
426
+ }, moreText || '更多', moreIcon || /*#__PURE__*/React.createElement(DownOutlined, null))) : /*#__PURE__*/React.createElement(Popconfirm, _extends({
427
+ placement: "topRight",
428
+ open: popVisibleIndex === rowParams.rowIndex,
429
+ icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null),
430
+ trigger: "click"
431
+ }, popRow.hasOwnProperty('confirmConfig') ? popRow.confirmConfig : {}, {
432
+ // 弹出扩展配置
433
+ title: /*#__PURE__*/React.createElement(PopConfirmTitle, _extends({}, popRow, {
434
+ extraRow: rowParams
435
+ })),
436
+ onCancel: function onCancel() {
437
+ setPopVisibleIndex(-1);
438
+ // 优先调用其 confirmConfig 配置的 onCancel 事件
439
+ if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onCancel) {
440
+ var _popRow$confirmConfig;
441
+ (_popRow$confirmConfig = popRow.confirmConfig).onCancel.apply(_popRow$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
442
+ return rowParams[pItem];
443
+ })));
444
+ }
445
+ },
446
+ onConfirm: function onConfirm() {
447
+ setPopVisibleIndex(-1);
448
+ // 优先调用其 confirmConfig 配置的 onConfirm 事件
449
+ if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onConfirm) {
450
+ var _popRow$confirmConfig2;
451
+ (_popRow$confirmConfig2 = popRow.confirmConfig).onConfirm.apply(_popRow$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
452
+ return rowParams[pItem];
453
+ })));
454
+ } else if (popRow.fn) {
455
+ popRow.fn.apply(popRow, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
456
+ return rowParams[pItem];
457
+ })));
458
+ }
389
459
  }
390
- }
391
- }), /*#__PURE__*/React.createElement(_Dropdown, Object.assign({
392
- menu: {
393
- items: deepTransTextMenus(forDrop)
394
- },
395
- placement: "bottomRight"
396
- }, dropdownConfig), /*#__PURE__*/React.createElement("a", {
397
- className: "spec-button-group-text"
398
- }, moreText, " ", /*#__PURE__*/React.createElement(DownOutlined, null)))));
399
- }
400
- // 数量不超出时渲染
401
- return /*#__PURE__*/React.createElement("span", {
402
- className: "spec-button-group"
403
- }, resetList.map(function (item, index) {
404
- return renderDisplayButton(item, index);
405
- }));
460
+ }), /*#__PURE__*/React.createElement(Dropdown, _extends({
461
+ menu: {
462
+ items: deepTransTextMenus(forDrop)
463
+ },
464
+ placement: "bottomRight"
465
+ }, dropdownConfig), /*#__PURE__*/React.createElement("a", {
466
+ className: 'spec-button-group-text'
467
+ }, moreText || '更多', moreIcon || /*#__PURE__*/React.createElement(DownOutlined, null)))));
468
+ }
469
+ return /*#__PURE__*/React.createElement("span", {
470
+ className: classNames(componentName, hashId)
471
+ }, resetList.map(function (item, index) {
472
+ return renderDisplayButton(item, index);
473
+ }));
474
+ };
475
+ return wrapSSR(ButtonGroupGroupNode());
406
476
  };
407
477
  export default ButtonGroup;
@@ -0,0 +1,8 @@
1
+ import { GlobalToken } from "antd";
2
+ import { CSSProperties } from "react";
3
+ export interface SpecButtonGroupToken extends GlobalToken {
4
+ [k: string]: any;
5
+ }
6
+ export declare const prepareComponentToken: (token: GlobalToken) => CSSProperties;
7
+ declare const SpecButtonGroupStyleFunc: (prefix: string) => any;
8
+ export default SpecButtonGroupStyleFunc;