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,224 +1,298 @@
1
1
  "use strict";
2
2
 
3
- 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); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- require("antd/es/button/style");
9
- var _button = _interopRequireDefault(require("antd/es/button"));
10
- require("antd/es/form/style");
11
- var _form = _interopRequireDefault(require("antd/es/form"));
12
- var _react = _interopRequireDefault(require("react"));
13
- var _ValueFormat = _interopRequireDefault(require("../utils/ValueFormat.js"));
14
- var _index = _interopRequireDefault(require("../ButtonGroup/index"));
15
- require("./style/index.less");
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _antd = require("antd");
16
9
  var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
10
+ var _utils = require("../utils");
11
+ var _ButtonGroup = _interopRequireDefault(require("../ButtonGroup/"));
12
+ var _data = require("../data/");
13
+ require("./style/index.less");
14
+ var _ConfigContext = require("../ConfigContext");
15
+ var _FilterStyle = _interopRequireDefault(require("./style/FilterStyle"));
17
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
23
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
26
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
28
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // import { general } from '../data/index';
30
- var FormItem = _form.default.Item;
31
- var StandardFilter = /*#__PURE__*/function (_React$Component) {
32
- _inherits(StandardFilter, _React$Component);
33
- var _super = _createSuper(StandardFilter);
34
- function StandardFilter(props) {
35
- var _this;
36
- _classCallCheck(this, StandardFilter);
37
- _this = _super.call(this, props);
38
- _this.filterFormRef = /*#__PURE__*/_react.default.createRef();
39
- // 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
40
- _this.updateFormFields = function (newVal, force) {
41
- var getFormFields = _this.props.getFormFields;
42
- var resetValues = {};
43
- if (force) {
44
- // this.filterFormRef.current.resetFields()
45
- // 先清空 再赋值
46
- resetValues = _this.filterFormRef.current.getFieldsValue();
47
- Object.keys(resetValues).forEach(function (item) {
48
- resetValues[item] = undefined;
49
- });
50
- }
51
- _this.filterFormRef.current.setFieldsValue(Object.assign(Object.assign({}, resetValues), newVal)); // 直接清空表单的赋值
52
- if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
53
- }; // 强制更新表单值,用于赋初始化实例值
54
- _this.forceUpdateForm = function () {
55
- var getFormFields = _this.props.getFormFields;
56
- if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
57
- };
58
- _this.handleSearch = function (values) {
59
- var _this$props = _this.props,
60
- formItemGroup = _this$props.formItemGroup,
61
- onFilterSearch = _this$props.onFilterSearch; // if (Object.prototype.hasOwnProperty.call(values, false)) {
62
- // delete values.false // TODO 自定义结构会莫名的出来一个false字段
63
- // }
64
- var resultValues = (0, _ValueFormat.default)(values, formItemGroup);
65
- if (onFilterSearch) {
66
- onFilterSearch(Object.assign({}, resultValues));
67
- }
68
- };
69
- _this.handleReset = function () {
70
- var onFilterReset = _this.props.onFilterReset; // 使用此方法,表单校验无法清空掉
71
- // const resetValues = this.filterFormRef.current.getFieldsValue()
72
- // Object.keys(resetValues).forEach((item) => {
73
- // resetValues[item] = undefined
74
- // })
75
- // this.filterFormRef.current.setFieldsValue({ ...resetValues }) // 直接清空表单的赋值
76
- _this.filterFormRef.current.resetFields();
77
- _this.setState({
78
- reFormItemGroup: _this.props.formItemGroup // 重新渲染列表
79
- });
17
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+ 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); }
20
+ 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); }
21
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
22
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
25
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
26
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
+ function 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; }
28
+ 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; }
29
+ 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; }
30
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
31
+ 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); } // @ts-nocheck
32
+ var FormItem = _antd.Form.Item;
33
+ var StandardFilter = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
34
+ var InitFanContext = (0, _react.useContext)(_ConfigContext.FanContext);
35
+ var providerConfig = InitFanContext['StandardFilter'] || {}; // 使用上下文(全局配置)设置扩展的配置项
36
+ var _providerConfig$props = _objectSpread(_objectSpread({}, providerConfig), props),
37
+ _providerConfig$props2 = _providerConfig$props.formItemGroup,
38
+ formItemGroup = _providerConfig$props2 === void 0 ? [] : _providerConfig$props2,
39
+ itemGroupConfig = _providerConfig$props.itemGroupConfig,
40
+ initialValues = _providerConfig$props.initialValues,
41
+ getFormFields = _providerConfig$props.getFormFields,
42
+ onFilterSearch = _providerConfig$props.onFilterSearch,
43
+ onFilterReset = _providerConfig$props.onFilterReset,
44
+ className = _providerConfig$props.className,
45
+ style = _providerConfig$props.style,
46
+ _providerConfig$props3 = _providerConfig$props.buttonGroup,
47
+ buttonGroup = _providerConfig$props3 === void 0 ? [] : _providerConfig$props3,
48
+ buttonGroupConfig = _providerConfig$props.buttonGroupConfig,
49
+ min = _providerConfig$props.min,
50
+ codes = _providerConfig$props.codes,
51
+ permissionCodes = _providerConfig$props.permissionCodes,
52
+ confirmText = _providerConfig$props.confirmText,
53
+ cancelText = _providerConfig$props.cancelText,
54
+ _providerConfig$props4 = _providerConfig$props.confirmButtonProps,
55
+ confirmButtonProps = _providerConfig$props4 === void 0 ? {} : _providerConfig$props4,
56
+ _providerConfig$props5 = _providerConfig$props.cancelButtonProps,
57
+ cancelButtonProps = _providerConfig$props5 === void 0 ? {} : _providerConfig$props5,
58
+ filterButtonColSpan = _providerConfig$props.filterButtonColSpan,
59
+ filterButtonConfig = _providerConfig$props.filterButtonConfig,
60
+ formLayout = _providerConfig$props.formLayout,
61
+ _providerConfig$props6 = _providerConfig$props.gridLayout,
62
+ gridLayout = _providerConfig$props6 === void 0 ? 'inline' : _providerConfig$props6,
63
+ filterFormStyle = _providerConfig$props.filterFormStyle,
64
+ filterBtnsStyle = _providerConfig$props.filterBtnsStyle,
65
+ _providerConfig$props7 = _providerConfig$props.colon,
66
+ colon = _providerConfig$props7 === void 0 ? true : _providerConfig$props7,
67
+ dateFormatter = _providerConfig$props.dateFormatter;
68
+ var filterFormRef = (0, _react.useRef)();
69
+ // ref 的转发
70
+ (0, _react.useImperativeHandle)(ref, function () {
71
+ return filterFormRef === null || filterFormRef === void 0 ? void 0 : filterFormRef.current;
72
+ });
73
+ var _useState = (0, _react.useState)([]),
74
+ _useState2 = _slicedToArray(_useState, 2),
75
+ reFormItemGroup = _useState2[0],
76
+ setReFormItemGroup = _useState2[1];
77
+ var _useState3 = (0, _react.useState)(0),
78
+ _useState4 = _slicedToArray(_useState3, 2),
79
+ isHideCount = _useState4[0],
80
+ setIsHideCount = _useState4[1]; // 表单隐藏项数量值
80
81
 
81
- if (onFilterReset) {
82
- onFilterReset(_this.filterFormRef.current.getFieldsValue());
83
- }
84
- };
85
- _this.itemIsHide = function (isHide) {
86
- var current = _this.filterFormRef.current;
87
- if (!isHide) return false;
88
- if (typeof isHide === 'function') {
89
- return isHide(current ? current.getFieldsValue() : {}, current);
82
+ var componentName = 'spec-standard-filter';
83
+ var _useStyle = (0, _FilterStyle.default)(componentName),
84
+ _useStyle2 = _slicedToArray(_useStyle, 2),
85
+ wrapSSR = _useStyle2[0],
86
+ hashId = _useStyle2[1];
87
+ var filterFormLayout = (0, _react.useMemo)(function () {
88
+ return formLayout || 'inline';
89
+ }, [formLayout]);
90
+ // 配置筛选按钮(确认与取消)
91
+ var filterActionButtons = (0, _react.useMemo)(function () {
92
+ // 当前栅栅数量
93
+ var itemGroupSize = (itemGroupConfig === null || itemGroupConfig === void 0 ? void 0 : itemGroupConfig.size) || (filterFormLayout === 'horizontal' ? 'xxlg' : 'md');
94
+ if (itemGroupConfig !== null && itemGroupConfig !== void 0 && itemGroupConfig.columnCount) {
95
+ // 有配置栅格数 1,2,3,4
96
+ switch (itemGroupConfig === null || itemGroupConfig === void 0 ? void 0 : itemGroupConfig.columnCount) {
97
+ case 1:
98
+ itemGroupSize = 'sm';
99
+ break;
100
+ case 2:
101
+ itemGroupSize = 'md';
102
+ break;
103
+ case 3:
104
+ itemGroupSize = 'lg';
105
+ break;
106
+ case 4:
107
+ itemGroupSize = 'xxlg';
108
+ break;
90
109
  }
91
- return isHide;
92
- };
93
- // 表单列表组 formItemGroup 类型为数组或者React.Node
94
- _this.renderFormItemGroup = function () {
95
- var reFormItemGroup = _this.state.reFormItemGroup;
96
- if (Array.isArray(reFormItemGroup)) {
97
- return /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
98
- itemGroup: reFormItemGroup,
99
- layout: "inline",
100
- form: _this.filterFormRef,
101
- doUpdateFormFields: function doUpdateFormFields() {
102
- return _this.forceUpdateForm();
103
- }
104
- });
105
- /* return <>
106
- {
107
- reFormItemGroup.map((item, index) => {
108
- const { componentStyle, isHide } = item
109
- if (this.itemIsHide(isHide)) return null
110
- return (
111
- <FormItem key={item.filedName} label={item.label}
112
- name={item.type !== 'custom' && item.filedName}
113
- rules={item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])}
114
- {...item.protoFormItem}>
115
- {
116
- (item.type === 'custom' && item.customRender) ? item.customRender(this.filterFormRef, { ...item }) :
117
- <FieldComponent {...item}
118
- onChange={(val, ...otherParams) => {
119
- let updateValue = val
120
- if (item.type === 'input' || item.type === 'textarea' || item.type === 'radio') {
121
- updateValue = val.target.value
122
- }
123
- if (Array.isArray(val)) {
124
- updateValue = [...val]
125
- }
126
- this.updateFormFields({ [item.filedName]: updateValue })
127
- if (item.onChange) item.onChange(val, this.filterFormRef, ...otherParams)
128
- }}
129
- style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}/>
130
- }
131
- </FormItem>
132
- )
133
- })
134
- }
135
- </>*/
110
+ }
111
+ // 计算扣除栅格列数是否还有多余的项,用来判断筛选按钮的版式(初始化的时候,可能会受默认值内配置的isHide影响导致计算错误;或自定义表单控件组栅格影响)
112
+ var calculateTimes = (formItemGroup.length - isHideCount) % _data.general.modalSize[itemGroupSize].columnNumber;
113
+ // xs:1列 sm:1列 【span:24】
114
+ // md:2列 【span:12】
115
+ // lg:3列 xlg:3列 【span:8】
116
+ // xxlg:4列 【span:6】
117
+ if (!onFilterSearch && !onFilterReset) return [];
118
+ return [_objectSpread(_objectSpread({
119
+ label: '',
120
+ type: 'custom',
121
+ // display: 'block',
122
+ display: {
123
+ wrapperCol: {
124
+ // 占用的格子数按对应size配置的formItem(md下额外再新增1)
125
+ span: _data.general.modalSize[itemGroupSize].formLayout.labelCol.span + _data.general.modalSize[itemGroupSize].formLayout.wrapperCol.span + (itemGroupSize === 'md' ? 1 : 0)
126
+ }
127
+ },
128
+ protoFormItem: {
129
+ style: {
130
+ textAlign: filterFormLayout === 'horizontal' ? 'right' : 'left'
131
+ }
132
+ },
133
+ colSpan: filterButtonColSpan || 24 - calculateTimes * (24 / _data.general.modalSize[itemGroupSize].columnNumber)
134
+ }, filterButtonConfig), {}, {
135
+ customRender: function customRender() {
136
+ return /*#__PURE__*/_react.default.createElement(FormItem, {
137
+ noStyle: true
138
+ }, onFilterSearch && /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
139
+ type: "primary",
140
+ htmlType: "submit"
141
+ }, confirmButtonProps), confirmText || '查询'), onFilterReset && /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
142
+ type: "primary",
143
+ style: {
144
+ marginLeft: 8
145
+ },
146
+ onClick: handleReset,
147
+ ghost: true
148
+ }, cancelButtonProps), cancelText || '重置'));
136
149
  }
150
+ })];
151
+ }, [confirmText, cancelText, filterFormLayout, reFormItemGroup, onFilterSearch, onFilterReset, itemGroupConfig, filterFormRef, isHideCount]);
137
152
 
138
- return reFormItemGroup;
139
- };
140
- _this.state = {
141
- // recombinationGroup: [],
142
- reFormItemGroup: undefined
143
- };
144
- return _this;
145
- }
146
- _createClass(StandardFilter, [{
147
- key: "componentDidMount",
148
- value: function componentDidMount() {
149
- var initialValues = this.props.initialValues;
150
- this.updateFormFields(initialValues, true);
153
+ // 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
154
+ var updateFormFields = function updateFormFields(newVal, force) {
155
+ var resetValues = {};
156
+ if (force) {
157
+ // this.filterFormRef.current.resetFields()
158
+ // 先清空 再赋值
159
+ resetValues = filterFormRef.current.getFieldsValue();
160
+ Object.keys(resetValues).forEach(function (item) {
161
+ resetValues[item] = undefined;
162
+ });
151
163
  }
152
- }, {
153
- key: "componentDidUpdate",
154
- value: function componentDidUpdate(prevProps) {
155
- var initialValues = this.props.initialValues;
156
- if (prevProps.initialValues !== initialValues) {
157
- this.updateFormFields(initialValues, true);
158
- }
164
+ /* const dateFieldTypes = ['datePicker', 'dateTimePicker', 'rangePicker', 'rangeTimePicker', 'timePicker', 'timePickerRange']
165
+ const filterDateFields = formItemGroup.filter(fItem => dateFieldTypes.includes(fItem.type))
166
+ // 如果配置了dateFormatter='string',则将默认对其他进行格式转换
167
+ if (dateFormatter === 'string') {
168
+ // 需要将字符串转换成日期格式
169
+ filterDateFields.forEach(dItem => {
170
+ if (newVal[dItem.filedName]) {
171
+ if (typeof newVal[dItem.filedName] === 'string') {
172
+ console.log('将字符串转换成dayjs')
173
+ newVal[dItem.filedName] = dayjs(newVal[dItem.filedName])
174
+ } else if (Array.isArray(newVal[dItem.filedName])) {
175
+ console.log('将数组转换成dayjs数组')
176
+ newVal[dItem.filedName] = newVal[dItem.filedName].map(valItem => {
177
+ return typeof valItem === 'string' ? dayjs(valItem) : valItem
178
+ })
179
+ } else {
180
+ // console.log('其他情况,当它是日期格式,则不进行转换')
181
+ }
182
+ }
183
+ })
184
+ } */
185
+ filterFormRef.current.setFieldsValue(_objectSpread(_objectSpread({}, resetValues), newVal || {})); // 直接清空表单的赋值
186
+ updateCalculate(filterFormRef.current.getFieldsValue());
187
+ if (getFormFields) getFormFields(filterFormRef.current.getFieldsValue(), filterFormRef);
188
+ };
189
+ // 强制更新表单值,用于赋初始化实例值
190
+ var forceUpdateForm = (0, _react.useCallback)(function () {
191
+ var formValues = filterFormRef.current.getFieldsValue();
192
+ // if (Object.prototype.hasOwnProperty.call(formValues, false)) {
193
+ // delete formValues.false // TODO 自定义结构会莫名的出来一个false字段
194
+ // }
195
+ updateCalculate(formValues); // 更新当前表单数量,排除被隐藏的值
196
+ if (getFormFields) getFormFields(filterFormRef.current.getFieldsValue(), filterFormRef);
197
+ }, [dateFormatter, formItemGroup]);
198
+ // 计算表单隐藏项
199
+ var updateCalculate = (0, _react.useCallback)(function (formValues) {
200
+ setIsHideCount(reFormItemGroup.filter(function (item) {
201
+ return item.hasOwnProperty('isHide') ? item.isHide(_objectSpread({}, formValues), filterFormRef) : false;
202
+ }).length);
203
+ }, [reFormItemGroup, filterFormRef]);
204
+ var handleSearch = function handleSearch(values) {
205
+ if (Object.prototype.hasOwnProperty.call(values, false)) {
206
+ delete values.false; // TODO 自定义结构会莫名的出来一个false字段
159
207
  }
160
- }, {
161
- key: "render",
162
- value: function render() {
163
- var _this$props2 = this.props,
164
- className = _this$props2.className,
165
- style = _this$props2.style,
166
- onFilterReset = _this$props2.onFilterReset,
167
- _this$props2$buttonGr = _this$props2.buttonGroup,
168
- buttonGroup = _this$props2$buttonGr === void 0 ? [] : _this$props2$buttonGr,
169
- min = _this$props2.min,
170
- codes = _this$props2.codes,
171
- permissionCodes = _this$props2.permissionCodes,
172
- confirmText = _this$props2.confirmText,
173
- cancelText = _this$props2.cancelText,
174
- onFilterSearch = _this$props2.onFilterSearch,
175
- buttonGroupConfig = _this$props2.buttonGroupConfig; // const { recombinationGroup } = this.state;
176
- return /*#__PURE__*/_react.default.createElement(_form.default, {
177
- name: "standard-filter-form",
178
- ref: this.filterFormRef,
179
- layout: "inline",
180
- onFinish: this.handleSearch,
181
- className: className,
182
- style: style
183
- }, /*#__PURE__*/_react.default.createElement("div", {
184
- className: "filter-grid"
185
- }, /*#__PURE__*/_react.default.createElement("div", {
186
- className: "filter-form"
187
- }, this.state.reFormItemGroup ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderFormItemGroup(), /*#__PURE__*/_react.default.createElement(FormItem, {
188
- style: {
189
- display: !onFilterSearch && !onFilterReset ? 'none' : 'inline-block'
208
+ var resultValues = dateFormatter === 'string' ? (0, _utils.UtilValueFormat)(values, formItemGroup) : values;
209
+ console.log('格式化前数据', values);
210
+ console.log('格式化后数据', resultValues);
211
+ if (onFilterSearch) {
212
+ onFilterSearch(_objectSpread({}, resultValues));
213
+ }
214
+ };
215
+ var handleReset = function handleReset() {
216
+ var _filterFormRef$curren;
217
+ // 使用此方法,表单校验无法清空掉
218
+ // const resetValues = this.filterFormRef.current.getFieldsValue()
219
+ // Object.keys(resetValues).forEach((item) => {
220
+ // resetValues[item] = undefined
221
+ // })
222
+ // this.filterFormRef.current.setFieldsValue({ ...resetValues }) // 直接清空表单的赋值
223
+ filterFormRef.current.resetFields();
224
+ setReFormItemGroup(formItemGroup); // 重新渲染列表
225
+ updateCalculate(filterFormRef === null || filterFormRef === void 0 || (_filterFormRef$curren = filterFormRef.current) === null || _filterFormRef$curren === void 0 ? void 0 : _filterFormRef$curren.getFieldsValue());
226
+ if (onFilterReset) {
227
+ var _filterFormRef$curren2;
228
+ onFilterReset(filterFormRef === null || filterFormRef === void 0 || (_filterFormRef$curren2 = filterFormRef.current) === null || _filterFormRef$curren2 === void 0 ? void 0 : _filterFormRef$curren2.getFieldsValue());
229
+ }
230
+ };
231
+ (0, _react.useEffect)(function () {
232
+ if (initialValues && JSON.stringify(initialValues) !== '{}') {
233
+ updateFormFields(initialValues, true);
234
+ }
235
+ }, [initialValues]);
236
+ (0, _react.useEffect)(function () {
237
+ setReFormItemGroup(formItemGroup);
238
+ }, [formItemGroup]);
239
+ // / 表单列表组 formItemGroup 类型为数组或者React.Node
240
+ var renderFormItemGroup = function renderFormItemGroup() {
241
+ if (Array.isArray(reFormItemGroup)) {
242
+ // 数组则默认加上"确认与取消"按钮
243
+ return /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, _extends({
244
+ itemGroup: reFormItemGroup.concat(filterActionButtons),
245
+ size: filterFormLayout === 'horizontal' ? 'xxlg' : 'md' // size决定栅格排列数量(4列排版)
246
+ ,
247
+ layout: filterFormLayout,
248
+ form: filterFormRef
249
+ // displayLayout={{labelCol: { span: 8 }, wrapperCol: { span: 16 },}}
250
+ ,
251
+ doUpdateFormFields: function doUpdateFormFields() {
252
+ return forceUpdateForm();
190
253
  }
191
- }, onFilterSearch && /*#__PURE__*/_react.default.createElement(_button.default, {
192
- type: "primary",
193
- htmlType: "submit"
194
- }, " ", confirmText || '查询'), onFilterReset && /*#__PURE__*/_react.default.createElement(_button.default, {
195
- type: "primary",
196
- style: {
197
- marginLeft: 8
198
- },
199
- onClick: this.handleReset,
200
- ghost: true
201
- }, cancelText || '重置'))) : null), buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
202
- className: "filter-btns"
203
- }, /*#__PURE__*/_react.default.createElement(_index.default, {
204
- options: buttonGroup,
205
- min: min,
206
- codes: codes,
207
- permissionCodes: permissionCodes,
208
- dropdownConfig: buttonGroupConfig
209
- })) : null));
254
+ }, itemGroupConfig));
210
255
  }
211
- }], [{
212
- key: "getDerivedStateFromProps",
213
- value: function getDerivedStateFromProps(nextProps) {
214
- var formItemGroup = nextProps.formItemGroup; // const restOptionList = removeNoPermission(buttonGroup, permissionCodes, codes) || []
215
- return {
216
- // recombinationGroup: restOptionList,
217
- reFormItemGroup: formItemGroup
218
- };
256
+ return reFormItemGroup;
257
+ };
258
+ /**
259
+ * 生成guid
260
+ */
261
+ var guid = function guid() {
262
+ function S4() {
263
+ return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
219
264
  }
220
- }]);
221
- return StandardFilter;
222
- }(_react.default.Component);
223
- var _default = StandardFilter;
224
- exports.default = _default;
265
+ return "".concat(S4(), "-").concat(S4());
266
+ };
267
+ var renderButtonGroup = function renderButtonGroup() {
268
+ return buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
269
+ className: "filter-btns ",
270
+ style: filterBtnsStyle
271
+ }, /*#__PURE__*/_react.default.createElement(_ButtonGroup.default, {
272
+ options: buttonGroup,
273
+ min: min,
274
+ codes: codes,
275
+ permissionCodes: permissionCodes,
276
+ dropdownConfig: buttonGroupConfig
277
+ })) : null;
278
+ };
279
+ return wrapSSR( /*#__PURE__*/_react.default.createElement(_antd.Form, {
280
+ name: 'standard-filter-form-' + guid(),
281
+ ref: filterFormRef,
282
+ layout: filterFormLayout,
283
+ onFinish: handleSearch
284
+ // className={classNames(componentName, hashId, props?.className)}
285
+ ,
286
+ className: "standard-filter ".concat(componentName, " ").concat(className || '', " ").concat(hashId),
287
+ style: style,
288
+ colon: colon
289
+ // {...providerConfig} // 直接传这里面的话,会影响layout渲染
290
+ // initialValues={{ ...initialValues }}
291
+ }, /*#__PURE__*/_react.default.createElement("div", {
292
+ className: "filter-grid filter-grid-".concat(gridLayout),
293
+ style: filterFormStyle
294
+ }, reFormItemGroup.length === 0 ? null : /*#__PURE__*/_react.default.createElement("div", {
295
+ className: "filter-form filter-form-".concat(formLayout)
296
+ }, reFormItemGroup ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderFormItemGroup()) : null), renderButtonGroup())));
297
+ });
298
+ var _default = exports.default = StandardFilter;
@@ -0,0 +1,6 @@
1
+ import { GlobalToken } from "antd";
2
+ export interface StandardFilterTokenType extends GlobalToken {
3
+ [k: string]: any;
4
+ }
5
+ declare const StandardFilterStyleFunc: (prefix: string) => any;
6
+ export default StandardFilterStyleFunc;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _genStyleHook = require("../../theme/utils/genStyleHook");
8
+ 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); }
9
+ 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; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ 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); }
12
+ var StandardFilterStyleFunc = function StandardFilterStyleFunc(prefix) {
13
+ var prepareComponentToken = function prepareComponentToken(token) {
14
+ return {
15
+ // fontWeight: 400,
16
+ };
17
+ };
18
+ return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
19
+ var prefixCls = ".".concat(prefix);
20
+ return [_defineProperty({}, prefixCls, {
21
+ '.filter-grid': {
22
+ // backgroundColor: token.colorBgBase,
23
+ '.filter-form': {
24
+ '.ant-form-item-control, ant-form-item-label': {
25
+ lineHeight: token.controlHeight + 'px' // @input-height-base;
26
+ }
27
+ },
28
+ '.filter-form .ant-form-item': {
29
+ marginRight: token.paddingMD,
30
+ marginBottom: token.paddingMD
31
+ },
32
+ '.filter-btns ': {
33
+ backgroundColor: token.colorBgBase
34
+ },
35
+ '.filter-btns .ant-btn': {
36
+ marginLeft: token.paddingXS,
37
+ marginTop: token.paddingXS,
38
+ // marginBottom: token.paddingMD,
39
+ marginBottom: token.paddingXS
40
+ },
41
+ '.ant-select-single:not(.ant-select-customize-input) .ant-select-selector': {
42
+ lineHeight: token.controlHeight - 2
43
+ },
44
+ '&.filter-grid-horizontal': {
45
+ '.filter-btn': {
46
+ '.spec-button-group': {
47
+ paddingTop: token.paddingMD
48
+ }
49
+ }
50
+ }
51
+ }
52
+ })];
53
+ }, prepareComponentToken // 当前组件扩展的变量
54
+ );
55
+ };
56
+ var _default = exports.default = StandardFilterStyleFunc;