dpzvc3-ui 3.1.5 → 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 (276) 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/package.json +7 -2
  13. package/build-style.js +0 -58
  14. package/dist-prod/91.05c8ec5277a15f939b0f.js +0 -3
  15. package/dist-prod/91.05c8ec5277a15f939b0f.js.LICENSE.txt +0 -25
  16. package/dist-prod/91.05c8ec5277a15f939b0f.js.map +0 -1
  17. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js +0 -2
  18. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js.map +0 -1
  19. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js +0 -2
  20. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js.map +0 -1
  21. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js +0 -2
  22. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js.map +0 -1
  23. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js +0 -2
  24. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js.map +0 -1
  25. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js +0 -2
  26. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js.map +0 -1
  27. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js +0 -2
  28. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js.map +0 -1
  29. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js +0 -2
  30. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js.map +0 -1
  31. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js +0 -2
  32. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js.map +0 -1
  33. package/dist-prod/header.eb10433dd892738ee95a.chunk.js +0 -2
  34. package/dist-prod/header.eb10433dd892738ee95a.chunk.js.map +0 -1
  35. package/dist-prod/index.html +0 -19
  36. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js +0 -2
  37. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js.map +0 -1
  38. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js +0 -2
  39. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js.map +0 -1
  40. package/dist-prod/main.662ad15361e7f3d20234.js +0 -2
  41. package/dist-prod/main.662ad15361e7f3d20234.js.map +0 -1
  42. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js +0 -2
  43. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js.map +0 -1
  44. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js +0 -2
  45. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js.map +0 -1
  46. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js +0 -2
  47. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js.map +0 -1
  48. package/dist-prod/popup.538422c7e188363a468d.chunk.js +0 -2
  49. package/dist-prod/popup.538422c7e188363a468d.chunk.js.map +0 -1
  50. package/dist-prod/progress.240de4b633002f573030.chunk.js +0 -2
  51. package/dist-prod/progress.240de4b633002f573030.chunk.js.map +0 -1
  52. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js +0 -2
  53. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js.map +0 -1
  54. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js +0 -2
  55. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js.map +0 -1
  56. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js +0 -2
  57. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js.map +0 -1
  58. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js +0 -2
  59. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js.map +0 -1
  60. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js +0 -2
  61. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js.map +0 -1
  62. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js +0 -2
  63. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js.map +0 -1
  64. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js +0 -2
  65. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js.map +0 -1
  66. package/dist-prod/tab.29f19483f699b7811259.chunk.js +0 -2
  67. package/dist-prod/tab.29f19483f699b7811259.chunk.js.map +0 -1
  68. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js +0 -2
  69. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js.map +0 -1
  70. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js +0 -2
  71. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js.map +0 -1
  72. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js +0 -2
  73. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js.map +0 -1
  74. package/postcss.config.js +0 -5
  75. package/src/components/Indicator/Indicator.tsx +0 -67
  76. package/src/components/Indicator/Indicator.vue +0 -82
  77. package/src/components/Indicator/index.ts +0 -111
  78. package/src/components/Indicator/types.ts +0 -15
  79. package/src/components/Text/index.ts +0 -14
  80. package/src/components/Text/textBar.tsx +0 -104
  81. package/src/components/Text/types.ts +0 -13
  82. package/src/components/actionSheet/actionSheet.d.ts +0 -16
  83. package/src/components/actionSheet/actionSheet.tsx +0 -86
  84. package/src/components/actionSheet/index.ts +0 -6
  85. package/src/components/actionSheet/types.ts +0 -10
  86. package/src/components/app.vue +0 -59
  87. package/src/components/badge/badge.tsx +0 -80
  88. package/src/components/badge/index.ts +0 -12
  89. package/src/components/badge/types.ts +0 -8
  90. package/src/components/button/button.tsx +0 -105
  91. package/src/components/button/index.ts +0 -13
  92. package/src/components/button/types.ts +0 -13
  93. package/src/components/card/card.d.ts +0 -16
  94. package/src/components/card/card.tsx +0 -38
  95. package/src/components/card/index.ts +0 -12
  96. package/src/components/card/types.ts +0 -3
  97. package/src/components/cell/cell.tsx +0 -89
  98. package/src/components/cell/index.ts +0 -12
  99. package/src/components/cell/types.ts +0 -8
  100. package/src/components/cellSwipe/cellSwipe.tsx +0 -188
  101. package/src/components/cellSwipe/index.ts +0 -13
  102. package/src/components/cellSwipe/types.ts +0 -17
  103. package/src/components/checkBox/checkbox-group.tsx +0 -75
  104. package/src/components/checkBox/checkbox.tsx +0 -107
  105. package/src/components/checkBox/index.ts +0 -29
  106. package/src/components/checkBox/types.ts +0 -32
  107. package/src/components/header/header.tsx +0 -119
  108. package/src/components/header/index.ts +0 -13
  109. package/src/components/header/types.ts +0 -7
  110. package/src/components/loadMore/index.ts +0 -14
  111. package/src/components/loadMore/loadMore.tsx +0 -265
  112. package/src/components/loadMore/types.ts +0 -26
  113. package/src/components/message/confirm.ts +0 -104
  114. package/src/components/message/index.ts +0 -113
  115. package/src/components/message/message.tsx +0 -100
  116. package/src/components/message/messageGroup.tsx +0 -59
  117. package/src/components/message/types.ts +0 -48
  118. package/src/components/modal/confirm.ts +0 -123
  119. package/src/components/modal/index.ts +0 -68
  120. package/src/components/modal/modal.tsx +0 -248
  121. package/src/components/modal/types.ts +0 -51
  122. package/src/components/number/Number.tsx +0 -143
  123. package/src/components/number/index.ts +0 -10
  124. package/src/components/number/types.ts +0 -13
  125. package/src/components/picker/area-picker/area-picker.vue +0 -230
  126. package/src/components/picker/area-picker/props.js +0 -17
  127. package/src/components/picker/date-picker/date-picker.vue +0 -191
  128. package/src/components/picker/date-picker/props.js +0 -24
  129. package/src/components/picker/index.ts +0 -12
  130. package/src/components/picker/normal-picker/normal-picker.vue +0 -120
  131. package/src/components/picker/normal-picker/props.js +0 -20
  132. package/src/components/picker/picker-slot.vue +0 -217
  133. package/src/components/picker/picker.tsx +0 -112
  134. package/src/components/picker/types.ts +0 -17
  135. package/src/components/popup/index.ts +0 -12
  136. package/src/components/popup/popup.d.ts +0 -16
  137. package/src/components/popup/popup.tsx +0 -68
  138. package/src/components/popup/types.ts +0 -9
  139. package/src/components/progress/index.ts +0 -12
  140. package/src/components/progress/progress.tsx +0 -81
  141. package/src/components/progress/types.ts +0 -9
  142. package/src/components/prompt/confirm.ts +0 -104
  143. package/src/components/prompt/index.ts +0 -50
  144. package/src/components/prompt/prompt.tsx +0 -161
  145. package/src/components/prompt/types.ts +0 -45
  146. package/src/components/radioBox/index.ts +0 -34
  147. package/src/components/radioBox/radiobox-group.tsx +0 -66
  148. package/src/components/radioBox/radiobox.tsx +0 -115
  149. package/src/components/radioBox/types.ts +0 -24
  150. package/src/components/rater/index.ts +0 -12
  151. package/src/components/rater/rater.d.ts +0 -16
  152. package/src/components/rater/raters.tsx +0 -101
  153. package/src/components/rater/types.ts +0 -10
  154. package/src/components/slideBar/index.ts +0 -13
  155. package/src/components/slideBar/slideBar.tsx +0 -288
  156. package/src/components/slideBar/types.ts +0 -20
  157. package/src/components/spinner/behavior/blade.vue +0 -42
  158. package/src/components/spinner/behavior/double-bounce.vue +0 -38
  159. package/src/components/spinner/behavior/fading-circle.vue +0 -55
  160. package/src/components/spinner/behavior/snake.vue +0 -41
  161. package/src/components/spinner/behavior/triple-bounce.vue +0 -52
  162. package/src/components/spinner/index.ts +0 -13
  163. package/src/components/spinner/props.js +0 -28
  164. package/src/components/spinner/spinner.tsx +0 -85
  165. package/src/components/spinner/types.ts +0 -20
  166. package/src/components/swipe/index.ts +0 -13
  167. package/src/components/swipe/swipe.tsx +0 -292
  168. package/src/components/swipe/types.ts +0 -21
  169. package/src/components/switchbar/index.ts +0 -13
  170. package/src/components/switchbar/switchbar.tsx +0 -58
  171. package/src/components/switchbar/types.ts +0 -6
  172. package/src/components/tab/index.ts +0 -12
  173. package/src/components/tab/tab.tsx +0 -71
  174. package/src/components/tab/types.ts +0 -15
  175. package/src/components/toTop/index.ts +0 -13
  176. package/src/components/toTop/toTop.tsx +0 -54
  177. package/src/components/toTop/types.ts +0 -7
  178. package/src/components/upload/index.ts +0 -13
  179. package/src/components/upload/types.ts +0 -9
  180. package/src/components/upload/upload.tsx +0 -180
  181. package/src/config/config.js +0 -16
  182. package/src/directives/clickoutside.js +0 -42
  183. package/src/directives/tranferDom.js +0 -66
  184. package/src/index.d.ts +0 -131
  185. package/src/index.ts +0 -136
  186. package/src/lib/MegaPixImage.js +0 -164
  187. package/src/lib/MegaPixImageOld.js +0 -153
  188. package/src/lib/exif-js.js +0 -235
  189. package/src/lib/exif.js +0 -789
  190. package/src/lib/lib.js +0 -22
  191. package/src/main.ts +0 -33
  192. package/src/mixin/emitter.js +0 -72
  193. package/src/mixin/input.js +0 -41
  194. package/src/router.ts +0 -36
  195. package/src/shims-vue.d.ts +0 -37
  196. package/src/styles/base/font.less +0 -99
  197. package/src/styles/base/reset.less +0 -135
  198. package/src/styles/base/variable.less +0 -108
  199. package/src/styles/components/actionSheet.less +0 -43
  200. package/src/styles/components/badge.less +0 -81
  201. package/src/styles/components/button.less +0 -124
  202. package/src/styles/components/card.less +0 -31
  203. package/src/styles/components/cell-swipe.less +0 -20
  204. package/src/styles/components/cell.less +0 -75
  205. package/src/styles/components/checkBox.less +0 -113
  206. package/src/styles/components/editor.less +0 -3
  207. package/src/styles/components/header.less +0 -72
  208. package/src/styles/components/indicator.less +0 -39
  209. package/src/styles/components/loadmore.less +0 -48
  210. package/src/styles/components/message.less +0 -57
  211. package/src/styles/components/modal.less +0 -84
  212. package/src/styles/components/number.less +0 -60
  213. package/src/styles/components/picker.less +0 -152
  214. package/src/styles/components/popup.less +0 -46
  215. package/src/styles/components/progress.less +0 -52
  216. package/src/styles/components/prompt.less +0 -37
  217. package/src/styles/components/radioBox.less +0 -142
  218. package/src/styles/components/rater.less +0 -16
  219. package/src/styles/components/slide-Bar.less +0 -149
  220. package/src/styles/components/spinner.less +0 -329
  221. package/src/styles/components/swipe.less +0 -125
  222. package/src/styles/components/switchBar.less +0 -88
  223. package/src/styles/components/tab.less +0 -71
  224. package/src/styles/components/text.less +0 -82
  225. package/src/styles/components/toTop.less +0 -28
  226. package/src/styles/components/upload.less +0 -23
  227. package/src/styles/index.less +0 -39
  228. package/src/styles/utils/1px.less +0 -206
  229. package/src/styles/utils/animation.less +0 -165
  230. package/src/styles/utils/nowrap.less +0 -19
  231. package/src/template/index.ejs +0 -40
  232. package/src/types/index.d.ts +0 -127
  233. package/src/types/js-shims.d.ts +0 -36
  234. package/src/utils/test.ts +0 -2
  235. package/src/utils/util.ts +0 -168
  236. package/src/utils/util1.js +0 -202
  237. package/src/vconsole-resources.min.js +0 -6
  238. package/src/vconsole-sources.min.js +0 -6
  239. package/src/vconsole.min.js +0 -7
  240. package/src/views/ActionSheet.vue +0 -46
  241. package/src/views/Badge/Badge.less +0 -12
  242. package/src/views/Badge/Badge.tsx +0 -23
  243. package/src/views/Badge.vue +0 -53
  244. package/src/views/Button.vue +0 -69
  245. package/src/views/Card.vue +0 -89
  246. package/src/views/Cell.vue +0 -31
  247. package/src/views/CellSwipe.vue +0 -80
  248. package/src/views/CheckBox.vue +0 -78
  249. package/src/views/Header.vue +0 -71
  250. package/src/views/Indicator.vue +0 -82
  251. package/src/views/LoadMore.vue +0 -76
  252. package/src/views/Message.vue +0 -61
  253. package/src/views/Modal.vue +0 -69
  254. package/src/views/Picker.vue +0 -142
  255. package/src/views/Popup.vue +0 -103
  256. package/src/views/Progress.vue +0 -49
  257. package/src/views/Prompt.vue +0 -43
  258. package/src/views/RadioBox.vue +0 -70
  259. package/src/views/Rater.vue +0 -53
  260. package/src/views/SlideBar.vue +0 -62
  261. package/src/views/Spinner.vue +0 -27
  262. package/src/views/Swipe.vue +0 -59
  263. package/src/views/SwitchBar.vue +0 -49
  264. package/src/views/Tab.vue +0 -55
  265. package/src/views/Text.vue +0 -97
  266. package/src/views/ToTop.vue +0 -31
  267. package/src/views/Upload.vue +0 -65
  268. package/src/views/guide.vue +0 -164
  269. package/src/views/index.vue +0 -554
  270. package/tsconfig.build.json +0 -31
  271. package/tsconfig.json +0 -41
  272. package/webpack.base.config.js +0 -85
  273. package/webpack.dev.config.js +0 -43
  274. package/webpack.dist.dev.config.js +0 -76
  275. package/webpack.dist.prod.config.js +0 -90
  276. package/webpack.prod.config.js +0 -52
@@ -1,288 +0,0 @@
1
- // src/components/slideBar/slideBar.tsx
2
- import {
3
- defineComponent,
4
- ref,
5
- computed,
6
- onMounted,
7
- onBeforeUnmount,
8
- PropType
9
- } from 'vue'
10
- import type { SlideBarProps, SlideBarItem } from './types'
11
-
12
- export type { SlideBarProps }
13
-
14
- const prefixCls = 'dpzvc3-slideBar'
15
-
16
- export default defineComponent({
17
- name: 'SlideBar',
18
-
19
- props: {
20
- scrollHeight: {
21
- type: [String, Number] as PropType<string | number>,
22
- default: '30px'
23
- },
24
- height: {
25
- type: [String, Number] as PropType<string | number>,
26
- default: '100%'
27
- },
28
- styles: {
29
- type: Object as PropType<Record<string, any>>,
30
- default: () => ({})
31
- },
32
- childWidth: {
33
- type: Number,
34
- default: 70
35
- },
36
- scrollColor: {
37
- type: String,
38
- default: '#036eb8'
39
- },
40
- textAlign: {
41
- type: String,
42
- default: 'center'
43
- },
44
- flex: {
45
- type: Boolean,
46
- default: true
47
- },
48
- type: {
49
- type: String as PropType<SlideBarProps['type']>,
50
- default: 'normal'
51
- },
52
- list: {
53
- type: Array as PropType<SlideBarItem[]>,
54
- default: () => [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }]
55
- },
56
- index: {
57
- type: Number,
58
- default: 0
59
- },
60
- distanceIndex: {
61
- type: Number,
62
- default: 1.5
63
- },
64
- canDrag: {
65
- type: Boolean,
66
- default: true
67
- }
68
- },
69
-
70
- emits: ['on-change'],
71
-
72
- setup(props: SlideBarProps, { emit, slots }) {
73
- const headerRef = ref<HTMLDivElement | null>(null)
74
- const contentRef = ref<HTMLDivElement | null>(null)
75
-
76
- const startIndex = ref(props.index ?? 0)
77
- const clientWidth = ref(0)
78
- const dragging = ref(false)
79
- const distance = ref(0)
80
- const startTranslateX = ref(0)
81
- const startX = ref(0)
82
-
83
- const items = ref(props.list ?? [])
84
- const isFlex = ref(!!props.flex)
85
- const fixed = ref(false)
86
-
87
- const translateX = ref(0)
88
-
89
- const getItemWidth = computed(() =>
90
- isFlex.value
91
- ? clientWidth.value / items.value.length
92
- : props.childWidth!
93
- )
94
-
95
- const classes = computed(() => [prefixCls])
96
-
97
- const headerClasses = computed(() => [
98
- `${prefixCls}-header`,
99
- { fixed: fixed.value }
100
- ])
101
-
102
- const wrapperClasses = computed(() => [
103
- `${prefixCls}-wrapper`,
104
- isFlex.value ? `${prefixCls}-flex` : `${prefixCls}-slide`,
105
- {
106
- normal: props.type === 'normal' && isFlex.value,
107
- vertical: props.type === 'vertical' && isFlex.value
108
- }
109
- ])
110
-
111
- const contentClasses = computed(() => [
112
- `${prefixCls}-content`,
113
- { [`${prefixCls}-dragging`]: dragging.value }
114
- ])
115
-
116
- const absoluteClass = computed(() => [`${prefixCls}-wrapper-absolute`])
117
- const containerClass = computed(() => [`${prefixCls}-container`])
118
-
119
- const getStyles = computed(() => ({ ...props.styles }))
120
-
121
- const getContainerStyle = computed(() => ({
122
- width: clientWidth.value * items.value.length + 'px',
123
- transform: `translate3d(${translateX.value}px,0,0)`
124
- }))
125
-
126
- const getScrollStyle = computed(() => ({
127
- width: getItemWidth.value + 'px',
128
- transform: `translate3d(${startIndex.value * getItemWidth.value}px,0,0)`,
129
- backgroundColor: props.scrollColor
130
- }))
131
-
132
- const maxIndex = computed(() => items.value.length - 1)
133
-
134
- /* tab 切换 */
135
- const changeBar = (index: number) => {
136
- if (startIndex.value === index) return
137
- startIndex.value = index
138
- translateX.value = -index * clientWidth.value
139
- emit('on-change', index)
140
- }
141
-
142
- /* 拖拽逻辑 */
143
- const onTouchStart = (e: TouchEvent) => {
144
- startTranslateX.value = translateX.value
145
- distance.value = 0
146
- startX.value = e.touches[0].clientX
147
- dragging.value = true
148
- }
149
-
150
- const onTouchMove = (e: TouchEvent) => {
151
- const currentX = e.touches[0].clientX
152
- distance.value = props.distanceIndex
153
- ? (currentX - startX.value) / props.distanceIndex
154
- : currentX - startX.value
155
- translateX.value = startTranslateX.value + distance.value
156
- }
157
-
158
- const onTouchEnd = () => {
159
- if (distance.value < 0 && Math.abs(distance.value) > clientWidth.value / 2) {
160
- slideLeft()
161
- } else if (distance.value > 0 && Math.abs(distance.value) > clientWidth.value / 2) {
162
- slideRight()
163
- } else {
164
- translateX.value = startTranslateX.value
165
- }
166
- dragging.value = false
167
- }
168
-
169
- const slideLeft = () => {
170
- if (startIndex.value >= maxIndex.value) {
171
- translateX.value = startTranslateX.value
172
- } else {
173
- startIndex.value++
174
- translateX.value = startTranslateX.value - clientWidth.value
175
- }
176
- emit('on-change', startIndex.value)
177
- }
178
-
179
- const slideRight = () => {
180
- if (startIndex.value <= 0) {
181
- translateX.value = startTranslateX.value
182
- } else {
183
- startIndex.value--
184
- translateX.value = startTranslateX.value + clientWidth.value
185
- }
186
- emit('on-change', startIndex.value)
187
- }
188
-
189
- /* 固定 header */
190
- const onScroll = () => {
191
- if (!headerRef.value) return
192
- fixed.value = headerRef.value.getBoundingClientRect().top <= 0
193
- }
194
-
195
- const onResize = () => {
196
- if (!headerRef.value) return
197
- clientWidth.value = headerRef.value.clientWidth
198
- }
199
-
200
- onMounted(() => {
201
- if (!headerRef.value) return
202
- clientWidth.value = headerRef.value.clientWidth
203
- translateX.value = -startIndex.value * clientWidth.value
204
-
205
- window.addEventListener('resize', onResize)
206
- window.addEventListener('scroll', onScroll)
207
-
208
- if (props.canDrag && contentRef.value) {
209
- contentRef.value.addEventListener('touchstart', onTouchStart)
210
- contentRef.value.addEventListener('touchmove', onTouchMove)
211
- contentRef.value.addEventListener('touchend', onTouchEnd)
212
- }
213
- })
214
-
215
- onBeforeUnmount(() => {
216
- window.removeEventListener('resize', onResize)
217
- window.removeEventListener('scroll', onScroll)
218
-
219
- if (props.canDrag && contentRef.value) {
220
- contentRef.value.removeEventListener('touchstart', onTouchStart)
221
- contentRef.value.removeEventListener('touchmove', onTouchMove)
222
- contentRef.value.removeEventListener('touchend', onTouchEnd)
223
- }
224
- })
225
-
226
- return () => (
227
- <div class={classes.value} style={getStyles.value}>
228
- {/* header */}
229
- <div ref={headerRef} class={headerClasses.value}>
230
- <div
231
- class={wrapperClasses.value}
232
- style={{
233
- width: isFlex.value
234
- ? 'auto'
235
- : items.value.length * getItemWidth.value + 'px'
236
- }}
237
- >
238
- {items.value.map((item, key) => (
239
- <div
240
- key={key}
241
- class={[
242
- 'dpzvc3-slideBar-child',
243
- startIndex.value === key && 'active',
244
- !isFlex.value && 'normalChild'
245
- ]}
246
- style={{
247
- textAlign: props.textAlign,
248
- width: getItemWidth.value + 'px',
249
- height: props.scrollHeight,
250
- lineHeight: String(props.scrollHeight)
251
- }}
252
- onClick={() => changeBar(key)}
253
- >
254
- {slots[`slide-bar-header-${key}`]
255
- ? slots[`slide-bar-header-${key}`]!()
256
- : <a class="content ellipse-fir">{item.name}</a>}
257
- </div>
258
- ))}
259
- </div>
260
-
261
- <div class={absoluteClass.value} style={getScrollStyle.value} />
262
- </div>
263
-
264
- {/* content */}
265
- <div class={containerClass.value} style={{ height: props.height }}>
266
- <div
267
- ref={contentRef}
268
- class={contentClasses.value}
269
- style={getContainerStyle.value}
270
- >
271
- {items.value.map((_, index) => (
272
- <div
273
- key={index}
274
- class={[
275
- 'dpzvc3-slideBar-content-item',
276
- startIndex.value === index && 'active'
277
- ]}
278
- style={{ width: clientWidth.value + 'px' }}
279
- >
280
- {slots[`slot-item-${index}`]?.()}
281
- </div>
282
- ))}
283
- </div>
284
- </div>
285
- </div>
286
- )
287
- }
288
- })
@@ -1,20 +0,0 @@
1
- // src/components/slideBar/types.ts
2
- export interface SlideBarItem {
3
- name: string
4
- [key: string]: any
5
- }
6
-
7
- export interface SlideBarProps {
8
- scrollHeight?: string | number
9
- height?: string | number
10
- styles?: Record<string, any>
11
- childWidth?: number
12
- scrollColor?: string
13
- textAlign?: string
14
- flex?: boolean
15
- type?: 'normal' | 'vertical'
16
- list?: SlideBarItem[]
17
- index?: number
18
- distanceIndex?: number
19
- canDrag?: boolean
20
- }
@@ -1,42 +0,0 @@
1
- <template>
2
- <div
3
- class="dpzvc3-spinner-blade"
4
- :style="spinnerStyle"
5
- >
6
- <div
7
- v-for="i in 12"
8
- :key="i"
9
- class="blade"
10
- :class="'blade-' + i"
11
- :style="bladeStyle"
12
- />
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import { defineComponent, computed } from 'vue'
18
- import spinnerProps from '../props' // 复用 spinnerProps
19
- // 如果原来 mixins props 是这样
20
- // {
21
- // color: String,
22
- // size: [Number, String]
23
- // }
24
-
25
- export default defineComponent({
26
- name: 'Dpzvc3Blade',
27
- props: spinnerProps.props,
28
- setup (props) {
29
- // 计算每个 blade 的样式
30
- const bladeStyle = computed(() => {
31
- return props.color ? { backgroundColor: props.color } : {}
32
- })
33
- const { spinnerStyle } = spinnerProps.setup(props)
34
- // console.log(spinnerStyle, 'ddds')
35
- // 如果需要设置整个 spinner 容器的大小
36
- return {
37
- bladeStyle,
38
- spinnerStyle
39
- }
40
- }
41
- })
42
- </script>
@@ -1,38 +0,0 @@
1
- <template>
2
- <div
3
- class="dpzvc3-spinner-double-bounce"
4
- :style="spinnerStyle"
5
- >
6
- <div
7
- v-for="i in 2"
8
- :key="i"
9
- class="bounce"
10
- :class="'bounce-' + i"
11
- :style="bounceStyle"
12
- />
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import { computed, defineComponent } from 'vue'
18
- import spinnerProps from '../props' // 复用 spinnerProps
19
-
20
- export default defineComponent({
21
- name: 'Dpzvc3DoubleBounce',
22
- props: spinnerProps.props,
23
- setup (props) {
24
- const { spinnerStyle } = spinnerProps.setup(props)
25
-
26
- const bounceStyle = computed(() => {
27
- return props.color
28
- ? { backgroundColor: props.color }
29
- : {}
30
- })
31
-
32
- return {
33
- spinnerStyle,
34
- bounceStyle
35
- }
36
- }
37
- })
38
- </script>
@@ -1,55 +0,0 @@
1
- <template>
2
- <div
3
- class="dpzvc3-spinner-fading-circle"
4
- :style="spinnerStyle"
5
- >
6
- <div
7
- v-for="i in 12"
8
- :key="i"
9
- class="block"
10
- :class="'block-' + i"
11
- :style="blockStyle(i - 1)"
12
- >
13
- <div
14
- class="circle"
15
- :class="'circle-' + i"
16
- :style="circleStyle(i - 1)"
17
- />
18
- </div>
19
- </div>
20
- </template>
21
-
22
- <script>
23
- import { computed, defineComponent } from 'vue'
24
- import spinnerProps from '../props'
25
-
26
- export default defineComponent({
27
- name: 'Dpzvc3FadingCircle',
28
- props: spinnerProps.props,
29
- setup (props) {
30
- // 使用复用的 spinnerStyle
31
- const { spinnerStyle } = spinnerProps.setup(props)
32
-
33
- // block 旋转样式
34
- const blockStyle = (index) => {
35
- return {
36
- transform: `rotate(${30 * index}deg)`
37
- }
38
- }
39
-
40
- // circle 样式,包括颜色和动画延迟
41
- const circleStyle = (index) => {
42
- return {
43
- backgroundColor: props.color || '#39f',
44
- animationDelay: `${(1.2 / 12) * index - 1.2}s`
45
- }
46
- }
47
-
48
- return {
49
- spinnerStyle,
50
- blockStyle,
51
- circleStyle
52
- }
53
- }
54
- })
55
- </script>
@@ -1,41 +0,0 @@
1
- <template>
2
- <div
3
- class="dpzvc3-spinner-snake"
4
- :style="spinnerStyle"
5
- />
6
- </template>
7
-
8
- <script>
9
- import { computed, defineComponent } from 'vue'
10
- import spinnerProps from '../props'
11
-
12
- export default defineComponent({
13
- name: 'Dpzvc3Snake',
14
- props: spinnerProps.props,
15
- setup (props) {
16
- // 计算 spinner 样式
17
- const spinnerStyle = computed(() => {
18
- const style = {}
19
-
20
- if (props.size) {
21
- const borderSize = Math.ceil(props.size / 8)
22
- style.height = props.size + 'px'
23
- style.width = props.size + 'px'
24
- style.borderWidth = borderSize + 'px'
25
- }
26
-
27
- if (props.color) {
28
- style.borderTopColor = props.color
29
- style.borderLeftColor = props.color
30
- style.borderBottomColor = props.color
31
- }
32
-
33
- return style
34
- })
35
-
36
- return {
37
- spinnerStyle
38
- }
39
- }
40
- })
41
- </script>
@@ -1,52 +0,0 @@
1
- <template>
2
- <div
3
- class="dpzvc3-spinner-triple-bounce"
4
- :style="spinnerStyle"
5
- >
6
- <div
7
- v-for="(i,key) in 3"
8
- :key="key"
9
- class="bounce"
10
- :class="'bounce-' + i"
11
- :style="bounceStyle"
12
- />
13
- </div>
14
- </template>
15
-
16
- <script type="text/ecmascript-6">
17
- import props from '../props'
18
-
19
- export default {
20
- mixins: [props],
21
- computed: {
22
- // eslint-disable-next-line vue/return-in-computed-property
23
- unitSize () {
24
- if (this.size) {
25
- return Math.round(this.size / 6) * 2
26
- }
27
- },
28
- // eslint-disable-next-line vue/return-in-computed-property
29
- spinnerStyle () {
30
- if (this.size) {
31
- return {
32
- padding: (this.size - this.unitSize) / 2 + 'px 0'
33
- }
34
- }
35
- },
36
- bounceStyle () {
37
- const style = {}
38
-
39
- if (this.size) {
40
- style.width = this.unitSize + 'px'
41
- style.height = this.unitSize + 'px'
42
- }
43
-
44
- if (this.color) {
45
- style.backgroundColor = this.color
46
- }
47
-
48
- return style
49
- }
50
- }
51
- }
52
- </script>
@@ -1,13 +0,0 @@
1
- /**
2
- * Created by admin on 2025/10/16.
3
- */
4
- import type { App } from 'vue'
5
- import Spinner from './spinner'
6
- Spinner.install = (app: App): void => {
7
- app.component('Spinner', Spinner); // 注册全局组件
8
- }
9
- type IWithInstall<T> = T & { install(app: App): void };
10
- const _Spinner=Spinner as IWithInstall<typeof Spinner>;
11
- export default _Spinner
12
- // export default Spinner
13
- export type { SpinnerProps } from './types'
@@ -1,28 +0,0 @@
1
- // spinnerProps.js
2
- import { computed } from 'vue'
3
-
4
- export default {
5
- props: {
6
- size: {
7
- type: [Number, String]
8
- },
9
- color: {
10
- type: String
11
- }
12
- },
13
- setup (props) {
14
- const spinnerStyle = computed(() => {
15
- if (props.size) {
16
- return {
17
- height: typeof Number(props.size) === 'number' ? `${props.size}px` : props.size,
18
- width: typeof Number(props.size) === 'number' ? `${props.size}px` : props.size
19
- }
20
- }
21
- return {}
22
- })
23
-
24
- return {
25
- spinnerStyle
26
- }
27
- }
28
- }
@@ -1,85 +0,0 @@
1
- // src/components/spinner/spinner.tsx
2
- import { defineComponent, computed, PropType } from 'vue'
3
- // import type { DefineComponent } from 'vue'
4
- import SpinnerBlade from './behavior/blade.vue'
5
- import SpinnerSnake from './behavior/snake.vue'
6
- import SpinnerDoubleBounce from './behavior/double-bounce.vue'
7
- import SpinnerTripleBounce from './behavior/triple-bounce.vue'
8
- import SpinnerFadingCircle from './behavior/fading-circle.vue'
9
-
10
- import type { SpinnerProps, SpinnerType } from './types'
11
- export type { SpinnerProps }
12
-
13
- const SPINNERS = [
14
- 'blade',
15
- 'snake',
16
- 'double-bounce',
17
- 'triple-bounce',
18
- 'fading-circle'
19
- ] as const
20
-
21
- const SPINNER_MAP = {
22
- blade: SpinnerBlade,
23
- snake: SpinnerSnake,
24
- 'double-bounce': SpinnerDoubleBounce,
25
- 'triple-bounce': SpinnerTripleBounce,
26
- 'fading-circle': SpinnerFadingCircle
27
- } as const
28
-
29
- function parseSpinner(type: SpinnerType | number): keyof typeof SPINNER_MAP {
30
- let value: string | number = type ?? 0
31
-
32
- // 数字类型(索引)
33
- if (typeof value === 'number' || /^\d+$/.test(String(value))) {
34
- const index = Number(value)
35
- if (index >= SPINNERS.length) {
36
- console.warn(`'${value}' spinner not found, use the default spinner.`)
37
- return SPINNERS[0]
38
- }
39
- return SPINNERS[index]
40
- }
41
-
42
- // 字符串类型
43
- if (!SPINNERS.includes(value as any)) {
44
- console.warn(`'${value}' spinner not found, use the default spinner.`)
45
- return SPINNERS[0]
46
- }
47
-
48
- return value as keyof typeof SPINNER_MAP
49
- }
50
- // type Compute<T> = { [K in keyof T]: Compute<T[K]> }; // 将类型展开方便提示
51
- export default defineComponent({
52
- name: 'Dpzvc3Spinner',
53
-
54
- props: {
55
- size: {
56
- type: [Number, String] as PropType<number | string>,
57
- default: 30
58
- },
59
- type: {
60
- type: [String, Number] as PropType<SpinnerType | number>,
61
- default: 'snake'
62
- },
63
- color: {
64
- type: String as PropType<string>,
65
- default: '#39f'
66
- }
67
- },
68
-
69
- setup(props) {
70
- const SpinnerComponent = computed(() => {
71
- const key = parseSpinner(props.type)
72
- return SPINNER_MAP[key]
73
- })
74
- return () => {
75
- const Comp = SpinnerComponent.value as any
76
- return (
77
- <Comp
78
- size={props.size}
79
- type={props.type}
80
- color={props.color}
81
- />
82
- )
83
- }
84
- }
85
- })
@@ -1,20 +0,0 @@
1
- // src/components/spinner/types.ts
2
- export type SpinnerType =
3
- | 'blade'
4
- | 'snake'
5
- | 'double-bounce'
6
- | 'triple-bounce'
7
- | 'fading-circle'
8
-
9
- // type Compute<T> = { [K in keyof T]: T[K] extends Object ? Compute<T[K]> : T[K] }; // 将类型展开方便提示
10
- // interface Spinner {
11
- // size?: number | string
12
- // type?: SpinnerType | number
13
- // color?: string
14
- // }
15
- // export type SpinnerProps = Compute<Spinner>
16
- export interface SpinnerProps {
17
- size?: number | string
18
- type?: SpinnerType | number
19
- color?: string
20
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Created by admin on 2017/5/11.
3
- */
4
- import type { App } from 'vue'
5
- import Swipe from './swipe'
6
- // export default Swipe
7
- Swipe.install = (app: App): void => {
8
- app.component('Swipe', Swipe); // 注册全局组件
9
- }
10
- type IWithInstall<T> = T & { install(app: App): void };
11
- const _Swipe=Swipe as IWithInstall<typeof Swipe>;
12
- export default _Swipe
13
- export type { SwipeProps } from './types'