dpzvc3-ui 3.0.6 → 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 (478) hide show
  1. package/dist/dpzvc3.esm.js +7641 -10423
  2. package/dist/dpzvc3.esm.js.map +1 -1
  3. package/dist/dpzvc3.esm.min.js +1 -1
  4. package/dist/dpzvc3.esm.min.js.map +1 -1
  5. package/dist/dpzvc3.js +6646 -8258
  6. package/dist/dpzvc3.js.map +1 -1
  7. package/dist/dpzvc3.min.js +1 -1
  8. package/dist/dpzvc3.min.js.map +1 -1
  9. package/dist/styles/components/radioBox.css +1 -1
  10. package/dist/styles/components/rater.css +1 -0
  11. package/dist/styles/dpzvc3.css +1 -1
  12. package/dist/types/components/Indicator/types.d.ts +16 -0
  13. package/dist/types/components/Indicator/types.d.ts.map +1 -0
  14. package/dist/types/components/Prompt/types.d.ts +37 -0
  15. package/dist/types/components/Prompt/types.d.ts.map +1 -0
  16. package/dist/types/components/Text/index.d.ts +12 -0
  17. package/dist/types/components/Text/index.d.ts.map +1 -0
  18. package/dist/types/components/Text/textBar.d.ts +84 -0
  19. package/dist/types/components/Text/textBar.d.ts.map +1 -0
  20. package/dist/types/components/Text/types.d.ts +13 -0
  21. package/dist/types/components/Text/types.d.ts.map +1 -0
  22. package/dist/types/components/actionSheet/actionSheet.d.ts +42 -0
  23. package/dist/types/components/actionSheet/actionSheet.d.ts.map +1 -0
  24. package/dist/types/components/actionSheet/index.d.ts +7 -0
  25. package/dist/types/components/actionSheet/index.d.ts.map +1 -0
  26. package/dist/types/components/actionSheet/types.d.ts +11 -0
  27. package/dist/types/components/actionSheet/types.d.ts.map +1 -0
  28. package/dist/types/components/badge/badge.d.ts +51 -0
  29. package/dist/types/components/badge/badge.d.ts.map +1 -0
  30. package/dist/types/components/badge/index.d.ts +12 -0
  31. package/dist/types/components/badge/index.d.ts.map +1 -0
  32. package/dist/types/components/badge/types.d.ts +8 -0
  33. package/dist/types/components/badge/types.d.ts.map +1 -0
  34. package/dist/types/components/button/button.d.ts +103 -0
  35. package/dist/types/components/button/button.d.ts.map +1 -0
  36. package/dist/types/components/button/index.d.ts +12 -0
  37. package/dist/types/components/button/index.d.ts.map +1 -0
  38. package/dist/types/components/button/types.d.ts +13 -0
  39. package/dist/types/components/button/types.d.ts.map +1 -0
  40. package/dist/types/components/card/card.d.ts +18 -0
  41. package/dist/types/components/card/card.d.ts.map +1 -0
  42. package/dist/types/components/card/index.d.ts +12 -0
  43. package/dist/types/components/card/index.d.ts.map +1 -0
  44. package/dist/types/components/card/types.d.ts +4 -0
  45. package/dist/types/components/card/types.d.ts.map +1 -0
  46. package/dist/types/components/cell/cell.d.ts +24 -0
  47. package/dist/types/components/cell/cell.d.ts.map +1 -0
  48. package/dist/types/components/cell/index.d.ts +12 -0
  49. package/dist/types/components/cell/index.d.ts.map +1 -0
  50. package/dist/types/components/cell/types.d.ts +8 -0
  51. package/dist/types/components/cell/types.d.ts.map +1 -0
  52. package/dist/types/components/cellSwipe/cellSwipe.d.ts +37 -0
  53. package/dist/types/components/cellSwipe/cellSwipe.d.ts.map +1 -0
  54. package/dist/types/components/cellSwipe/index.d.ts +12 -0
  55. package/dist/types/components/cellSwipe/index.d.ts.map +1 -0
  56. package/dist/types/components/cellSwipe/types.d.ts +15 -0
  57. package/dist/types/components/cellSwipe/types.d.ts.map +1 -0
  58. package/dist/types/components/checkBox/checkbox-group.d.ts +38 -0
  59. package/dist/types/components/checkBox/checkbox-group.d.ts.map +1 -0
  60. package/dist/types/components/checkBox/checkbox.d.ts +36 -0
  61. package/dist/types/components/checkBox/checkbox.d.ts.map +1 -0
  62. package/dist/types/components/checkBox/index.d.ts +14 -0
  63. package/dist/types/components/checkBox/index.d.ts.map +1 -0
  64. package/dist/types/components/checkBox/types.d.ts +22 -0
  65. package/dist/types/components/checkBox/types.d.ts.map +1 -0
  66. package/dist/types/components/header/header.d.ts +47 -0
  67. package/dist/types/components/header/header.d.ts.map +1 -0
  68. package/dist/types/components/header/index.d.ts +12 -0
  69. package/dist/types/components/header/index.d.ts.map +1 -0
  70. package/dist/types/components/header/types.d.ts +7 -0
  71. package/dist/types/components/header/types.d.ts.map +1 -0
  72. package/dist/types/components/loadMore/index.d.ts +12 -0
  73. package/dist/types/components/loadMore/index.d.ts.map +1 -0
  74. package/dist/types/components/loadMore/loadMore.d.ts +150 -0
  75. package/dist/types/components/loadMore/loadMore.d.ts.map +1 -0
  76. package/dist/types/components/loadMore/types.d.ts +23 -0
  77. package/dist/types/components/loadMore/types.d.ts.map +1 -0
  78. package/dist/types/components/message/types.d.ts +32 -0
  79. package/dist/types/components/message/types.d.ts.map +1 -0
  80. package/dist/types/components/modal/types.d.ts +33 -0
  81. package/dist/types/components/modal/types.d.ts.map +1 -0
  82. package/dist/types/components/number/Number.d.ts +77 -0
  83. package/dist/types/components/number/Number.d.ts.map +1 -0
  84. package/dist/types/components/number/index.d.ts +9 -0
  85. package/dist/types/components/number/index.d.ts.map +1 -0
  86. package/dist/types/components/number/types.d.ts +12 -0
  87. package/dist/types/components/number/types.d.ts.map +1 -0
  88. package/dist/types/components/picker/index.d.ts +12 -0
  89. package/dist/types/components/picker/index.d.ts.map +1 -0
  90. package/dist/types/components/picker/picker.d.ts +237 -0
  91. package/dist/types/components/picker/picker.d.ts.map +1 -0
  92. package/dist/types/components/picker/types.d.ts +17 -0
  93. package/dist/types/components/picker/types.d.ts.map +1 -0
  94. package/dist/types/components/popup/index.d.ts +12 -0
  95. package/dist/types/components/popup/index.d.ts.map +1 -0
  96. package/dist/types/components/popup/popup.d.ts +71 -0
  97. package/dist/types/components/popup/popup.d.ts.map +1 -0
  98. package/dist/types/components/popup/types.d.ts +10 -0
  99. package/dist/types/components/popup/types.d.ts.map +1 -0
  100. package/dist/types/components/progress/index.d.ts +12 -0
  101. package/dist/types/components/progress/index.d.ts.map +1 -0
  102. package/dist/types/components/progress/progress.d.ts +36 -0
  103. package/dist/types/components/progress/progress.d.ts.map +1 -0
  104. package/dist/types/components/progress/types.d.ts +9 -0
  105. package/dist/types/components/progress/types.d.ts.map +1 -0
  106. package/dist/types/components/radioBox/index.d.ts +14 -0
  107. package/dist/types/components/radioBox/index.d.ts.map +1 -0
  108. package/dist/types/components/radioBox/radiobox-group.d.ts +31 -0
  109. package/dist/types/components/radioBox/radiobox-group.d.ts.map +1 -0
  110. package/dist/types/components/radioBox/radiobox.d.ts +38 -0
  111. package/dist/types/components/radioBox/radiobox.d.ts.map +1 -0
  112. package/dist/types/components/radioBox/types.d.ts +18 -0
  113. package/dist/types/components/radioBox/types.d.ts.map +1 -0
  114. package/dist/types/components/rater/index.d.ts +12 -0
  115. package/dist/types/components/rater/index.d.ts.map +1 -0
  116. package/dist/types/components/rater/raters.d.ts +83 -0
  117. package/dist/types/components/rater/raters.d.ts.map +1 -0
  118. package/dist/types/components/rater/types.d.ts +11 -0
  119. package/dist/types/components/rater/types.d.ts.map +1 -0
  120. package/dist/types/components/slideBar/index.d.ts +12 -0
  121. package/dist/types/components/slideBar/index.d.ts.map +1 -0
  122. package/dist/types/components/slideBar/slideBar.d.ts +46 -0
  123. package/dist/types/components/slideBar/slideBar.d.ts.map +1 -0
  124. package/dist/types/components/slideBar/types.d.ts +19 -0
  125. package/dist/types/components/slideBar/types.d.ts.map +1 -0
  126. package/dist/types/components/spinner/index.d.ts +12 -0
  127. package/dist/types/components/spinner/index.d.ts.map +1 -0
  128. package/dist/types/components/spinner/spinner.d.ts +36 -0
  129. package/dist/types/components/spinner/spinner.d.ts.map +1 -0
  130. package/dist/types/components/spinner/types.d.ts +7 -0
  131. package/dist/types/components/spinner/types.d.ts.map +1 -0
  132. package/dist/types/components/swipe/index.d.ts +12 -0
  133. package/dist/types/components/swipe/index.d.ts.map +1 -0
  134. package/dist/types/components/swipe/swipe.d.ts +99 -0
  135. package/dist/types/components/swipe/swipe.d.ts.map +1 -0
  136. package/dist/types/components/swipe/types.d.ts +20 -0
  137. package/dist/types/components/swipe/types.d.ts.map +1 -0
  138. package/dist/types/components/switchbar/index.d.ts +12 -0
  139. package/dist/types/components/switchbar/index.d.ts.map +1 -0
  140. package/dist/types/components/switchbar/switchbar.d.ts +38 -0
  141. package/dist/types/components/switchbar/switchbar.d.ts.map +1 -0
  142. package/dist/types/components/switchbar/types.d.ts +6 -0
  143. package/dist/types/components/switchbar/types.d.ts.map +1 -0
  144. package/dist/types/components/tab/index.d.ts +12 -0
  145. package/dist/types/components/tab/index.d.ts.map +1 -0
  146. package/dist/types/components/tab/tab.d.ts +54 -0
  147. package/dist/types/components/tab/tab.d.ts.map +1 -0
  148. package/dist/types/components/tab/types.d.ts +14 -0
  149. package/dist/types/components/tab/types.d.ts.map +1 -0
  150. package/dist/types/components/toTop/index.d.ts +12 -0
  151. package/dist/types/components/toTop/index.d.ts.map +1 -0
  152. package/dist/types/components/toTop/toTop.d.ts +18 -0
  153. package/dist/types/components/toTop/toTop.d.ts.map +1 -0
  154. package/dist/types/components/toTop/types.d.ts +7 -0
  155. package/dist/types/components/toTop/types.d.ts.map +1 -0
  156. package/dist/types/components/upload/index.d.ts +12 -0
  157. package/dist/types/components/upload/index.d.ts.map +1 -0
  158. package/dist/types/components/upload/types.d.ts +9 -0
  159. package/dist/types/components/upload/types.d.ts.map +1 -0
  160. package/dist/types/components/upload/upload.d.ts +19 -0
  161. package/dist/types/components/upload/upload.d.ts.map +1 -0
  162. package/dist/types/index.d.ts +157 -0
  163. package/dist/types/lib/MegaPixImage.d.ts +9 -0
  164. package/dist/types/lib/MegaPixImage.d.ts.map +1 -0
  165. package/dist/types/lib/lib.d.ts +3 -0
  166. package/dist/types/lib/lib.d.ts.map +1 -0
  167. package/dist/types/utils/util.d.ts +31 -0
  168. package/dist/types/utils/util.d.ts.map +1 -0
  169. package/dist-prod/91.05c8ec5277a15f939b0f.js +3 -0
  170. package/dist-prod/{91.e2fdec39667928bf57b9.js.map → 91.05c8ec5277a15f939b0f.js.map} +1 -1
  171. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js +2 -0
  172. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js.map +1 -0
  173. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js +2 -0
  174. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js.map +1 -0
  175. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js +2 -0
  176. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js.map +1 -0
  177. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js +2 -0
  178. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js.map +1 -0
  179. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js +2 -0
  180. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js.map +1 -0
  181. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js +2 -0
  182. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js.map +1 -0
  183. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js +2 -0
  184. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js.map +1 -0
  185. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js +2 -0
  186. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js.map +1 -0
  187. package/dist-prod/header.eb10433dd892738ee95a.chunk.js +2 -0
  188. package/dist-prod/header.eb10433dd892738ee95a.chunk.js.map +1 -0
  189. package/dist-prod/index.html +1 -1
  190. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js +2 -0
  191. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js.map +1 -0
  192. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js +2 -0
  193. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js.map +1 -0
  194. package/dist-prod/main.662ad15361e7f3d20234.js +2 -0
  195. package/dist-prod/main.662ad15361e7f3d20234.js.map +1 -0
  196. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js +2 -0
  197. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js.map +1 -0
  198. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js +2 -0
  199. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js.map +1 -0
  200. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js +2 -0
  201. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js.map +1 -0
  202. package/dist-prod/popup.538422c7e188363a468d.chunk.js +2 -0
  203. package/dist-prod/popup.538422c7e188363a468d.chunk.js.map +1 -0
  204. package/dist-prod/progress.240de4b633002f573030.chunk.js +2 -0
  205. package/dist-prod/progress.240de4b633002f573030.chunk.js.map +1 -0
  206. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js +2 -0
  207. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js.map +1 -0
  208. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js +2 -0
  209. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js.map +1 -0
  210. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js +2 -0
  211. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js.map +1 -0
  212. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js +2 -0
  213. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js.map +1 -0
  214. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js +2 -0
  215. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js.map +1 -0
  216. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js +2 -0
  217. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js.map +1 -0
  218. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js +2 -0
  219. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js.map +1 -0
  220. package/dist-prod/tab.29f19483f699b7811259.chunk.js +2 -0
  221. package/dist-prod/tab.29f19483f699b7811259.chunk.js.map +1 -0
  222. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js +2 -0
  223. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js.map +1 -0
  224. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js +2 -0
  225. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js.map +1 -0
  226. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js +2 -0
  227. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js.map +1 -0
  228. package/package.json +12 -3
  229. package/src/components/Indicator/Indicator.tsx +67 -0
  230. package/src/components/Indicator/index.ts +111 -0
  231. package/src/components/Indicator/types.ts +15 -0
  232. package/src/components/Text/index.ts +14 -0
  233. package/src/components/Text/textBar.tsx +104 -0
  234. package/src/components/Text/types.ts +13 -0
  235. package/src/components/actionSheet/actionSheet.d.ts +16 -0
  236. package/src/components/actionSheet/actionSheet.tsx +86 -0
  237. package/src/components/{action-sheet/index.js → actionSheet/index.ts} +1 -0
  238. package/src/components/actionSheet/types.ts +10 -0
  239. package/src/components/badge/{badge.vue → badge.tsx} +31 -31
  240. package/src/components/badge/index.ts +12 -0
  241. package/src/components/badge/types.ts +8 -0
  242. package/src/components/button/{button.vue → button.tsx} +46 -52
  243. package/src/components/button/index.ts +13 -0
  244. package/src/components/button/types.ts +13 -0
  245. package/src/components/card/card.d.ts +16 -0
  246. package/src/components/card/card.tsx +38 -0
  247. package/src/components/card/index.ts +12 -0
  248. package/src/components/card/types.ts +3 -0
  249. package/src/components/cell/cell.tsx +89 -0
  250. package/src/components/cell/index.ts +12 -0
  251. package/src/components/cell/types.ts +8 -0
  252. package/src/components/cellSwipe/cellSwipe.tsx +188 -0
  253. package/src/components/cellSwipe/index.ts +13 -0
  254. package/src/components/cellSwipe/types.ts +17 -0
  255. package/src/components/checkBox/checkbox-group.tsx +75 -0
  256. package/src/components/checkBox/checkbox.tsx +107 -0
  257. package/src/components/checkBox/index.ts +29 -0
  258. package/src/components/checkBox/types.ts +32 -0
  259. package/src/components/header/header.tsx +119 -0
  260. package/src/components/header/index.ts +13 -0
  261. package/src/components/header/types.ts +7 -0
  262. package/src/components/loadMore/index.ts +14 -0
  263. package/src/components/loadMore/loadMore.tsx +265 -0
  264. package/src/components/loadMore/types.ts +26 -0
  265. package/src/components/message/confirm.ts +104 -0
  266. package/src/components/message/{index.js → index.ts} +20 -18
  267. package/src/components/message/message.tsx +100 -0
  268. package/src/components/message/messageGroup.tsx +59 -0
  269. package/src/components/message/types.ts +48 -0
  270. package/src/components/modal/{confirm.js → confirm.ts} +8 -7
  271. package/src/components/modal/index.ts +68 -0
  272. package/src/components/modal/modal.tsx +248 -0
  273. package/src/components/modal/types.ts +51 -0
  274. package/src/components/number/Number.tsx +143 -0
  275. package/src/components/number/index.ts +10 -0
  276. package/src/components/number/types.ts +13 -0
  277. package/src/components/picker/index.ts +12 -0
  278. package/src/components/picker/picker.tsx +112 -0
  279. package/src/components/picker/types.ts +17 -0
  280. package/src/components/popup/index.ts +12 -0
  281. package/src/components/popup/popup.d.ts +16 -0
  282. package/src/components/popup/popup.tsx +68 -0
  283. package/src/components/popup/types.ts +9 -0
  284. package/src/components/progress/index.ts +12 -0
  285. package/src/components/progress/progress.tsx +81 -0
  286. package/src/components/progress/types.ts +9 -0
  287. package/src/components/prompt/{confirm.js → confirm.ts} +27 -14
  288. package/src/components/prompt/index.ts +50 -0
  289. package/src/components/prompt/prompt.tsx +161 -0
  290. package/src/components/prompt/types.ts +45 -0
  291. package/src/components/radioBox/index.ts +34 -0
  292. package/src/components/radioBox/radiobox-group.tsx +66 -0
  293. package/src/components/radioBox/radiobox.tsx +115 -0
  294. package/src/components/radioBox/types.ts +24 -0
  295. package/src/components/rater/index.ts +12 -0
  296. package/src/components/rater/rater.d.ts +16 -0
  297. package/src/components/rater/raters.tsx +101 -0
  298. package/src/components/rater/types.ts +10 -0
  299. package/src/components/slideBar/index.ts +13 -0
  300. package/src/components/slideBar/slideBar.tsx +288 -0
  301. package/src/components/slideBar/types.ts +20 -0
  302. package/src/components/spinner/index.ts +13 -0
  303. package/src/components/spinner/spinner.tsx +85 -0
  304. package/src/components/spinner/types.ts +20 -0
  305. package/src/components/swipe/index.ts +13 -0
  306. package/src/components/swipe/swipe.tsx +292 -0
  307. package/src/components/swipe/types.ts +21 -0
  308. package/src/components/switchbar/index.ts +13 -0
  309. package/src/components/switchbar/switchbar.tsx +58 -0
  310. package/src/components/switchbar/types.ts +6 -0
  311. package/src/components/tab/index.ts +12 -0
  312. package/src/components/tab/tab.tsx +71 -0
  313. package/src/components/tab/types.ts +15 -0
  314. package/src/components/toTop/index.ts +13 -0
  315. package/src/components/toTop/toTop.tsx +54 -0
  316. package/src/components/toTop/types.ts +7 -0
  317. package/src/components/upload/index.ts +13 -0
  318. package/src/components/upload/types.ts +9 -0
  319. package/src/components/upload/upload.tsx +180 -0
  320. package/src/index.ts +175 -0
  321. package/src/lib/MegaPixImage.js +1 -0
  322. package/src/{main.js → main.ts} +4 -2
  323. package/src/shims-vue.d.ts +37 -0
  324. package/src/styles/components/radioBox.less +5 -1
  325. package/src/styles/components/rater.less +16 -0
  326. package/src/styles/index.less +1 -0
  327. package/src/types/index.d.ts +157 -0
  328. package/src/types/js-shims.d.ts +36 -0
  329. package/src/utils/test.ts +2 -0
  330. package/src/utils/util.ts +168 -0
  331. package/src/utils/{util.js → util1.js} +2 -2
  332. package/src/views/ActionSheet.vue +7 -7
  333. package/src/views/Badge/Badge.less +12 -0
  334. package/src/views/Badge/Badge.tsx +23 -0
  335. package/src/views/Badge.vue +4 -2
  336. package/src/views/Button.vue +17 -17
  337. package/src/views/Card.vue +2 -1
  338. package/src/views/Cell.vue +6 -5
  339. package/src/views/CellSwipe.vue +51 -39
  340. package/src/views/CheckBox.vue +7 -6
  341. package/src/views/Header.vue +8 -7
  342. package/src/views/Indicator.vue +15 -15
  343. package/src/views/LoadMore.vue +13 -10
  344. package/src/views/Message.vue +14 -14
  345. package/src/views/Modal.vue +10 -10
  346. package/src/views/Picker.vue +19 -17
  347. package/src/views/Popup.vue +47 -41
  348. package/src/views/Progress.vue +8 -6
  349. package/src/views/Prompt.vue +5 -5
  350. package/src/views/RadioBox.vue +6 -4
  351. package/src/views/Rater.vue +7 -3
  352. package/src/views/SlideBar.vue +9 -5
  353. package/src/views/Spinner.vue +17 -5
  354. package/src/views/Swipe.vue +5 -3
  355. package/src/views/SwitchBar.vue +6 -4
  356. package/src/views/Tab.vue +8 -6
  357. package/src/views/Text.vue +14 -10
  358. package/src/views/ToTop.vue +19 -5
  359. package/src/views/Upload.vue +8 -4
  360. package/tsconfig.build.json +30 -0
  361. package/tsconfig.json +39 -0
  362. package/webpack.base.config.js +22 -2
  363. package/webpack.dev.config.js +2 -1
  364. package/webpack.dist.dev.config.js +3 -2
  365. package/webpack.dist.prod.config.js +3 -2
  366. package/webpack.prod.config.js +2 -1
  367. package/dist-prod/91.e2fdec39667928bf57b9.js +0 -3
  368. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js +0 -2
  369. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js.map +0 -1
  370. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js +0 -2
  371. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js.map +0 -1
  372. package/dist-prod/button.28b491339fbba29c3f16.chunk.js +0 -2
  373. package/dist-prod/button.28b491339fbba29c3f16.chunk.js.map +0 -1
  374. package/dist-prod/card.3ad847f07bebc1391125.chunk.js +0 -2
  375. package/dist-prod/card.3ad847f07bebc1391125.chunk.js.map +0 -1
  376. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js +0 -2
  377. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js.map +0 -1
  378. package/dist-prod/cellswipe.04240414bed39e28e7b9.chunk.js +0 -2
  379. package/dist-prod/cellswipe.04240414bed39e28e7b9.chunk.js.map +0 -1
  380. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js +0 -2
  381. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js.map +0 -1
  382. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js +0 -2
  383. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js.map +0 -1
  384. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js +0 -2
  385. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js.map +0 -1
  386. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js +0 -2
  387. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js.map +0 -1
  388. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js +0 -2
  389. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js.map +0 -1
  390. package/dist-prod/main.717f5c8b51911571fb82.js +0 -2
  391. package/dist-prod/main.717f5c8b51911571fb82.js.map +0 -1
  392. package/dist-prod/message.e57fa263a214006f7191.chunk.js +0 -2
  393. package/dist-prod/message.e57fa263a214006f7191.chunk.js.map +0 -1
  394. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js +0 -2
  395. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js.map +0 -1
  396. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js +0 -2
  397. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js.map +0 -1
  398. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js +0 -2
  399. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js.map +0 -1
  400. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js +0 -2
  401. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js.map +0 -1
  402. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js +0 -2
  403. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js.map +0 -1
  404. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js +0 -2
  405. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js.map +0 -1
  406. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js +0 -2
  407. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js.map +0 -1
  408. package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js +0 -2
  409. package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js.map +0 -1
  410. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js +0 -2
  411. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js.map +0 -1
  412. package/dist-prod/swipe.75b7d741be73c0064982.chunk.js +0 -2
  413. package/dist-prod/swipe.75b7d741be73c0064982.chunk.js.map +0 -1
  414. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js +0 -2
  415. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js.map +0 -1
  416. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js +0 -2
  417. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js.map +0 -1
  418. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js +0 -2
  419. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js.map +0 -1
  420. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js +0 -2
  421. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js.map +0 -1
  422. package/dist-prod/upload.a9b44c8a72fe70980a1e.chunk.js +0 -2
  423. package/dist-prod/upload.a9b44c8a72fe70980a1e.chunk.js.map +0 -1
  424. package/src/components/Indicator/index.js +0 -86
  425. package/src/components/Text/Number.vue +0 -167
  426. package/src/components/Text/index.js +0 -7
  427. package/src/components/Text/textBar.vue +0 -122
  428. package/src/components/action-sheet/actionSheet.vue +0 -98
  429. package/src/components/badge/index.js +0 -5
  430. package/src/components/button/index.js +0 -5
  431. package/src/components/card/card.vue +0 -49
  432. package/src/components/card/index.js +0 -5
  433. package/src/components/cell/cell.vue +0 -113
  434. package/src/components/cell/index.js +0 -5
  435. package/src/components/cell-swipe/cell-swipe.vue +0 -168
  436. package/src/components/cell-swipe/index.js +0 -5
  437. package/src/components/checkBox/checkbox-group.vue +0 -74
  438. package/src/components/checkBox/checkbox.vue +0 -117
  439. package/src/components/checkBox/index.js +0 -8
  440. package/src/components/header/header.vue +0 -131
  441. package/src/components/header/index.js +0 -5
  442. package/src/components/loadMore/index.js +0 -5
  443. package/src/components/loadMore/loadmore.vue +0 -258
  444. package/src/components/message/confirm.js +0 -60
  445. package/src/components/message/message.vue +0 -137
  446. package/src/components/message/messageGroup.vue +0 -82
  447. package/src/components/modal/index.js +0 -52
  448. package/src/components/modal/modal.vue +0 -138
  449. package/src/components/picker/index.js +0 -5
  450. package/src/components/picker/picker.vue +0 -111
  451. package/src/components/popup/index.js +0 -5
  452. package/src/components/popup/popup.vue +0 -91
  453. package/src/components/progress/index.js +0 -5
  454. package/src/components/progress/progress.vue +0 -86
  455. package/src/components/prompt/index.js +0 -53
  456. package/src/components/prompt/prompt.vue +0 -125
  457. package/src/components/radioBox/index.js +0 -8
  458. package/src/components/rater/index.js +0 -5
  459. package/src/components/rater/rater.vue +0 -118
  460. package/src/components/slideBar/index.js +0 -6
  461. package/src/components/slideBar/slideBar.vue +0 -225
  462. package/src/components/spinner/index.js +0 -5
  463. package/src/components/spinner/spinner.vue +0 -78
  464. package/src/components/swipe/index.js +0 -5
  465. package/src/components/swipe/swipe.vue +0 -289
  466. package/src/components/switchbar/index.js +0 -5
  467. package/src/components/switchbar/switchbar.vue +0 -79
  468. package/src/components/tab/index.js +0 -6
  469. package/src/components/tab/tab.vue +0 -89
  470. package/src/components/toTop/index.js +0 -5
  471. package/src/components/toTop/topTop.vue +0 -78
  472. package/src/components/upload/index.js +0 -5
  473. package/src/components/upload/upload.vue +0 -166
  474. package/src/index.js +0 -149
  475. /package/dist-prod/{91.e2fdec39667928bf57b9.js.LICENSE.txt → 91.05c8ec5277a15f939b0f.js.LICENSE.txt} +0 -0
  476. /package/src/components/radioBox/{radiobox-group.vue → radiobox-group1.vue} +0 -0
  477. /package/src/components/radioBox/{radiobox.vue → radiobox1.vue} +0 -0
  478. /package/src/{router.js → router.ts} +0 -0
@@ -1,258 +0,0 @@
1
- <template>
2
- <div
3
- ref="containerRef"
4
- :class="containerClasses"
5
- :style="{ height: height }"
6
- @scroll="onScroll"
7
- >
8
- <!-- 上拉刷新 -->
9
- <div
10
- v-if="refresh"
11
- :class="topClasses"
12
- :style="{ height: translateY + 'px' }"
13
- >
14
- <div :class="statusClass">
15
- <slot name="top">
16
- <span class="spinner">
17
- <Spinner
18
- v-if="upStatus === 'loading'"
19
- size="15"
20
- type="snake"
21
- />
22
- </span>
23
- <span class="dpzvc3-loadmore-text">{{ upText }}</span>
24
- </slot>
25
- </div>
26
- </div>
27
-
28
- <!-- 内容 -->
29
- <div :class="contentClasses">
30
- <slot />
31
- </div>
32
-
33
- <!-- 下拉加载更多 -->
34
- <div
35
- v-if="loadMore"
36
- :class="bottomClasses"
37
- >
38
- <div :class="statusClass">
39
- <slot name="bottom">
40
- <span class="spinner">
41
- <Spinner
42
- v-if="downStatus === 'loading'"
43
- size="15"
44
- type="snake"
45
- />
46
- </span>
47
- <span class="dpzvc3-loadmore-text">{{ downText }}</span>
48
- </slot>
49
- </div>
50
- </div>
51
- </div>
52
- </template>
53
-
54
- <script>
55
- import { defineComponent, ref, computed, watch, onMounted, onBeforeUnmount } from 'vue'
56
- import Spinner from '../spinner'
57
-
58
- const prefixCls = 'dpzvc3-loadmore'
59
-
60
- export default defineComponent({
61
- name: 'Dpzvc3Loadmore',
62
- components: { Spinner },
63
- props: {
64
- height: { type: [Number, String], default: '100%' },
65
- refresh: Function,
66
- upLoadingText: { type: String, default: '加载中...' },
67
- upDistance: { type: Number, default: 70 },
68
- upPullText: { type: String, default: '↓ 下拉刷新' },
69
- upDropText: { type: String, default: '↑ 释放更新' },
70
- maxDistance: { type: Number, default: 0 },
71
- speed: { type: Number, default: 3 },
72
- downEndText: { type: String, default: '没有更多了' },
73
- downDropText: { type: String, default: '↑ 上拉加载数据' },
74
- downLoadingText: { type: String, default: '加载中...' },
75
- downDistance: { type: Number, default: 50 },
76
- loadMore: Function,
77
- hasMore: { type: Boolean, default: true },
78
- styles: { type: Object, default: () => ({}) },
79
- auto: { type: Boolean, default: true },
80
- autoFill: { type: Boolean, default: true }
81
- },
82
- setup (props, { emit }) {
83
- const containerRef = ref(null)
84
-
85
- // 状态
86
- const translateY = ref(0)
87
- const startTranslateY = ref(0)
88
- const currentY = ref(0)
89
- const startY = ref(0)
90
- const upStatus = ref('')
91
- const downStatus = ref('')
92
- const direction = ref('')
93
- const upText = ref('')
94
- const downText = ref('')
95
- const down = ref(false)
96
- const drag = ref(false)
97
- const more = ref(props.hasMore)
98
-
99
- // classes
100
- const containerClasses = computed(() => [prefixCls])
101
- const topClasses = computed(() => [prefixCls + '-top', { [`${prefixCls}-drag`]: !drag.value }])
102
- const bottomClasses = computed(() => [prefixCls + '-bottom'])
103
- const contentClasses = computed(() => [prefixCls + '-content'])
104
- const statusClass = computed(() => [prefixCls + '-status'])
105
-
106
- // watch 状态
107
- watch(upStatus, val => {
108
- switch (val) {
109
- case 'pull': upText.value = props.upPullText; break
110
- case 'drop': upText.value = props.upDropText; break
111
- case 'loading': upText.value = props.upLoadingText; break
112
- }
113
- emit('on-change-up-status', val)
114
- })
115
-
116
- watch(downStatus, val => {
117
- switch (val) {
118
- case 'end': downText.value = props.downEndText; break
119
- case 'drop': downText.value = props.downDropText; break
120
- case 'loading': downText.value = props.downLoadingText; break
121
- default: downText.value = ''; break
122
- }
123
- emit('on-change-down-status', val)
124
- })
125
-
126
- watch(() => props.hasMore, val => {
127
- more.value = val
128
- if (!val) downStatus.value = 'end'
129
- })
130
-
131
- // 方法
132
- const isBottom = () => {
133
- const el = containerRef.value
134
- return el.scrollHeight <= el.offsetHeight
135
- }
136
-
137
- const onLoadOff = () => {
138
- translateY.value = 0
139
- upStatus.value = ''
140
- downStatus.value = ''
141
- if (!more.value) downStatus.value = 'end'
142
- setTimeout(() => {
143
- if (more.value && isBottom()) {
144
- direction.value = 'up'
145
- downStatus.value = 'loading'
146
- props.loadMore && props.loadMore()
147
- }
148
- }, 1000)
149
- }
150
-
151
- const onScroll = e => {
152
- e.preventDefault()
153
- if (downStatus.value === 'loading') return
154
- const el = containerRef.value
155
- const scrollTop = el.scrollTop
156
- if (props.loadMore) {
157
- const absY = el.scrollHeight - (el.offsetHeight + scrollTop)
158
- if (absY > props.downDistance && downStatus.value === 'drop') downStatus.value = ''
159
- else if (absY <= props.downDistance && absY > props.downDistance && more.value) downStatus.value = 'drop'
160
- else if (absY <= props.downDistance) {
161
- downStatus.value = 'loading'
162
- if (more.value) props.loadMore()
163
- else setTimeout(onLoadOff, 1000)
164
- }
165
- }
166
- }
167
-
168
- const onTouchStart = e => {
169
- if (upStatus.value === 'loading') return
170
- startY.value = e.touches[0].clientY
171
- startTranslateY.value = translateY.value
172
- down.value = false
173
- }
174
-
175
- const onTouchMove = e => {
176
- const el = containerRef.value
177
- if (!el) return
178
- const pos = el.getBoundingClientRect()
179
- if (upStatus.value === 'loading' || (startY.value < pos.top && startY.value > pos.bottom)) return
180
- currentY.value = e.touches[0].clientY
181
- const distance = (currentY.value - startY.value) / props.speed
182
- const scrollTop = el.scrollTop
183
- direction.value = distance > 0 ? 'down' : 'up'
184
-
185
- if (currentY.value >= startY.value && props.refresh && scrollTop === 0 && direction.value === 'down') {
186
- e.preventDefault()
187
- e.stopPropagation()
188
- translateY.value = props.maxDistance > 0 ? Math.min(distance - scrollTop, props.maxDistance) : distance - scrollTop
189
- if (translateY.value < 0) translateY.value = 0
190
- upStatus.value = translateY.value >= props.upDistance ? 'drop' : 'pull'
191
- drag.value = true
192
- down.value = down.value || isBottom()
193
- }
194
- }
195
-
196
- const onTouchEnd = e => {
197
- if (upStatus.value === 'loading') return
198
- const el = containerRef.value
199
- if (direction.value === 'down' && el.scrollTop <= 0 && translateY.value >= 0) {
200
- if (upStatus.value === 'drop') {
201
- translateY.value = 40
202
- upStatus.value = 'loading'
203
- props.refresh && props.refresh()
204
- } else {
205
- translateY.value = 0
206
- }
207
- }
208
- direction.value = ''
209
- drag.value = false
210
- }
211
-
212
- onMounted(() => {
213
- if (props.auto && props.refresh) {
214
- translateY.value = 40
215
- drag.value = false
216
- direction.value = 'down'
217
- upStatus.value = 'loading'
218
- props.refresh()
219
- }
220
-
221
- const el = containerRef.value
222
- if (el) {
223
- el.addEventListener('touchstart', onTouchStart, false)
224
- el.addEventListener('touchmove', onTouchMove, false)
225
- el.addEventListener('touchend', onTouchEnd, false)
226
- }
227
- })
228
-
229
- onBeforeUnmount(() => {
230
- const el = containerRef.value
231
- if (el) {
232
- el.removeEventListener('touchstart', onTouchStart, false)
233
- el.removeEventListener('touchmove', onTouchMove, false)
234
- el.removeEventListener('touchend', onTouchEnd, false)
235
- }
236
- })
237
-
238
- return {
239
- containerRef,
240
- translateY,
241
- upStatus,
242
- downStatus,
243
- upText,
244
- downText,
245
- down,
246
- drag,
247
- more,
248
- containerClasses,
249
- topClasses,
250
- bottomClasses,
251
- contentClasses,
252
- statusClass,
253
- onScroll,
254
- onLoadOff
255
- }
256
- }
257
- })
258
- </script>
@@ -1,60 +0,0 @@
1
- /**
2
- * confirm.js - Vue 3 版本
3
- * 负责创建 MessageGroup 实例
4
- */
5
-
6
- import { createVNode, render } from 'vue'
7
- import MessageGroup from './messageGroup.vue'
8
-
9
- MessageGroup.newInstance = function (props = {}) {
10
- const container = document.createElement('div')
11
- document.body.appendChild(container)
12
-
13
- let vnode = null
14
- let instance = null // 组件实例 proxy
15
-
16
- const mount = () => {
17
- vnode = createVNode(MessageGroup, {
18
- ...props
19
- // 这里使用 ref 拿到组件实例 proxy
20
- })
21
- render(vnode, container)
22
- instance = vnode.component.proxy
23
- }
24
-
25
- mount()
26
-
27
- return {
28
- add (options) {
29
- if (instance && instance.add) {
30
- instance.add(options)
31
- }
32
- },
33
- remove (name) {
34
- if (instance && instance.remove) {
35
- instance.remove(name)
36
- }
37
- },
38
- closeAll () {
39
- if (instance && instance.closeAll) {
40
- instance.closeAll()
41
- }
42
- },
43
- component: instance,
44
- destroy () {
45
- if (instance && instance.closeAll) {
46
- instance.closeAll()
47
- }
48
-
49
- setTimeout(() => {
50
- render(null, container)
51
- if (container.parentNode) {
52
- container.parentNode.removeChild(container)
53
- }
54
- instance = null
55
- }, 500)
56
- }
57
- }
58
- }
59
-
60
- export default MessageGroup
@@ -1,137 +0,0 @@
1
- <template>
2
- <transition name="dpzvc3-ani-scale">
3
- <div :class="classes">
4
- <div
5
- v-if="showLeft"
6
- :class="leftClasses"
7
- >
8
- <slot name="message-left">
9
- <Spinner
10
- size="65"
11
- type="blade"
12
- color="#ffffff"
13
- />
14
- </slot>
15
- </div>
16
-
17
- <p :class="wrapperClasses">
18
- {{ text }}
19
- </p>
20
-
21
- <div
22
- v-if="!rightHide"
23
- :class="rightClasses"
24
- >
25
- <slot name="message-right" />
26
- </div>
27
- </div>
28
- </transition>
29
- </template>
30
-
31
- <script>
32
- import { defineComponent, computed, onMounted, onBeforeUnmount, inject } from 'vue'
33
- import Spinner from '../spinner'
34
-
35
- const prefixCls = 'dpzvc3-message'
36
-
37
- export default defineComponent({
38
- name: 'DpzMessage',
39
- components: { Spinner },
40
-
41
- props: {
42
- name: {
43
- type: [String, Number],
44
- required: true
45
- },
46
- text: {
47
- type: [String, Number],
48
- default: ''
49
- },
50
- duration: {
51
- type: Number,
52
- default: 1.5
53
- },
54
- showLeft: {
55
- type: Boolean,
56
- default: false
57
- },
58
- rightHide: {
59
- type: Boolean,
60
- default: true
61
- },
62
- type: {
63
- type: String,
64
- default: 'normal',
65
- validator: val =>
66
- ['success', 'loading', 'error', 'normal', 'warning', 'danger'].includes(val)
67
- },
68
- onClose: {
69
- type: Function,
70
- default: () => {}
71
- },
72
- position: {
73
- type: String,
74
- default: 'top'
75
- }
76
- },
77
-
78
- setup (props) {
79
- /** 🔑 从 messageGroup 注入 remove 方法 */
80
- const remove = inject('removeMessage')
81
-
82
- let timer = null
83
-
84
- const classes = computed(() => [
85
- prefixCls,
86
- `${prefixCls}-position-${props.position}`
87
- ])
88
-
89
- const wrapperClasses = computed(() => [
90
- `${prefixCls}-text`
91
- ])
92
-
93
- const leftClasses = computed(() => [
94
- `${prefixCls}-left`
95
- ])
96
-
97
- const rightClasses = computed(() => [
98
- `${prefixCls}-right`
99
- ])
100
-
101
- const closeTimer = () => {
102
- if (timer) {
103
- clearTimeout(timer)
104
- timer = null
105
- }
106
- }
107
-
108
- const close = () => {
109
- closeTimer()
110
- remove && remove(props.name)
111
- props.onClose()
112
- }
113
-
114
- onMounted(() => {
115
- closeTimer()
116
-
117
- if (props.duration !== 0) {
118
- timer = setTimeout(() => {
119
- close()
120
- }, props.duration * 1000)
121
- }
122
- })
123
-
124
- onBeforeUnmount(() => {
125
- closeTimer()
126
- })
127
-
128
- return {
129
- classes,
130
- wrapperClasses,
131
- leftClasses,
132
- rightClasses,
133
- close
134
- }
135
- }
136
- })
137
- </script>
@@ -1,82 +0,0 @@
1
- <template>
2
- <div
3
- class="dpzvc3-message-group"
4
- :style="styles"
5
- >
6
- <Message
7
- v-for="message in messages"
8
- :key="message.name"
9
- :name="message.name"
10
- :text="message.text"
11
- :duration="message.duration"
12
- :show-left="message.showLeft"
13
- :right-hide="message.rightHide"
14
- :type="message.type"
15
- :position="message.position"
16
- :on-close="message.onClose"
17
- />
18
- </div>
19
- </template>
20
-
21
- <script>
22
- import { defineComponent, ref, provide } from 'vue'
23
- import Message from './message.vue'
24
-
25
- export default defineComponent({
26
- name: 'MessageGroup',
27
- components: {
28
- Message
29
- },
30
- props: {
31
- styles: {
32
- type: Object,
33
- default: () => ({})
34
- }
35
- },
36
-
37
- setup () {
38
- const messages = ref([])
39
-
40
- /** 添加 message */
41
- const add = (props = {}) => {
42
- const message = Object.assign(
43
- {
44
- name: '',
45
- text: '',
46
- duration: 1.5,
47
- showLeft: false,
48
- rightHide: true,
49
- type: 'normal',
50
- position: 'top',
51
- onClose: () => {}
52
- },
53
- props
54
- )
55
-
56
- messages.value.push(message)
57
- }
58
-
59
- /** 移除 message(供 message.vue 注入使用) */
60
- const remove = (name) => {
61
- messages.value = messages.value.filter(
62
- item => item.name !== name
63
- )
64
- }
65
-
66
- /** 关闭所有 */
67
- const closeAll = () => {
68
- messages.value = []
69
- }
70
-
71
- /** 🔑 向子组件注入 remove 方法 */
72
- provide('removeMessage', remove)
73
-
74
- return {
75
- messages,
76
- add,
77
- remove,
78
- closeAll
79
- }
80
- }
81
- })
82
- </script>
@@ -1,52 +0,0 @@
1
- /**
2
- * index.js - Vue 3 版本
3
- */
4
- import Modal from './confirm'
5
-
6
- let modalInstance = null
7
-
8
- function getModalInstance () {
9
- if (!modalInstance) {
10
- modalInstance = Modal.newInstance({
11
- showHead: true,
12
- closable: true,
13
- maskClosable: false,
14
- footerHide: false
15
- })
16
- }
17
- return modalInstance
18
- }
19
-
20
- function confirm (options = {}) {
21
- const instance = getModalInstance()
22
-
23
- options.onRemove = () => {
24
- modalInstance = null
25
- }
26
-
27
- instance.show(options)
28
- return instance
29
- }
30
-
31
- // info 模态框,显示取消按钮
32
- Modal.info = function (props = {}) {
33
- props.showCancle = true
34
- props.showHead = false
35
- return confirm(props)
36
- }
37
-
38
- // confirm 模态框,不显示取消按钮
39
- Modal.confirm = function (props = {}) {
40
- props.showCancle = false
41
- props.showHead = false
42
- return confirm(props)
43
- }
44
-
45
- // 移除当前 modal
46
- Modal.remove = function () {
47
- if (!modalInstance) return false
48
- const instance = getModalInstance()
49
- instance.remove()
50
- }
51
-
52
- export default Modal