dpzvc3-ui 3.1.4 → 3.1.6

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 (279) hide show
  1. package/README.md +1 -1
  2. package/dist/dpzvc3.esm.js +5 -4
  3. package/dist/dpzvc3.esm.js.map +1 -1
  4. package/dist/dpzvc3.esm.min.js +1 -1
  5. package/dist/dpzvc3.esm.min.js.map +1 -1
  6. package/dist/dpzvc3.js +5 -4
  7. package/dist/dpzvc3.js.map +1 -1
  8. package/dist/dpzvc3.min.js +1 -1
  9. package/dist/dpzvc3.min.js.map +1 -1
  10. package/dist/types/components/actionSheet/index.d.ts +6 -1
  11. package/dist/types/components/actionSheet/index.d.ts.map +1 -1
  12. package/dist/types/index.d.ts +2 -2
  13. package/package.json +7 -2
  14. package/build-style.js +0 -58
  15. package/dist-prod/91.05c8ec5277a15f939b0f.js +0 -3
  16. package/dist-prod/91.05c8ec5277a15f939b0f.js.LICENSE.txt +0 -25
  17. package/dist-prod/91.05c8ec5277a15f939b0f.js.map +0 -1
  18. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js +0 -2
  19. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js.map +0 -1
  20. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js +0 -2
  21. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js.map +0 -1
  22. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js +0 -2
  23. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js.map +0 -1
  24. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js +0 -2
  25. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js.map +0 -1
  26. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js +0 -2
  27. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js.map +0 -1
  28. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js +0 -2
  29. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js.map +0 -1
  30. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js +0 -2
  31. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js.map +0 -1
  32. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js +0 -2
  33. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js.map +0 -1
  34. package/dist-prod/header.eb10433dd892738ee95a.chunk.js +0 -2
  35. package/dist-prod/header.eb10433dd892738ee95a.chunk.js.map +0 -1
  36. package/dist-prod/index.html +0 -19
  37. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js +0 -2
  38. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js.map +0 -1
  39. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js +0 -2
  40. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js.map +0 -1
  41. package/dist-prod/main.662ad15361e7f3d20234.js +0 -2
  42. package/dist-prod/main.662ad15361e7f3d20234.js.map +0 -1
  43. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js +0 -2
  44. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js.map +0 -1
  45. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js +0 -2
  46. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js.map +0 -1
  47. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js +0 -2
  48. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js.map +0 -1
  49. package/dist-prod/popup.538422c7e188363a468d.chunk.js +0 -2
  50. package/dist-prod/popup.538422c7e188363a468d.chunk.js.map +0 -1
  51. package/dist-prod/progress.240de4b633002f573030.chunk.js +0 -2
  52. package/dist-prod/progress.240de4b633002f573030.chunk.js.map +0 -1
  53. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js +0 -2
  54. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js.map +0 -1
  55. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js +0 -2
  56. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js.map +0 -1
  57. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js +0 -2
  58. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js.map +0 -1
  59. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js +0 -2
  60. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js.map +0 -1
  61. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js +0 -2
  62. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js.map +0 -1
  63. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js +0 -2
  64. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js.map +0 -1
  65. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js +0 -2
  66. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js.map +0 -1
  67. package/dist-prod/tab.29f19483f699b7811259.chunk.js +0 -2
  68. package/dist-prod/tab.29f19483f699b7811259.chunk.js.map +0 -1
  69. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js +0 -2
  70. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js.map +0 -1
  71. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js +0 -2
  72. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js.map +0 -1
  73. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js +0 -2
  74. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js.map +0 -1
  75. package/postcss.config.js +0 -5
  76. package/src/components/Indicator/Indicator.tsx +0 -67
  77. package/src/components/Indicator/Indicator.vue +0 -82
  78. package/src/components/Indicator/index.ts +0 -111
  79. package/src/components/Indicator/types.ts +0 -15
  80. package/src/components/Text/index.ts +0 -14
  81. package/src/components/Text/textBar.tsx +0 -104
  82. package/src/components/Text/types.ts +0 -13
  83. package/src/components/actionSheet/actionSheet.d.ts +0 -16
  84. package/src/components/actionSheet/actionSheet.tsx +0 -86
  85. package/src/components/actionSheet/index.ts +0 -6
  86. package/src/components/actionSheet/types.ts +0 -10
  87. package/src/components/app.vue +0 -59
  88. package/src/components/badge/badge.tsx +0 -80
  89. package/src/components/badge/index.ts +0 -12
  90. package/src/components/badge/types.ts +0 -8
  91. package/src/components/button/button.tsx +0 -105
  92. package/src/components/button/index.ts +0 -13
  93. package/src/components/button/types.ts +0 -13
  94. package/src/components/card/card.d.ts +0 -16
  95. package/src/components/card/card.tsx +0 -38
  96. package/src/components/card/index.ts +0 -12
  97. package/src/components/card/types.ts +0 -3
  98. package/src/components/cell/cell.tsx +0 -89
  99. package/src/components/cell/index.ts +0 -12
  100. package/src/components/cell/types.ts +0 -8
  101. package/src/components/cellSwipe/cellSwipe.tsx +0 -188
  102. package/src/components/cellSwipe/index.ts +0 -13
  103. package/src/components/cellSwipe/types.ts +0 -17
  104. package/src/components/checkBox/checkbox-group.tsx +0 -75
  105. package/src/components/checkBox/checkbox.tsx +0 -107
  106. package/src/components/checkBox/index.ts +0 -29
  107. package/src/components/checkBox/types.ts +0 -32
  108. package/src/components/header/header.tsx +0 -119
  109. package/src/components/header/index.ts +0 -13
  110. package/src/components/header/types.ts +0 -7
  111. package/src/components/loadMore/index.ts +0 -14
  112. package/src/components/loadMore/loadMore.tsx +0 -265
  113. package/src/components/loadMore/types.ts +0 -26
  114. package/src/components/message/confirm.ts +0 -104
  115. package/src/components/message/index.ts +0 -113
  116. package/src/components/message/message.tsx +0 -100
  117. package/src/components/message/messageGroup.tsx +0 -59
  118. package/src/components/message/types.ts +0 -48
  119. package/src/components/modal/confirm.ts +0 -123
  120. package/src/components/modal/index.ts +0 -68
  121. package/src/components/modal/modal.tsx +0 -248
  122. package/src/components/modal/types.ts +0 -51
  123. package/src/components/number/Number.tsx +0 -143
  124. package/src/components/number/index.ts +0 -10
  125. package/src/components/number/types.ts +0 -13
  126. package/src/components/picker/area-picker/area-picker.vue +0 -230
  127. package/src/components/picker/area-picker/props.js +0 -17
  128. package/src/components/picker/date-picker/date-picker.vue +0 -191
  129. package/src/components/picker/date-picker/props.js +0 -24
  130. package/src/components/picker/index.ts +0 -12
  131. package/src/components/picker/normal-picker/normal-picker.vue +0 -120
  132. package/src/components/picker/normal-picker/props.js +0 -20
  133. package/src/components/picker/picker-slot.vue +0 -217
  134. package/src/components/picker/picker.tsx +0 -112
  135. package/src/components/picker/types.ts +0 -17
  136. package/src/components/popup/index.ts +0 -12
  137. package/src/components/popup/popup.d.ts +0 -16
  138. package/src/components/popup/popup.tsx +0 -68
  139. package/src/components/popup/types.ts +0 -9
  140. package/src/components/progress/index.ts +0 -12
  141. package/src/components/progress/progress.tsx +0 -81
  142. package/src/components/progress/types.ts +0 -9
  143. package/src/components/prompt/confirm.ts +0 -104
  144. package/src/components/prompt/index.ts +0 -50
  145. package/src/components/prompt/prompt.tsx +0 -161
  146. package/src/components/prompt/types.ts +0 -45
  147. package/src/components/radioBox/index.ts +0 -34
  148. package/src/components/radioBox/radiobox-group.tsx +0 -66
  149. package/src/components/radioBox/radiobox-group1.vue +0 -66
  150. package/src/components/radioBox/radiobox.tsx +0 -115
  151. package/src/components/radioBox/radiobox1.vue +0 -89
  152. package/src/components/radioBox/types.ts +0 -24
  153. package/src/components/rater/index.ts +0 -12
  154. package/src/components/rater/rater.d.ts +0 -16
  155. package/src/components/rater/raters.tsx +0 -101
  156. package/src/components/rater/types.ts +0 -10
  157. package/src/components/slideBar/index.ts +0 -13
  158. package/src/components/slideBar/slideBar.tsx +0 -288
  159. package/src/components/slideBar/types.ts +0 -20
  160. package/src/components/spinner/behavior/blade.vue +0 -42
  161. package/src/components/spinner/behavior/double-bounce.vue +0 -38
  162. package/src/components/spinner/behavior/fading-circle.vue +0 -55
  163. package/src/components/spinner/behavior/snake.vue +0 -41
  164. package/src/components/spinner/behavior/triple-bounce.vue +0 -52
  165. package/src/components/spinner/index.ts +0 -13
  166. package/src/components/spinner/props.js +0 -28
  167. package/src/components/spinner/spinner.tsx +0 -85
  168. package/src/components/spinner/types.ts +0 -20
  169. package/src/components/swipe/index.ts +0 -13
  170. package/src/components/swipe/swipe.tsx +0 -292
  171. package/src/components/swipe/types.ts +0 -21
  172. package/src/components/switchbar/index.ts +0 -13
  173. package/src/components/switchbar/switchbar.tsx +0 -58
  174. package/src/components/switchbar/types.ts +0 -6
  175. package/src/components/tab/index.ts +0 -12
  176. package/src/components/tab/tab.tsx +0 -71
  177. package/src/components/tab/types.ts +0 -15
  178. package/src/components/toTop/index.ts +0 -13
  179. package/src/components/toTop/toTop.tsx +0 -54
  180. package/src/components/toTop/types.ts +0 -7
  181. package/src/components/upload/index.ts +0 -13
  182. package/src/components/upload/types.ts +0 -9
  183. package/src/components/upload/upload.tsx +0 -180
  184. package/src/config/config.js +0 -16
  185. package/src/directives/clickoutside.js +0 -42
  186. package/src/directives/tranferDom.js +0 -66
  187. package/src/index.d.ts +0 -131
  188. package/src/index.ts +0 -136
  189. package/src/lib/MegaPixImage.js +0 -164
  190. package/src/lib/MegaPixImageOld.js +0 -153
  191. package/src/lib/exif-js.js +0 -235
  192. package/src/lib/exif.js +0 -789
  193. package/src/lib/lib.js +0 -22
  194. package/src/main.ts +0 -33
  195. package/src/mixin/emitter.js +0 -72
  196. package/src/mixin/input.js +0 -41
  197. package/src/router.ts +0 -36
  198. package/src/shims-vue.d.ts +0 -37
  199. package/src/styles/base/font.less +0 -99
  200. package/src/styles/base/reset.less +0 -135
  201. package/src/styles/base/variable.less +0 -108
  202. package/src/styles/components/actionSheet.less +0 -43
  203. package/src/styles/components/badge.less +0 -81
  204. package/src/styles/components/button.less +0 -124
  205. package/src/styles/components/card.less +0 -31
  206. package/src/styles/components/cell-swipe.less +0 -20
  207. package/src/styles/components/cell.less +0 -75
  208. package/src/styles/components/checkBox.less +0 -113
  209. package/src/styles/components/editor.less +0 -3
  210. package/src/styles/components/header.less +0 -72
  211. package/src/styles/components/indicator.less +0 -39
  212. package/src/styles/components/loadmore.less +0 -48
  213. package/src/styles/components/message.less +0 -57
  214. package/src/styles/components/modal.less +0 -84
  215. package/src/styles/components/number.less +0 -60
  216. package/src/styles/components/picker.less +0 -152
  217. package/src/styles/components/popup.less +0 -46
  218. package/src/styles/components/progress.less +0 -52
  219. package/src/styles/components/prompt.less +0 -37
  220. package/src/styles/components/radioBox.less +0 -142
  221. package/src/styles/components/rater.less +0 -16
  222. package/src/styles/components/slide-Bar.less +0 -149
  223. package/src/styles/components/spinner.less +0 -329
  224. package/src/styles/components/swipe.less +0 -125
  225. package/src/styles/components/switchBar.less +0 -88
  226. package/src/styles/components/tab.less +0 -71
  227. package/src/styles/components/text.less +0 -82
  228. package/src/styles/components/toTop.less +0 -28
  229. package/src/styles/components/upload.less +0 -23
  230. package/src/styles/index.less +0 -39
  231. package/src/styles/utils/1px.less +0 -206
  232. package/src/styles/utils/animation.less +0 -165
  233. package/src/styles/utils/nowrap.less +0 -19
  234. package/src/template/index.ejs +0 -40
  235. package/src/types/index.d.ts +0 -127
  236. package/src/types/js-shims.d.ts +0 -36
  237. package/src/utils/test.ts +0 -2
  238. package/src/utils/util.ts +0 -168
  239. package/src/utils/util1.js +0 -202
  240. package/src/vconsole-resources.min.js +0 -6
  241. package/src/vconsole-sources.min.js +0 -6
  242. package/src/vconsole.min.js +0 -7
  243. package/src/views/ActionSheet.vue +0 -46
  244. package/src/views/Badge/Badge.less +0 -12
  245. package/src/views/Badge/Badge.tsx +0 -23
  246. package/src/views/Badge.vue +0 -53
  247. package/src/views/Button.vue +0 -69
  248. package/src/views/Card.vue +0 -89
  249. package/src/views/Cell.vue +0 -31
  250. package/src/views/CellSwipe.vue +0 -80
  251. package/src/views/CheckBox.vue +0 -78
  252. package/src/views/Header.vue +0 -71
  253. package/src/views/Indicator.vue +0 -82
  254. package/src/views/LoadMore.vue +0 -76
  255. package/src/views/Message.vue +0 -61
  256. package/src/views/Modal.vue +0 -69
  257. package/src/views/Picker.vue +0 -142
  258. package/src/views/Popup.vue +0 -103
  259. package/src/views/Progress.vue +0 -49
  260. package/src/views/Prompt.vue +0 -43
  261. package/src/views/RadioBox.vue +0 -70
  262. package/src/views/Rater.vue +0 -53
  263. package/src/views/SlideBar.vue +0 -62
  264. package/src/views/Spinner.vue +0 -27
  265. package/src/views/Swipe.vue +0 -59
  266. package/src/views/SwitchBar.vue +0 -49
  267. package/src/views/Tab.vue +0 -55
  268. package/src/views/Text.vue +0 -97
  269. package/src/views/ToTop.vue +0 -31
  270. package/src/views/Upload.vue +0 -65
  271. package/src/views/guide.vue +0 -164
  272. package/src/views/index.vue +0 -554
  273. package/tsconfig.build.json +0 -31
  274. package/tsconfig.json +0 -41
  275. package/webpack.base.config.js +0 -85
  276. package/webpack.dev.config.js +0 -43
  277. package/webpack.dist.dev.config.js +0 -76
  278. package/webpack.dist.prod.config.js +0 -90
  279. package/webpack.prod.config.js +0 -52
@@ -1,112 +0,0 @@
1
- // src/components/picker/picker.tsx
2
- import { defineComponent, ref, computed, watch, provide, PropType } from 'vue'
3
- import Popup from '../popup'
4
- import AreaPicker from './area-picker/area-picker.vue'
5
- import DatePicker from './date-picker/date-picker.vue'
6
- import NormalPicker from './normal-picker/normal-picker.vue'
7
- import type { PickerProps } from './types'
8
-
9
- export type { PickerProps }
10
-
11
- const prefixCls = 'dpzvc3-picker'
12
- const LIST = ['DatePicker', 'AreaPicker', 'NormalPicker']
13
-
14
- export default defineComponent({
15
- name: 'Dpzvc3Picker',
16
- components: { Popup, AreaPicker, DatePicker, NormalPicker },
17
- props: {
18
- type: {
19
- type: String as PropType<PickerProps['type']>,
20
- default: 'DatePicker',
21
- validator: (val: string) => LIST.includes(val)
22
- },
23
- modelValue: { type: Boolean, default: false },
24
- /** AreaPicker props */
25
- addressValue: String,
26
- styles: { type: Object as PropType<Record<string, any>>, default: () => ({}) },
27
- valueSeparator: { type: String, default: '/' },
28
- /** DatePicker props */
29
- dateValue: String,
30
- year: { type: [Boolean, Array] as PropType<boolean | any[]>, default: true },
31
- month: { type: [Boolean, Array] as PropType<boolean | any[]>, default: true },
32
- day: { type: [Boolean, Array] as PropType<boolean | any[]>, default: true },
33
- /** NormalPicker props */
34
- list: { type: Array as PropType<any[]>, default: () => [] },
35
- initArr: { type: Array as PropType<any[]>, default: () => [] }
36
- },
37
- emits: ['update:modelValue', 'sure', 'cancle', 'normal-change'],
38
- setup(props, { emit, slots }) {
39
- const visible = ref(props.modelValue)
40
-
41
- watch(() => props.modelValue, val => {
42
- visible.value = val
43
- })
44
-
45
- watch(visible, val => {
46
- emit('update:modelValue', val)
47
- })
48
-
49
- const wrapperClass = computed(() => [`${prefixCls}-wrapper`])
50
- const contentClass = computed(() => [`${prefixCls}-content`])
51
-
52
- const onOk = (val: any) => {
53
- emit('update:modelValue', false)
54
- emit('sure', val)
55
- }
56
-
57
- const onFail = () => {
58
- emit('update:modelValue', false)
59
- emit('cancle')
60
- }
61
-
62
- const onNormalChange = (val: any) => {
63
- emit('normal-change', val)
64
- }
65
-
66
- provide('DpzVc3Picker', {
67
- pickerOnOk: onOk,
68
- pickeronFail: onFail,
69
- pickerOnNormalChange: onNormalChange
70
- })
71
-
72
- return () => (
73
- <Popup v-model={visible.value} height="284px" position="bottom">
74
- <div class={wrapperClass.value}>
75
- <div class={contentClass.value}>
76
- {props.type === 'AreaPicker' && (
77
- <AreaPicker
78
- styles={props.styles}
79
- address-value={props.addressValue}
80
- value-separator={props.valueSeparator}
81
- onOk={onOk}
82
- onFail={onFail}
83
- />
84
- )}
85
-
86
- {props.type === 'DatePicker' && (
87
- <DatePicker
88
- year={props.year}
89
- month={props.month}
90
- day={props.day}
91
- date-value={props.dateValue}
92
- value-separator={props.valueSeparator}
93
- onOk={onOk}
94
- onFail={onFail}
95
- />
96
- )}
97
-
98
- {props.type === 'NormalPicker' && (
99
- <NormalPicker
100
- list={props.list}
101
- init-arr={props.initArr}
102
- onOk={onOk}
103
- onFail={onFail}
104
- onScroll={onNormalChange}
105
- />
106
- )}
107
- </div>
108
- </div>
109
- </Popup>
110
- )
111
- }
112
- })
@@ -1,17 +0,0 @@
1
- // src/components/picker/types.ts
2
- export interface PickerProps {
3
- type?: 'DatePicker' | 'AreaPicker' | 'NormalPicker'
4
- modelValue?: boolean
5
- /** AreaPicker */
6
- addressValue?: string
7
- styles?: Record<string, any>
8
- valueSeparator?: string
9
- /** DatePicker */
10
- year?: boolean | any[]
11
- month?: boolean | any[]
12
- day?: boolean | any[]
13
- dateValue?: string
14
- /** NormalPicker */
15
- list?: any[]
16
- initArr?: any[]
17
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Created by admin on 2025/11/19.
3
- */
4
- import type { App } from 'vue'
5
- import Popup from './popup'
6
- Popup.install = (app: App): void => {
7
- app.component('Popup', Popup); // 注册全局组件
8
- }
9
- type IWithInstall<T> = T & { install(app: App): void };
10
- const _Popup=Popup as IWithInstall<typeof Popup>;
11
- export default _Popup
12
- export type { PopupProps } from './types'
@@ -1,16 +0,0 @@
1
- // src/components/popup/popup.d.ts
2
-
3
- import type { App } from 'vue'
4
- import type { PopupProps } from './types' // 引入同级 types.ts 中的 BadgeProps
5
-
6
- /** Badge 组件实例类型,带 install 方法 */
7
- declare const Popup: {
8
- /** Vue 组件本身 */
9
- new (): any
10
- /** props 类型引用 */
11
- __props?: PopupProps
12
- /** install 方法,用于全量注册 */
13
- install(app: App): void
14
- }
15
-
16
- export default Badge
@@ -1,68 +0,0 @@
1
- import { defineComponent, ref, computed, watch, PropType, Transition } from 'vue'
2
- import type { PopupProps } from './types'
3
- export type { PopupProps }
4
-
5
- const prefixCls = 'dpzvc3-popup'
6
-
7
- export default defineComponent({
8
- name: 'Dpzvc3Popup',
9
- props: {
10
- modelValue: { type: Boolean, default: false },
11
- position: { type: String as PropType<PopupProps['position']>, default: 'bottom' },
12
- showMask: { type: Boolean, default: true },
13
- maskClosable: { type: Boolean, default: true },
14
- width: { type: [Number, String] as PropType<number | string>, default: '100%' },
15
- height: { type: [Number, String] as PropType<number | string> },
16
- styles: { type: Object as PropType<Record<string, string | number>>, default: () => ({}) }
17
- },
18
- emits: ['update:modelValue'],
19
- setup(props, { emit, slots }) {
20
- const visible = ref(props.modelValue)
21
- const mask = ref(props.showMask)
22
-
23
- watch(() => props.modelValue, val => { visible.value = val })
24
- watch(visible, val => { emit('update:modelValue', val) })
25
- watch(() => props.showMask, val => { mask.value = val })
26
-
27
- const classes = computed(() => [prefixCls])
28
- const popupClasses = computed(() => [`${prefixCls}-${props.position}`, `${prefixCls}-content`])
29
- const contentStyle = computed(() => {
30
- const heightValue = props.height != null ? props.height : (props.position === 'top' ? 'auto' : '100%')
31
- return { ...props.styles, width: props.width, height: heightValue }
32
- })
33
-
34
- const close = () => { if (props.maskClosable && mask.value) visible.value = false }
35
-
36
- return () => (
37
- <div class={classes.value}>
38
- {/* 遮罩层 */}
39
- <Transition
40
- name="dpzvc3-ani-fade"
41
- v-slots={{
42
- default: () =>
43
- mask.value && visible.value && (
44
- <div
45
- class={`${prefixCls}-mask`}
46
- onClick={close}
47
- onTouchMove={(e:any) => e.preventDefault()}
48
- />
49
- )
50
- }}
51
- />
52
-
53
- {/* 弹窗内容 */}
54
- <Transition
55
- name={`dpzvc3-ani-${props.position}`}
56
- v-slots={{
57
- default: () =>
58
- visible.value && (
59
- <div class={popupClasses.value} style={contentStyle.value}>
60
- {slots.default?.()}
61
- </div>
62
- )
63
- }}
64
- />
65
- </div>
66
- )
67
- }
68
- })
@@ -1,9 +0,0 @@
1
- export type PopupProps = {
2
- modelValue?: boolean
3
- position?: 'top' | 'bottom' | 'right' | 'left'
4
- showMask?: boolean
5
- maskClosable?: boolean
6
- width?: number | string
7
- height?: number | string
8
- styles?: Record<string, string | number>
9
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Created by yishide on 2025/09/26.
3
- */
4
- import type { App } from 'vue'
5
- import Progress from './progress'
6
- Progress.install = (app: App): void => {
7
- app.component('DpProgress', Progress); // 注册全局组件
8
- }
9
- type IWithInstall<T> = T & { install(app: App): void };
10
- const _Progress=Progress as IWithInstall<typeof Progress>;
11
- export default _Progress
12
- export type { ProgressProps } from './types'
@@ -1,81 +0,0 @@
1
- // src/components/Progress/Progress.tsx
2
- import {
3
- defineComponent,
4
- ref,
5
- computed,
6
- watch
7
- } from 'vue'
8
- import type { PropType, CSSProperties } from 'vue'
9
- import type { ProgressProps } from './types'
10
- export type { ProgressProps }
11
-
12
- const prefixCls = 'dpzvc3-progress'
13
-
14
- export default defineComponent({
15
- name: 'DpzVcProgress',
16
-
17
- props: {
18
- styles: {
19
- type: Object as PropType<CSSProperties>,
20
- default: () => ({})
21
- },
22
- modelValue: {
23
- type: [Number, String] as PropType<number | string>,
24
- default: 0
25
- },
26
- barHeight: {
27
- type: [Number, String] as PropType<number | string>,
28
- default: 3
29
- }
30
- },
31
-
32
- setup(props, { slots }) {
33
- /** 当前进度 */
34
- const width = ref<number>(0)
35
-
36
- /** 同步 v-model */
37
- watch(
38
- () => props.modelValue,
39
- (val) => {
40
- const num = Number(val) || 0
41
- width.value = num >= 100 ? 100 : num
42
- },
43
- { immediate: true }
44
- )
45
-
46
- /** class */
47
- const classes = computed(() => [prefixCls])
48
- const outerClass = computed(() => [`${prefixCls}-outer`])
49
- const runawayClass = computed(() => [`${prefixCls}-runaway`])
50
- const progressClass = computed(() => [`${prefixCls}-progress`])
51
-
52
- /** style */
53
- const runawayStyle = computed<CSSProperties>(() => ({
54
- height: `${props.barHeight}px`
55
- }))
56
-
57
- const progressStyle = computed<CSSProperties>(() => ({
58
- height: `${props.barHeight}px`,
59
- width: `${width.value}%`
60
- }))
61
-
62
- return () => (
63
- <div class={classes.value} style={props.styles}>
64
- {slots.left?.()}
65
-
66
- <div class={outerClass.value}>
67
- <div
68
- class={runawayClass.value}
69
- style={runawayStyle.value}
70
- />
71
- <div
72
- class={progressClass.value}
73
- style={progressStyle.value}
74
- />
75
- </div>
76
-
77
- {slots.right?.()}
78
- </div>
79
- )
80
- }
81
- })
@@ -1,9 +0,0 @@
1
- // src/components/Progress/types.ts
2
- export interface ProgressProps {
3
- /** 自定义样式 */
4
- styles?: Record<string, any>
5
- /** 当前进度 */
6
- modelValue?: number | string
7
- /** 进度条高度 */
8
- barHeight?: number | string
9
- }
@@ -1,104 +0,0 @@
1
- /**
2
- * Vue 3 prompt confirm
3
- * 使用 createVNode + render
4
- */
5
-
6
- import { createVNode, render } from 'vue'
7
- import Prompt from './prompt'
8
- import type { MergePromptOptions, PromptProps } from './types'
9
- // let seed = 0
10
-
11
- function createPromptInstance (properties:MergePromptOptions = {}) {
12
- // const id = `dpzvc3-prompt-${seed++}`
13
- // const instance = null
14
- // 容器
15
- const container = document.createElement('div')
16
- // container.id = id
17
- document.body.appendChild(container)
18
- // 组件 props(默认值)
19
- const props: MergePromptOptions = {
20
- value: false,
21
- text: '',
22
- placeholderText: '请输入',
23
- width: '70%',
24
- title: '',
25
- okText: '确定',
26
- cancleText: '取消',
27
- loading: false,
28
- showCancle: true,
29
- spec: '',
30
- message: '',
31
- validator: null,
32
- onOk: () => {},
33
- onCancle: () => {},
34
- ...properties
35
- }
36
- const mergeProps = <T extends object, K extends keyof T>(
37
- target: T,
38
- source: Partial<T>
39
- ) =>{
40
- (Object.keys(source) as K[]).forEach((key) => {
41
- target[key] = source[key]!
42
- })
43
- }
44
- const updateVNode = () => {
45
- // vnode
46
- // console.log(props, 'props')
47
- const vnode = createVNode(Prompt, {
48
- ...props,
49
- // 给动态挂载组件绑定 update:value 事件
50
- 'onUpdate:value': (val: boolean) => {
51
- // 当子组件 emit('update:value', false) 时执行
52
- if (val === false) {
53
- vnode.component!.props.value = false // 关闭内部显示
54
- destroy() // 销毁 DOM
55
- }
56
- },
57
- onRemove: destroy
58
- })
59
- // 挂载
60
- render(vnode, container)
61
- // instance = vnode.component
62
- }
63
- // 销毁
64
- const destroy = () => {
65
- props.value = false
66
- setTimeout(() => {
67
- render(null, container)
68
- }, 300)
69
- }
70
-
71
- return {
72
- /**
73
- * 显示
74
- */
75
- show (options: PromptProps = {}) {
76
- // alert(1)
77
- mergeProps(props, options)
78
- // Object.keys(options).forEach((key) => {
79
- // const typeKey = key as keyof PromptProps
80
- // const val = options[typeKey];
81
- // // if (val) {
82
- // props[typeKey] = val
83
- // // }
84
- // })
85
- // console.log(instance.props, 'props')
86
- props.value = true
87
- updateVNode()
88
- },
89
-
90
- /**
91
- * 关闭
92
- */
93
- remove () {
94
- props.value = false
95
-
96
- destroy()
97
- },
98
-
99
- // component: instance
100
- }
101
- }
102
-
103
- // export default Prompt
104
- export { createPromptInstance }
@@ -1,50 +0,0 @@
1
- /**
2
- * Created by admin on 2025/12/10.
3
- * Rewritten for Vue 3 (no createApp)
4
- */
5
-
6
- import {createPromptInstance } from './confirm'
7
- import type { MergePromptOptions, PromptInstance, DefaultPromptProps } from './types'
8
- let promptInstance: DefaultPromptProps
9
-
10
- function getPromptInstance () {
11
- if (!promptInstance) {
12
- promptInstance = createPromptInstance({
13
- closable: true,
14
- maskClosable: false,
15
- // footerHide: false
16
- })
17
- }
18
- return promptInstance
19
- }
20
-
21
- /**
22
- * confirm 核心方法
23
- */
24
- function confirm (options: MergePromptOptions = {}) {
25
- const instance: DefaultPromptProps = getPromptInstance()!
26
-
27
- // 组件销毁回调
28
- options.onRemove = () => {
29
- promptInstance = null
30
- }
31
-
32
- instance.show(options)
33
- }
34
-
35
- /**
36
- * info 弹窗
37
- */
38
- const Prompt: PromptInstance = {
39
- info: (props: MergePromptOptions = {}) => {
40
- props.showCancle = true
41
- return confirm(props)
42
- },
43
- remove: () => {
44
- if (!promptInstance) return false
45
- const instance = getPromptInstance()!
46
- instance.remove()
47
- }
48
- }
49
-
50
- export default Prompt
@@ -1,161 +0,0 @@
1
- // src/components/Prompt/Prompt.tsx
2
- import {
3
- defineComponent,
4
- ref,
5
- watch
6
- } from 'vue'
7
- import type { PropType } from 'vue'
8
- import type { PromptProps } from './types'
9
-
10
- import Modal from '../modal/modal'
11
- import TextBar from '../Text/textBar'
12
- import DpButton from '../button/button'
13
-
14
- export default defineComponent({
15
- name: 'Dpzvc3Prompt',
16
-
17
- props: {
18
- value: { type: Boolean, default: false },
19
- text: { type: String, default: '' },
20
- closable: { type: Boolean, default: true },
21
- maskClosable: { type: Boolean, default: true },
22
- title: String,
23
- width: { type: String, default: '220px' },
24
- okText: { type: String, default: '确定' },
25
- cancleText: { type: String, default: '取消' },
26
- loading: { type: Boolean, default: false },
27
- styles: Object as PropType<Record<string, any>>,
28
- spec: { type: String, default: '提示' },
29
- validator: {
30
- type: [RegExp, Function] as PropType<PromptProps['validator'] | null>,
31
- default: null
32
- },
33
- msg: String,
34
- placeholderText: String,
35
- onOk: {
36
- type: Function as PropType<(val: string) => void>,
37
- default: () => {}
38
- },
39
- onCancle: {
40
- type: Function as PropType<() => void>,
41
- default: () => {}
42
- }
43
- },
44
-
45
- emits: ['update:value', 'on-ok', 'on-cancle'],
46
-
47
- setup (props, { emit }) {
48
- /** 内部状态 */
49
- const visible = ref(props.value)
50
- const texts = ref(props.text)
51
- const message = ref(props.msg || '')
52
- const placeholder = ref(props.placeholderText)
53
- const buttonLoading = ref(false)
54
-
55
- /** 同步外部 */
56
- watch(() => props.value, val => {
57
- visible.value = val
58
- })
59
-
60
- watch(() => props.text, val => {
61
- texts.value = val
62
- })
63
-
64
- watch(() => props.loading, val => {
65
- buttonLoading.value = val
66
- })
67
-
68
- /** 确定 */
69
- const ok = () => {
70
- let valid: boolean | string = true
71
-
72
- if (props.validator) {
73
- if (props.validator instanceof RegExp) {
74
- valid = props.validator.test(texts.value)
75
- } else if (typeof props.validator === 'function') {
76
- valid = props.validator(texts.value)
77
- }
78
- }
79
-
80
- if (valid !== true) {
81
- message.value = typeof valid === 'string' ? valid : ''
82
- return
83
- }
84
-
85
- emit('update:value', false)
86
- props.onOk?.(texts.value)
87
- emit('on-ok', texts.value)
88
- }
89
-
90
- /** 取消 */
91
- const cancle = () => {
92
- emit('update:value', false)
93
- props.onCancle?.()
94
- emit('on-cancle')
95
- }
96
-
97
- return () => (
98
- <Modal
99
- v-model={visible.value}
100
- width={props.width}
101
- title={props.title}
102
- style={props.styles}
103
- maskClosable={props.maskClosable}
104
- >
105
- {{
106
- header: () => (
107
- <div
108
- class="dpzvc3-modal-header-inner ellipse-fir"
109
- innerHTML={props.title}
110
- />
111
- ),
112
-
113
- body: () => (
114
- <div class="dpzvc3-prompt-body-inner">
115
- <div class="dpzvc3-prompt-content">
116
- <span class="dpzvc3-prompt-spec">
117
- {props.spec}
118
- </span>
119
-
120
- <TextBar
121
- v-model={texts.value}
122
- type="text"
123
- placeholder={placeholder.value}
124
- />
125
-
126
- {message.value && (
127
- <div
128
- class="dpzvc3-prompt-error"
129
- innerHTML={message.value}
130
- />
131
- )}
132
- </div>
133
- </div>
134
- ),
135
-
136
- footer: () => (
137
- <>
138
- <DpButton
139
- styles={{ background: '#ffffff', color: 'red' }}
140
- onClick={ok}
141
- >
142
- {{
143
- 'button-inner': () => props.okText
144
- }}
145
- </DpButton>
146
-
147
- <DpButton
148
- styles={{ background: '#ffffff', color: '#ccc' }}
149
- onClick={cancle}
150
- >
151
- {{
152
- 'button-inner': () => props.cancleText
153
- }}
154
- </DpButton>
155
- </>
156
- )
157
- }}
158
- </Modal>
159
- )
160
- }
161
- })