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,5 +1,6 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -8,6 +9,7 @@ exports.queryFileInfo = queryFileInfo;
8
9
  exports.uploadChunk = uploadChunk;
9
10
  var _axios = _interopRequireDefault(require("axios"));
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
11
13
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
14
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
15
  /**
@@ -58,18 +60,16 @@ function lockChunk(fileHash, chunkIndex) {
58
60
  fileHash: fileHash,
59
61
  chunkIndex: chunkIndex
60
62
  }).then( /*#__PURE__*/function () {
61
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref4) {
63
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref4) {
62
64
  var result;
63
- return regeneratorRuntime.wrap(function _callee$(_context) {
64
- while (1) {
65
- switch (_context.prev = _context.next) {
66
- case 0:
67
- result = _ref4.data;
68
- return _context.abrupt("return", result);
69
- case 2:
70
- case "end":
71
- return _context.stop();
72
- }
65
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
66
+ while (1) switch (_context.prev = _context.next) {
67
+ case 0:
68
+ result = _ref4.data;
69
+ return _context.abrupt("return", result);
70
+ case 2:
71
+ case "end":
72
+ return _context.stop();
73
73
  }
74
74
  }, _callee);
75
75
  }));
@@ -11,27 +11,29 @@ var _lib = require("./lib");
11
11
  var _api = require("./api");
12
12
  var _uploadQueue = _interopRequireDefault(require("./upload-queue.class"));
13
13
  require("./style/style.less");
14
+ var _excluded = ["perChunkSize", "errorCb"];
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ 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); }
17
+ 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; }
17
18
  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; }
18
19
  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; }
19
20
  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; }
20
21
  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; }
21
22
  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; }
22
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
23
- 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 _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
24
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
25
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
25
26
  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."); }
26
27
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
27
28
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
29
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
28
30
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
29
31
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
30
32
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
33
  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."); }
32
34
  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); }
33
- 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; }
34
- 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; } }
35
+ 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; }
36
+ 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; } }
35
37
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable no-unused-vars */
36
38
  /**
37
39
  * 初始化组件
@@ -58,84 +60,78 @@ function useComponentInit(component, WrappedComponent) {
58
60
  之后的定时器则是针对较大的文件,以较大的时间间隔来触发查询
59
61
  */
60
62
  function _checkIfFinish() {
61
- _checkIfFinish = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
63
+ _checkIfFinish = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
62
64
  var remoteFileInfo;
63
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
64
- while (1) {
65
- switch (_context3.prev = _context3.next) {
66
- case 0:
67
- _context3.next = 2;
68
- return (0, _api.queryFileInfo)({
69
- fileHash: fileHash
70
- });
71
- case 2:
72
- remoteFileInfo = _context3.sent;
73
- console.log('请求接口queryFileInfo=》 完成分片上传后,更新上传状态');
74
- if (!(remoteFileInfo.status === 'finish')) {
75
- _context3.next = 7;
76
- break;
77
- }
78
- updateFileInfo.call({
79
- filesList: filesList,
80
- setFilesList: setFilesList
81
- }, fileHash, {
82
- status: remoteFileInfo.status,
83
- url: remoteFileInfo.publicPath
84
- });
85
- return _context3.abrupt("return", true);
86
- case 7:
87
- console.log('更新上传状态==》remoteFileInfo', remoteFileInfo);
88
- return _context3.abrupt("return", false);
89
- case 9:
90
- case "end":
91
- return _context3.stop();
92
- }
65
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
66
+ while (1) switch (_context3.prev = _context3.next) {
67
+ case 0:
68
+ _context3.next = 2;
69
+ return (0, _api.queryFileInfo)({
70
+ fileHash: fileHash
71
+ });
72
+ case 2:
73
+ remoteFileInfo = _context3.sent;
74
+ console.log('请求接口queryFileInfo=》 完成分片上传后,更新上传状态');
75
+ if (!(remoteFileInfo.status === 'finish')) {
76
+ _context3.next = 7;
77
+ break;
78
+ }
79
+ updateFileInfo.call({
80
+ filesList: filesList,
81
+ setFilesList: setFilesList
82
+ }, fileHash, {
83
+ status: remoteFileInfo.status,
84
+ url: remoteFileInfo.publicPath
85
+ });
86
+ return _context3.abrupt("return", true);
87
+ case 7:
88
+ console.log('更新上传状态==》remoteFileInfo', remoteFileInfo);
89
+ return _context3.abrupt("return", false);
90
+ case 9:
91
+ case "end":
92
+ return _context3.stop();
93
93
  }
94
94
  }, _callee3);
95
95
  }));
96
96
  return _checkIfFinish.apply(this, arguments);
97
97
  }
98
- setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
98
+ setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
99
99
  var intervalID;
100
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
101
- while (1) {
102
- switch (_context2.prev = _context2.next) {
103
- case 0:
104
- _context2.next = 2;
105
- return checkIfFinish();
106
- case 2:
107
- _context2.t0 = _context2.sent;
108
- if (!(_context2.t0 === false)) {
109
- _context2.next = 6;
110
- break;
111
- }
112
- intervalID = setInterval( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
113
- return regeneratorRuntime.wrap(function _callee$(_context) {
114
- while (1) {
115
- switch (_context.prev = _context.next) {
116
- case 0:
117
- _context.next = 2;
118
- return checkIfFinish();
119
- case 2:
120
- _context.t0 = _context.sent;
121
- if (!(_context.t0 === true)) {
122
- _context.next = 6;
123
- break;
124
- }
125
- clearInterval(intervalID);
126
- intervalIDArr.splice(intervalIDArr.indexOf(intervalIDArr), 1);
127
- case 6:
128
- case "end":
129
- return _context.stop();
100
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
101
+ while (1) switch (_context2.prev = _context2.next) {
102
+ case 0:
103
+ _context2.next = 2;
104
+ return checkIfFinish();
105
+ case 2:
106
+ _context2.t0 = _context2.sent;
107
+ if (!(_context2.t0 === false)) {
108
+ _context2.next = 6;
109
+ break;
110
+ }
111
+ intervalID = setInterval( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
112
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
113
+ while (1) switch (_context.prev = _context.next) {
114
+ case 0:
115
+ _context.next = 2;
116
+ return checkIfFinish();
117
+ case 2:
118
+ _context.t0 = _context.sent;
119
+ if (!(_context.t0 === true)) {
120
+ _context.next = 6;
121
+ break;
130
122
  }
131
- }
132
- }, _callee);
133
- })), 5000);
134
- intervalIDArr.push(intervalID);
135
- case 6:
136
- case "end":
137
- return _context2.stop();
138
- }
123
+ clearInterval(intervalID);
124
+ intervalIDArr.splice(intervalIDArr.indexOf(intervalIDArr), 1);
125
+ case 6:
126
+ case "end":
127
+ return _context.stop();
128
+ }
129
+ }, _callee);
130
+ })), 5000);
131
+ intervalIDArr.push(intervalID);
132
+ case 6:
133
+ case "end":
134
+ return _context2.stop();
139
135
  }
140
136
  }, _callee2);
141
137
  })), 500);
@@ -186,7 +182,6 @@ function initFilesListState(file) {
186
182
  size: file.size,
187
183
  sizeStr: (0, _lib.bytesToSize)(file.size) // 转换当前字节数
188
184
  };
189
-
190
185
  this.setFilesList([].concat(_toConsumableArray(this.filesList), [fileInfo]));
191
186
  console.log('根据用户选择上传的文件来初始化文件信息', fileInfo);
192
187
  return fileInfo;
@@ -236,60 +231,58 @@ function returnFileInputChangeCb(_ref3) {
236
231
  errorCb = _ref3.errorCb;
237
232
  console.log('调用input更新事件');
238
233
  return /*#__PURE__*/function () {
239
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(event) {
234
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(event) {
240
235
  var file, currentFileInfo, chunksArr, fileContentHash, remoteFileInfo;
241
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
242
- while (1) {
243
- switch (_context4.prev = _context4.next) {
244
- case 0:
245
- file = event.target.files[0];
246
- currentFileInfo = initFilesListState.call(_this, file);
247
- console.log('当前已选择需要上传的文件', file);
248
- chunksArr = (0, _lib.splitFileToChunks)(file, perChunkSize); // 文件分片
249
- _context4.next = 6;
250
- return (0, _lib.calFileContentHash)(chunksArr);
251
- case 6:
252
- fileContentHash = _context4.sent;
253
- // 计算文件内容的hash
254
- if (checkDuplicateByHash.call(_this, fileContentHash)) {
255
- removeFile.call(_this, currentFileInfo);
256
- errorCb({
257
- errorCode: 1,
258
- message: 'duplicate file found by hash'
259
- });
260
- }
261
- console.log('当前文件内的fileContentHash', fileContentHash);
262
- updateFileInfo.call(_this, currentFileInfo.hash, {
263
- hash: fileContentHash
264
- });
265
- /* 查询该文件上传情况 */
266
- _context4.next = 12;
267
- return (0, _api.queryFileInfo)(_objectSpread(_objectSpread({}, currentFileInfo), {}, {
268
- fileHash: fileContentHash,
269
- chunksLength: chunksArr.length
270
- }));
271
- case 12:
272
- remoteFileInfo = _context4.sent;
273
- console.log('请求接口queryFileInfo=》初始化,返回当前文件上传情况 =>remoteFileInfo:', remoteFileInfo);
274
- updateFileInfo.call(_this, fileContentHash, {
275
- status: remoteFileInfo.status,
276
- url: remoteFileInfo.publicPath,
277
- chunks: remoteFileInfo.chunks,
278
- chunksLength: remoteFileInfo.chunksLength
236
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
237
+ while (1) switch (_context4.prev = _context4.next) {
238
+ case 0:
239
+ file = event.target.files[0];
240
+ currentFileInfo = initFilesListState.call(_this, file);
241
+ console.log('当前已选择需要上传的文件', file);
242
+ chunksArr = (0, _lib.splitFileToChunks)(file, perChunkSize); // 文件分片
243
+ _context4.next = 6;
244
+ return (0, _lib.calFileContentHash)(chunksArr);
245
+ case 6:
246
+ fileContentHash = _context4.sent;
247
+ // 计算文件内容的hash
248
+ if (checkDuplicateByHash.call(_this, fileContentHash)) {
249
+ removeFile.call(_this, currentFileInfo);
250
+ errorCb({
251
+ errorCode: 1,
252
+ message: 'duplicate file found by hash'
279
253
  });
280
- /* 秒传 */
281
- if (!(remoteFileInfo.status === 'finish')) {
282
- _context4.next = 17;
283
- break;
284
- }
285
- return _context4.abrupt("return");
286
- case 17:
287
- _this.uploadQueue.addChunksToQueue(remoteFileInfo, chunksArr); // 建立上传队列
288
- _this.uploadQueue.run(); // 触发上传
289
- case 19:
290
- case "end":
291
- return _context4.stop();
292
- }
254
+ }
255
+ console.log('当前文件内的fileContentHash', fileContentHash);
256
+ updateFileInfo.call(_this, currentFileInfo.hash, {
257
+ hash: fileContentHash
258
+ });
259
+ /* 查询该文件上传情况 */
260
+ _context4.next = 12;
261
+ return (0, _api.queryFileInfo)(_objectSpread(_objectSpread({}, currentFileInfo), {}, {
262
+ fileHash: fileContentHash,
263
+ chunksLength: chunksArr.length
264
+ }));
265
+ case 12:
266
+ remoteFileInfo = _context4.sent;
267
+ console.log('请求接口queryFileInfo=》初始化,返回当前文件上传情况 =>remoteFileInfo:', remoteFileInfo);
268
+ updateFileInfo.call(_this, fileContentHash, {
269
+ status: remoteFileInfo.status,
270
+ url: remoteFileInfo.publicPath,
271
+ chunks: remoteFileInfo.chunks,
272
+ chunksLength: remoteFileInfo.chunksLength
273
+ });
274
+ /* 秒传 */
275
+ if (!(remoteFileInfo.status === 'finish')) {
276
+ _context4.next = 17;
277
+ break;
278
+ }
279
+ return _context4.abrupt("return");
280
+ case 17:
281
+ _this.uploadQueue.addChunksToQueue(remoteFileInfo, chunksArr); // 建立上传队列
282
+ _this.uploadQueue.run(); // 触发上传
283
+ case 19:
284
+ case "end":
285
+ return _context4.stop();
293
286
  }
294
287
  }, _callee4);
295
288
  }));
@@ -306,7 +299,7 @@ function withUploader(WrappedComponent) {
306
299
  return function UploaderHoc(props) {
307
300
  var perChunkSize = props.perChunkSize,
308
301
  errorCb = props.errorCb,
309
- restProps = _objectWithoutProperties(props, ["perChunkSize", "errorCb"]);
302
+ restProps = _objectWithoutProperties(props, _excluded);
310
303
  var fileInputRef = (0, _react.useRef)(null);
311
304
  var state = useComponentInit(UploaderHoc, WrappedComponent);
312
305
  /* 组装传给具体实现组件的props */
@@ -10,6 +10,8 @@ exports.guid = guid;
10
10
  exports.splitFileToChunks = splitFileToChunks;
11
11
  var _worker = _interopRequireDefault(require("worker-loader!./worker.js"));
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ 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); }
14
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
13
15
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
14
16
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } // eslint-disable-next-line import/no-webpack-loader-syntax
15
17
  // 启动 Web Worker
@@ -50,26 +52,24 @@ function calFileContentHash(_x) {
50
52
  * @param {Number} precise 小数精度
51
53
  */
52
54
  function _calFileContentHash() {
53
- _calFileContentHash = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(chunksArr) {
55
+ _calFileContentHash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(chunksArr) {
54
56
  var worker;
55
- return regeneratorRuntime.wrap(function _callee$(_context) {
56
- while (1) {
57
- switch (_context.prev = _context.next) {
58
- case 0:
59
- worker = new _worker.default();
60
- worker.postMessage({
61
- chunksArr: chunksArr
62
- }); // 传递文件分片
63
- /* 接受计算好的hash */
64
- return _context.abrupt("return", new Promise(function (resolve) {
65
- worker.onmessage = function (event) {
66
- resolve(event.data.hash);
67
- };
68
- }));
69
- case 3:
70
- case "end":
71
- return _context.stop();
72
- }
57
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
58
+ while (1) switch (_context.prev = _context.next) {
59
+ case 0:
60
+ worker = new _worker.default();
61
+ worker.postMessage({
62
+ chunksArr: chunksArr
63
+ }); // 传递文件分片
64
+ /* 接受计算好的hash */
65
+ return _context.abrupt("return", new Promise(function (resolve) {
66
+ worker.onmessage = function (event) {
67
+ resolve(event.data.hash);
68
+ };
69
+ }));
70
+ case 3:
71
+ case "end":
72
+ return _context.stop();
73
73
  }
74
74
  }, _callee);
75
75
  }));