@cloudbase/weda-ui 2.0.28 → 3.1.0

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 (411) hide show
  1. package/package.json +12 -13
  2. package/src/configs/actions/showModal.json +0 -48
  3. package/src/configs/actions/showToast.json +0 -41
  4. package/src/configs/components/auth.json +0 -16
  5. package/src/configs/components/button.json +0 -239
  6. package/src/configs/components/calendar.json +0 -81
  7. package/src/configs/components/carousel.json +0 -292
  8. package/src/configs/components/chart/bar.json +0 -721
  9. package/src/configs/components/chart/line.json +0 -674
  10. package/src/configs/components/chart/pie.json +0 -494
  11. package/src/configs/components/chart/statisticsCard.json +0 -376
  12. package/src/configs/components/container.json +0 -50
  13. package/src/configs/components/dataView.json +0 -151
  14. package/src/configs/components/drawer.json +0 -115
  15. package/src/configs/components/form/checkbox.json +0 -173
  16. package/src/configs/components/form/form.json +0 -45
  17. package/src/configs/components/form/input.json +0 -154
  18. package/src/configs/components/form/label.json +0 -22
  19. package/src/configs/components/form/location.json +0 -155
  20. package/src/configs/components/form/radio.json +0 -203
  21. package/src/configs/components/form/richText.json +0 -125
  22. package/src/configs/components/form/select.json +0 -411
  23. package/src/configs/components/form/switch.json +0 -58
  24. package/src/configs/components/form/textarea.json +0 -116
  25. package/src/configs/components/form/tips.json +0 -34
  26. package/src/configs/components/form/uploader.json +0 -169
  27. package/src/configs/components/form/uploaderFile.json +0 -158
  28. package/src/configs/components/graphicCard.json +0 -413
  29. package/src/configs/components/image.json +0 -179
  30. package/src/configs/components/link.json +0 -79
  31. package/src/configs/components/listView.json +0 -281
  32. package/src/configs/components/lottery.json +0 -157
  33. package/src/configs/components/modal.json +0 -83
  34. package/src/configs/components/navLayout.json +0 -368
  35. package/src/configs/components/navigationBar.json +0 -62
  36. package/src/configs/components/picker/datePicker.json +0 -33
  37. package/src/configs/components/picker/picker.json +0 -18
  38. package/src/configs/components/picker/timePicker.json +0 -23
  39. package/src/configs/components/richtextview.json +0 -26
  40. package/src/configs/components/scrollVeiw.json +0 -253
  41. package/src/configs/components/slot.json +0 -17
  42. package/src/configs/components/swiper.json +0 -90
  43. package/src/configs/components/tabs.json +0 -121
  44. package/src/configs/components/text.json +0 -95
  45. package/src/configs/components/wedaVideo.json +0 -89
  46. package/src/configs/components/wxOpenApi/phone.json +0 -127
  47. package/src/configs/components/wxOpenApi/phoneCode.json +0 -109
  48. package/src/configs/components/wxOpenApi/share.json +0 -157
  49. package/src/configs/components/wxOpenApi/userInfo.json +0 -156
  50. package/src/configs/index.js +0 -111
  51. package/src/index.js +0 -4
  52. package/src/mp/README.md +0 -1
  53. package/src/mp/actions/showModal/index.js +0 -3
  54. package/src/mp/actions/showToast/index.js +0 -3
  55. package/src/mp/components/button/index.js +0 -91
  56. package/src/mp/components/button/index.json +0 -4
  57. package/src/mp/components/button/index.wxml +0 -22
  58. package/src/mp/components/button/index.wxss +0 -13
  59. package/src/mp/components/calendar/arrowright--line.svg +0 -11
  60. package/src/mp/components/calendar/index.js +0 -268
  61. package/src/mp/components/calendar/index.json +0 -5
  62. package/src/mp/components/calendar/index.wxml +0 -35
  63. package/src/mp/components/calendar/index.wxss +0 -179
  64. package/src/mp/components/carousel/index.js +0 -88
  65. package/src/mp/components/carousel/index.json +0 -7
  66. package/src/mp/components/carousel/index.wxml +0 -6
  67. package/src/mp/components/chart/bar/index.js +0 -257
  68. package/src/mp/components/chart/bar/index.json +0 -6
  69. package/src/mp/components/chart/bar/index.wxml +0 -3
  70. package/src/mp/components/chart/bar/index.wxss +0 -9
  71. package/src/mp/components/chart/common/config/bar.js +0 -50
  72. package/src/mp/components/chart/common/config/global.js +0 -16
  73. package/src/mp/components/chart/common/config/line.js +0 -48
  74. package/src/mp/components/chart/common/config/pie.js +0 -36
  75. package/src/mp/components/chart/common/core/eChartBar.js +0 -258
  76. package/src/mp/components/chart/common/core/eChartBase.js +0 -389
  77. package/src/mp/components/chart/common/core/eChartLine.js +0 -223
  78. package/src/mp/components/chart/common/core/eChartPie.js +0 -169
  79. package/src/mp/components/chart/common/lib/echarts.min.js +0 -18
  80. package/src/mp/components/chart/ec-canvas/ec-canvas.js +0 -277
  81. package/src/mp/components/chart/ec-canvas/ec-canvas.json +0 -4
  82. package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +0 -4
  83. package/src/mp/components/chart/ec-canvas/ec-canvas.wxss +0 -4
  84. package/src/mp/components/chart/ec-canvas/wx-canvas.js +0 -109
  85. package/src/mp/components/chart/line/index.js +0 -247
  86. package/src/mp/components/chart/line/index.json +0 -6
  87. package/src/mp/components/chart/line/index.wxml +0 -3
  88. package/src/mp/components/chart/line/index.wxss +0 -9
  89. package/src/mp/components/chart/pie/index.js +0 -182
  90. package/src/mp/components/chart/pie/index.json +0 -6
  91. package/src/mp/components/chart/pie/index.wxml +0 -3
  92. package/src/mp/components/chart/pie/index.wxss +0 -9
  93. package/src/mp/components/chart/statisticsCard/index.js +0 -253
  94. package/src/mp/components/chart/statisticsCard/index.json +0 -4
  95. package/src/mp/components/chart/statisticsCard/index.wxml +0 -9
  96. package/src/mp/components/chart/statisticsCard/index.wxss +0 -42
  97. package/src/mp/components/container/index.js +0 -20
  98. package/src/mp/components/container/index.json +0 -4
  99. package/src/mp/components/container/index.wxml +0 -3
  100. package/src/mp/components/dataView/index.js +0 -34
  101. package/src/mp/components/dataView/index.json +0 -7
  102. package/src/mp/components/dataView/index.wxml +0 -3
  103. package/src/mp/components/dataView/index.wxss +0 -0
  104. package/src/mp/components/form/checkbox/index.js +0 -124
  105. package/src/mp/components/form/checkbox/index.json +0 -7
  106. package/src/mp/components/form/checkbox/index.wxml +0 -13
  107. package/src/mp/components/form/checkbox/index.wxss +0 -1
  108. package/src/mp/components/form/form/index.js +0 -18
  109. package/src/mp/components/form/form/index.json +0 -4
  110. package/src/mp/components/form/form/index.wxml +0 -5
  111. package/src/mp/components/form/form/index.wxss +0 -1
  112. package/src/mp/components/form/formcell/index.js +0 -54
  113. package/src/mp/components/form/formcell/index.json +0 -4
  114. package/src/mp/components/form/formcell/index.wxml +0 -11
  115. package/src/mp/components/form/formcell/index.wxss +0 -31
  116. package/src/mp/components/form/input/index.js +0 -110
  117. package/src/mp/components/form/input/index.json +0 -7
  118. package/src/mp/components/form/input/index.wxml +0 -24
  119. package/src/mp/components/form/input/index.wxss +0 -22
  120. package/src/mp/components/form/location/components/mapChoose/index.js +0 -201
  121. package/src/mp/components/form/location/components/mapChoose/index.json +0 -4
  122. package/src/mp/components/form/location/components/mapChoose/index.wxml +0 -42
  123. package/src/mp/components/form/location/components/mapChoose/index.wxss +0 -188
  124. package/src/mp/components/form/location/index.js +0 -388
  125. package/src/mp/components/form/location/index.json +0 -6
  126. package/src/mp/components/form/location/index.wxml +0 -21
  127. package/src/mp/components/form/location/index.wxss +0 -89
  128. package/src/mp/components/form/radio/index.js +0 -124
  129. package/src/mp/components/form/radio/index.json +0 -7
  130. package/src/mp/components/form/radio/index.wxml +0 -13
  131. package/src/mp/components/form/radio/index.wxss +0 -1
  132. package/src/mp/components/form/select/index.js +0 -677
  133. package/src/mp/components/form/select/index.json +0 -7
  134. package/src/mp/components/form/select/index.wxml +0 -12
  135. package/src/mp/components/form/select/index.wxss +0 -16
  136. package/src/mp/components/form/select/region/index.js +0 -107
  137. package/src/mp/components/form/switch/index.js +0 -75
  138. package/src/mp/components/form/switch/index.json +0 -7
  139. package/src/mp/components/form/switch/index.wxml +0 -11
  140. package/src/mp/components/form/switch/index.wxss +0 -1
  141. package/src/mp/components/form/textarea/index.js +0 -90
  142. package/src/mp/components/form/textarea/index.json +0 -7
  143. package/src/mp/components/form/textarea/index.wxml +0 -8
  144. package/src/mp/components/form/textarea/index.wxss +0 -10
  145. package/src/mp/components/form/tips/index.js +0 -41
  146. package/src/mp/components/form/tips/index.json +0 -4
  147. package/src/mp/components/form/tips/index.wxml +0 -1
  148. package/src/mp/components/form/tips/index.wxss +0 -1
  149. package/src/mp/components/form/uploader/index.js +0 -158
  150. package/src/mp/components/form/uploader/index.json +0 -10
  151. package/src/mp/components/form/uploader/index.wxml +0 -14
  152. package/src/mp/components/form/uploader/index.wxss +0 -36
  153. package/src/mp/components/form/uploader/weui-uploader.js +0 -219
  154. package/src/mp/components/form/uploader/weui-uploader.json +0 -7
  155. package/src/mp/components/form/uploader/weui-uploader.wxml +0 -45
  156. package/src/mp/components/form/uploader/weui-uploader.wxss +0 -1
  157. package/src/mp/components/form/uploaderFile/index.js +0 -313
  158. package/src/mp/components/form/uploaderFile/index.json +0 -9
  159. package/src/mp/components/form/uploaderFile/index.wxml +0 -45
  160. package/src/mp/components/form/uploaderFile/index.wxss +0 -105
  161. package/src/mp/components/graphicCard/chevron-right.svg +0 -3
  162. package/src/mp/components/graphicCard/index.js +0 -203
  163. package/src/mp/components/graphicCard/index.json +0 -4
  164. package/src/mp/components/graphicCard/index.wxml +0 -25
  165. package/src/mp/components/graphicCard/index.wxss +0 -157
  166. package/src/mp/components/image/index.js +0 -182
  167. package/src/mp/components/image/index.json +0 -7
  168. package/src/mp/components/image/index.wxml +0 -9
  169. package/src/mp/components/image/index.wxss +0 -49
  170. package/src/mp/components/listView/arrow-right-line.svg +0 -3
  171. package/src/mp/components/listView/index.js +0 -274
  172. package/src/mp/components/listView/index.json +0 -4
  173. package/src/mp/components/listView/index.wxml +0 -38
  174. package/src/mp/components/listView/index.wxss +0 -155
  175. package/src/mp/components/listView/more-line.svg +0 -3
  176. package/src/mp/components/lottery/index.js +0 -270
  177. package/src/mp/components/lottery/index.json +0 -4
  178. package/src/mp/components/lottery/index.wxml +0 -41
  179. package/src/mp/components/lottery/index.wxss +0 -323
  180. package/src/mp/components/modal/index.js +0 -39
  181. package/src/mp/components/modal/index.json +0 -4
  182. package/src/mp/components/modal/index.wxml +0 -1
  183. package/src/mp/components/navLayout/index.js +0 -120
  184. package/src/mp/components/navLayout/index.json +0 -7
  185. package/src/mp/components/navLayout/index.wxml +0 -23
  186. package/src/mp/components/navLayout/index.wxss +0 -1193
  187. package/src/mp/components/navigationBar/index.js +0 -204
  188. package/src/mp/components/navigationBar/index.json +0 -5
  189. package/src/mp/components/navigationBar/index.wxml +0 -80
  190. package/src/mp/components/navigationBar/index.wxss +0 -1257
  191. package/src/mp/components/richText/index.js +0 -67
  192. package/src/mp/components/richText/index.json +0 -4
  193. package/src/mp/components/richText/index.wxml +0 -3
  194. package/src/mp/components/richText/index.wxss +0 -27
  195. package/src/mp/components/scrollView/index.js +0 -119
  196. package/src/mp/components/scrollView/index.json +0 -4
  197. package/src/mp/components/scrollView/index.wxml +0 -38
  198. package/src/mp/components/slot/index.js +0 -20
  199. package/src/mp/components/slot/index.json +0 -4
  200. package/src/mp/components/slot/index.wxml +0 -3
  201. package/src/mp/components/swiper/index.js +0 -65
  202. package/src/mp/components/swiper/index.json +0 -4
  203. package/src/mp/components/swiper/index.wxml +0 -3
  204. package/src/mp/components/tabs/index.js +0 -59
  205. package/src/mp/components/tabs/index.json +0 -4
  206. package/src/mp/components/tabs/index.wxml +0 -12
  207. package/src/mp/components/tabs/index.wxss +0 -57
  208. package/src/mp/components/text/index.js +0 -40
  209. package/src/mp/components/text/index.json +0 -4
  210. package/src/mp/components/text/index.wxml +0 -1
  211. package/src/mp/components/text/index.wxss +0 -26
  212. package/src/mp/components/wedaVideo/index.js +0 -86
  213. package/src/mp/components/wedaVideo/index.json +0 -4
  214. package/src/mp/components/wedaVideo/index.wxml +0 -4
  215. package/src/mp/components/wedaVideo/index.wxss +0 -20
  216. package/src/mp/components/wxOpenApi/phone/index.js +0 -109
  217. package/src/mp/components/wxOpenApi/phone/index.json +0 -4
  218. package/src/mp/components/wxOpenApi/phone/index.wxml +0 -4
  219. package/src/mp/components/wxOpenApi/phone/index.wxss +0 -22
  220. package/src/mp/components/wxOpenApi/phoneCode/index.js +0 -89
  221. package/src/mp/components/wxOpenApi/phoneCode/index.json +0 -4
  222. package/src/mp/components/wxOpenApi/phoneCode/index.wxml +0 -4
  223. package/src/mp/components/wxOpenApi/phoneCode/index.wxss +0 -22
  224. package/src/mp/components/wxOpenApi/share/index.js +0 -117
  225. package/src/mp/components/wxOpenApi/share/index.json +0 -4
  226. package/src/mp/components/wxOpenApi/share/index.wxml +0 -4
  227. package/src/mp/components/wxOpenApi/share/index.wxss +0 -22
  228. package/src/mp/components/wxOpenApi/userInfo/index.js +0 -88
  229. package/src/mp/components/wxOpenApi/userInfo/index.json +0 -4
  230. package/src/mp/components/wxOpenApi/userInfo/index.wxml +0 -4
  231. package/src/mp/components/wxOpenApi/userInfo/index.wxss +0 -22
  232. package/src/mp/index.json +0 -52
  233. package/src/mp/package.json +0 -6
  234. package/src/mp/style/weda-ui.wxss +0 -71
  235. package/src/mp/utils/classnames.js +0 -39
  236. package/src/mp/utils/constant.js +0 -20
  237. package/src/mp/utils/dayjs.min.js +0 -1
  238. package/src/mp/utils/debounce.js +0 -133
  239. package/src/mp/utils/deepEqual.js +0 -42
  240. package/src/mp/utils/destr.js +0 -49
  241. package/src/mp/utils/dr_square_point.js +0 -29
  242. package/src/mp/utils/handleEvents.js +0 -32
  243. package/src/mp/utils/lodash.js +0 -2
  244. package/src/mp/utils/platform.js +0 -45
  245. package/src/mp/utils/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js +0 -1336
  246. package/src/mp/utils/spark-md5.js +0 -776
  247. package/src/mp/utils/tcb.js +0 -90
  248. package/src/setupTests.js +0 -14
  249. package/src/web/actions/index.js +0 -2
  250. package/src/web/actions/showModal/index.tsx +0 -118
  251. package/src/web/actions/showToast/index.js +0 -3
  252. package/src/web/components/auth/index.css +0 -0
  253. package/src/web/components/auth/index.js +0 -66
  254. package/src/web/components/button/index.css +0 -27
  255. package/src/web/components/button/index.tsx +0 -119
  256. package/src/web/components/calendar/index.css +0 -416
  257. package/src/web/components/calendar/index.jsx +0 -312
  258. package/src/web/components/calendar/util.js +0 -90
  259. package/src/web/components/carousel/index.css +0 -119
  260. package/src/web/components/carousel/index.tsx +0 -417
  261. package/src/web/components/chart/bar/index.tsx +0 -140
  262. package/src/web/components/chart/common/config/bar.js +0 -49
  263. package/src/web/components/chart/common/config/global.js +0 -16
  264. package/src/web/components/chart/common/config/line.js +0 -50
  265. package/src/web/components/chart/common/config/pie.js +0 -37
  266. package/src/web/components/chart/common/core/eChartBar.js +0 -259
  267. package/src/web/components/chart/common/core/eChartBase.ts +0 -396
  268. package/src/web/components/chart/common/core/eChartLine.js +0 -225
  269. package/src/web/components/chart/common/core/eChartPie.js +0 -173
  270. package/src/web/components/chart/common/core/type.ts +0 -34
  271. package/src/web/components/chart/common/echart.css +0 -106
  272. package/src/web/components/chart/common/echarts.ts +0 -31
  273. package/src/web/components/chart/common/useChart.tsx +0 -87
  274. package/src/web/components/chart/line/index.tsx +0 -136
  275. package/src/web/components/chart/pie/index.tsx +0 -99
  276. package/src/web/components/chart/statisticsCard/index.css +0 -63
  277. package/src/web/components/chart/statisticsCard/index.tsx +0 -307
  278. package/src/web/components/chart/statisticsCard/interface.ts +0 -14
  279. package/src/web/components/container/index.tsx +0 -34
  280. package/src/web/components/dataView/index.tsx +0 -20
  281. package/src/web/components/dataView/interface.ts +0 -6
  282. package/src/web/components/drawer/index.tsx +0 -68
  283. package/src/web/components/form/checkbox/index.tsx +0 -210
  284. package/src/web/components/form/enumSelect/MultipleSelect.jsx +0 -89
  285. package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -92
  286. package/src/web/components/form/enumSelect/SelectContainer.jsx +0 -43
  287. package/src/web/components/form/enumSelect/index.jsx +0 -9
  288. package/src/web/components/form/enumSelect/props/defaultProps.js +0 -39
  289. package/src/web/components/form/enumSelect/props/propsTypes.js +0 -50
  290. package/src/web/components/form/form/index.css +0 -9
  291. package/src/web/components/form/form/index.tsx +0 -51
  292. package/src/web/components/form/formcell/index.css +0 -85
  293. package/src/web/components/form/formcell/index.tsx +0 -85
  294. package/src/web/components/form/input/index.css +0 -40
  295. package/src/web/components/form/input/index.tsx +0 -166
  296. package/src/web/components/form/location/common/mapChoose.css +0 -180
  297. package/src/web/components/form/location/common/mapChoose.jsx +0 -343
  298. package/src/web/components/form/location/common/mapView.jsx +0 -190
  299. package/src/web/components/form/location/common/propsConfig.js +0 -54
  300. package/src/web/components/form/location/common/selectModal.css +0 -44
  301. package/src/web/components/form/location/common/selectModal.jsx +0 -73
  302. package/src/web/components/form/location/common/useLocationInfo.js +0 -104
  303. package/src/web/components/form/location/components/LocationH5/index.css +0 -239
  304. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +0 -413
  305. package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -96
  306. package/src/web/components/form/location/components/LocationPC/index.css +0 -44
  307. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +0 -332
  308. package/src/web/components/form/location/constants.js +0 -4
  309. package/src/web/components/form/location/index.css +0 -0
  310. package/src/web/components/form/location/index.jsx +0 -25
  311. package/src/web/components/form/radio/index.css +0 -12
  312. package/src/web/components/form/radio/index.tsx +0 -179
  313. package/src/web/components/form/renderDecorator.tsx +0 -28
  314. package/src/web/components/form/select/h5.tsx +0 -602
  315. package/src/web/components/form/select/index.css +0 -27
  316. package/src/web/components/form/select/index.tsx +0 -510
  317. package/src/web/components/form/select/region/index.ts +0 -152
  318. package/src/web/components/form/select/time.jsx +0 -145
  319. package/src/web/components/form/select/year.tsx +0 -172
  320. package/src/web/components/form/switch/index.tsx +0 -100
  321. package/src/web/components/form/textarea/index.css +0 -11
  322. package/src/web/components/form/textarea/index.tsx +0 -127
  323. package/src/web/components/form/tips/index.css +0 -4
  324. package/src/web/components/form/tips/index.tsx +0 -34
  325. package/src/web/components/form/types.d.ts +0 -12
  326. package/src/web/components/form/uploader/index.css +0 -118
  327. package/src/web/components/form/uploader/index.tsx +0 -65
  328. package/src/web/components/form/uploader/uploader.h5.tsx +0 -290
  329. package/src/web/components/form/uploader/uploader.pc.tsx +0 -287
  330. package/src/web/components/form/uploaderFile/fail.svg +0 -12
  331. package/src/web/components/form/uploaderFile/index.css +0 -422
  332. package/src/web/components/form/uploaderFile/index.jsx +0 -25
  333. package/src/web/components/form/uploaderFile/pending.svg +0 -18
  334. package/src/web/components/form/uploaderFile/success.svg +0 -12
  335. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +0 -606
  336. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +0 -520
  337. package/src/web/components/graphicCard/index.css +0 -159
  338. package/src/web/components/graphicCard/index.tsx +0 -310
  339. package/src/web/components/image/image.tsx +0 -187
  340. package/src/web/components/image/index.css +0 -54
  341. package/src/web/components/image/index.tsx +0 -121
  342. package/src/web/components/index.js +0 -95
  343. package/src/web/components/link/index.css +0 -8
  344. package/src/web/components/link/index.tsx +0 -119
  345. package/src/web/components/listView/arrow-right-line.svg +0 -3
  346. package/src/web/components/listView/index.css +0 -143
  347. package/src/web/components/listView/index.tsx +0 -346
  348. package/src/web/components/listView/interface.ts +0 -98
  349. package/src/web/components/lottery/index.css +0 -333
  350. package/src/web/components/lottery/index.tsx +0 -567
  351. package/src/web/components/lottery/lotteryUtil.ts +0 -130
  352. package/src/web/components/modal/index.tsx +0 -60
  353. package/src/web/components/navLayout/index.css +0 -332
  354. package/src/web/components/navLayout/index.tsx +0 -247
  355. package/src/web/components/navigationBar/chevron-right--double.svg +0 -3
  356. package/src/web/components/navigationBar/common.tsx +0 -203
  357. package/src/web/components/navigationBar/h5Menu.tsx +0 -179
  358. package/src/web/components/navigationBar/horizontalMenu.tsx +0 -201
  359. package/src/web/components/navigationBar/index.css +0 -762
  360. package/src/web/components/navigationBar/index.tsx +0 -231
  361. package/src/web/components/navigationBar/type.d.ts +0 -118
  362. package/src/web/components/navigationBar/verticalMenu.tsx +0 -81
  363. package/src/web/components/phone/index.css +0 -0
  364. package/src/web/components/phone/index.tsx +0 -22
  365. package/src/web/components/phoneCode/index.css +0 -0
  366. package/src/web/components/phoneCode/index.tsx +0 -22
  367. package/src/web/components/picker/datePicker.tsx +0 -48
  368. package/src/web/components/picker/picker.tsx +0 -59
  369. package/src/web/components/picker/timePicker.tsx +0 -56
  370. package/src/web/components/richText/const.ts +0 -3
  371. package/src/web/components/richText/index.css +0 -93
  372. package/src/web/components/richText/index.jsx +0 -473
  373. package/src/web/components/richTextView/index.css +0 -63
  374. package/src/web/components/richTextView/index.tsx +0 -63
  375. package/src/web/components/scrollView/index.tsx +0 -148
  376. package/src/web/components/share/index.css +0 -0
  377. package/src/web/components/share/index.tsx +0 -38
  378. package/src/web/components/slot/index.tsx +0 -19
  379. package/src/web/components/swiper/index.css +0 -106
  380. package/src/web/components/swiper/index.tsx +0 -291
  381. package/src/web/components/tabs/index.css +0 -64
  382. package/src/web/components/tabs/index.tsx +0 -35
  383. package/src/web/components/tabs/tabs.h5.tsx +0 -84
  384. package/src/web/components/tabs/tabs.pc.tsx +0 -74
  385. package/src/web/components/text/index.css +0 -26
  386. package/src/web/components/text/index.tsx +0 -60
  387. package/src/web/components/uploaderFileView/index.css +0 -11
  388. package/src/web/components/uploaderFileView/index.jsx +0 -84
  389. package/src/web/components/uploaderView/index.css +0 -31
  390. package/src/web/components/uploaderView/index.tsx +0 -92
  391. package/src/web/components/userInfo/index.css +0 -0
  392. package/src/web/components/userInfo/index.tsx +0 -30
  393. package/src/web/components/wedaVideo/index.css +0 -42
  394. package/src/web/components/wedaVideo/index.tsx +0 -208
  395. package/src/web/index.js +0 -4
  396. package/src/web/types.d.ts +0 -21
  397. package/src/web/utils/classnames.js +0 -39
  398. package/src/web/utils/constant.ts +0 -23
  399. package/src/web/utils/debounce.js +0 -98
  400. package/src/web/utils/events.js +0 -2
  401. package/src/web/utils/getLocalCounter.js +0 -5
  402. package/src/web/utils/isObjectEqual.js +0 -15
  403. package/src/web/utils/loading-fallback.tsx +0 -2
  404. package/src/web/utils/lodash.ts +0 -2
  405. package/src/web/utils/platform.js +0 -170
  406. package/src/web/utils/tcb.js +0 -86
  407. package/src/web/utils/tmap.js +0 -4
  408. package/src/web/utils/useSetState.ts +0 -18
  409. package/src/web/utils/useSyncValue.ts +0 -17
  410. package/src/web/utils/weui.js +0 -3
  411. package/src/web/weda-ui.css +0 -90
@@ -1,776 +0,0 @@
1
- (function (factory) {
2
- if (typeof exports === 'object') {
3
- // Node/CommonJS
4
- module.exports = factory();
5
- }
6
- // else if (typeof define === 'function' && define.amd) {
7
- // // AMD
8
- // define(factory);
9
- // }
10
- else {
11
- // Browser globals (with support for web workers)
12
- var glob;
13
-
14
- try {
15
- glob = window;
16
- } catch (e) {
17
- glob = self;
18
- }
19
-
20
- glob.SparkMD5 = factory();
21
- }
22
- })(function (factory = undefined) {
23
- // 'use strict';
24
-
25
- /*
26
- * Fastest md5 implementation around (JKM md5).
27
- * Credits: Joseph Myers
28
- *
29
- * @see http://www.myersdaily.org/joseph/javascript/md5-text.html
30
- * @see http://jsperf.com/md5-shootout/7
31
- */
32
-
33
- /* this function is much faster,
34
- so if possible we use it. Some IEs
35
- are the only ones I know of that
36
- need the idiotic second function,
37
- generated by an if clause. */
38
- var add32 = function (a, b) {
39
- return (a + b) & 0xffffffff;
40
- },
41
- hex_chr = [
42
- '0',
43
- '1',
44
- '2',
45
- '3',
46
- '4',
47
- '5',
48
- '6',
49
- '7',
50
- '8',
51
- '9',
52
- 'a',
53
- 'b',
54
- 'c',
55
- 'd',
56
- 'e',
57
- 'f',
58
- ];
59
-
60
- function cmn(q, a, b, x, s, t) {
61
- a = add32(add32(a, q), add32(x, t));
62
- return add32((a << s) | (a >>> (32 - s)), b);
63
- }
64
-
65
- function md5cycle(x, k) {
66
- var a = x[0],
67
- b = x[1],
68
- c = x[2],
69
- d = x[3];
70
-
71
- a += (((b & c) | (~b & d)) + k[0] - 680876936) | 0;
72
- a = (((a << 7) | (a >>> 25)) + b) | 0;
73
- d += (((a & b) | (~a & c)) + k[1] - 389564586) | 0;
74
- d = (((d << 12) | (d >>> 20)) + a) | 0;
75
- c += (((d & a) | (~d & b)) + k[2] + 606105819) | 0;
76
- c = (((c << 17) | (c >>> 15)) + d) | 0;
77
- b += (((c & d) | (~c & a)) + k[3] - 1044525330) | 0;
78
- b = (((b << 22) | (b >>> 10)) + c) | 0;
79
- a += (((b & c) | (~b & d)) + k[4] - 176418897) | 0;
80
- a = (((a << 7) | (a >>> 25)) + b) | 0;
81
- d += (((a & b) | (~a & c)) + k[5] + 1200080426) | 0;
82
- d = (((d << 12) | (d >>> 20)) + a) | 0;
83
- c += (((d & a) | (~d & b)) + k[6] - 1473231341) | 0;
84
- c = (((c << 17) | (c >>> 15)) + d) | 0;
85
- b += (((c & d) | (~c & a)) + k[7] - 45705983) | 0;
86
- b = (((b << 22) | (b >>> 10)) + c) | 0;
87
- a += (((b & c) | (~b & d)) + k[8] + 1770035416) | 0;
88
- a = (((a << 7) | (a >>> 25)) + b) | 0;
89
- d += (((a & b) | (~a & c)) + k[9] - 1958414417) | 0;
90
- d = (((d << 12) | (d >>> 20)) + a) | 0;
91
- c += (((d & a) | (~d & b)) + k[10] - 42063) | 0;
92
- c = (((c << 17) | (c >>> 15)) + d) | 0;
93
- b += (((c & d) | (~c & a)) + k[11] - 1990404162) | 0;
94
- b = (((b << 22) | (b >>> 10)) + c) | 0;
95
- a += (((b & c) | (~b & d)) + k[12] + 1804603682) | 0;
96
- a = (((a << 7) | (a >>> 25)) + b) | 0;
97
- d += (((a & b) | (~a & c)) + k[13] - 40341101) | 0;
98
- d = (((d << 12) | (d >>> 20)) + a) | 0;
99
- c += (((d & a) | (~d & b)) + k[14] - 1502002290) | 0;
100
- c = (((c << 17) | (c >>> 15)) + d) | 0;
101
- b += (((c & d) | (~c & a)) + k[15] + 1236535329) | 0;
102
- b = (((b << 22) | (b >>> 10)) + c) | 0;
103
-
104
- a += (((b & d) | (c & ~d)) + k[1] - 165796510) | 0;
105
- a = (((a << 5) | (a >>> 27)) + b) | 0;
106
- d += (((a & c) | (b & ~c)) + k[6] - 1069501632) | 0;
107
- d = (((d << 9) | (d >>> 23)) + a) | 0;
108
- c += (((d & b) | (a & ~b)) + k[11] + 643717713) | 0;
109
- c = (((c << 14) | (c >>> 18)) + d) | 0;
110
- b += (((c & a) | (d & ~a)) + k[0] - 373897302) | 0;
111
- b = (((b << 20) | (b >>> 12)) + c) | 0;
112
- a += (((b & d) | (c & ~d)) + k[5] - 701558691) | 0;
113
- a = (((a << 5) | (a >>> 27)) + b) | 0;
114
- d += (((a & c) | (b & ~c)) + k[10] + 38016083) | 0;
115
- d = (((d << 9) | (d >>> 23)) + a) | 0;
116
- c += (((d & b) | (a & ~b)) + k[15] - 660478335) | 0;
117
- c = (((c << 14) | (c >>> 18)) + d) | 0;
118
- b += (((c & a) | (d & ~a)) + k[4] - 405537848) | 0;
119
- b = (((b << 20) | (b >>> 12)) + c) | 0;
120
- a += (((b & d) | (c & ~d)) + k[9] + 568446438) | 0;
121
- a = (((a << 5) | (a >>> 27)) + b) | 0;
122
- d += (((a & c) | (b & ~c)) + k[14] - 1019803690) | 0;
123
- d = (((d << 9) | (d >>> 23)) + a) | 0;
124
- c += (((d & b) | (a & ~b)) + k[3] - 187363961) | 0;
125
- c = (((c << 14) | (c >>> 18)) + d) | 0;
126
- b += (((c & a) | (d & ~a)) + k[8] + 1163531501) | 0;
127
- b = (((b << 20) | (b >>> 12)) + c) | 0;
128
- a += (((b & d) | (c & ~d)) + k[13] - 1444681467) | 0;
129
- a = (((a << 5) | (a >>> 27)) + b) | 0;
130
- d += (((a & c) | (b & ~c)) + k[2] - 51403784) | 0;
131
- d = (((d << 9) | (d >>> 23)) + a) | 0;
132
- c += (((d & b) | (a & ~b)) + k[7] + 1735328473) | 0;
133
- c = (((c << 14) | (c >>> 18)) + d) | 0;
134
- b += (((c & a) | (d & ~a)) + k[12] - 1926607734) | 0;
135
- b = (((b << 20) | (b >>> 12)) + c) | 0;
136
-
137
- a += ((b ^ c ^ d) + k[5] - 378558) | 0;
138
- a = (((a << 4) | (a >>> 28)) + b) | 0;
139
- d += ((a ^ b ^ c) + k[8] - 2022574463) | 0;
140
- d = (((d << 11) | (d >>> 21)) + a) | 0;
141
- c += ((d ^ a ^ b) + k[11] + 1839030562) | 0;
142
- c = (((c << 16) | (c >>> 16)) + d) | 0;
143
- b += ((c ^ d ^ a) + k[14] - 35309556) | 0;
144
- b = (((b << 23) | (b >>> 9)) + c) | 0;
145
- a += ((b ^ c ^ d) + k[1] - 1530992060) | 0;
146
- a = (((a << 4) | (a >>> 28)) + b) | 0;
147
- d += ((a ^ b ^ c) + k[4] + 1272893353) | 0;
148
- d = (((d << 11) | (d >>> 21)) + a) | 0;
149
- c += ((d ^ a ^ b) + k[7] - 155497632) | 0;
150
- c = (((c << 16) | (c >>> 16)) + d) | 0;
151
- b += ((c ^ d ^ a) + k[10] - 1094730640) | 0;
152
- b = (((b << 23) | (b >>> 9)) + c) | 0;
153
- a += ((b ^ c ^ d) + k[13] + 681279174) | 0;
154
- a = (((a << 4) | (a >>> 28)) + b) | 0;
155
- d += ((a ^ b ^ c) + k[0] - 358537222) | 0;
156
- d = (((d << 11) | (d >>> 21)) + a) | 0;
157
- c += ((d ^ a ^ b) + k[3] - 722521979) | 0;
158
- c = (((c << 16) | (c >>> 16)) + d) | 0;
159
- b += ((c ^ d ^ a) + k[6] + 76029189) | 0;
160
- b = (((b << 23) | (b >>> 9)) + c) | 0;
161
- a += ((b ^ c ^ d) + k[9] - 640364487) | 0;
162
- a = (((a << 4) | (a >>> 28)) + b) | 0;
163
- d += ((a ^ b ^ c) + k[12] - 421815835) | 0;
164
- d = (((d << 11) | (d >>> 21)) + a) | 0;
165
- c += ((d ^ a ^ b) + k[15] + 530742520) | 0;
166
- c = (((c << 16) | (c >>> 16)) + d) | 0;
167
- b += ((c ^ d ^ a) + k[2] - 995338651) | 0;
168
- b = (((b << 23) | (b >>> 9)) + c) | 0;
169
-
170
- a += ((c ^ (b | ~d)) + k[0] - 198630844) | 0;
171
- a = (((a << 6) | (a >>> 26)) + b) | 0;
172
- d += ((b ^ (a | ~c)) + k[7] + 1126891415) | 0;
173
- d = (((d << 10) | (d >>> 22)) + a) | 0;
174
- c += ((a ^ (d | ~b)) + k[14] - 1416354905) | 0;
175
- c = (((c << 15) | (c >>> 17)) + d) | 0;
176
- b += ((d ^ (c | ~a)) + k[5] - 57434055) | 0;
177
- b = (((b << 21) | (b >>> 11)) + c) | 0;
178
- a += ((c ^ (b | ~d)) + k[12] + 1700485571) | 0;
179
- a = (((a << 6) | (a >>> 26)) + b) | 0;
180
- d += ((b ^ (a | ~c)) + k[3] - 1894986606) | 0;
181
- d = (((d << 10) | (d >>> 22)) + a) | 0;
182
- c += ((a ^ (d | ~b)) + k[10] - 1051523) | 0;
183
- c = (((c << 15) | (c >>> 17)) + d) | 0;
184
- b += ((d ^ (c | ~a)) + k[1] - 2054922799) | 0;
185
- b = (((b << 21) | (b >>> 11)) + c) | 0;
186
- a += ((c ^ (b | ~d)) + k[8] + 1873313359) | 0;
187
- a = (((a << 6) | (a >>> 26)) + b) | 0;
188
- d += ((b ^ (a | ~c)) + k[15] - 30611744) | 0;
189
- d = (((d << 10) | (d >>> 22)) + a) | 0;
190
- c += ((a ^ (d | ~b)) + k[6] - 1560198380) | 0;
191
- c = (((c << 15) | (c >>> 17)) + d) | 0;
192
- b += ((d ^ (c | ~a)) + k[13] + 1309151649) | 0;
193
- b = (((b << 21) | (b >>> 11)) + c) | 0;
194
- a += ((c ^ (b | ~d)) + k[4] - 145523070) | 0;
195
- a = (((a << 6) | (a >>> 26)) + b) | 0;
196
- d += ((b ^ (a | ~c)) + k[11] - 1120210379) | 0;
197
- d = (((d << 10) | (d >>> 22)) + a) | 0;
198
- c += ((a ^ (d | ~b)) + k[2] + 718787259) | 0;
199
- c = (((c << 15) | (c >>> 17)) + d) | 0;
200
- b += ((d ^ (c | ~a)) + k[9] - 343485551) | 0;
201
- b = (((b << 21) | (b >>> 11)) + c) | 0;
202
-
203
- x[0] = (a + x[0]) | 0;
204
- x[1] = (b + x[1]) | 0;
205
- x[2] = (c + x[2]) | 0;
206
- x[3] = (d + x[3]) | 0;
207
- }
208
-
209
- function md5blk(s) {
210
- var md5blks = [],
211
- i; /* Andy King said do it this way. */
212
-
213
- for (i = 0; i < 64; i += 4) {
214
- md5blks[i >> 2] =
215
- s.charCodeAt(i) +
216
- (s.charCodeAt(i + 1) << 8) +
217
- (s.charCodeAt(i + 2) << 16) +
218
- (s.charCodeAt(i + 3) << 24);
219
- }
220
- return md5blks;
221
- }
222
-
223
- function md5blk_array(a) {
224
- var md5blks = [],
225
- i; /* Andy King said do it this way. */
226
-
227
- for (i = 0; i < 64; i += 4) {
228
- md5blks[i >> 2] =
229
- a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
230
- }
231
- return md5blks;
232
- }
233
-
234
- function md51(s) {
235
- var n = s.length,
236
- state = [1732584193, -271733879, -1732584194, 271733878],
237
- i,
238
- length,
239
- tail,
240
- tmp,
241
- lo,
242
- hi;
243
-
244
- for (i = 64; i <= n; i += 64) {
245
- md5cycle(state, md5blk(s.substring(i - 64, i)));
246
- }
247
- s = s.substring(i - 64);
248
- length = s.length;
249
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
250
- for (i = 0; i < length; i += 1) {
251
- tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
252
- }
253
- tail[i >> 2] |= 0x80 << (i % 4 << 3);
254
- if (i > 55) {
255
- md5cycle(state, tail);
256
- for (i = 0; i < 16; i += 1) {
257
- tail[i] = 0;
258
- }
259
- }
260
-
261
- // Beware that the final length might not fit in 32 bits so we take care of that
262
- tmp = n * 8;
263
- tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
264
- lo = parseInt(tmp[2], 16);
265
- hi = parseInt(tmp[1], 16) || 0;
266
-
267
- tail[14] = lo;
268
- tail[15] = hi;
269
-
270
- md5cycle(state, tail);
271
- return state;
272
- }
273
-
274
- function md51_array(a) {
275
- var n = a.length,
276
- state = [1732584193, -271733879, -1732584194, 271733878],
277
- i,
278
- length,
279
- tail,
280
- tmp,
281
- lo,
282
- hi;
283
-
284
- for (i = 64; i <= n; i += 64) {
285
- md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
286
- }
287
-
288
- // Not sure if it is a bug, however IE10 will always produce a sub array of length 1
289
- // containing the last element of the parent array if the sub array specified starts
290
- // beyond the length of the parent array - weird.
291
- // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
292
- a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);
293
-
294
- length = a.length;
295
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
296
- for (i = 0; i < length; i += 1) {
297
- tail[i >> 2] |= a[i] << (i % 4 << 3);
298
- }
299
-
300
- tail[i >> 2] |= 0x80 << (i % 4 << 3);
301
- if (i > 55) {
302
- md5cycle(state, tail);
303
- for (i = 0; i < 16; i += 1) {
304
- tail[i] = 0;
305
- }
306
- }
307
-
308
- // Beware that the final length might not fit in 32 bits so we take care of that
309
- tmp = n * 8;
310
- tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
311
- lo = parseInt(tmp[2], 16);
312
- hi = parseInt(tmp[1], 16) || 0;
313
-
314
- tail[14] = lo;
315
- tail[15] = hi;
316
-
317
- md5cycle(state, tail);
318
-
319
- return state;
320
- }
321
-
322
- function rhex(n) {
323
- var s = '',
324
- j;
325
- for (j = 0; j < 4; j += 1) {
326
- s += hex_chr[(n >> (j * 8 + 4)) & 0x0f] + hex_chr[(n >> (j * 8)) & 0x0f];
327
- }
328
- return s;
329
- }
330
-
331
- function hex(x) {
332
- var i;
333
- for (i = 0; i < x.length; i += 1) {
334
- x[i] = rhex(x[i]);
335
- }
336
- return x.join('');
337
- }
338
-
339
- // In some cases the fast add32 function cannot be used..
340
- if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {
341
- add32 = function (x, y) {
342
- var lsw = (x & 0xffff) + (y & 0xffff),
343
- msw = (x >> 16) + (y >> 16) + (lsw >> 16);
344
- return (msw << 16) | (lsw & 0xffff);
345
- };
346
- }
347
-
348
- // ---------------------------------------------------
349
-
350
- /**
351
- * ArrayBuffer slice polyfill.
352
- *
353
- * @see https://github.com/ttaubert/node-arraybuffer-slice
354
- */
355
-
356
- if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {
357
- (function () {
358
- function clamp(val, length) {
359
- val = val | 0 || 0;
360
-
361
- if (val < 0) {
362
- return Math.max(val + length, 0);
363
- }
364
-
365
- return Math.min(val, length);
366
- }
367
-
368
- ArrayBuffer.prototype.slice = function (from, to) {
369
- var length = this.byteLength,
370
- begin = clamp(from, length),
371
- end = length,
372
- num,
373
- target,
374
- targetArray,
375
- sourceArray;
376
-
377
- if (to !== undefined) {
378
- end = clamp(to, length);
379
- }
380
-
381
- if (begin > end) {
382
- return new ArrayBuffer(0);
383
- }
384
-
385
- num = end - begin;
386
- target = new ArrayBuffer(num);
387
- targetArray = new Uint8Array(target);
388
-
389
- sourceArray = new Uint8Array(this, begin, num);
390
- targetArray.set(sourceArray);
391
-
392
- return target;
393
- };
394
- })();
395
- }
396
-
397
- // ---------------------------------------------------
398
-
399
- /**
400
- * Helpers.
401
- */
402
-
403
- function toUtf8(str) {
404
- if (/[\u0080-\uFFFF]/.test(str)) {
405
- str = unescape(encodeURIComponent(str));
406
- }
407
-
408
- return str;
409
- }
410
-
411
- function utf8Str2ArrayBuffer(str, returnUInt8Array) {
412
- var length = str.length,
413
- buff = new ArrayBuffer(length),
414
- arr = new Uint8Array(buff),
415
- i;
416
-
417
- for (i = 0; i < length; i += 1) {
418
- arr[i] = str.charCodeAt(i);
419
- }
420
-
421
- return returnUInt8Array ? arr : buff;
422
- }
423
-
424
- function arrayBuffer2Utf8Str(buff) {
425
- return String.fromCharCode.apply(null, new Uint8Array(buff));
426
- }
427
-
428
- function concatenateArrayBuffers(first, second, returnUInt8Array) {
429
- var result = new Uint8Array(first.byteLength + second.byteLength);
430
-
431
- result.set(new Uint8Array(first));
432
- result.set(new Uint8Array(second), first.byteLength);
433
-
434
- return returnUInt8Array ? result : result.buffer;
435
- }
436
-
437
- function hexToBinaryString(hex) {
438
- var bytes = [],
439
- length = hex.length,
440
- x;
441
-
442
- for (x = 0; x < length - 1; x += 2) {
443
- bytes.push(parseInt(hex.substr(x, 2), 16));
444
- }
445
-
446
- return String.fromCharCode.apply(String, bytes);
447
- }
448
-
449
- // ---------------------------------------------------
450
-
451
- /**
452
- * SparkMD5 OOP implementation.
453
- *
454
- * Use this class to perform an incremental md5, otherwise use the
455
- * static methods instead.
456
- */
457
-
458
- function SparkMD5() {
459
- // call reset to init the instance
460
- this.reset();
461
- }
462
-
463
- /**
464
- * Appends a string.
465
- * A conversion will be applied if an utf8 string is detected.
466
- *
467
- * @param {String} str The string to be appended
468
- *
469
- * @return {SparkMD5} The instance itself
470
- */
471
- SparkMD5.prototype.append = function (str) {
472
- // Converts the string to utf8 bytes if necessary
473
- // Then append as binary
474
- this.appendBinary(toUtf8(str));
475
-
476
- return this;
477
- };
478
-
479
- /**
480
- * Appends a binary string.
481
- *
482
- * @param {String} contents The binary string to be appended
483
- *
484
- * @return {SparkMD5} The instance itself
485
- */
486
- SparkMD5.prototype.appendBinary = function (contents) {
487
- this._buff += contents;
488
- this._length += contents.length;
489
-
490
- var length = this._buff.length,
491
- i;
492
-
493
- for (i = 64; i <= length; i += 64) {
494
- md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
495
- }
496
-
497
- this._buff = this._buff.substring(i - 64);
498
-
499
- return this;
500
- };
501
-
502
- /**
503
- * Finishes the incremental computation, reseting the internal state and
504
- * returning the result.
505
- *
506
- * @param {Boolean} raw True to get the raw string, false to get the hex string
507
- *
508
- * @return {String} The result
509
- */
510
- SparkMD5.prototype.end = function (raw) {
511
- var buff = this._buff,
512
- length = buff.length,
513
- i,
514
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
515
- ret;
516
-
517
- for (i = 0; i < length; i += 1) {
518
- tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);
519
- }
520
-
521
- this._finish(tail, length);
522
- ret = hex(this._hash);
523
-
524
- if (raw) {
525
- ret = hexToBinaryString(ret);
526
- }
527
-
528
- this.reset();
529
-
530
- return ret;
531
- };
532
-
533
- /**
534
- * Resets the internal state of the computation.
535
- *
536
- * @return {SparkMD5} The instance itself
537
- */
538
- SparkMD5.prototype.reset = function () {
539
- this._buff = '';
540
- this._length = 0;
541
- this._hash = [1732584193, -271733879, -1732584194, 271733878];
542
-
543
- return this;
544
- };
545
-
546
- /**
547
- * Gets the internal state of the computation.
548
- *
549
- * @return {Object} The state
550
- */
551
- SparkMD5.prototype.getState = function () {
552
- return {
553
- buff: this._buff,
554
- length: this._length,
555
- hash: this._hash,
556
- };
557
- };
558
-
559
- /**
560
- * Gets the internal state of the computation.
561
- *
562
- * @param {Object} state The state
563
- *
564
- * @return {SparkMD5} The instance itself
565
- */
566
- SparkMD5.prototype.setState = function (state) {
567
- this._buff = state.buff;
568
- this._length = state.length;
569
- this._hash = state.hash;
570
-
571
- return this;
572
- };
573
-
574
- /**
575
- * Releases memory used by the incremental buffer and other additional
576
- * resources. If you plan to use the instance again, use reset instead.
577
- */
578
- SparkMD5.prototype.destroy = function () {
579
- delete this._hash;
580
- delete this._buff;
581
- delete this._length;
582
- };
583
-
584
- /**
585
- * Finish the final calculation based on the tail.
586
- *
587
- * @param {Array} tail The tail (will be modified)
588
- * @param {Number} length The length of the remaining buffer
589
- */
590
- SparkMD5.prototype._finish = function (tail, length) {
591
- var i = length,
592
- tmp,
593
- lo,
594
- hi;
595
-
596
- tail[i >> 2] |= 0x80 << (i % 4 << 3);
597
- if (i > 55) {
598
- md5cycle(this._hash, tail);
599
- for (i = 0; i < 16; i += 1) {
600
- tail[i] = 0;
601
- }
602
- }
603
-
604
- // Do the final computation based on the tail and length
605
- // Beware that the final length may not fit in 32 bits so we take care of that
606
- tmp = this._length * 8;
607
- tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
608
- lo = parseInt(tmp[2], 16);
609
- hi = parseInt(tmp[1], 16) || 0;
610
-
611
- tail[14] = lo;
612
- tail[15] = hi;
613
- md5cycle(this._hash, tail);
614
- };
615
-
616
- /**
617
- * Performs the md5 hash on a string.
618
- * A conversion will be applied if utf8 string is detected.
619
- *
620
- * @param {String} str The string
621
- * @param {Boolean} [raw] True to get the raw string, false to get the hex string
622
- *
623
- * @return {String} The result
624
- */
625
- SparkMD5.hash = function (str, raw) {
626
- // Converts the string to utf8 bytes if necessary
627
- // Then compute it using the binary function
628
- return SparkMD5.hashBinary(toUtf8(str), raw);
629
- };
630
-
631
- /**
632
- * Performs the md5 hash on a binary string.
633
- *
634
- * @param {String} content The binary string
635
- * @param {Boolean} [raw] True to get the raw string, false to get the hex string
636
- *
637
- * @return {String} The result
638
- */
639
- SparkMD5.hashBinary = function (content, raw) {
640
- var hash = md51(content),
641
- ret = hex(hash);
642
-
643
- return raw ? hexToBinaryString(ret) : ret;
644
- };
645
-
646
- // ---------------------------------------------------
647
-
648
- /**
649
- * SparkMD5 OOP implementation for array buffers.
650
- *
651
- * Use this class to perform an incremental md5 ONLY for array buffers.
652
- */
653
- SparkMD5.ArrayBuffer = function () {
654
- // call reset to init the instance
655
- this.reset();
656
- };
657
-
658
- /**
659
- * Appends an array buffer.
660
- *
661
- * @param {ArrayBuffer} arr The array to be appended
662
- *
663
- * @return {SparkMD5.ArrayBuffer} The instance itself
664
- */
665
- SparkMD5.ArrayBuffer.prototype.append = function (arr) {
666
- var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),
667
- length = buff.length,
668
- i;
669
-
670
- this._length += arr.byteLength;
671
-
672
- for (i = 64; i <= length; i += 64) {
673
- md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
674
- }
675
-
676
- this._buff =
677
- i - 64 < length
678
- ? new Uint8Array(buff.buffer.slice(i - 64))
679
- : new Uint8Array(0);
680
-
681
- return this;
682
- };
683
-
684
- /**
685
- * Finishes the incremental computation, reseting the internal state and
686
- * returning the result.
687
- *
688
- * @param {Boolean} raw True to get the raw string, false to get the hex string
689
- *
690
- * @return {String} The result
691
- */
692
- SparkMD5.ArrayBuffer.prototype.end = function (raw) {
693
- var buff = this._buff,
694
- length = buff.length,
695
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
696
- i,
697
- ret;
698
-
699
- for (i = 0; i < length; i += 1) {
700
- tail[i >> 2] |= buff[i] << (i % 4 << 3);
701
- }
702
-
703
- this._finish(tail, length);
704
- ret = hex(this._hash);
705
-
706
- if (raw) {
707
- ret = hexToBinaryString(ret);
708
- }
709
-
710
- this.reset();
711
-
712
- return ret;
713
- };
714
-
715
- /**
716
- * Resets the internal state of the computation.
717
- *
718
- * @return {SparkMD5.ArrayBuffer} The instance itself
719
- */
720
- SparkMD5.ArrayBuffer.prototype.reset = function () {
721
- this._buff = new Uint8Array(0);
722
- this._length = 0;
723
- this._hash = [1732584193, -271733879, -1732584194, 271733878];
724
-
725
- return this;
726
- };
727
-
728
- /**
729
- * Gets the internal state of the computation.
730
- *
731
- * @return {Object} The state
732
- */
733
- SparkMD5.ArrayBuffer.prototype.getState = function () {
734
- var state = SparkMD5.prototype.getState.call(this);
735
-
736
- // Convert buffer to a string
737
- state.buff = arrayBuffer2Utf8Str(state.buff);
738
-
739
- return state;
740
- };
741
-
742
- /**
743
- * Gets the internal state of the computation.
744
- *
745
- * @param {Object} state The state
746
- *
747
- * @return {SparkMD5.ArrayBuffer} The instance itself
748
- */
749
- SparkMD5.ArrayBuffer.prototype.setState = function (state) {
750
- // Convert string to buffer
751
- state.buff = utf8Str2ArrayBuffer(state.buff, true);
752
-
753
- return SparkMD5.prototype.setState.call(this, state);
754
- };
755
-
756
- SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
757
-
758
- SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
759
-
760
- /**
761
- * Performs the md5 hash on an array buffer.
762
- *
763
- * @param {ArrayBuffer} arr The array buffer
764
- * @param {Boolean} [raw] True to get the raw string, false to get the hex one
765
- *
766
- * @return {String} The result
767
- */
768
- SparkMD5.ArrayBuffer.hash = function (arr, raw) {
769
- var hash = md51_array(new Uint8Array(arr)),
770
- ret = hex(hash);
771
-
772
- return raw ? hexToBinaryString(ret) : ret;
773
- };
774
-
775
- return SparkMD5;
776
- });