dpzvc3-ui 3.0.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 (268) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +175 -0
  3. package/build-style.js +58 -0
  4. package/dist/dpzvc3.esm.js +17676 -0
  5. package/dist/dpzvc3.esm.js.map +1 -0
  6. package/dist/dpzvc3.esm.min.js +2 -0
  7. package/dist/dpzvc3.esm.min.js.map +1 -0
  8. package/dist/dpzvc3.js +15200 -0
  9. package/dist/dpzvc3.js.map +1 -0
  10. package/dist/dpzvc3.min.js +2 -0
  11. package/dist/dpzvc3.min.js.map +1 -0
  12. package/dist/styles/base/font.css +1 -0
  13. package/dist/styles/base/reset.css +1 -0
  14. package/dist/styles/base/variable.css +0 -0
  15. package/dist/styles/components/actionSheet.css +1 -0
  16. package/dist/styles/components/badge.css +1 -0
  17. package/dist/styles/components/button.css +1 -0
  18. package/dist/styles/components/card.css +1 -0
  19. package/dist/styles/components/cell-swipe.css +1 -0
  20. package/dist/styles/components/cell.css +1 -0
  21. package/dist/styles/components/checkBox.css +1 -0
  22. package/dist/styles/components/editor.css +1 -0
  23. package/dist/styles/components/header.css +1 -0
  24. package/dist/styles/components/indicator.css +1 -0
  25. package/dist/styles/components/loadmore.css +1 -0
  26. package/dist/styles/components/message.css +1 -0
  27. package/dist/styles/components/modal.css +1 -0
  28. package/dist/styles/components/number.css +1 -0
  29. package/dist/styles/components/picker.css +1 -0
  30. package/dist/styles/components/popup.css +1 -0
  31. package/dist/styles/components/progress.css +1 -0
  32. package/dist/styles/components/prompt.css +1 -0
  33. package/dist/styles/components/radioBox.css +1 -0
  34. package/dist/styles/components/slide-Bar.css +1 -0
  35. package/dist/styles/components/spinner.css +1 -0
  36. package/dist/styles/components/swipe.css +1 -0
  37. package/dist/styles/components/switchBar.css +1 -0
  38. package/dist/styles/components/tab.css +1 -0
  39. package/dist/styles/components/text.css +1 -0
  40. package/dist/styles/components/toTop.css +1 -0
  41. package/dist/styles/components/upload.css +1 -0
  42. package/dist/styles/dpzvc3.css +1 -0
  43. package/dist/styles/utils/1px.css +1 -0
  44. package/dist/styles/utils/animation.css +1 -0
  45. package/dist/styles/utils/nowrap.css +1 -0
  46. package/dist-prod/91.9d79b442ec3131707419.js +3 -0
  47. package/dist-prod/91.9d79b442ec3131707419.js.LICENSE.txt +25 -0
  48. package/dist-prod/91.9d79b442ec3131707419.js.map +1 -0
  49. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js +2 -0
  50. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js.map +1 -0
  51. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js +2 -0
  52. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js.map +1 -0
  53. package/dist-prod/button.28b491339fbba29c3f16.chunk.js +2 -0
  54. package/dist-prod/button.28b491339fbba29c3f16.chunk.js.map +1 -0
  55. package/dist-prod/card.3ad847f07bebc1391125.chunk.js +2 -0
  56. package/dist-prod/card.3ad847f07bebc1391125.chunk.js.map +1 -0
  57. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js +2 -0
  58. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js.map +1 -0
  59. package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js +2 -0
  60. package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js.map +1 -0
  61. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js +2 -0
  62. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js.map +1 -0
  63. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js +2 -0
  64. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js.map +1 -0
  65. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js +2 -0
  66. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js.map +1 -0
  67. package/dist-prod/index.html +19 -0
  68. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js +2 -0
  69. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js.map +1 -0
  70. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js +2 -0
  71. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js.map +1 -0
  72. package/dist-prod/main.2e9aaa9095e329ea2d7b.js +2 -0
  73. package/dist-prod/main.2e9aaa9095e329ea2d7b.js.map +1 -0
  74. package/dist-prod/message.e57fa263a214006f7191.chunk.js +2 -0
  75. package/dist-prod/message.e57fa263a214006f7191.chunk.js.map +1 -0
  76. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js +2 -0
  77. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js.map +1 -0
  78. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js +2 -0
  79. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js.map +1 -0
  80. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js +2 -0
  81. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js.map +1 -0
  82. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js +2 -0
  83. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js.map +1 -0
  84. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js +2 -0
  85. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js.map +1 -0
  86. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js +2 -0
  87. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js.map +1 -0
  88. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js +2 -0
  89. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js.map +1 -0
  90. package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js +2 -0
  91. package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js.map +1 -0
  92. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js +2 -0
  93. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js.map +1 -0
  94. package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js +2 -0
  95. package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js.map +1 -0
  96. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js +2 -0
  97. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js.map +1 -0
  98. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js +2 -0
  99. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js.map +1 -0
  100. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js +2 -0
  101. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js.map +1 -0
  102. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js +2 -0
  103. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js.map +1 -0
  104. package/dist-prod/upload.ec7a954970889869d93e.chunk.js +2 -0
  105. package/dist-prod/upload.ec7a954970889869d93e.chunk.js.map +1 -0
  106. package/images/IMG_2614 2 2.JPG +0 -0
  107. package/images/IMG_2614.JPG +0 -0
  108. package/images/IMG_2615 2.JPG +0 -0
  109. package/images/IMG_2615.JPG +0 -0
  110. package/package.json +113 -0
  111. package/postcss.config.js +5 -0
  112. package/src/components/Indicator/Indicator.vue +82 -0
  113. package/src/components/Indicator/index.js +86 -0
  114. package/src/components/Text/Number.vue +167 -0
  115. package/src/components/Text/index.js +7 -0
  116. package/src/components/Text/textBar.vue +122 -0
  117. package/src/components/action-sheet/actionSheet.vue +93 -0
  118. package/src/components/action-sheet/index.js +5 -0
  119. package/src/components/app.vue +61 -0
  120. package/src/components/badge/badge.vue +80 -0
  121. package/src/components/badge/index.js +5 -0
  122. package/src/components/button/button.vue +111 -0
  123. package/src/components/button/index.js +5 -0
  124. package/src/components/card/card.vue +49 -0
  125. package/src/components/card/index.js +5 -0
  126. package/src/components/cell/cell.vue +93 -0
  127. package/src/components/cell/index.js +5 -0
  128. package/src/components/cell-swipe/cell-swipe.vue +169 -0
  129. package/src/components/cell-swipe/index.js +5 -0
  130. package/src/components/checkBox/checkbox-group.vue +74 -0
  131. package/src/components/checkBox/checkbox.vue +117 -0
  132. package/src/components/checkBox/index.js +8 -0
  133. package/src/components/header/header.vue +130 -0
  134. package/src/components/header/index.js +5 -0
  135. package/src/components/loadMore/index.js +5 -0
  136. package/src/components/loadMore/loadmore.vue +258 -0
  137. package/src/components/message/confirm.js +60 -0
  138. package/src/components/message/index.js +111 -0
  139. package/src/components/message/message.vue +137 -0
  140. package/src/components/message/messageGroup.vue +82 -0
  141. package/src/components/modal/confirm.js +122 -0
  142. package/src/components/modal/index.js +52 -0
  143. package/src/components/modal/modal.vue +138 -0
  144. package/src/components/picker/area-picker/area-picker.vue +230 -0
  145. package/src/components/picker/area-picker/props.js +17 -0
  146. package/src/components/picker/date-picker/date-picker.vue +191 -0
  147. package/src/components/picker/date-picker/props.js +24 -0
  148. package/src/components/picker/index.js +5 -0
  149. package/src/components/picker/normal-picker/normal-picker.vue +120 -0
  150. package/src/components/picker/normal-picker/props.js +20 -0
  151. package/src/components/picker/picker-slot.vue +217 -0
  152. package/src/components/picker/picker.vue +111 -0
  153. package/src/components/popup/index.js +5 -0
  154. package/src/components/popup/popup.vue +91 -0
  155. package/src/components/progress/index.js +5 -0
  156. package/src/components/progress/progress.vue +86 -0
  157. package/src/components/prompt/confirm.js +91 -0
  158. package/src/components/prompt/index.js +53 -0
  159. package/src/components/prompt/prompt.vue +125 -0
  160. package/src/components/radioBox/index.js +8 -0
  161. package/src/components/radioBox/radiobox-group.vue +66 -0
  162. package/src/components/radioBox/radiobox.vue +88 -0
  163. package/src/components/rater/index.js +5 -0
  164. package/src/components/rater/rater.vue +118 -0
  165. package/src/components/slideBar/index.js +6 -0
  166. package/src/components/slideBar/slideBar.vue +207 -0
  167. package/src/components/spinner/behavior/blade.vue +42 -0
  168. package/src/components/spinner/behavior/double-bounce.vue +38 -0
  169. package/src/components/spinner/behavior/fading-circle.vue +55 -0
  170. package/src/components/spinner/behavior/snake.vue +41 -0
  171. package/src/components/spinner/behavior/triple-bounce.vue +52 -0
  172. package/src/components/spinner/index.js +5 -0
  173. package/src/components/spinner/props.js +28 -0
  174. package/src/components/spinner/spinner.vue +78 -0
  175. package/src/components/swipe/index.js +5 -0
  176. package/src/components/swipe/swipe.vue +281 -0
  177. package/src/components/switchbar/index.js +5 -0
  178. package/src/components/switchbar/switchbar.vue +79 -0
  179. package/src/components/tab/index.js +6 -0
  180. package/src/components/tab/tab.vue +89 -0
  181. package/src/components/toTop/index.js +5 -0
  182. package/src/components/toTop/topTop.vue +78 -0
  183. package/src/components/upload/index.js +5 -0
  184. package/src/components/upload/upload.vue +166 -0
  185. package/src/config/config.js +16 -0
  186. package/src/directives/clickoutside.js +42 -0
  187. package/src/directives/tranferDom.js +66 -0
  188. package/src/index.js +149 -0
  189. package/src/lib/MegaPixImage.js +163 -0
  190. package/src/lib/MegaPixImageOld.js +153 -0
  191. package/src/lib/exif-js.js +235 -0
  192. package/src/lib/exif.js +789 -0
  193. package/src/main.js +31 -0
  194. package/src/mixin/emitter.js +72 -0
  195. package/src/mixin/input.js +41 -0
  196. package/src/router.js +36 -0
  197. package/src/styles/base/font.less +99 -0
  198. package/src/styles/base/reset.less +135 -0
  199. package/src/styles/base/variable.less +108 -0
  200. package/src/styles/components/actionSheet.less +43 -0
  201. package/src/styles/components/badge.less +81 -0
  202. package/src/styles/components/button.less +124 -0
  203. package/src/styles/components/card.less +31 -0
  204. package/src/styles/components/cell-swipe.less +20 -0
  205. package/src/styles/components/cell.less +75 -0
  206. package/src/styles/components/checkBox.less +113 -0
  207. package/src/styles/components/editor.less +3 -0
  208. package/src/styles/components/header.less +72 -0
  209. package/src/styles/components/indicator.less +39 -0
  210. package/src/styles/components/loadmore.less +48 -0
  211. package/src/styles/components/message.less +57 -0
  212. package/src/styles/components/modal.less +84 -0
  213. package/src/styles/components/number.less +60 -0
  214. package/src/styles/components/picker.less +152 -0
  215. package/src/styles/components/popup.less +46 -0
  216. package/src/styles/components/progress.less +52 -0
  217. package/src/styles/components/prompt.less +37 -0
  218. package/src/styles/components/radioBox.less +138 -0
  219. package/src/styles/components/slide-Bar.less +149 -0
  220. package/src/styles/components/spinner.less +329 -0
  221. package/src/styles/components/swipe.less +125 -0
  222. package/src/styles/components/switchBar.less +88 -0
  223. package/src/styles/components/tab.less +71 -0
  224. package/src/styles/components/text.less +82 -0
  225. package/src/styles/components/toTop.less +28 -0
  226. package/src/styles/components/upload.less +23 -0
  227. package/src/styles/index.less +38 -0
  228. package/src/styles/utils/1px.less +206 -0
  229. package/src/styles/utils/animation.less +165 -0
  230. package/src/styles/utils/nowrap.less +19 -0
  231. package/src/template/index.ejs +40 -0
  232. package/src/utils/util.js +202 -0
  233. package/src/vconsole-resources.min.js +6 -0
  234. package/src/vconsole-sources.min.js +6 -0
  235. package/src/vconsole.min.js +7 -0
  236. package/src/views/ActionSheet.vue +46 -0
  237. package/src/views/Badge.vue +51 -0
  238. package/src/views/Button.vue +69 -0
  239. package/src/views/Card.vue +88 -0
  240. package/src/views/Cell.vue +30 -0
  241. package/src/views/CellSwipe.vue +68 -0
  242. package/src/views/CheckBox.vue +77 -0
  243. package/src/views/Header.vue +70 -0
  244. package/src/views/Indicator.vue +82 -0
  245. package/src/views/LoadMore.vue +73 -0
  246. package/src/views/Message.vue +61 -0
  247. package/src/views/Modal.vue +69 -0
  248. package/src/views/Picker.vue +140 -0
  249. package/src/views/Popup.vue +97 -0
  250. package/src/views/Progress.vue +47 -0
  251. package/src/views/Prompt.vue +43 -0
  252. package/src/views/RadioBox.vue +68 -0
  253. package/src/views/Rater.vue +49 -0
  254. package/src/views/SlideBar.vue +55 -0
  255. package/src/views/Spinner.vue +15 -0
  256. package/src/views/Swipe.vue +59 -0
  257. package/src/views/SwitchBar.vue +47 -0
  258. package/src/views/Tab.vue +53 -0
  259. package/src/views/Text.vue +93 -0
  260. package/src/views/ToTop.vue +17 -0
  261. package/src/views/Upload.vue +61 -0
  262. package/src/views/guide.vue +164 -0
  263. package/src/views/index.vue +554 -0
  264. package/webpack.base.config.js +65 -0
  265. package/webpack.dev.config.js +42 -0
  266. package/webpack.dist.dev.config.js +75 -0
  267. package/webpack.dist.prod.config.js +89 -0
  268. package/webpack.prod.config.js +51 -0
package/package.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ "name": "dpzvc3-ui",
3
+ "version": "3.0.0",
4
+ "description": "Vue组件库",
5
+ "main": "dist/dpzvc3.js",
6
+ "module": "dist/dpzvc3.esm.js",
7
+ "scripts": {
8
+ "init": "webpack --progress --config webpack.dev.config.js",
9
+ "dev": "webpack serve --config webpack.dev.config.js --open",
10
+ "build:style": "gulp --gulpfile build-style.js",
11
+ "build:dev": "webpack --config webpack.dist.dev.config.js",
12
+ "build:prod": "webpack --config webpack.dist.prod.config.js",
13
+ "build": "npm run build:style && npm run build:dev && npm run build:prod",
14
+ "dist": "webpack --progress --config webpack.prod.config.js",
15
+ "prepare": "husky"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/yishide/dpzvc3.git"
20
+ },
21
+ "keywords": [
22
+ "Vue3",
23
+ "Vue3 Cli",
24
+ "Webpack5",
25
+ "dpzvc3",
26
+ "UI",
27
+ "Vue3 Components",
28
+ "Vue3组件库",
29
+ "移动端组件库"
30
+ ],
31
+ "dependencies": {
32
+ "china-area-data": "^3.0.0",
33
+ "core-js": "^2.4.1",
34
+ "deepmerge": "^1.3.1",
35
+ "exifr": "^7.1.3",
36
+ "vue-router": "^4.6.4"
37
+ },
38
+ "devDependencies": {
39
+ "@babel/core": "^7.28.5",
40
+ "@babel/plugin-transform-runtime": "^7.28.5",
41
+ "@babel/preset-env": "^7.28.5",
42
+ "@babel/runtime": "^7.28.4",
43
+ "@vue/compiler-sfc": "^3.5.26",
44
+ "@vue/eslint-config-standard": "^8.0.1",
45
+ "autoprefixer": "^10.4.23",
46
+ "autoprefixer-loader": "^2.0.0",
47
+ "babel": "^6.23.0",
48
+ "babel-core": "^6.26.3",
49
+ "babel-loader": "^8.4.1",
50
+ "babel-plugin-transform-object-rest-spread": "^6.23.0",
51
+ "babel-plugin-transform-runtime": "^6.23.0",
52
+ "babel-preset-es2015": "^6.24.1",
53
+ "babel-preset-latest": "^6.24.1",
54
+ "babel-preset-stage-0": "^6.24.1",
55
+ "babel-runtime": "^6.26.0",
56
+ "cross-env": "^3.1.4",
57
+ "css-loader": "^6.11.0",
58
+ "del": "^8.0.1",
59
+ "eslint": "^8.57.1",
60
+ "eslint-plugin-html": "^1.7.0",
61
+ "eslint-plugin-import": "^2.32.0",
62
+ "eslint-plugin-node": "^11.1.0",
63
+ "eslint-plugin-promise": "^6.6.0",
64
+ "eslint-plugin-vue": "^9.33.0",
65
+ "eslint-webpack-plugin": "^4.2.0",
66
+ "file-loader": "^0.8.5",
67
+ "function-bind": "^1.1.0",
68
+ "gh-pages": "^6.3.0",
69
+ "gulp": "^4.0.2",
70
+ "gulp-clean-css": "^4.3.0",
71
+ "gulp-cli": "^2.3.0",
72
+ "gulp-header": "^2.0.9",
73
+ "gulp-less": "^5.0.0",
74
+ "gulp-postcss": "^10.0.0",
75
+ "gulp-rename": "^2.1.0",
76
+ "html-loader": "^0.3.0",
77
+ "html-webpack-plugin": "^5.6.5",
78
+ "husky": "^9.1.7",
79
+ "less": "^4.5.1",
80
+ "less-loader": "^11.1.4",
81
+ "lint-staged": "^16.2.7",
82
+ "lolex": "^1.5.2",
83
+ "mini-css-extract-plugin": "^2.9.4",
84
+ "postcss": "^8.5.6",
85
+ "postcss-loader": "^6.2.1",
86
+ "style-loader": "^3.3.4",
87
+ "terser-webpack-plugin": "^4.2.3",
88
+ "url-loader": "^0.5.9",
89
+ "vue": "^3.5.26",
90
+ "vue-hot-reload-api": "^1.3.3",
91
+ "vue-html-loader": "^1.2.3",
92
+ "vue-loader": "^17.4.2",
93
+ "vue-style-loader": "^4.1.3",
94
+ "webpack": "^5.104.1",
95
+ "webpack-cli": "^5.1.4",
96
+ "webpack-dev-server": "^4.15.2",
97
+ "webpack-merge": "^5.10.0"
98
+ },
99
+ "author": "yishide",
100
+ "license": "MIT",
101
+ "bugs": {
102
+ "url": "https://github.com/yishide/dpzvc3/issues"
103
+ },
104
+ "homepage": "https://github.com/yishide/dpzvc3#readme",
105
+ "directories": {
106
+ "example": "example"
107
+ },
108
+ "lint-staged": {
109
+ "*.{js,vue}": [
110
+ "eslint --max-warnings=0"
111
+ ]
112
+ }
113
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ plugins: [
3
+ require('autoprefixer')()
4
+ ]
5
+ }
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <transition name="dpzvc3-ani-fade">
3
+ <div
4
+ v-show="visible"
5
+ :class="classes"
6
+ @touchmove.prevent
7
+ >
8
+ <div :class="containerClasses">
9
+ <div :class="wrapperClasses">
10
+ <Spinner
11
+ :size="size"
12
+ :type="type"
13
+ :color="color"
14
+ />
15
+ <span :style="{ color }">{{ text }}</span>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </transition>
20
+ </template>
21
+
22
+ <script>
23
+ import { defineComponent, ref, watch, computed } from 'vue'
24
+ import Spinner from '../spinner'
25
+
26
+ const prefixCls = 'dpzvc3-Indicator'
27
+
28
+ export default defineComponent({
29
+ name: 'Dpzvc3Indicator',
30
+ components: { Spinner },
31
+ props: {
32
+ modelValue: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ color: {
37
+ type: String,
38
+ default: '#ffffff'
39
+ },
40
+ type: {
41
+ type: String,
42
+ default: 'snake'
43
+ },
44
+ size: {
45
+ type: [Number, String],
46
+ default: 45
47
+ },
48
+ text: {
49
+ type: String,
50
+ default: '加载中...'
51
+ }
52
+ },
53
+ emits: ['update:modelValue'],
54
+ setup (props, { emit }) {
55
+ const visible = ref(props.modelValue)
56
+
57
+ // watch modelValue 更新 visible
58
+ watch(
59
+ () => props.modelValue,
60
+ val => {
61
+ visible.value = val
62
+ }
63
+ )
64
+
65
+ // watch visible 更新 v-model
66
+ watch(visible, val => {
67
+ emit('update:modelValue', val)
68
+ })
69
+
70
+ const classes = computed(() => [prefixCls])
71
+ const containerClasses = computed(() => [`${prefixCls}-container`])
72
+ const wrapperClasses = computed(() => [`${prefixCls}-wrapper`])
73
+
74
+ return {
75
+ visible,
76
+ classes,
77
+ containerClasses,
78
+ wrapperClasses
79
+ }
80
+ }
81
+ })
82
+ </script>
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Indicator - Vue 3 版本
3
+ */
4
+ import { createVNode, render } from 'vue'
5
+ import Indicator from './Indicator.vue'
6
+
7
+ let instance = null
8
+ let container = null
9
+
10
+ function createInstance (props = {}) {
11
+ container = document.createElement('div')
12
+ document.body.appendChild(container)
13
+
14
+ const defaultProps = {
15
+ size: 45,
16
+ type: 'snake',
17
+ color: '#ffffff',
18
+ text: '加载中...',
19
+ visible: false,
20
+ ...props
21
+ }
22
+ const vnode = createVNode(Indicator, {
23
+ ...defaultProps,
24
+ onRemove: destroyInstance
25
+ })
26
+ render(vnode, container)
27
+ instance = vnode.component
28
+ return instance
29
+ }
30
+
31
+ function destroyInstance () {
32
+ if (!instance || !container) return
33
+ render(null, container)
34
+ if (container.parentNode) {
35
+ container.parentNode.removeChild(container)
36
+ }
37
+ instance = null
38
+ container = null
39
+ }
40
+
41
+ function open (options = {}) {
42
+ if (!instance) {
43
+ createInstance(options)
44
+ }
45
+
46
+ // 更新 props
47
+ if (instance) {
48
+ Object.keys(options).forEach(key => {
49
+ instance.props[key] = options[key]
50
+ })
51
+ instance.props.modelValue = true
52
+ }
53
+ }
54
+
55
+ function close () {
56
+ if (!instance) return
57
+ instance.props.modelValue = false
58
+ destroyInstance()
59
+ }
60
+
61
+ /* ================== 对外 API ================== */
62
+
63
+ Indicator.open = open
64
+ Indicator.remove = close
65
+
66
+ Indicator.snake = function (props = {}) {
67
+ props.type = 'snake'
68
+ open(props)
69
+ }
70
+
71
+ Indicator.blade = function (props = {}) {
72
+ props.type = 'blade'
73
+ open(props)
74
+ }
75
+
76
+ Indicator.circle = function (props = {}) {
77
+ props.type = 'fading-circle'
78
+ open(props)
79
+ }
80
+
81
+ Indicator.bounce = function (props = {}) {
82
+ props.type = 'double-bounce'
83
+ open(props)
84
+ }
85
+
86
+ export default Indicator
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <div
3
+ :class="classes"
4
+ :style="containerStyle"
5
+ >
6
+ <!-- 减按钮 -->
7
+ <div
8
+ :class="reduceClasses"
9
+ :style="getChangeStyle"
10
+ @click="change('reduce', downDisabled)"
11
+ >
12
+ <slot name="reduce">
13
+ -
14
+ </slot>
15
+ </div>
16
+
17
+ <!-- 输入框 -->
18
+ <div :class="wrapperClasses">
19
+ <input
20
+ type="number"
21
+ :style="inputStyle"
22
+ :min="min"
23
+ :max="max"
24
+ :step="step"
25
+ :value="currentValue"
26
+ :autocomplete="autocomplete"
27
+ @input="changeInput"
28
+ @focus="focusInput"
29
+ @blur="blurInput"
30
+ @change="onChangeInput"
31
+ @keyup.38="change('reduce', downDisabled)"
32
+ @keyup.40="change('add', upDisabled)"
33
+ >
34
+ </div>
35
+
36
+ <!-- 加按钮 -->
37
+ <div
38
+ :class="addtionClasses"
39
+ :style="getChangeStyle"
40
+ @click="change('add', upDisabled)"
41
+ >
42
+ <slot name="add">
43
+ +
44
+ </slot>
45
+ </div>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+ import { defineComponent, ref, computed, watch, onMounted } from 'vue'
51
+ import Input from '../../mixin/input'
52
+
53
+ const prefixCls = 'dpzvc3-number'
54
+
55
+ export default defineComponent({
56
+ name: 'Dpzvc3Number',
57
+ mixins: [Input],
58
+ props: {
59
+ min: { type: [Number, String], default: -Infinity },
60
+ max: { type: [Number, String], default: Infinity },
61
+ modelValue: [Number, String],
62
+ step: { type: Number, default: 1 },
63
+ width: { type: Number, default: 60 },
64
+ height: { type: Number, default: 35 },
65
+ numberStyle: { type: Object, default: () => ({}) },
66
+ containerStyle: { type: Object, default: () => ({}) }
67
+ },
68
+ emits: ['update:modelValue', 'input', 'on-input'],
69
+ setup (props, { emit }) {
70
+ const currentValue = ref(props.modelValue)
71
+ const upDisabled = ref(false)
72
+ const downDisabled = ref(false)
73
+
74
+ // 计算类名
75
+ const classes = computed(() => [prefixCls])
76
+ const reduceClasses = computed(() => [
77
+ `${prefixCls}-changevalue`,
78
+ 'left',
79
+ { disabled: downDisabled.value }
80
+ ])
81
+ const addtionClasses = computed(() => [
82
+ `${prefixCls}-changevalue`,
83
+ 'right',
84
+ { disabled: upDisabled.value }
85
+ ])
86
+ const wrapperClasses = computed(() => [`${prefixCls}-wrapper`])
87
+ const getChangeStyle = computed(() => ({
88
+ width: `${props.height}px`,
89
+ height: `${props.height}px`,
90
+ lineHeight: `${props.height}px`
91
+ }))
92
+ const inputStyle = computed(() => ({
93
+ ...props.numberStyle,
94
+ width: `${props.width}px`,
95
+ height: `${props.height}px`
96
+ }))
97
+
98
+ // 改变值时计算按钮状态
99
+ function changeVal (val) {
100
+ const numberVal = Number(val)
101
+ if (!isNaN(numberVal) || numberVal === 0) {
102
+ upDisabled.value = numberVal + props.step > props.max
103
+ downDisabled.value = numberVal - props.step < props.min
104
+ } else {
105
+ upDisabled.value = true
106
+ downDisabled.value = true
107
+ }
108
+ }
109
+
110
+ function setValue (val) {
111
+ currentValue.value = val
112
+ emit('input', val)
113
+ emit('update:modelValue', val)
114
+ }
115
+
116
+ // 输入框事件
117
+ function changeInput (e) {
118
+ let val = e.target.value.trim()
119
+ val = Number(val)
120
+ if (val < props.min) val = props.min
121
+ if (val > props.max) val = props.max
122
+ setValue(val)
123
+ e.target.value = currentValue.value
124
+ emit('on-input', e)
125
+ emit('update:modelValue', val)
126
+ }
127
+
128
+ // 点击加减按钮
129
+ function change (type, disabled) {
130
+ if (disabled) return
131
+ let val = Number(currentValue.value)
132
+ if (isNaN(val)) return
133
+ if (type === 'reduce') val -= props.step
134
+ else if (type === 'add') val += props.step
135
+ if (val < props.min) val = props.min
136
+ if (val > props.max) val = props.max
137
+ setValue(val)
138
+ }
139
+
140
+ watch(() => props.modelValue, (val) => {
141
+ currentValue.value = val
142
+ })
143
+
144
+ watch(currentValue, (val) => {
145
+ changeVal(val)
146
+ })
147
+
148
+ onMounted(() => {
149
+ changeVal(currentValue.value)
150
+ })
151
+
152
+ return {
153
+ currentValue,
154
+ upDisabled,
155
+ downDisabled,
156
+ classes,
157
+ reduceClasses,
158
+ addtionClasses,
159
+ wrapperClasses,
160
+ getChangeStyle,
161
+ inputStyle,
162
+ changeInput,
163
+ change
164
+ }
165
+ }
166
+ })
167
+ </script>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Created by admin on 2025/9/24.
3
+ */
4
+ import Text from './textBar'
5
+ import Number from './Number'
6
+ Text.Number = Number
7
+ export default Text
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <div
3
+ :class="classes"
4
+ :style="styles"
5
+ >
6
+ <!-- 普通输入框 -->
7
+ <label
8
+ v-if="type !== 'textarea'"
9
+ :class="inputClasses"
10
+ :style="inputStyles"
11
+ >
12
+ <input
13
+ :type="type"
14
+ :autofocus="autofocus"
15
+ :value="currentVal"
16
+ :placeholder="placeholder"
17
+ :readonly="readonly"
18
+ :maxlength="maxlength"
19
+ :autocomplete="autocomplete"
20
+ :name="name"
21
+ :disabled="disable"
22
+ @input="changeInput"
23
+ @blur="blurInput"
24
+ @focus="focusInput"
25
+ @keyup.enter="enterInput"
26
+ @change="onChangeInput"
27
+ >
28
+ </label>
29
+
30
+ <!-- 多行文本框 -->
31
+ <label
32
+ v-else
33
+ :class="textareaClasses"
34
+ >
35
+ <textarea
36
+ :type="type"
37
+ :autofocus="autofocus"
38
+ :value="currentVal"
39
+ :placeholder="placeholder"
40
+ :readonly="readonly"
41
+ :maxlength="maxlength"
42
+ :name="name"
43
+ :rows="rows"
44
+ :disabled="disable"
45
+ @input="changeInput"
46
+ @blur="blurInput"
47
+ @focus="focusInput"
48
+ @keyup.enter="enterInput"
49
+ @change="onChangeInput"
50
+ />
51
+ </label>
52
+ </div>
53
+ </template>
54
+
55
+ <script>
56
+ import { defineComponent, ref, computed, watch } from 'vue'
57
+ import Input from '../../mixin/input'
58
+
59
+ const prefixCls = 'dpzvc3-textBar'
60
+
61
+ export default defineComponent({
62
+ name: 'TextBar',
63
+ mixins: [Input],
64
+ props: {
65
+ rows: Number,
66
+ autofocus: { type: Boolean, default: true },
67
+ type: { type: String, default: 'text' },
68
+ modelValue: { type: [String, Number], default: '' },
69
+ placeholder: { type: [String, Number], default: '请输入' },
70
+ inputStyles: Object,
71
+ maxlength: Number,
72
+ name: String,
73
+ readonly: { type: Boolean, default: false }
74
+ },
75
+ emits: ['update:modelValue', 'input', 'on-input', 'on-enter'],
76
+ setup (props, { emit }) {
77
+ const currentVal = ref(props.modelValue)
78
+
79
+ // 类名
80
+ const classes = computed(() => [prefixCls])
81
+ const inputClasses = computed(() => [`${prefixCls}-input`])
82
+ const textareaClasses = computed(() => [`${prefixCls}-textarea`])
83
+
84
+ // 监听 props.value 改变
85
+ watch(
86
+ () => props.modelValue,
87
+ (val) => {
88
+ currentVal.value = val
89
+ }
90
+ )
91
+
92
+ // 监听内部值变化
93
+ watch(currentVal, (val) => {
94
+ emit('input', val)
95
+ emit('on-input', val)
96
+ emit('update:modelValue', val)
97
+ })
98
+
99
+ // 输入事件
100
+ function changeInput (e) {
101
+ currentVal.value = e.target.value
102
+ emit('input', currentVal.value)
103
+ emit('on-input', e)
104
+ emit('update:modelValue', currentVal.value)
105
+ }
106
+
107
+ // 回车事件
108
+ function enterInput (e) {
109
+ emit('on-enter', e)
110
+ }
111
+
112
+ return {
113
+ currentVal,
114
+ classes,
115
+ inputClasses,
116
+ textareaClasses,
117
+ changeInput,
118
+ enterInput
119
+ }
120
+ }
121
+ })
122
+ </script>
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <div>
3
+ <Popup
4
+ v-model="visible"
5
+ position="bottom"
6
+ :styles="{ background: 'transparent' }"
7
+ >
8
+ <div :class="classes">
9
+ <ul :class="wrapperClasses">
10
+ <li
11
+ v-for="(item, key) in actions"
12
+ :key="key"
13
+ :class="wrapperActionClass"
14
+ @click="emit(item, key)"
15
+ >
16
+ <span>{{ item.text }}</span>
17
+ </li>
18
+ </ul>
19
+ <a
20
+ v-if="cancleText"
21
+ href="javascript:;"
22
+ :class="cancleClass"
23
+ @click="visible = false"
24
+ >{{ cancleText }}</a>
25
+ </div>
26
+ </Popup>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import { ref, computed, watch } from 'vue'
32
+ import Popup from '../popup'
33
+
34
+ const prefixCls = 'dpzvc3-actionSheet'
35
+
36
+ export default {
37
+ name: 'ActionSheet',
38
+ components: { Popup },
39
+ props: {
40
+ modelValue: { // Vue 3 v-model 默认绑定 modelValue
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ items: {
45
+ type: Array,
46
+ default: () => []
47
+ },
48
+ cancleText: {
49
+ type: String,
50
+ default: '取消'
51
+ }
52
+ },
53
+ setup (props, { emit }) {
54
+ // 内部状态
55
+ const visible = ref(props.modelValue)
56
+ const actions = ref(props.items)
57
+
58
+ // 同步 props.modelValue
59
+ watch(() => props.modelValue, (val) => {
60
+ visible.value = val
61
+ })
62
+
63
+ // 监听 visible 改变,通知父组件
64
+ watch(visible, (val) => {
65
+ emit('update:modelValue', val)
66
+ })
67
+
68
+ // 样式类
69
+ const classes = computed(() => [prefixCls])
70
+ const wrapperClasses = computed(() => [`${prefixCls}-wrapper`])
71
+ const wrapperActionClass = computed(() => [`${prefixCls}-wrapper-action`])
72
+ const cancleClass = computed(() => [`${prefixCls}-cancle`])
73
+
74
+ // 点击事件
75
+ const emitAction = (item, index) => {
76
+ if (item.onClick && typeof item.onClick === 'function') {
77
+ item.onClick(item, index)
78
+ }
79
+ visible.value = false
80
+ }
81
+
82
+ return {
83
+ visible,
84
+ actions,
85
+ classes,
86
+ wrapperClasses,
87
+ wrapperActionClass,
88
+ cancleClass,
89
+ emit: emitAction
90
+ }
91
+ }
92
+ }
93
+ </script>
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Created by admin on 2025/9/19.
3
+ */
4
+ import ActionSheet from './actionSheet'
5
+ export default ActionSheet