@cloud-app-dev/vidc 4.0.15 → 4.0.17

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 (409) hide show
  1. package/.dumirc.ts +2 -18
  2. package/.fatherrc.ts +0 -1
  3. package/package.json +35 -31
  4. package/release-build.sh +1 -2
  5. package/es/AppContext/Sync.d.ts +0 -8
  6. package/es/AppContext/Sync.js +0 -44
  7. package/es/AppContext/index.d.ts +0 -10
  8. package/es/AppContext/index.js +0 -144
  9. package/es/AppContext/interface.d.ts +0 -41
  10. package/es/AppContext/static.d.ts +0 -8
  11. package/es/AppContext/static.js +0 -9
  12. package/es/Auth/index.d.ts +0 -8
  13. package/es/Auth/index.js +0 -18
  14. package/es/AutoExit/index.d.ts +0 -6
  15. package/es/AutoExit/index.js +0 -23
  16. package/es/CheckGroupFixed/demo.d.ts +0 -3
  17. package/es/CheckGroupFixed/demo.js +0 -25
  18. package/es/CheckGroupFixed/index.d.ts +0 -18
  19. package/es/CheckGroupFixed/index.js +0 -150
  20. package/es/CheckGroupFixed/index.less +0 -53
  21. package/es/Config/index.d.ts +0 -4
  22. package/es/Config/index.js +0 -77
  23. package/es/Config/interface.d.ts +0 -65
  24. package/es/Config/utils.d.ts +0 -4
  25. package/es/Config/utils.js +0 -33
  26. package/es/ConfigContext/index.d.ts +0 -22
  27. package/es/ConfigContext/index.js +0 -25
  28. package/es/CustomRenderSelect/index.d.ts +0 -12
  29. package/es/CustomRenderSelect/index.js +0 -83
  30. package/es/CustomRenderSelect/index.less +0 -25
  31. package/es/DBTools/index.d.ts +0 -25
  32. package/es/DBTools/index.js +0 -337
  33. package/es/DisableMark/index.d.ts +0 -9
  34. package/es/DisableMark/index.js +0 -22
  35. package/es/DisableMark/index.less +0 -9
  36. package/es/DomMove/demo.d.ts +0 -2
  37. package/es/DomMove/demo.js +0 -20
  38. package/es/DomMove/index.d.ts +0 -16
  39. package/es/DomMove/index.js +0 -149
  40. package/es/DomMove/utils.d.ts +0 -8
  41. package/es/DomMove/utils.js +0 -33
  42. package/es/Drag/DragAndDropItem.d.ts +0 -4
  43. package/es/Drag/DragAndDropItem.js +0 -133
  44. package/es/Drag/DropItem.d.ts +0 -4
  45. package/es/Drag/DropItem.js +0 -50
  46. package/es/Drag/index.d.ts +0 -7
  47. package/es/Drag/index.js +0 -7
  48. package/es/Drag/interface.d.ts +0 -16
  49. package/es/DynamicGridList/Demo.d.ts +0 -3
  50. package/es/DynamicGridList/Demo.js +0 -86
  51. package/es/DynamicGridList/index.d.ts +0 -27
  52. package/es/DynamicGridList/index.js +0 -71
  53. package/es/DynamicList/demo.d.ts +0 -2
  54. package/es/DynamicList/demo.js +0 -50
  55. package/es/DynamicList/index.d.ts +0 -31
  56. package/es/DynamicList/index.js +0 -96
  57. package/es/DynamicList/index.less +0 -17
  58. package/es/DynamicList/interface.d.ts +0 -19
  59. package/es/DynamicList/utils.d.ts +0 -4
  60. package/es/DynamicList/utils.js +0 -6
  61. package/es/ErrorFallback/index.d.ts +0 -9
  62. package/es/ErrorFallback/index.js +0 -38
  63. package/es/ErrorFallback/inerface.d.ts +0 -48
  64. package/es/EventTools/index.d.ts +0 -3
  65. package/es/EventTools/index.js +0 -12
  66. package/es/FrontendPlayer/index.d.ts +0 -4
  67. package/es/FrontendPlayer/index.js +0 -2
  68. package/es/FullScreen/index.d.ts +0 -22
  69. package/es/FullScreen/index.js +0 -36
  70. package/es/FullScreen/index.less +0 -18
  71. package/es/GridList/Demo.d.ts +0 -3
  72. package/es/GridList/Demo.js +0 -89
  73. package/es/GridList/data.d.ts +0 -16
  74. package/es/GridList/data.js +0 -609
  75. package/es/GridList/hook.d.ts +0 -13
  76. package/es/GridList/hook.js +0 -270
  77. package/es/GridList/index.d.ts +0 -15
  78. package/es/GridList/index.js +0 -48
  79. package/es/GridList/index.less +0 -8
  80. package/es/GridList/interface.d.ts +0 -59
  81. package/es/GridList/utils.d.ts +0 -9
  82. package/es/GridList/utils.js +0 -42
  83. package/es/HightLevel/index.d.ts +0 -9
  84. package/es/HightLevel/index.js +0 -21
  85. package/es/HightLevel/index.less +0 -3
  86. package/es/IconFont/index.d.ts +0 -12
  87. package/es/IconFont/index.js +0 -63
  88. package/es/ImageView/index.d.ts +0 -17
  89. package/es/ImageView/index.js +0 -58
  90. package/es/ImageView/index.less +0 -11
  91. package/es/InstanceHistory/index.d.ts +0 -3
  92. package/es/InstanceHistory/index.js +0 -7
  93. package/es/LabelPlayer/111.png +0 -0
  94. package/es/LabelPlayer/demo.d.ts +0 -2
  95. package/es/LabelPlayer/demo.js +0 -123
  96. package/es/LabelPlayer/index.d.ts +0 -21
  97. package/es/LabelPlayer/index.js +0 -169
  98. package/es/LabelPlayer/index.less +0 -24
  99. package/es/LabelValue/index.d.ts +0 -15
  100. package/es/LabelValue/index.js +0 -32
  101. package/es/LabelValue/index.less +0 -23
  102. package/es/List/demo.d.ts +0 -3
  103. package/es/List/demo.js +0 -26
  104. package/es/List/index.d.ts +0 -28
  105. package/es/List/index.js +0 -30
  106. package/es/List/index.less +0 -13
  107. package/es/ListWithSizeAnimate/demo.d.ts +0 -2
  108. package/es/ListWithSizeAnimate/demo.js +0 -128
  109. package/es/ListWithSizeAnimate/index.d.ts +0 -14
  110. package/es/ListWithSizeAnimate/index.js +0 -97
  111. package/es/ListWithSizeAnimate/index.less +0 -23
  112. package/es/LoaderScript/index.d.ts +0 -47
  113. package/es/LoaderScript/index.js +0 -38
  114. package/es/LoaderScript/utils.d.ts +0 -13
  115. package/es/LoaderScript/utils.js +0 -179
  116. package/es/Map/AMap.d.ts +0 -7109
  117. package/es/Map/BasicMap/AMapInstance.d.ts +0 -19
  118. package/es/Map/BasicMap/AMapInstance.js +0 -98
  119. package/es/Map/BasicMap/LeafletInstance.d.ts +0 -18
  120. package/es/Map/BasicMap/LeafletInstance.js +0 -111
  121. package/es/Map/BasicMap/index.d.ts +0 -9
  122. package/es/Map/BasicMap/index.js +0 -98
  123. package/es/Map/BasicMap/index.less +0 -29
  124. package/es/Map/ClusterLayer/demo.d.ts +0 -3
  125. package/es/Map/ClusterLayer/demo.js +0 -22
  126. package/es/Map/ClusterLayer/hook.d.ts +0 -5
  127. package/es/Map/ClusterLayer/hook.js +0 -124
  128. package/es/Map/ClusterLayer/index.d.ts +0 -6
  129. package/es/Map/ClusterLayer/index.js +0 -32
  130. package/es/Map/ClusterLayer/index.less +0 -29
  131. package/es/Map/ClusterLayer/props.d.ts +0 -8
  132. package/es/Map/Config/index.d.ts +0 -9
  133. package/es/Map/Config/index.js +0 -52
  134. package/es/Map/Config/utils.d.ts +0 -2
  135. package/es/Map/Config/utils.js +0 -65
  136. package/es/Map/Context/index.d.ts +0 -11
  137. package/es/Map/Context/index.js +0 -56
  138. package/es/Map/FindPio/index.d.ts +0 -4
  139. package/es/Map/FindPio/index.js +0 -14
  140. package/es/Map/FindPio/index.less +0 -7
  141. package/es/Map/InfoWindow/MakerLikeWindow.d.ts +0 -4
  142. package/es/Map/InfoWindow/MakerLikeWindow.js +0 -113
  143. package/es/Map/InfoWindow/demo.d.ts +0 -3
  144. package/es/Map/InfoWindow/demo.js +0 -76
  145. package/es/Map/InfoWindow/index.d.ts +0 -11
  146. package/es/Map/InfoWindow/index.js +0 -67
  147. package/es/Map/LevelCenter/DragMarker/index.d.ts +0 -10
  148. package/es/Map/LevelCenter/DragMarker/index.js +0 -44
  149. package/es/Map/LevelCenter/demo.d.ts +0 -3
  150. package/es/Map/LevelCenter/demo.js +0 -46
  151. package/es/Map/LevelCenter/index.d.ts +0 -15
  152. package/es/Map/LevelCenter/index.js +0 -71
  153. package/es/Map/LoaderMap/index.d.ts +0 -12
  154. package/es/Map/LoaderMap/index.js +0 -71
  155. package/es/Map/MapDrawSelect/demo.d.ts +0 -3
  156. package/es/Map/MapDrawSelect/demo.js +0 -79
  157. package/es/Map/MapDrawSelect/index.d.ts +0 -15
  158. package/es/Map/MapDrawSelect/index.js +0 -62
  159. package/es/Map/MouseTool/index.d.ts +0 -10
  160. package/es/Map/MouseTool/index.js +0 -44
  161. package/es/Map/MouseTool/useMouseTools.d.ts +0 -7
  162. package/es/Map/MouseTool/useMouseTools.js +0 -83
  163. package/es/Map/ResetTools/index.d.ts +0 -10
  164. package/es/Map/ResetTools/index.js +0 -67
  165. package/es/Map/ResetTools/index.less +0 -39
  166. package/es/Map/SinglePoint/demo.d.ts +0 -3
  167. package/es/Map/SinglePoint/demo.js +0 -16
  168. package/es/Map/SinglePoint/index.d.ts +0 -27
  169. package/es/Map/SinglePoint/index.js +0 -57
  170. package/es/Map/SinglePoint/index.less +0 -41
  171. package/es/Map/hook/useMapEvent.d.ts +0 -2
  172. package/es/Map/hook/useMapEvent.js +0 -19
  173. package/es/Map/hook/useMapType.d.ts +0 -4
  174. package/es/Map/hook/useMapType.js +0 -12
  175. package/es/Map/icon.d.ts +0 -2
  176. package/es/Map/icon.js +0 -10
  177. package/es/Map/index.d.ts +0 -24
  178. package/es/Map/index.js +0 -25
  179. package/es/Map/interface.d.ts +0 -74
  180. package/es/Map/points.d.ts +0 -74
  181. package/es/Map/points.js +0 -1
  182. package/es/Map/useMarker/index.d.ts +0 -10
  183. package/es/Map/useMarker/index.js +0 -71
  184. package/es/Map/withMap/index.d.ts +0 -3
  185. package/es/Map/withMap/index.js +0 -18
  186. package/es/Picture/component/DefaultRects/RectInfo.d.ts +0 -8
  187. package/es/Picture/component/DefaultRects/RectInfo.js +0 -88
  188. package/es/Picture/component/DefaultRects/index.d.ts +0 -13
  189. package/es/Picture/component/DefaultRects/index.js +0 -58
  190. package/es/Picture/component/DefaultRects/index.less +0 -211
  191. package/es/Picture/component/DefaultRects/utils.d.ts +0 -2
  192. package/es/Picture/component/DefaultRects/utils.js +0 -11
  193. package/es/Picture/component/DrawRect/index.d.ts +0 -13
  194. package/es/Picture/component/DrawRect/index.js +0 -51
  195. package/es/Picture/component/DrawRect/index.less +0 -8
  196. package/es/Picture/component/RectMenu/index.d.ts +0 -12
  197. package/es/Picture/component/RectMenu/index.js +0 -79
  198. package/es/Picture/component/RectMenu/index.less +0 -36
  199. package/es/Picture/component/RectMenu/utils.d.ts +0 -12
  200. package/es/Picture/component/RectMenu/utils.js +0 -19
  201. package/es/Picture/component/Tools/index.d.ts +0 -12
  202. package/es/Picture/component/Tools/index.js +0 -93
  203. package/es/Picture/component/Tools/index.less +0 -49
  204. package/es/Picture/component/WheelScale/index.d.ts +0 -7
  205. package/es/Picture/component/WheelScale/index.js +0 -29
  206. package/es/Picture/demo.d.ts +0 -2
  207. package/es/Picture/demo.js +0 -114
  208. package/es/Picture/index.d.ts +0 -19
  209. package/es/Picture/index.js +0 -354
  210. package/es/Picture/index.less +0 -20
  211. package/es/Picture/interface.d.ts +0 -196
  212. package/es/Picture/loadCaptureRectImage.d.ts +0 -3
  213. package/es/Picture/loadCaptureRectImage.js +0 -99
  214. package/es/Picture/useDraw.d.ts +0 -1
  215. package/es/Picture/useDraw.js +0 -103
  216. package/es/Picture/utils.d.ts +0 -26
  217. package/es/Picture/utils.js +0 -143
  218. package/es/Player/api/index.d.ts +0 -68
  219. package/es/Player/api/index.js +0 -283
  220. package/es/Player/context.d.ts +0 -21
  221. package/es/Player/context.js +0 -25
  222. package/es/Player/contraller_bar/bar.d.ts +0 -8
  223. package/es/Player/contraller_bar/bar.js +0 -28
  224. package/es/Player/contraller_bar/contraller_event.d.ts +0 -6
  225. package/es/Player/contraller_bar/contraller_event.js +0 -53
  226. package/es/Player/contraller_bar/index.d.ts +0 -14
  227. package/es/Player/contraller_bar/index.js +0 -33
  228. package/es/Player/contraller_bar/left_bar.d.ts +0 -10
  229. package/es/Player/contraller_bar/left_bar.js +0 -88
  230. package/es/Player/contraller_bar/right_bar.d.ts +0 -8
  231. package/es/Player/contraller_bar/right_bar.js +0 -37
  232. package/es/Player/contraller_bar/time.d.ts +0 -3
  233. package/es/Player/contraller_bar/time.js +0 -21
  234. package/es/Player/contraller_bar/useBarStatus.d.ts +0 -2
  235. package/es/Player/contraller_bar/useBarStatus.js +0 -43
  236. package/es/Player/contraller_bar/volume.d.ts +0 -9
  237. package/es/Player/contraller_bar/volume.js +0 -65
  238. package/es/Player/demo.d.ts +0 -3
  239. package/es/Player/demo.js +0 -277
  240. package/es/Player/empty.d.ts +0 -2
  241. package/es/Player/empty.js +0 -6
  242. package/es/Player/event/errorEvent.d.ts +0 -14
  243. package/es/Player/event/errorEvent.js +0 -88
  244. package/es/Player/event/eventName.d.ts +0 -18
  245. package/es/Player/event/eventName.js +0 -30
  246. package/es/Player/event/index.d.ts +0 -24
  247. package/es/Player/event/index.js +0 -204
  248. package/es/Player/fps_play.d.ts +0 -11
  249. package/es/Player/fps_play.js +0 -84
  250. package/es/Player/frontend_player.d.ts +0 -8
  251. package/es/Player/frontend_player.js +0 -72
  252. package/es/Player/frontend_timeline.d.ts +0 -10
  253. package/es/Player/frontend_timeline.js +0 -145
  254. package/es/Player/iconfont.d.ts +0 -5
  255. package/es/Player/iconfont.js +0 -22
  256. package/es/Player/index.d.ts +0 -2
  257. package/es/Player/index.js +0 -2
  258. package/es/Player/live_heart.d.ts +0 -8
  259. package/es/Player/live_heart.js +0 -46
  260. package/es/Player/message.d.ts +0 -5
  261. package/es/Player/message.js +0 -138
  262. package/es/Player/player.d.ts +0 -231
  263. package/es/Player/segment_player.d.ts +0 -9
  264. package/es/Player/segment_player.js +0 -230
  265. package/es/Player/segment_timeline.d.ts +0 -12
  266. package/es/Player/segment_timeline.js +0 -190
  267. package/es/Player/single_player.d.ts +0 -5
  268. package/es/Player/single_player.js +0 -275
  269. package/es/Player/style/bar.less +0 -43
  270. package/es/Player/style/iconfont.js +0 -43
  271. package/es/Player/style/index.less +0 -34
  272. package/es/Player/style/message.less +0 -56
  273. package/es/Player/style/slider.less +0 -106
  274. package/es/Player/style/timeline.less +0 -116
  275. package/es/Player/style/volume.less +0 -24
  276. package/es/Player/timeline.d.ts +0 -5
  277. package/es/Player/timeline.js +0 -98
  278. package/es/Player/util.d.ts +0 -43
  279. package/es/Player/util.js +0 -189
  280. package/es/PlayerExt/demo.d.ts +0 -3
  281. package/es/PlayerExt/demo.js +0 -170
  282. package/es/PlayerExt/index.d.ts +0 -48
  283. package/es/PlayerExt/index.js +0 -207
  284. package/es/PlayerExt/index.less +0 -10
  285. package/es/Progress/index.d.ts +0 -12
  286. package/es/Progress/index.js +0 -56
  287. package/es/Progress/index.less +0 -21
  288. package/es/ROI/demo.d.ts +0 -3
  289. package/es/ROI/demo.js +0 -18
  290. package/es/ROI/index.d.ts +0 -33
  291. package/es/ROI/index.js +0 -57
  292. package/es/ROI/index.less +0 -33
  293. package/es/RefDrawer/Footer.d.ts +0 -9
  294. package/es/RefDrawer/Footer.js +0 -27
  295. package/es/RefDrawer/demo.d.ts +0 -3
  296. package/es/RefDrawer/demo.js +0 -32
  297. package/es/RefDrawer/index.d.ts +0 -26
  298. package/es/RefDrawer/index.js +0 -73
  299. package/es/RefModal/demo.d.ts +0 -3
  300. package/es/RefModal/demo.js +0 -32
  301. package/es/RefModal/index.d.ts +0 -17
  302. package/es/RefModal/index.js +0 -71
  303. package/es/ScreenPlayer/Live.d.ts +0 -10
  304. package/es/ScreenPlayer/Live.js +0 -220
  305. package/es/ScreenPlayer/LiveTools.d.ts +0 -29
  306. package/es/ScreenPlayer/LiveTools.js +0 -167
  307. package/es/ScreenPlayer/PlayerWithExt.d.ts +0 -34
  308. package/es/ScreenPlayer/PlayerWithExt.js +0 -240
  309. package/es/ScreenPlayer/RatePick.d.ts +0 -8
  310. package/es/ScreenPlayer/RatePick.js +0 -30
  311. package/es/ScreenPlayer/Record.d.ts +0 -10
  312. package/es/ScreenPlayer/Record.js +0 -447
  313. package/es/ScreenPlayer/RecordTools.d.ts +0 -38
  314. package/es/ScreenPlayer/RecordTools.js +0 -216
  315. package/es/ScreenPlayer/ScreenSelect.d.ts +0 -7
  316. package/es/ScreenPlayer/ScreenSelect.js +0 -51
  317. package/es/ScreenPlayer/SegmentTimeLine.d.ts +0 -17
  318. package/es/ScreenPlayer/SegmentTimeLine.js +0 -38
  319. package/es/ScreenPlayer/TimeMode.d.ts +0 -7
  320. package/es/ScreenPlayer/TimeMode.js +0 -30
  321. package/es/ScreenPlayer/TimeSelect.d.ts +0 -7
  322. package/es/ScreenPlayer/TimeSelect.js +0 -94
  323. package/es/ScreenPlayer/demo.d.ts +0 -2
  324. package/es/ScreenPlayer/demo.js +0 -24
  325. package/es/ScreenPlayer/demo2.d.ts +0 -2
  326. package/es/ScreenPlayer/demo2.js +0 -200
  327. package/es/ScreenPlayer/index.d.ts +0 -6
  328. package/es/ScreenPlayer/index.js +0 -9
  329. package/es/ScreenPlayer/index.less +0 -335
  330. package/es/ScreenPlayer/interface.d.ts +0 -216
  331. package/es/ScreenPlayer/useTimeSlider.d.ts +0 -25
  332. package/es/ScreenPlayer/useTimeSlider.js +0 -450
  333. package/es/ScreenPlayer/useVideoFit.d.ts +0 -5
  334. package/es/ScreenPlayer/useVideoFit.js +0 -35
  335. package/es/ScreenPlayer/utils.d.ts +0 -17
  336. package/es/ScreenPlayer/utils.js +0 -85
  337. package/es/SegmentPlayer/index.d.ts +0 -2
  338. package/es/SegmentPlayer/index.js +0 -2
  339. package/es/Service/http.d.ts +0 -6
  340. package/es/Service/http.js +0 -125
  341. package/es/Service/index.d.ts +0 -3
  342. package/es/Service/index.js +0 -10
  343. package/es/Service/interface.d.ts +0 -22
  344. package/es/Service/middleware.d.ts +0 -5
  345. package/es/Service/middleware.js +0 -15
  346. package/es/SocketEmitter/eventEmitter.d.ts +0 -27
  347. package/es/SocketEmitter/eventEmitter.js +0 -88
  348. package/es/SocketEmitter/index.d.ts +0 -24
  349. package/es/SocketEmitter/index.js +0 -125
  350. package/es/SocketEmitter/interface.d.ts +0 -4
  351. package/es/TableLayout/index.d.ts +0 -10
  352. package/es/TableLayout/index.js +0 -29
  353. package/es/TableLayout/index.less +0 -4
  354. package/es/ThemeAntd/demo.d.ts +0 -4
  355. package/es/ThemeAntd/demo.js +0 -129
  356. package/es/ThemeAntd/demo.less +0 -20
  357. package/es/ThemeAntd/index.d.ts +0 -7
  358. package/es/ThemeAntd/index.js +0 -23
  359. package/es/ThemeAntd/index.less +0 -4
  360. package/es/Timeout/index.d.ts +0 -32
  361. package/es/Timeout/index.js +0 -70
  362. package/es/VList/index.d.ts +0 -11
  363. package/es/VList/index.js +0 -42
  364. package/es/VList/index.less +0 -6
  365. package/es/VList/utils.d.ts +0 -14
  366. package/es/VList/utils.js +0 -17
  367. package/es/bigNumberTransformCN/index.d.ts +0 -5
  368. package/es/bigNumberTransformCN/index.js +0 -60
  369. package/es/cache/index.d.ts +0 -34
  370. package/es/cache/index.js +0 -94
  371. package/es/copy/index.d.ts +0 -1
  372. package/es/copy/index.js +0 -9
  373. package/es/core.d.ts +0 -0
  374. package/es/getThemeStyle/index.d.ts +0 -2
  375. package/es/getThemeStyle/index.js +0 -5
  376. package/es/index.d.ts +0 -60
  377. package/es/index.js +0 -60
  378. package/es/logger/index.d.ts +0 -7
  379. package/es/logger/index.js +0 -30
  380. package/es/nextTick/index.d.ts +0 -1
  381. package/es/nextTick/index.js +0 -7
  382. package/es/submidstr/index.d.ts +0 -5
  383. package/es/submidstr/index.js +0 -14
  384. package/es/treeHelper/index.d.ts +0 -11
  385. package/es/treeHelper/index.js +0 -189
  386. package/es/typings.d.ts +0 -2
  387. package/es/useDrawROI/index.d.ts +0 -16
  388. package/es/useDrawROI/index.js +0 -322
  389. package/es/useEventEmitterHandle/index.d.ts +0 -2
  390. package/es/useEventEmitterHandle/index.js +0 -17
  391. package/es/useFullscreen/demo.d.ts +0 -2
  392. package/es/useFullscreen/demo.js +0 -48
  393. package/es/useFullscreen/index.d.ts +0 -12
  394. package/es/useFullscreen/index.js +0 -76
  395. package/es/useHistory/index.d.ts +0 -3
  396. package/es/useHistory/index.js +0 -9
  397. package/es/useHistory/interface.d.ts +0 -3
  398. package/es/useInfiniteScroll/index.d.ts +0 -16
  399. package/es/useInfiniteScroll/index.js +0 -101
  400. package/es/useRafInterval/index.d.ts +0 -5
  401. package/es/useRafInterval/index.js +0 -70
  402. package/es/useSimpleState/index.d.ts +0 -3
  403. package/es/useSimpleState/index.js +0 -36
  404. package/es/useVirtualList/index.d.ts +0 -13
  405. package/es/useVirtualList/index.js +0 -139
  406. package/es/utils.d.ts +0 -14
  407. package/es/utils.js +0 -75
  408. package/es/uuid/index.d.ts +0 -4
  409. package/es/uuid/index.js +0 -15
@@ -1,133 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- 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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- 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); }
7
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
- 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."); }
9
- 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); }
10
- 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; }
11
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- /* eslint-disable @typescript-eslint/no-unused-expressions */
14
- import React, { useCallback, useMemo, useRef, useState } from 'react';
15
- import uuid from "../uuid";
16
- function DragAndDropItem(_ref) {
17
- var children = _ref.children,
18
- dragData = _ref.dragData,
19
- dragId = _ref.dragId,
20
- style = _ref.style,
21
- onDropEnd = _ref.onDropEnd,
22
- _ref$disabledCopyElem = _ref.disabledCopyElement,
23
- disabledCopyElement = _ref$disabledCopyElem === void 0 ? true : _ref$disabledCopyElem;
24
- var id = useMemo(function () {
25
- return dragId || "dragId-".concat(uuid());
26
- }, [dragId]);
27
- var _useState = useState(['', '']),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- status = _useState2[0],
30
- setStatus = _useState2[1];
31
- var _useState3 = useState([0, 0]),
32
- _useState4 = _slicedToArray(_useState3, 2),
33
- offset = _useState4[0],
34
- setOffset = _useState4[1];
35
- var domRef = useRef(null);
36
- var dragDomTemp = useRef(null);
37
- var onDrop = useCallback(function (event) {
38
- event.stopPropagation();
39
- setStatus(function (old) {
40
- return [old[0], 'droped'];
41
- });
42
- var data = JSON.parse(event.dataTransfer.getData('DATA'));
43
- onDropEnd && onDropEnd(data);
44
- }, [onDropEnd]);
45
- var onDragEnter = useCallback(function (event) {
46
- event.stopPropagation();
47
- setStatus(function (old) {
48
- return [old[0], 'dragenter'];
49
- });
50
- }, []);
51
- var onDragLeave = useCallback(function (event) {
52
- event.stopPropagation();
53
- setStatus(function (old) {
54
- return [old[0], 'dragleave'];
55
- });
56
- }, []);
57
- var allowDrop = useCallback(function (event) {
58
- return event.preventDefault();
59
- }, []);
60
- var onDragStart = useCallback(function (event) {
61
- if (!domRef.current) {
62
- return;
63
- }
64
- if (!disabledCopyElement) {
65
- var pageX = event.pageX,
66
- pageY = event.pageY;
67
- var _domRef$current$getBo = domRef.current.getBoundingClientRect(),
68
- x = _domRef$current$getBo.x,
69
- y = _domRef$current$getBo.y,
70
- width = _domRef$current$getBo.width,
71
- height = _domRef$current$getBo.height;
72
- var offsetX = pageX - x;
73
- var offsetY = pageY - y;
74
- dragDomTemp.current = domRef.current.cloneNode(true);
75
- domRef.current.after(dragDomTemp.current);
76
- //初始化缓存dom位置
77
- dragDomTemp.current.style.position = 'fixed';
78
- dragDomTemp.current.style.left = "".concat(event.pageX - offsetX, "px");
79
- dragDomTemp.current.style.top = "".concat(event.pageY - offsetY, "px");
80
- dragDomTemp.current.style.draggable = false;
81
- dragDomTemp.current.style.pointerEvents = 'none';
82
- dragDomTemp.current.style.opacity = 0.5;
83
- dragDomTemp.current.style.zIndex = 99;
84
- dragDomTemp.current.style.width = "".concat(width, "px");
85
- dragDomTemp.current.style.height = "".concat(height, "px");
86
- setOffset([offsetX, offsetY]);
87
- event.dataTransfer.setDragImage(new Image(), 0, 0);
88
- }
89
- setStatus(function (old) {
90
- return ['draging', old[1]];
91
- });
92
- var res = {
93
- data: dragData,
94
- _id: id
95
- };
96
- event.dataTransfer.setData('DATA', JSON.stringify(res));
97
- }, [disabledCopyElement, dragData, id]);
98
- var onDragEnd = useCallback(function () {
99
- dragDomTemp.current && dragDomTemp.current.remove();
100
- setStatus(function (old) {
101
- return ['dragEnd', old[1]];
102
- });
103
- }, []);
104
- var onDrag = useCallback(function (e) {
105
- if (dragDomTemp.current) {
106
- if (e.pageX === 0 && e.pageY === 0) {
107
- return;
108
- }
109
- if (e.pageX < offset[2] || e.pageY < offset[3]) {
110
- return;
111
- }
112
- dragDomTemp.current.style.position = 'fixed';
113
- dragDomTemp.current.style.left = "".concat(e.pageX - offset[0], "px");
114
- dragDomTemp.current.style.top = "".concat(e.pageY - offset[1], "px");
115
- }
116
- }, [offset]);
117
- return /*#__PURE__*/React.cloneElement(children, {
118
- ref: domRef,
119
- onDragStart: onDragStart,
120
- onDrag: onDrag,
121
- 'data-dragId': id,
122
- draggable: true,
123
- onDragEnd: onDragEnd,
124
- onDrop: onDrop,
125
- onDragOver: allowDrop,
126
- onDragEnter: onDragEnter,
127
- onDragLeave: onDragLeave,
128
- style: _objectSpread(_objectSpread({}, style), {}, {
129
- opacity: status[0] === 'draging' || status[1] === 'dragenter' ? 0.5 : 1
130
- })
131
- });
132
- }
133
- export default DragAndDropItem;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { IDropItemProps } from './interface';
3
- declare function DropItem<T>({ children, style, onDropEnd }: IDropItemProps<T>): React.FunctionComponentElement<any>;
4
- export default DropItem;
@@ -1,50 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- 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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- 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); }
7
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
- 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."); }
9
- 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); }
10
- 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; }
11
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- /* eslint-disable @typescript-eslint/no-unused-expressions */
14
- import React, { useCallback, useRef, useState } from 'react';
15
- function DropItem(_ref) {
16
- var children = _ref.children,
17
- style = _ref.style,
18
- onDropEnd = _ref.onDropEnd;
19
- var _useState = useState(''),
20
- _useState2 = _slicedToArray(_useState, 2),
21
- status = _useState2[0],
22
- setStatus = _useState2[1];
23
- var domRef = useRef(null);
24
- var onDrop = useCallback(function (event) {
25
- event.stopPropagation();
26
- setStatus('droped');
27
- var data = JSON.parse(event.dataTransfer.getData('DATA'));
28
- onDropEnd && onDropEnd(data);
29
- }, [onDropEnd]);
30
- var onDragEnter = useCallback(function (event) {
31
- event.stopPropagation();
32
- setStatus('dragenter');
33
- }, []);
34
- var onDragLeave = useCallback(function (event) {
35
- event.stopPropagation();
36
- setStatus('dragleave');
37
- }, []);
38
- var allowDrop = useCallback(function (event) {
39
- return event.preventDefault();
40
- }, []);
41
- return /*#__PURE__*/React.cloneElement(children, {
42
- ref: domRef,
43
- onDrop: onDrop,
44
- onDragOver: allowDrop,
45
- onDragEnter: onDragEnter,
46
- onDragLeave: onDragLeave,
47
- style: status === 'dragenter' ? _objectSpread({}, style) : undefined
48
- });
49
- }
50
- export default DropItem;
@@ -1,7 +0,0 @@
1
- import DragAndDropItem from './DragAndDropItem';
2
- import DropItem from './DropItem';
3
- declare const Drag: {
4
- DragAndDropItem: typeof DragAndDropItem;
5
- DropItem: typeof DropItem;
6
- };
7
- export default Drag;
package/es/Drag/index.js DELETED
@@ -1,7 +0,0 @@
1
- import DragAndDropItem from "./DragAndDropItem";
2
- import DropItem from "./DropItem";
3
- var Drag = {
4
- DragAndDropItem: DragAndDropItem,
5
- DropItem: DropItem
6
- };
7
- export default Drag;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
-
3
- export interface IDragAndDropItemProps<T> {
4
- children: JSX.Element;
5
- dragData: T;
6
- dragId?: string;
7
- style?: React.CSSProperties;
8
- onDropEnd: (params: { data: T; _id: string }) => void;
9
- disabledCopyElement?: boolean;
10
- }
11
-
12
- export interface IDropItemProps<T> {
13
- children: JSX.Element;
14
- style?: React.CSSProperties;
15
- onDropEnd: (params: { data: T; _id?: string }) => void;
16
- }
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const App: () => JSX.Element;
3
- export default App;
@@ -1,86 +0,0 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
- 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."); }
3
- 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); }
4
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- 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; }
7
- /* eslint-disable @typescript-eslint/no-unused-expressions */
8
- import React from 'react';
9
- import GridList from "./index";
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
- function random(low, high) {
13
- return Math.floor(Math.random() * high) + low;
14
- }
15
- var IMAGES = function IMAGES() {
16
- return Array.from({
17
- length: 20
18
- }, function (_, index) {
19
- var width = 300;
20
- var height = random(200, 300);
21
- return {
22
- url: "https://picsum.photos/id/".concat(index + 1, "/").concat(width, "/").concat(height, ".jpg"),
23
- width: width,
24
- height: height
25
- };
26
- });
27
- };
28
- function loadPage(d) {
29
- if (!d) {
30
- // eslint-disable-next-line no-param-reassign
31
- d = {};
32
- }
33
- var resultData = IMAGES();
34
- d.page ? d.page++ : d.page = 1;
35
- d.list ? d.list = [].concat(_toConsumableArray(d.list), _toConsumableArray(resultData)) : d.list = resultData;
36
- return new Promise(function (resolve) {
37
- console.log(d.page);
38
- setTimeout(function () {
39
- return resolve(d);
40
- }, 10);
41
- });
42
- }
43
- var App = function App() {
44
- return /*#__PURE__*/_jsx("div", {
45
- style: {
46
- height: 400
47
- },
48
- children: /*#__PURE__*/_jsx(GridList, {
49
- itemKey: "url",
50
- itemHeight: 400,
51
- itemWidth: 250,
52
- renderItem: function renderItem(image) {
53
- return /*#__PURE__*/_jsxs("div", {
54
- style: {
55
- border: '1px solid gray',
56
- height: '100%',
57
- display: 'flex',
58
- flexDirection: 'column'
59
- },
60
- children: [/*#__PURE__*/_jsx("div", {
61
- style: {
62
- flex: 1,
63
- overflow: 'hidden'
64
- },
65
- children: /*#__PURE__*/_jsx("img", {
66
- src: image.url,
67
- alt: "",
68
- style: {
69
- objectFit: 'cover',
70
- display: 'block',
71
- width: '100%',
72
- height: '100%'
73
- }
74
- })
75
- }), /*#__PURE__*/_jsx("p", {
76
- children: "\u6807\u9898"
77
- }), /*#__PURE__*/_jsx("p", {
78
- children: "\u63CF\u8FF0"
79
- })]
80
- });
81
- },
82
- loadPage: loadPage
83
- })
84
- });
85
- };
86
- export default App;
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import { GridListCell } from '../GridList/interface';
3
- import { TData } from '../useInfiniteScroll';
4
- export interface IDynamicGridListProps<T> {
5
- itemHeight?: number;
6
- className?: string;
7
- /**
8
- * 重载条件
9
- */
10
- reloadDeps?: any[];
11
- /**
12
- * render列表
13
- * @param options
14
- */
15
- renderItem: (item: T, cell: GridListCell<T>) => React.ReactNode;
16
- loadPage(d?: TData<T>): Promise<TData<T>>;
17
- itemWidth?: number;
18
- itemKey: string;
19
- getGridGap?: (...args: any) => number;
20
- isNoMore?: (data?: TData<T>) => boolean;
21
- threshold?: number;
22
- }
23
- declare function DynamicGridList<T>({ renderItem, itemHeight, itemKey, itemWidth, reloadDeps, getGridGap, loadPage, isNoMore, threshold, ...props }: IDynamicGridListProps<T>): JSX.Element;
24
- declare namespace DynamicGridList {
25
- var defaultProps: any;
26
- }
27
- export default DynamicGridList;
@@ -1,71 +0,0 @@
1
- import _useUpdateEffect from "ahooks/es/useUpdateEffect";
2
- var _excluded = ["renderItem", "itemHeight", "itemKey", "itemWidth", "reloadDeps", "getGridGap", "loadPage", "isNoMore", "threshold"];
3
- 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; }
4
- 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; }
5
- import React, { useMemo, useRef } from 'react';
6
- import GridList from "../GridList";
7
- import useInfiniteScroll from "../useInfiniteScroll";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- function DynamicGridList(_ref) {
10
- var renderItem = _ref.renderItem,
11
- itemHeight = _ref.itemHeight,
12
- itemKey = _ref.itemKey,
13
- itemWidth = _ref.itemWidth,
14
- reloadDeps = _ref.reloadDeps,
15
- getGridGap = _ref.getGridGap,
16
- loadPage = _ref.loadPage,
17
- isNoMore = _ref.isNoMore,
18
- threshold = _ref.threshold,
19
- props = _objectWithoutProperties(_ref, _excluded);
20
- var containerRef = useRef(null);
21
- var _useInfiniteScroll = useInfiniteScroll(loadPage, {
22
- target: containerRef,
23
- threshold: threshold,
24
- isNoMore: isNoMore,
25
- reloadDeps: reloadDeps
26
- }),
27
- data = _useInfiniteScroll.data,
28
- noMore = _useInfiniteScroll.noMore;
29
- _useUpdateEffect(function () {
30
- if (noMore) {
31
- console.warn('数据已全部加载完成');
32
- }
33
- }, [noMore]);
34
- function getItemData(data) {
35
- return {
36
- key: data[itemKey],
37
- height: itemHeight,
38
- width: itemWidth
39
- };
40
- }
41
- function getColumnCount(elementWidth, gridGap) {
42
- return Math.floor((elementWidth + gridGap) / ((itemWidth !== null && itemWidth !== void 0 ? itemWidth : 0) + gridGap));
43
- }
44
- function getWindowMargin(windowHeight) {
45
- return Math.round(windowHeight * 1.5);
46
- }
47
- var dataList = useMemo(function () {
48
- return data ? data.list || [] : [];
49
- }, [data]);
50
- return /*#__PURE__*/_jsx(GridList, {
51
- className: "cloudapp-dynamic-grid-list ".concat(props.className),
52
- items: dataList,
53
- ref: containerRef,
54
- getItemData: getItemData,
55
- getColumnCount: getColumnCount,
56
- getWindowMargin: getWindowMargin,
57
- renderItem: renderItem,
58
- getGridGap: getGridGap
59
- });
60
- }
61
- DynamicGridList.defaultProps = {
62
- reloadDeps: [],
63
- className: '',
64
- getGridGap: function getGridGap() {
65
- return 20;
66
- },
67
- itemHeight: 300,
68
- itemWidth: 250,
69
- threshold: 50
70
- };
71
- export default DynamicGridList;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function (): JSX.Element;
@@ -1,50 +0,0 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
- 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."); }
3
- 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); }
4
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- 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; }
7
- /* eslint-disable @typescript-eslint/no-unused-expressions */
8
- import { ConfigProvider } from 'antd';
9
- import React from 'react';
10
- import DynamicList from "./index";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- var resultData = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13'];
13
- function loadPage(d) {
14
- if (!d) {
15
- // eslint-disable-next-line no-param-reassign
16
- d = {};
17
- }
18
- d.page ? d.page++ : d.page = 1;
19
- d.list ? d.list = [].concat(_toConsumableArray(d.list), resultData) : d.list = resultData;
20
- return new Promise(function (resolve) {
21
- setTimeout(function () {
22
- resolve(d);
23
- }, 2000);
24
- });
25
- }
26
- export default function () {
27
- return /*#__PURE__*/_jsx(ConfigProvider, {
28
- prefixCls: "cloudapp",
29
- children: /*#__PURE__*/_jsx("div", {
30
- style: {
31
- display: 'flex'
32
- },
33
- children: /*#__PURE__*/_jsx("div", {
34
- style: {
35
- height: 400,
36
- width: 300
37
- },
38
- children: /*#__PURE__*/_jsx(DynamicList, {
39
- loadPage: loadPage,
40
- itemHeight: 40,
41
- renderItem: function renderItem(item) {
42
- return /*#__PURE__*/_jsx("div", {
43
- children: item.data
44
- });
45
- }
46
- })
47
- })
48
- })
49
- });
50
- }
@@ -1,31 +0,0 @@
1
- /// <reference types="react" />
2
- import type { TData } from '../useInfiniteScroll';
3
- import './index.less';
4
- export interface IDynamicListProps<T> {
5
- itemHeight?: number;
6
- itemClassName?: string;
7
- /**
8
- * 重载条件
9
- */
10
- reloadDeps?: any[];
11
- /**
12
- * render列表
13
- * @param options
14
- */
15
- renderItem(options: {
16
- index: number;
17
- data: T;
18
- }): JSX.Element;
19
- loadPage(d?: TData<T>): Promise<TData<T>>;
20
- }
21
- declare function DynamicList<T>({ renderItem, itemHeight, itemClassName, reloadDeps, loadPage }: IDynamicListProps<T>): JSX.Element;
22
- declare namespace DynamicList {
23
- var defaultProps: {
24
- limit: number;
25
- itemHeight: number;
26
- params: {};
27
- itemKey: string;
28
- itemClassName: string;
29
- };
30
- }
31
- export default DynamicList;
@@ -1,96 +0,0 @@
1
- import _useUpdateEffect from "ahooks/es/useUpdateEffect";
2
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
- 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."); }
4
- 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); }
5
- 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; }
6
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- import { Skeleton } from 'antd';
9
- import React, { useMemo, useRef } from 'react';
10
- import useInfiniteScroll from "../useInfiniteScroll";
11
- import useVirtualList from "../useVirtualList";
12
- import { LIMIT, skeletonList } from "./utils";
13
-
14
- //style
15
- import "./index.less";
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
- function DynamicList(_ref) {
19
- var renderItem = _ref.renderItem,
20
- itemHeight = _ref.itemHeight,
21
- itemClassName = _ref.itemClassName,
22
- reloadDeps = _ref.reloadDeps,
23
- loadPage = _ref.loadPage;
24
- var containerRef = useRef(null);
25
- var wrapperRef = useRef(null);
26
- var _useInfiniteScroll = useInfiniteScroll(loadPage, {
27
- target: containerRef,
28
- threshold: 50,
29
- isNoMore: function isNoMore(d) {
30
- var _d$list$length, _d$list;
31
- return ((_d$list$length = d === null || d === void 0 ? void 0 : (_d$list = d.list) === null || _d$list === void 0 ? void 0 : _d$list.length) !== null && _d$list$length !== void 0 ? _d$list$length : 0) >= (d === null || d === void 0 ? void 0 : d.count);
32
- },
33
- reloadDeps: reloadDeps
34
- }),
35
- data = _useInfiniteScroll.data,
36
- loading = _useInfiniteScroll.loading,
37
- noMore = _useInfiniteScroll.noMore;
38
- var isSkeleton = useMemo(function () {
39
- return !noMore && loading;
40
- }, [noMore, loading]);
41
- var dataList = useMemo(function () {
42
- return data ? data.list || [] : [];
43
- }, [data]);
44
- var _useVirtualList = useVirtualList(dataList, {
45
- containerTarget: containerRef,
46
- wrapperTarget: wrapperRef,
47
- itemHeight: itemHeight,
48
- overscan: 10
49
- }),
50
- _useVirtualList2 = _slicedToArray(_useVirtualList, 2),
51
- list = _useVirtualList2[0],
52
- scrollTo = _useVirtualList2[1];
53
- _useUpdateEffect(function () {
54
- return scrollTo(0);
55
- }, reloadDeps ? reloadDeps : []);
56
- return /*#__PURE__*/_jsx("div", {
57
- className: "l-c-dynamic-list-layout",
58
- children: /*#__PURE__*/_jsxs("div", {
59
- className: "l-c-dynamic-box",
60
- ref: containerRef,
61
- children: [/*#__PURE__*/_jsx("div", {
62
- ref: wrapperRef,
63
- children: list.map(function (item) {
64
- return /*#__PURE__*/_jsx("div", {
65
- style: {
66
- height: itemHeight
67
- },
68
- className: itemClassName,
69
- children: renderItem(item)
70
- }, item.index);
71
- })
72
- }), isSkeleton && skeletonList.map(function (_, index) {
73
- return /*#__PURE__*/_jsx("div", {
74
- style: {
75
- padding: '0 10px',
76
- height: itemHeight
77
- },
78
- className: itemClassName,
79
- children: /*#__PURE__*/_jsx(Skeleton, {
80
- paragraph: false,
81
- loading: true,
82
- active: true
83
- })
84
- }, index);
85
- })]
86
- })
87
- });
88
- }
89
- DynamicList.defaultProps = {
90
- limit: LIMIT,
91
- itemHeight: 40,
92
- params: {},
93
- itemKey: 'id',
94
- itemClassName: ''
95
- };
96
- export default DynamicList;
@@ -1,17 +0,0 @@
1
- .l-c-dynamic-list-layout {
2
- display: flex;
3
- flex-direction: column;
4
- width: 100%;
5
- height: 100%;
6
- border: 1px solid var(--gray2);
7
-
8
- .dynamic-list-item {
9
- padding: 0 10px;
10
- }
11
-
12
- .l-c-dynamic-box {
13
- flex: 1;
14
- overflow: auto;
15
- contain: strict;
16
- }
17
- }
@@ -1,19 +0,0 @@
1
- import type { TData } from '../../useInfiniteScroll';
2
- export interface IDynamicListProps<T> {
3
- itemHeight?: number;
4
-
5
- itemClassName?: string;
6
-
7
- /**
8
- * 重载条件
9
- */
10
- reloadDeps?: any[];
11
-
12
- /**
13
- * render列表
14
- * @param options
15
- */
16
- renderItem(options: { index: number; data: T }): JSX.Element;
17
-
18
- loadPage(d: TData<T>): Promise<TData<T>>;
19
- }
@@ -1,4 +0,0 @@
1
- export declare const LIMIT = 10;
2
- export declare const skeletonList: {
3
- skeleton: boolean;
4
- }[];
@@ -1,6 +0,0 @@
1
- export var LIMIT = 10;
2
- export var skeletonList = Array.from(new Array(LIMIT)).map(function () {
3
- return {
4
- skeleton: true
5
- };
6
- });