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.
- package/README.md +1 -1
- package/dist/dpzvc3.esm.js +5 -4
- package/dist/dpzvc3.esm.js.map +1 -1
- package/dist/dpzvc3.esm.min.js +1 -1
- package/dist/dpzvc3.esm.min.js.map +1 -1
- package/dist/dpzvc3.js +5 -4
- package/dist/dpzvc3.js.map +1 -1
- package/dist/dpzvc3.min.js +1 -1
- package/dist/dpzvc3.min.js.map +1 -1
- package/dist/types/components/actionSheet/index.d.ts +6 -1
- package/dist/types/components/actionSheet/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +7 -2
- package/build-style.js +0 -58
- package/dist-prod/91.05c8ec5277a15f939b0f.js +0 -3
- package/dist-prod/91.05c8ec5277a15f939b0f.js.LICENSE.txt +0 -25
- package/dist-prod/91.05c8ec5277a15f939b0f.js.map +0 -1
- package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js +0 -2
- package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js.map +0 -1
- package/dist-prod/badge.16ab5c05734fe1530701.chunk.js +0 -2
- package/dist-prod/badge.16ab5c05734fe1530701.chunk.js.map +0 -1
- package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js +0 -2
- package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js.map +0 -1
- package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js +0 -2
- package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js.map +0 -1
- package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js +0 -2
- package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js.map +0 -1
- package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js +0 -2
- package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js.map +0 -1
- package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js +0 -2
- package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js.map +0 -1
- package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js +0 -2
- package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js.map +0 -1
- package/dist-prod/header.eb10433dd892738ee95a.chunk.js +0 -2
- package/dist-prod/header.eb10433dd892738ee95a.chunk.js.map +0 -1
- package/dist-prod/index.html +0 -19
- package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js +0 -2
- package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js.map +0 -1
- package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js +0 -2
- package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js.map +0 -1
- package/dist-prod/main.662ad15361e7f3d20234.js +0 -2
- package/dist-prod/main.662ad15361e7f3d20234.js.map +0 -1
- package/dist-prod/message.de17fea3de4daa70bab4.chunk.js +0 -2
- package/dist-prod/message.de17fea3de4daa70bab4.chunk.js.map +0 -1
- package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js +0 -2
- package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js.map +0 -1
- package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js +0 -2
- package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js.map +0 -1
- package/dist-prod/popup.538422c7e188363a468d.chunk.js +0 -2
- package/dist-prod/popup.538422c7e188363a468d.chunk.js.map +0 -1
- package/dist-prod/progress.240de4b633002f573030.chunk.js +0 -2
- package/dist-prod/progress.240de4b633002f573030.chunk.js.map +0 -1
- package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js +0 -2
- package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js.map +0 -1
- package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js +0 -2
- package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js.map +0 -1
- package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js +0 -2
- package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js.map +0 -1
- package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js +0 -2
- package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js.map +0 -1
- package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js +0 -2
- package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js.map +0 -1
- package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js +0 -2
- package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js.map +0 -1
- package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js +0 -2
- package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js.map +0 -1
- package/dist-prod/tab.29f19483f699b7811259.chunk.js +0 -2
- package/dist-prod/tab.29f19483f699b7811259.chunk.js.map +0 -1
- package/dist-prod/text.a6e4251f772d23843e2b.chunk.js +0 -2
- package/dist-prod/text.a6e4251f772d23843e2b.chunk.js.map +0 -1
- package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js +0 -2
- package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js.map +0 -1
- package/dist-prod/upload.0638581e551ed9afaba2.chunk.js +0 -2
- package/dist-prod/upload.0638581e551ed9afaba2.chunk.js.map +0 -1
- package/postcss.config.js +0 -5
- package/src/components/Indicator/Indicator.tsx +0 -67
- package/src/components/Indicator/Indicator.vue +0 -82
- package/src/components/Indicator/index.ts +0 -111
- package/src/components/Indicator/types.ts +0 -15
- package/src/components/Text/index.ts +0 -14
- package/src/components/Text/textBar.tsx +0 -104
- package/src/components/Text/types.ts +0 -13
- package/src/components/actionSheet/actionSheet.d.ts +0 -16
- package/src/components/actionSheet/actionSheet.tsx +0 -86
- package/src/components/actionSheet/index.ts +0 -6
- package/src/components/actionSheet/types.ts +0 -10
- package/src/components/app.vue +0 -59
- package/src/components/badge/badge.tsx +0 -80
- package/src/components/badge/index.ts +0 -12
- package/src/components/badge/types.ts +0 -8
- package/src/components/button/button.tsx +0 -105
- package/src/components/button/index.ts +0 -13
- package/src/components/button/types.ts +0 -13
- package/src/components/card/card.d.ts +0 -16
- package/src/components/card/card.tsx +0 -38
- package/src/components/card/index.ts +0 -12
- package/src/components/card/types.ts +0 -3
- package/src/components/cell/cell.tsx +0 -89
- package/src/components/cell/index.ts +0 -12
- package/src/components/cell/types.ts +0 -8
- package/src/components/cellSwipe/cellSwipe.tsx +0 -188
- package/src/components/cellSwipe/index.ts +0 -13
- package/src/components/cellSwipe/types.ts +0 -17
- package/src/components/checkBox/checkbox-group.tsx +0 -75
- package/src/components/checkBox/checkbox.tsx +0 -107
- package/src/components/checkBox/index.ts +0 -29
- package/src/components/checkBox/types.ts +0 -32
- package/src/components/header/header.tsx +0 -119
- package/src/components/header/index.ts +0 -13
- package/src/components/header/types.ts +0 -7
- package/src/components/loadMore/index.ts +0 -14
- package/src/components/loadMore/loadMore.tsx +0 -265
- package/src/components/loadMore/types.ts +0 -26
- package/src/components/message/confirm.ts +0 -104
- package/src/components/message/index.ts +0 -113
- package/src/components/message/message.tsx +0 -100
- package/src/components/message/messageGroup.tsx +0 -59
- package/src/components/message/types.ts +0 -48
- package/src/components/modal/confirm.ts +0 -123
- package/src/components/modal/index.ts +0 -68
- package/src/components/modal/modal.tsx +0 -248
- package/src/components/modal/types.ts +0 -51
- package/src/components/number/Number.tsx +0 -143
- package/src/components/number/index.ts +0 -10
- package/src/components/number/types.ts +0 -13
- package/src/components/picker/area-picker/area-picker.vue +0 -230
- package/src/components/picker/area-picker/props.js +0 -17
- package/src/components/picker/date-picker/date-picker.vue +0 -191
- package/src/components/picker/date-picker/props.js +0 -24
- package/src/components/picker/index.ts +0 -12
- package/src/components/picker/normal-picker/normal-picker.vue +0 -120
- package/src/components/picker/normal-picker/props.js +0 -20
- package/src/components/picker/picker-slot.vue +0 -217
- package/src/components/picker/picker.tsx +0 -112
- package/src/components/picker/types.ts +0 -17
- package/src/components/popup/index.ts +0 -12
- package/src/components/popup/popup.d.ts +0 -16
- package/src/components/popup/popup.tsx +0 -68
- package/src/components/popup/types.ts +0 -9
- package/src/components/progress/index.ts +0 -12
- package/src/components/progress/progress.tsx +0 -81
- package/src/components/progress/types.ts +0 -9
- package/src/components/prompt/confirm.ts +0 -104
- package/src/components/prompt/index.ts +0 -50
- package/src/components/prompt/prompt.tsx +0 -161
- package/src/components/prompt/types.ts +0 -45
- package/src/components/radioBox/index.ts +0 -34
- package/src/components/radioBox/radiobox-group.tsx +0 -66
- package/src/components/radioBox/radiobox-group1.vue +0 -66
- package/src/components/radioBox/radiobox.tsx +0 -115
- package/src/components/radioBox/radiobox1.vue +0 -89
- package/src/components/radioBox/types.ts +0 -24
- package/src/components/rater/index.ts +0 -12
- package/src/components/rater/rater.d.ts +0 -16
- package/src/components/rater/raters.tsx +0 -101
- package/src/components/rater/types.ts +0 -10
- package/src/components/slideBar/index.ts +0 -13
- package/src/components/slideBar/slideBar.tsx +0 -288
- package/src/components/slideBar/types.ts +0 -20
- package/src/components/spinner/behavior/blade.vue +0 -42
- package/src/components/spinner/behavior/double-bounce.vue +0 -38
- package/src/components/spinner/behavior/fading-circle.vue +0 -55
- package/src/components/spinner/behavior/snake.vue +0 -41
- package/src/components/spinner/behavior/triple-bounce.vue +0 -52
- package/src/components/spinner/index.ts +0 -13
- package/src/components/spinner/props.js +0 -28
- package/src/components/spinner/spinner.tsx +0 -85
- package/src/components/spinner/types.ts +0 -20
- package/src/components/swipe/index.ts +0 -13
- package/src/components/swipe/swipe.tsx +0 -292
- package/src/components/swipe/types.ts +0 -21
- package/src/components/switchbar/index.ts +0 -13
- package/src/components/switchbar/switchbar.tsx +0 -58
- package/src/components/switchbar/types.ts +0 -6
- package/src/components/tab/index.ts +0 -12
- package/src/components/tab/tab.tsx +0 -71
- package/src/components/tab/types.ts +0 -15
- package/src/components/toTop/index.ts +0 -13
- package/src/components/toTop/toTop.tsx +0 -54
- package/src/components/toTop/types.ts +0 -7
- package/src/components/upload/index.ts +0 -13
- package/src/components/upload/types.ts +0 -9
- package/src/components/upload/upload.tsx +0 -180
- package/src/config/config.js +0 -16
- package/src/directives/clickoutside.js +0 -42
- package/src/directives/tranferDom.js +0 -66
- package/src/index.d.ts +0 -131
- package/src/index.ts +0 -136
- package/src/lib/MegaPixImage.js +0 -164
- package/src/lib/MegaPixImageOld.js +0 -153
- package/src/lib/exif-js.js +0 -235
- package/src/lib/exif.js +0 -789
- package/src/lib/lib.js +0 -22
- package/src/main.ts +0 -33
- package/src/mixin/emitter.js +0 -72
- package/src/mixin/input.js +0 -41
- package/src/router.ts +0 -36
- package/src/shims-vue.d.ts +0 -37
- package/src/styles/base/font.less +0 -99
- package/src/styles/base/reset.less +0 -135
- package/src/styles/base/variable.less +0 -108
- package/src/styles/components/actionSheet.less +0 -43
- package/src/styles/components/badge.less +0 -81
- package/src/styles/components/button.less +0 -124
- package/src/styles/components/card.less +0 -31
- package/src/styles/components/cell-swipe.less +0 -20
- package/src/styles/components/cell.less +0 -75
- package/src/styles/components/checkBox.less +0 -113
- package/src/styles/components/editor.less +0 -3
- package/src/styles/components/header.less +0 -72
- package/src/styles/components/indicator.less +0 -39
- package/src/styles/components/loadmore.less +0 -48
- package/src/styles/components/message.less +0 -57
- package/src/styles/components/modal.less +0 -84
- package/src/styles/components/number.less +0 -60
- package/src/styles/components/picker.less +0 -152
- package/src/styles/components/popup.less +0 -46
- package/src/styles/components/progress.less +0 -52
- package/src/styles/components/prompt.less +0 -37
- package/src/styles/components/radioBox.less +0 -142
- package/src/styles/components/rater.less +0 -16
- package/src/styles/components/slide-Bar.less +0 -149
- package/src/styles/components/spinner.less +0 -329
- package/src/styles/components/swipe.less +0 -125
- package/src/styles/components/switchBar.less +0 -88
- package/src/styles/components/tab.less +0 -71
- package/src/styles/components/text.less +0 -82
- package/src/styles/components/toTop.less +0 -28
- package/src/styles/components/upload.less +0 -23
- package/src/styles/index.less +0 -39
- package/src/styles/utils/1px.less +0 -206
- package/src/styles/utils/animation.less +0 -165
- package/src/styles/utils/nowrap.less +0 -19
- package/src/template/index.ejs +0 -40
- package/src/types/index.d.ts +0 -127
- package/src/types/js-shims.d.ts +0 -36
- package/src/utils/test.ts +0 -2
- package/src/utils/util.ts +0 -168
- package/src/utils/util1.js +0 -202
- package/src/vconsole-resources.min.js +0 -6
- package/src/vconsole-sources.min.js +0 -6
- package/src/vconsole.min.js +0 -7
- package/src/views/ActionSheet.vue +0 -46
- package/src/views/Badge/Badge.less +0 -12
- package/src/views/Badge/Badge.tsx +0 -23
- package/src/views/Badge.vue +0 -53
- package/src/views/Button.vue +0 -69
- package/src/views/Card.vue +0 -89
- package/src/views/Cell.vue +0 -31
- package/src/views/CellSwipe.vue +0 -80
- package/src/views/CheckBox.vue +0 -78
- package/src/views/Header.vue +0 -71
- package/src/views/Indicator.vue +0 -82
- package/src/views/LoadMore.vue +0 -76
- package/src/views/Message.vue +0 -61
- package/src/views/Modal.vue +0 -69
- package/src/views/Picker.vue +0 -142
- package/src/views/Popup.vue +0 -103
- package/src/views/Progress.vue +0 -49
- package/src/views/Prompt.vue +0 -43
- package/src/views/RadioBox.vue +0 -70
- package/src/views/Rater.vue +0 -53
- package/src/views/SlideBar.vue +0 -62
- package/src/views/Spinner.vue +0 -27
- package/src/views/Swipe.vue +0 -59
- package/src/views/SwitchBar.vue +0 -49
- package/src/views/Tab.vue +0 -55
- package/src/views/Text.vue +0 -97
- package/src/views/ToTop.vue +0 -31
- package/src/views/Upload.vue +0 -65
- package/src/views/guide.vue +0 -164
- package/src/views/index.vue +0 -554
- package/tsconfig.build.json +0 -31
- package/tsconfig.json +0 -41
- package/webpack.base.config.js +0 -85
- package/webpack.dev.config.js +0 -43
- package/webpack.dist.dev.config.js +0 -76
- package/webpack.dist.prod.config.js +0 -90
- package/webpack.prod.config.js +0 -52
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, watch,PropType } from 'vue'
|
|
2
|
-
|
|
3
|
-
import type { BadgeProps } from './types'
|
|
4
|
-
export type { BadgeProps }
|
|
5
|
-
|
|
6
|
-
export default defineComponent({
|
|
7
|
-
name: 'Dpzvc3Badge',
|
|
8
|
-
|
|
9
|
-
props: {
|
|
10
|
-
type: {
|
|
11
|
-
type: String as PropType<BadgeProps['type']>,
|
|
12
|
-
default: 'danger'
|
|
13
|
-
},
|
|
14
|
-
size: {
|
|
15
|
-
type: String as PropType<BadgeProps['size']>,
|
|
16
|
-
default: 'normal'
|
|
17
|
-
},
|
|
18
|
-
dot: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false
|
|
21
|
-
},
|
|
22
|
-
max: {
|
|
23
|
-
type: [Number, String],
|
|
24
|
-
default: 99
|
|
25
|
-
},
|
|
26
|
-
number: {
|
|
27
|
-
type: [Number, String]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
setup (props, { slots }) {
|
|
32
|
-
const prefixCls = 'dpzvc3-badge'
|
|
33
|
-
const visible = ref(true)
|
|
34
|
-
|
|
35
|
-
watch(
|
|
36
|
-
() => props.number,
|
|
37
|
-
(val) => {
|
|
38
|
-
if (props.dot) {
|
|
39
|
-
visible.value = true
|
|
40
|
-
} else if (val == null || isNaN(Number(val))) {
|
|
41
|
-
visible.value = false
|
|
42
|
-
} else {
|
|
43
|
-
visible.value = true
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{ immediate: true }
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
const classes = computed(() => [prefixCls])
|
|
50
|
-
|
|
51
|
-
const supClasses = computed(() => [
|
|
52
|
-
`${prefixCls}-${props.type}`,
|
|
53
|
-
{
|
|
54
|
-
[`${prefixCls}-size-${props.size}`]: !props.dot,
|
|
55
|
-
[`${prefixCls}-dot`]: props.dot
|
|
56
|
-
}
|
|
57
|
-
])
|
|
58
|
-
|
|
59
|
-
const displayCount = computed(() => {
|
|
60
|
-
if (props.dot) return ''
|
|
61
|
-
const num = Number(props.number)
|
|
62
|
-
return num <= Number(props.max) ? String(num) : `${props.max}+`
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
return () => (
|
|
66
|
-
<span class={classes.value}>
|
|
67
|
-
{slots.default?.()}
|
|
68
|
-
{visible.value && (
|
|
69
|
-
<sup class={supClasses.value}>
|
|
70
|
-
{displayCount.value}
|
|
71
|
-
</sup>
|
|
72
|
-
)}
|
|
73
|
-
</span>
|
|
74
|
-
)
|
|
75
|
-
// h('span', { class: classes.value }, [
|
|
76
|
-
// slots.default ? slots.default() : null,
|
|
77
|
-
// visible.value ? h('sup', { class: supClasses.value }, displayCount.value) : null
|
|
78
|
-
// ])
|
|
79
|
-
}
|
|
80
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2025/11/4.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import Badge from './badge'
|
|
6
|
-
Badge.install = (app: App): void => {
|
|
7
|
-
app.component('Badge', Badge); // 注册全局组件
|
|
8
|
-
}
|
|
9
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
-
const _Badge=Badge as IWithInstall<typeof Badge>;
|
|
11
|
-
export default _Badge
|
|
12
|
-
export type { BadgeProps } from './types'
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// src/components/button/button.tsx
|
|
2
|
-
import { defineComponent, computed, PropType } from 'vue'
|
|
3
|
-
import Spinner from '../spinner'
|
|
4
|
-
import type { ButtonProps } from './types'
|
|
5
|
-
|
|
6
|
-
export type { ButtonProps }
|
|
7
|
-
|
|
8
|
-
const prefixCls = 'dpzvc3-button'
|
|
9
|
-
|
|
10
|
-
export default defineComponent({
|
|
11
|
-
name: 'VButton',
|
|
12
|
-
props: {
|
|
13
|
-
type: {
|
|
14
|
-
type: String as PropType<ButtonProps['type']>,
|
|
15
|
-
default: 'normal',
|
|
16
|
-
validator: (val: string) =>
|
|
17
|
-
['success', 'loading', 'normal', 'primary', 'warning', 'danger', 'text'].includes(val)
|
|
18
|
-
},
|
|
19
|
-
styles: {
|
|
20
|
-
type: Object as PropType<ButtonProps['styles']>,
|
|
21
|
-
default: () => ({})
|
|
22
|
-
},
|
|
23
|
-
circle: { type: Boolean, default: false },
|
|
24
|
-
disabled: { type: Boolean, default: false },
|
|
25
|
-
inline: { type: Boolean, default: false },
|
|
26
|
-
width: { type: String, default: '100%' },
|
|
27
|
-
height: { type: String, default: '40px' },
|
|
28
|
-
loading: { type: Boolean, default: false },
|
|
29
|
-
radius: { type: Boolean, default: true },
|
|
30
|
-
border: { type: String as PropType<ButtonProps['border']>, default: 'all' }
|
|
31
|
-
},
|
|
32
|
-
emits: ['click'],
|
|
33
|
-
setup(props, { emit, slots }) {
|
|
34
|
-
/** 外层容器类 */
|
|
35
|
-
const classes = computed(() => [
|
|
36
|
-
prefixCls,
|
|
37
|
-
{
|
|
38
|
-
[`${prefixCls}-circle`]: props.circle,
|
|
39
|
-
[`${prefixCls}-inline`]: props.inline
|
|
40
|
-
}
|
|
41
|
-
])
|
|
42
|
-
|
|
43
|
-
/** 外层容器样式 */
|
|
44
|
-
const wrapperStyles = computed(() => ({
|
|
45
|
-
display: props.inline ? 'inline-block' : 'block',
|
|
46
|
-
width: props.width,
|
|
47
|
-
height: props.height
|
|
48
|
-
}))
|
|
49
|
-
|
|
50
|
-
/** button 类 */
|
|
51
|
-
const buttonClass = computed(() => [
|
|
52
|
-
`${prefixCls}-btn`,
|
|
53
|
-
[`dpzvc3-1px-${props.border}`],
|
|
54
|
-
{
|
|
55
|
-
[`${prefixCls}-success`]: props.type === 'success',
|
|
56
|
-
[`${prefixCls}-loading`]: props.type === 'loading',
|
|
57
|
-
[`${prefixCls}-normal`]: props.type === 'normal',
|
|
58
|
-
[`${prefixCls}-warning`]: props.type === 'warning',
|
|
59
|
-
[`${prefixCls}-danger`]: props.type === 'danger',
|
|
60
|
-
[`${prefixCls}-text`]: props.type === 'text',
|
|
61
|
-
[`${prefixCls}-primary`]: props.type === 'primary',
|
|
62
|
-
[`${prefixCls}-disabled`]: props.disabled,
|
|
63
|
-
[`${prefixCls}-radius`]: props.radius
|
|
64
|
-
}
|
|
65
|
-
])
|
|
66
|
-
|
|
67
|
-
/** 点击事件 */
|
|
68
|
-
const handleClick = (e: MouseEvent) => {
|
|
69
|
-
if (props.disabled || props.loading) return
|
|
70
|
-
emit('click', e)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** loading 状态 */
|
|
74
|
-
const loadingValue = computed(() => props.loading)
|
|
75
|
-
|
|
76
|
-
/** JSX 渲染 */
|
|
77
|
-
return () => (
|
|
78
|
-
<div class={classes.value} style={wrapperStyles.value}>
|
|
79
|
-
<button
|
|
80
|
-
class={buttonClass.value}
|
|
81
|
-
style={props.styles}
|
|
82
|
-
disabled={props.disabled}
|
|
83
|
-
onClick={handleClick}
|
|
84
|
-
>
|
|
85
|
-
{/* left slot */}
|
|
86
|
-
{slots.left ? (
|
|
87
|
-
slots.left()
|
|
88
|
-
) : (
|
|
89
|
-
loadingValue.value && (
|
|
90
|
-
<span class="loading">
|
|
91
|
-
<Spinner type="blade" size={15} color="#ffffff" />
|
|
92
|
-
</span>
|
|
93
|
-
)
|
|
94
|
-
)}
|
|
95
|
-
|
|
96
|
-
{/* default slot */}
|
|
97
|
-
{slots.default ? slots.default() : <span>确定</span>}
|
|
98
|
-
|
|
99
|
-
{/* right slot */}
|
|
100
|
-
{slots.right?.()}
|
|
101
|
-
</button>
|
|
102
|
-
</div>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2017/5/9.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import DpButton from './button'
|
|
6
|
-
DpButton.install = (app: App): void => {
|
|
7
|
-
app.component('DpButton', DpButton); // 注册全局组件
|
|
8
|
-
}
|
|
9
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
-
const _DpButton=DpButton as IWithInstall<typeof DpButton>;
|
|
11
|
-
export default _DpButton
|
|
12
|
-
// export default DpButton
|
|
13
|
-
export type { ButtonProps } from './types'
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/components/button/types.ts
|
|
2
|
-
export interface ButtonProps {
|
|
3
|
-
type?: 'success' | 'loading' | 'normal' | 'primary' | 'warning' | 'danger' | 'text'
|
|
4
|
-
styles?: Record<string, any>
|
|
5
|
-
circle?: boolean
|
|
6
|
-
disabled?: boolean
|
|
7
|
-
inline?: boolean
|
|
8
|
-
width?: string
|
|
9
|
-
height?: string
|
|
10
|
-
loading?: boolean
|
|
11
|
-
radius?: boolean
|
|
12
|
-
border?: 'all' | 'top' | 'bottom' | 'left' | 'right' | 'none'
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/components/badge/badge.d.ts
|
|
2
|
-
|
|
3
|
-
import type { App } from 'vue'
|
|
4
|
-
import type { CardProps } from './types' // 引入同级 types.ts 中的 BadgeProps
|
|
5
|
-
|
|
6
|
-
/** Badge 组件实例类型,带 install 方法 */
|
|
7
|
-
declare const Card: {
|
|
8
|
-
/** Vue 组件本身 */
|
|
9
|
-
new (): any
|
|
10
|
-
/** props 类型引用 */
|
|
11
|
-
__props?: CardProps
|
|
12
|
-
/** install 方法,用于全量注册 */
|
|
13
|
-
install(app: App): void
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default Card
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// src/components/card/card.tsx
|
|
2
|
-
import { defineComponent, computed, PropType } from 'vue'
|
|
3
|
-
|
|
4
|
-
// export type CardProps = {
|
|
5
|
-
// width?: string
|
|
6
|
-
// }
|
|
7
|
-
import type { CardProps } from './types'
|
|
8
|
-
export type { CardProps }
|
|
9
|
-
|
|
10
|
-
const prefixCls = 'dpzvc3-card'
|
|
11
|
-
|
|
12
|
-
export default defineComponent({
|
|
13
|
-
name: 'Dpzvc3Card',
|
|
14
|
-
props: {
|
|
15
|
-
width: { type: String as PropType<string>, default: '100%' }
|
|
16
|
-
},
|
|
17
|
-
setup(props, { slots }) {
|
|
18
|
-
const classes = computed(() => [prefixCls])
|
|
19
|
-
const headerClass = computed(() => [`${prefixCls}-header`, 'dpzvc3-1px-bottom'])
|
|
20
|
-
const contentClass = computed(() => [`${prefixCls}-content`])
|
|
21
|
-
const footerClass = computed(() => [`${prefixCls}-footer`, 'dpzvc3-1px-top'])
|
|
22
|
-
const cardWidth = computed(() => props.width)
|
|
23
|
-
|
|
24
|
-
return () => (
|
|
25
|
-
<div class={classes.value} style={{ width: cardWidth.value }}>
|
|
26
|
-
<div class={headerClass.value}>
|
|
27
|
-
{slots.header?.()}
|
|
28
|
-
</div>
|
|
29
|
-
<div class={contentClass.value}>
|
|
30
|
-
{slots.default ? slots.default() : <div class="main" />}
|
|
31
|
-
</div>
|
|
32
|
-
<div class={footerClass.value}>
|
|
33
|
-
{slots.footer?.()}
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2017/7/7.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import Card from './card'
|
|
6
|
-
Card.install = (app: App): void => {
|
|
7
|
-
app.component('Card', Card); // 注册全局组件
|
|
8
|
-
}
|
|
9
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
-
const _Card = Card as IWithInstall<typeof Card>;
|
|
11
|
-
export default _Card
|
|
12
|
-
export type { CardProps } from './types'
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// src/components/cell/cell.tsx
|
|
2
|
-
import { defineComponent, computed,PropType} from 'vue'
|
|
3
|
-
import { useRouter } from 'vue-router'
|
|
4
|
-
|
|
5
|
-
import type { CellProps } from './types'
|
|
6
|
-
export type { CellProps }
|
|
7
|
-
|
|
8
|
-
const prefixCls = 'dpzvc3-cell'
|
|
9
|
-
|
|
10
|
-
export default defineComponent({
|
|
11
|
-
name: 'Dpzvc3Cell',
|
|
12
|
-
props: {
|
|
13
|
-
title: String,
|
|
14
|
-
value: null,
|
|
15
|
-
label: String,
|
|
16
|
-
link: String,
|
|
17
|
-
hasMask: Boolean
|
|
18
|
-
},
|
|
19
|
-
emits: ['touchstart', 'touchmove', 'touchend', 'click'],
|
|
20
|
-
setup(props, { emit, slots }) {
|
|
21
|
-
const router = useRouter()
|
|
22
|
-
|
|
23
|
-
const toLink = computed(() => {
|
|
24
|
-
if (!props.link) return ''
|
|
25
|
-
const resolved = router.resolve(props.link)
|
|
26
|
-
return resolved.matched.length ? resolved.href : props.link
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const classes = computed(() => [prefixCls])
|
|
30
|
-
const maskClass = computed(() => [`${prefixCls}-mask`])
|
|
31
|
-
const leftClasses = computed(() => [`${prefixCls}-left`])
|
|
32
|
-
const rightClasses = computed(() => [`${prefixCls}-right`])
|
|
33
|
-
const wrapperClasses = computed(() => [`${prefixCls}-main`, 'dpzvc3-1px-top'])
|
|
34
|
-
const titleClass = computed(() => [`${prefixCls}-main-title`])
|
|
35
|
-
const valueClass = computed(() => [`${prefixCls}-main-value`])
|
|
36
|
-
const labelClass = computed(() => [`${prefixCls}-main-label`])
|
|
37
|
-
|
|
38
|
-
const handleClick = (e: MouseEvent) => {
|
|
39
|
-
if (props.link) {
|
|
40
|
-
router.push(props.link)
|
|
41
|
-
} else {
|
|
42
|
-
emit('click', e)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const cellTouchStart = (e: TouchEvent) => emit('touchstart', e)
|
|
47
|
-
const cellTouchMove = (e: TouchEvent) => emit('touchmove', e)
|
|
48
|
-
const cellTouchEnd = (e: TouchEvent) => emit('touchend', e)
|
|
49
|
-
|
|
50
|
-
return () => (
|
|
51
|
-
<div
|
|
52
|
-
href={toLink.value}
|
|
53
|
-
class={classes.value}
|
|
54
|
-
onClick={handleClick}
|
|
55
|
-
onTouchstart={cellTouchStart}
|
|
56
|
-
onTouchmove={cellTouchMove}
|
|
57
|
-
onTouchend={cellTouchEnd}
|
|
58
|
-
>
|
|
59
|
-
{props.hasMask && <span class={maskClass.value} />}
|
|
60
|
-
|
|
61
|
-
<div class={leftClasses.value}>
|
|
62
|
-
{slots.left?.()}
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div class={wrapperClasses.value}>
|
|
66
|
-
<div class={titleClass.value}>
|
|
67
|
-
{slots.icon?.()}
|
|
68
|
-
{slots.title ? (
|
|
69
|
-
slots.title()
|
|
70
|
-
) : (
|
|
71
|
-
<>
|
|
72
|
-
<span>{props.title}</span>
|
|
73
|
-
<span class={labelClass.value}>{props.label}</span>
|
|
74
|
-
</>
|
|
75
|
-
)}
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<div class={valueClass.value}>
|
|
79
|
-
{slots.value ? slots.value() : <span>{props.value}</span>}
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div class={rightClasses.value}>
|
|
84
|
-
{slots.right?.()}
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2025/12/4.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import Cell from './cell'
|
|
6
|
-
Cell.install = (app: App): void => {
|
|
7
|
-
app.component('Cell', Cell); // 注册全局组件
|
|
8
|
-
}
|
|
9
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
-
const _Cell=Cell as IWithInstall<typeof Cell>;
|
|
11
|
-
export default _Cell
|
|
12
|
-
export type { CellProps } from './types'
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
// src/components/cell-swipe/cell-swipe.tsx
|
|
2
|
-
import {
|
|
3
|
-
ref,
|
|
4
|
-
reactive,
|
|
5
|
-
watch,
|
|
6
|
-
nextTick,
|
|
7
|
-
onMounted,
|
|
8
|
-
defineComponent
|
|
9
|
-
} from 'vue'
|
|
10
|
-
|
|
11
|
-
import Cell from '../cell'
|
|
12
|
-
import type { CellSwipeProps, CellSwipeAction } from './types'
|
|
13
|
-
|
|
14
|
-
export type { CellSwipeProps }
|
|
15
|
-
|
|
16
|
-
const translate3d = (x: number) => `translate3d(${x}px,0,0)`
|
|
17
|
-
|
|
18
|
-
export default defineComponent({
|
|
19
|
-
name: 'Dpzvc3CellSwipe',
|
|
20
|
-
props: {
|
|
21
|
-
title: String,
|
|
22
|
-
value: null,
|
|
23
|
-
label: String,
|
|
24
|
-
link: String,
|
|
25
|
-
hasMask: Boolean,
|
|
26
|
-
left: {
|
|
27
|
-
type: Array as () => CellSwipeAction[],
|
|
28
|
-
default: () => []
|
|
29
|
-
},
|
|
30
|
-
right: {
|
|
31
|
-
type: Array as () => CellSwipeAction[],
|
|
32
|
-
default: () => []
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
setup(props) {
|
|
36
|
-
const cellRef = ref<any>(null)
|
|
37
|
-
const leftRef = ref<HTMLElement | null>(null)
|
|
38
|
-
const rightRef = ref<HTMLElement | null>(null)
|
|
39
|
-
|
|
40
|
-
const state = reactive({
|
|
41
|
-
translate: 0,
|
|
42
|
-
startX: 0,
|
|
43
|
-
currentX: 0,
|
|
44
|
-
direction: '' as 'left' | 'right' | '',
|
|
45
|
-
leftWidth: 0,
|
|
46
|
-
rightWidth: 0,
|
|
47
|
-
wrapper: null as HTMLElement | null,
|
|
48
|
-
leftEl: null as HTMLElement | null,
|
|
49
|
-
rightEl: null as HTMLElement | null
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const swipe = (translate = 0) => {
|
|
53
|
-
state.translate = translate
|
|
54
|
-
state.wrapper && (state.wrapper.style.transform = translate3d(translate))
|
|
55
|
-
state.leftEl &&
|
|
56
|
-
(state.leftEl.style.transform = translate3d(-state.leftWidth + translate))
|
|
57
|
-
state.rightEl &&
|
|
58
|
-
(state.rightEl.style.transform = translate3d(state.rightWidth + translate))
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const onTouchStart = (e: TouchEvent) => {
|
|
62
|
-
state.startX = e.touches[0].clientX
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const onTouchMove = (e: TouchEvent) => {
|
|
66
|
-
e.preventDefault()
|
|
67
|
-
state.currentX = e.touches[0].clientX
|
|
68
|
-
const diff = state.currentX - state.startX
|
|
69
|
-
state.direction = diff < 0 ? 'left' : 'right'
|
|
70
|
-
|
|
71
|
-
if (state.direction === 'left') {
|
|
72
|
-
state.translate = Math.max(-state.rightWidth, diff)
|
|
73
|
-
} else {
|
|
74
|
-
state.translate = Math.min(state.leftWidth, diff)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
nextTick(() => swipe(state.translate))
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const onTouchEnd = () => {
|
|
81
|
-
if (
|
|
82
|
-
state.direction === 'right' &&
|
|
83
|
-
Math.abs(state.translate) > state.leftWidth / 2
|
|
84
|
-
) {
|
|
85
|
-
swipe(state.leftWidth)
|
|
86
|
-
} else if (
|
|
87
|
-
state.direction === 'left' &&
|
|
88
|
-
Math.abs(state.translate) > state.rightWidth / 2
|
|
89
|
-
) {
|
|
90
|
-
swipe(-state.rightWidth)
|
|
91
|
-
} else {
|
|
92
|
-
swipe(0)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
watch(
|
|
97
|
-
() => props.left,
|
|
98
|
-
() => {
|
|
99
|
-
nextTick(() => {
|
|
100
|
-
state.leftWidth = leftRef.value?.offsetWidth || 0
|
|
101
|
-
swipe()
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
watch(
|
|
107
|
-
() => props.right,
|
|
108
|
-
() => {
|
|
109
|
-
nextTick(() => {
|
|
110
|
-
state.rightWidth = rightRef.value?.offsetWidth || 0
|
|
111
|
-
swipe()
|
|
112
|
-
})
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
onMounted(() => {
|
|
117
|
-
nextTick(() => {
|
|
118
|
-
if (!cellRef.value) return
|
|
119
|
-
|
|
120
|
-
const el = cellRef.value.$el as HTMLElement
|
|
121
|
-
state.wrapper = el.querySelector('.dpzvc3-cell-main')
|
|
122
|
-
state.leftEl = leftRef.value?.parentElement || null
|
|
123
|
-
state.rightEl = rightRef.value?.parentElement || null
|
|
124
|
-
|
|
125
|
-
state.leftWidth = state.leftEl?.offsetWidth || 0
|
|
126
|
-
state.rightWidth = state.rightEl?.offsetWidth || 0
|
|
127
|
-
|
|
128
|
-
state.leftEl &&
|
|
129
|
-
(state.leftEl.style.transform = translate3d(-state.leftWidth))
|
|
130
|
-
state.rightEl &&
|
|
131
|
-
(state.rightEl.style.transform = translate3d(state.rightWidth + 1))
|
|
132
|
-
state.wrapper && (state.wrapper.style.transform = translate3d(0))
|
|
133
|
-
})
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
return () => (
|
|
137
|
-
<Cell
|
|
138
|
-
ref={cellRef}
|
|
139
|
-
title={props.title}
|
|
140
|
-
value={props.value}
|
|
141
|
-
label={props.label}
|
|
142
|
-
link={props.link}
|
|
143
|
-
hasMask={props.hasMask}
|
|
144
|
-
onClick={() => swipe(0)}
|
|
145
|
-
onTouchstart={onTouchStart}
|
|
146
|
-
onTouchmove={onTouchMove}
|
|
147
|
-
onTouchend={onTouchEnd}
|
|
148
|
-
>
|
|
149
|
-
{{
|
|
150
|
-
left: () => (
|
|
151
|
-
<div ref={leftRef} class="dpzvc3-cell-swipe-group">
|
|
152
|
-
{props.left?.map((item, index) => (
|
|
153
|
-
<span
|
|
154
|
-
key={index}
|
|
155
|
-
class="dpzvc3-cell-swipe-btn"
|
|
156
|
-
style={item.style}
|
|
157
|
-
innerHTML={item.content}
|
|
158
|
-
onClick={(e: any) => {
|
|
159
|
-
e.stopPropagation()
|
|
160
|
-
item.handleClick?.()
|
|
161
|
-
swipe(0)
|
|
162
|
-
}}
|
|
163
|
-
/>
|
|
164
|
-
))}
|
|
165
|
-
</div>
|
|
166
|
-
),
|
|
167
|
-
right: () => (
|
|
168
|
-
<div ref={rightRef} class="dpzvc3-cell-swipe-group">
|
|
169
|
-
{props.right?.map((item, index) => (
|
|
170
|
-
<span
|
|
171
|
-
key={index}
|
|
172
|
-
class="dpzvc3-cell-swipe-btn"
|
|
173
|
-
style={item.style}
|
|
174
|
-
innerHTML={item.content}
|
|
175
|
-
onClick={(e: any) => {
|
|
176
|
-
e.stopPropagation()
|
|
177
|
-
item.handleClick?.()
|
|
178
|
-
swipe(0)
|
|
179
|
-
}}
|
|
180
|
-
/>
|
|
181
|
-
))}
|
|
182
|
-
</div>
|
|
183
|
-
)
|
|
184
|
-
}}
|
|
185
|
-
</Cell>
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2017/7/4.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import CellSwipe from './cellSwipe'
|
|
6
|
-
// export default CellSwipe
|
|
7
|
-
CellSwipe.install = (app: App): void => {
|
|
8
|
-
app.component('CellSwipe', CellSwipe); // 注册全局组件
|
|
9
|
-
}
|
|
10
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
11
|
-
const _CellSwipe=CellSwipe as IWithInstall<typeof CellSwipe>;
|
|
12
|
-
export default _CellSwipe
|
|
13
|
-
export type { CellSwipeProps } from './types'
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/components/cell-swipe/types.ts
|
|
2
|
-
|
|
3
|
-
export interface CellSwipeAction {
|
|
4
|
-
content?: string
|
|
5
|
-
style?: Record<string, string>
|
|
6
|
-
handleClick?: () => void
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface CellSwipeProps {
|
|
10
|
-
title?: string
|
|
11
|
-
value?: any
|
|
12
|
-
label?: string
|
|
13
|
-
link?: string
|
|
14
|
-
hasMask?: boolean
|
|
15
|
-
left?: CellSwipeAction[]
|
|
16
|
-
right?: CellSwipeAction[]
|
|
17
|
-
}
|