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,45 +0,0 @@
|
|
|
1
|
-
// src/components/Prompt/types.ts
|
|
2
|
-
import type { CSSProperties } from 'vue'
|
|
3
|
-
type PromptValidator =
|
|
4
|
-
| RegExp
|
|
5
|
-
| ((val: string) => boolean | string)
|
|
6
|
-
|
|
7
|
-
export interface PromptProps {
|
|
8
|
-
value?: boolean
|
|
9
|
-
text?: string
|
|
10
|
-
closable?: boolean
|
|
11
|
-
maskClosable?: boolean
|
|
12
|
-
title?: string
|
|
13
|
-
width?: string
|
|
14
|
-
okText?: string
|
|
15
|
-
cancleText?: string
|
|
16
|
-
loading?: boolean
|
|
17
|
-
styles?: CSSProperties
|
|
18
|
-
spec?: string
|
|
19
|
-
validator?: PromptValidator | null
|
|
20
|
-
msg?: string
|
|
21
|
-
placeholderText?: string
|
|
22
|
-
onOk?: (val: string) => void
|
|
23
|
-
onCancle?: () => void
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type MergePromptOptions<T = PromptProps> = {
|
|
27
|
-
[K in keyof T]: T[K]
|
|
28
|
-
} & {
|
|
29
|
-
onRemove?: () => void
|
|
30
|
-
showCancle?: boolean,
|
|
31
|
-
message?: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Prompt实例
|
|
36
|
-
export type PromptInstance = {
|
|
37
|
-
remove: () => void,
|
|
38
|
-
info: (props: MergePromptOptions) => any
|
|
39
|
-
}
|
|
40
|
-
//开启
|
|
41
|
-
export type DefaultPromptProps = {
|
|
42
|
-
show: (options: MergePromptOptions) => any,
|
|
43
|
-
remove: () => void,
|
|
44
|
-
// component: ComponentPublicInstance
|
|
45
|
-
} | null
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2017/4/19.
|
|
3
|
-
*/
|
|
4
|
-
// import RadioBox from './radiobox.vue'
|
|
5
|
-
// import RadioBoxGroup from './radiobox-group.vue'
|
|
6
|
-
|
|
7
|
-
// RadioBox.group = RadioBoxGroup
|
|
8
|
-
// export default RadioBox
|
|
9
|
-
import type { App } from 'vue'
|
|
10
|
-
import RadioBox from './radiobox'
|
|
11
|
-
import RadioBoxGroup from './radiobox-group'
|
|
12
|
-
|
|
13
|
-
RadioBox.install = (app: App): void => {
|
|
14
|
-
app.component('RadioBox', RadioBox); // 注册全局组件
|
|
15
|
-
}
|
|
16
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
17
|
-
const _RadioBox = RadioBox as IWithInstall<typeof RadioBox>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
RadioBoxGroup.install = (app: App): void => {
|
|
22
|
-
app.component('RadioBoxGroup', RadioBoxGroup); // 注册全局组件
|
|
23
|
-
}
|
|
24
|
-
const _RadioBoxGroup = RadioBoxGroup as IWithInstall<typeof RadioBoxGroup>;
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
_RadioBox as RadioBox,
|
|
28
|
-
_RadioBoxGroup as RadioBoxGroup
|
|
29
|
-
}
|
|
30
|
-
// export {
|
|
31
|
-
// RadioBox,
|
|
32
|
-
// RadioBoxGroup
|
|
33
|
-
// }
|
|
34
|
-
export type { RadioBoxProps, RadioGroupProps } from './types'
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// src/components/radio-group/RadioGroup.tsx
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
computed,
|
|
5
|
-
watch,
|
|
6
|
-
provide,
|
|
7
|
-
ref,
|
|
8
|
-
PropType
|
|
9
|
-
} from 'vue'
|
|
10
|
-
import type { RadioGroupProps, RadioGroupProvide } from './types'
|
|
11
|
-
export type { RadioGroupProps }
|
|
12
|
-
|
|
13
|
-
const prefixCls = 'dpzvc3-radioBoxGroup'
|
|
14
|
-
|
|
15
|
-
export default defineComponent({
|
|
16
|
-
name: 'DpzVcRadioGroup',
|
|
17
|
-
|
|
18
|
-
props: {
|
|
19
|
-
modelValue: {
|
|
20
|
-
type: [String, Number, Boolean] as PropType<RadioGroupProps['modelValue']>,
|
|
21
|
-
default: ''
|
|
22
|
-
},
|
|
23
|
-
vertical: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: false
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
emits: ['update:modelValue', 'on-change', 'on-form-change'],
|
|
30
|
-
|
|
31
|
-
setup(props, { emit, slots }) {
|
|
32
|
-
const currentValue = ref<RadioGroupProps['modelValue']>(props.modelValue) as RadioGroupProvide['currentValue']
|
|
33
|
-
|
|
34
|
-
/** 提供给 Radio 子组件 */
|
|
35
|
-
const change = (val: RadioGroupProps['modelValue']) => {
|
|
36
|
-
currentValue.value = val!
|
|
37
|
-
emit('update:modelValue', val)
|
|
38
|
-
emit('on-change', val)
|
|
39
|
-
emit('on-form-change', val)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
provide<RadioGroupProvide>('radioBoxGroup', {
|
|
43
|
-
currentValue,
|
|
44
|
-
change
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
/** 监听外部 v-model */
|
|
48
|
-
watch(
|
|
49
|
-
() => props.modelValue,
|
|
50
|
-
val => {
|
|
51
|
-
currentValue.value = val
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
const classes = computed(() => [
|
|
56
|
-
prefixCls,
|
|
57
|
-
{ [`${prefixCls}-vertical`]: props.vertical }
|
|
58
|
-
])
|
|
59
|
-
|
|
60
|
-
return () => (
|
|
61
|
-
<div class={classes.value}>
|
|
62
|
-
{slots.default?.()}
|
|
63
|
-
</div>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
})
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="classes">
|
|
3
|
-
<slot />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { defineComponent, computed, watch, provide, ref } from 'vue'
|
|
9
|
-
|
|
10
|
-
const prefixCls = 'dpzvc3-radioBoxGroup'
|
|
11
|
-
|
|
12
|
-
export default defineComponent({
|
|
13
|
-
name: 'RadioBoxGroup',
|
|
14
|
-
props: {
|
|
15
|
-
modelValue: {
|
|
16
|
-
type: [String, Boolean, Number],
|
|
17
|
-
default: ''
|
|
18
|
-
},
|
|
19
|
-
vertical: {
|
|
20
|
-
type: Boolean,
|
|
21
|
-
default: false
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
emits: ['update:modelValue', 'on-change', 'on-form-change'],
|
|
25
|
-
setup (props, { emit }) {
|
|
26
|
-
const currentValue = ref(props.modelValue)
|
|
27
|
-
|
|
28
|
-
// 提供给子组件
|
|
29
|
-
provide('radioBoxGroup', {
|
|
30
|
-
currentValue,
|
|
31
|
-
change: (val) => {
|
|
32
|
-
currentValue.value = val
|
|
33
|
-
emit('update:modelValue', val)
|
|
34
|
-
emit('on-change', val)
|
|
35
|
-
emit('on-form-change', val)
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
// 监听外部 v-model 改变
|
|
40
|
-
watch(
|
|
41
|
-
() => props.modelValue,
|
|
42
|
-
(val) => {
|
|
43
|
-
currentValue.value = val
|
|
44
|
-
}
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
const classes = computed(() => [
|
|
48
|
-
prefixCls,
|
|
49
|
-
{ [`${prefixCls}-vertical`]: props.vertical }
|
|
50
|
-
])
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
classes,
|
|
54
|
-
currentValue
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<style scoped>
|
|
61
|
-
.dpzvc3-radioBoxGroup-vertical {
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
flex-direction: column;
|
|
65
|
-
}
|
|
66
|
-
</style>
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// src/components/RadioBox/RadioBox.tsx
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
inject,
|
|
5
|
-
computed,
|
|
6
|
-
ref,
|
|
7
|
-
onMounted
|
|
8
|
-
} from 'vue'
|
|
9
|
-
import type { PropType } from 'vue'
|
|
10
|
-
import type {
|
|
11
|
-
RadioBoxProps,
|
|
12
|
-
RadioGroupProvide,
|
|
13
|
-
} from './types'
|
|
14
|
-
export type { RadioBoxProps }
|
|
15
|
-
const prefixCls = 'dpzvc3-radiobox'
|
|
16
|
-
const radioGroupKey = 'radioBoxGroup'
|
|
17
|
-
|
|
18
|
-
export default defineComponent({
|
|
19
|
-
name: 'RadioBox',
|
|
20
|
-
|
|
21
|
-
props: {
|
|
22
|
-
label: {
|
|
23
|
-
type: [String, Number] as PropType<RadioBoxProps['label']>,
|
|
24
|
-
required: true
|
|
25
|
-
},
|
|
26
|
-
modelValue: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false
|
|
29
|
-
},
|
|
30
|
-
disable: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
emits: ['update:modelValue', 'on-change'],
|
|
37
|
-
|
|
38
|
-
setup (props, { emit, slots }) {
|
|
39
|
-
const slotEl = ref<HTMLElement | null>(null)
|
|
40
|
-
const show = ref(true)
|
|
41
|
-
|
|
42
|
-
/** 注入 RadioGroup(可选) */
|
|
43
|
-
const group = inject<RadioGroupProvide | null>(
|
|
44
|
-
radioGroupKey,
|
|
45
|
-
null
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
/** 是否选中 */
|
|
49
|
-
const isChecked = computed<boolean>(() => {
|
|
50
|
-
if (group) {
|
|
51
|
-
return group.currentValue.value === props.label
|
|
52
|
-
}
|
|
53
|
-
return !!props.modelValue
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
/** classes */
|
|
57
|
-
const classes = computed(() => [prefixCls])
|
|
58
|
-
|
|
59
|
-
const wrapperClasses = computed(() => [
|
|
60
|
-
`${prefixCls}-wrapper`,
|
|
61
|
-
{
|
|
62
|
-
[`${prefixCls}-checked`]: isChecked.value,
|
|
63
|
-
[`${prefixCls}-disable`]: props.disable
|
|
64
|
-
}
|
|
65
|
-
])
|
|
66
|
-
|
|
67
|
-
const innerClasses = computed(() => [`${prefixCls}-inner`])
|
|
68
|
-
const inputClass = computed(() => [`${prefixCls}-input`])
|
|
69
|
-
|
|
70
|
-
/** change */
|
|
71
|
-
const handleChange = (e: Event) => {
|
|
72
|
-
if (props.disable) return
|
|
73
|
-
|
|
74
|
-
const checked = (e.target as HTMLInputElement).checked
|
|
75
|
-
|
|
76
|
-
if (group) {
|
|
77
|
-
group.change(props.label)
|
|
78
|
-
} else {
|
|
79
|
-
emit('update:modelValue', checked)
|
|
80
|
-
emit('on-change', checked)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** 判断 slot 是否为空 */
|
|
85
|
-
onMounted(() => {
|
|
86
|
-
if (!group) {
|
|
87
|
-
if (slotEl.value && !slotEl.value.innerHTML) {
|
|
88
|
-
show.value = false
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
return () => (
|
|
94
|
-
<label class={classes.value}>
|
|
95
|
-
<span class={wrapperClasses.value}>
|
|
96
|
-
<span class={innerClasses.value}>
|
|
97
|
-
<input
|
|
98
|
-
type="radio"
|
|
99
|
-
disabled={props.disable}
|
|
100
|
-
checked={isChecked.value}
|
|
101
|
-
class={inputClass.value}
|
|
102
|
-
onChange={handleChange}
|
|
103
|
-
/>
|
|
104
|
-
</span>
|
|
105
|
-
</span>
|
|
106
|
-
|
|
107
|
-
{show.value && (
|
|
108
|
-
slots.default
|
|
109
|
-
? slots.default()
|
|
110
|
-
: <span ref={slotEl}>{props.label}</span>
|
|
111
|
-
)}
|
|
112
|
-
</label>
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
})
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<label :class="classes">
|
|
3
|
-
<span :class="wrapperClasses">
|
|
4
|
-
<span :class="innerClasses">
|
|
5
|
-
<input
|
|
6
|
-
type="radio"
|
|
7
|
-
:disabled="disable"
|
|
8
|
-
:checked="isChecked"
|
|
9
|
-
:class="inputClass"
|
|
10
|
-
@change="handleChange"
|
|
11
|
-
>
|
|
12
|
-
</span>
|
|
13
|
-
</span>
|
|
14
|
-
<slot v-if="show"><span ref="slotEl">{{ label }}</span></slot>
|
|
15
|
-
</label>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import { defineComponent, inject, computed, ref, onMounted } from 'vue'
|
|
20
|
-
|
|
21
|
-
const prefixCls = 'dpzvc3-radiobox'
|
|
22
|
-
|
|
23
|
-
export default defineComponent({
|
|
24
|
-
name: 'RadioBox',
|
|
25
|
-
props: {
|
|
26
|
-
label: { type: [String, Number], required: true },
|
|
27
|
-
modelValue: { type: Boolean, default: false },
|
|
28
|
-
disable: { type: Boolean, default: false }
|
|
29
|
-
},
|
|
30
|
-
emits: ['update:modelValue', 'on-change'],
|
|
31
|
-
setup (props, { emit }) {
|
|
32
|
-
const slotEl = ref(null)
|
|
33
|
-
const show = ref(true)
|
|
34
|
-
const group = inject('radioBoxGroup', null) // 如果有group则为对象,没有则为null
|
|
35
|
-
|
|
36
|
-
const isChecked = computed(() => {
|
|
37
|
-
if (group) {
|
|
38
|
-
return group.currentValue.value === props.label
|
|
39
|
-
} else {
|
|
40
|
-
return props.modelValue
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const classes = computed(() => [prefixCls])
|
|
45
|
-
const wrapperClasses = computed(() => [
|
|
46
|
-
`${prefixCls}-wrapper`,
|
|
47
|
-
{
|
|
48
|
-
[`${prefixCls}-checked`]: isChecked.value,
|
|
49
|
-
[`${prefixCls}-disable`]: props.disable
|
|
50
|
-
}
|
|
51
|
-
])
|
|
52
|
-
const innerClasses = computed(() => [`${prefixCls}-inner`])
|
|
53
|
-
const inputClass = computed(() => [`${prefixCls}-input`])
|
|
54
|
-
|
|
55
|
-
function handleChange (e) {
|
|
56
|
-
if (props.disable) return
|
|
57
|
-
const checked = e.target.checked
|
|
58
|
-
|
|
59
|
-
if (group) {
|
|
60
|
-
group.change(props.label)
|
|
61
|
-
} else {
|
|
62
|
-
// console.log(checked, 'ddadda')
|
|
63
|
-
emit('update:modelValue', checked)
|
|
64
|
-
emit('on-change', checked)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
onMounted(() => {
|
|
69
|
-
if (!group) {
|
|
70
|
-
// 判断是否有 slot 内容
|
|
71
|
-
if (slotEl.value && !slotEl.value.innerHTML) {
|
|
72
|
-
show.value = false
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
classes,
|
|
79
|
-
wrapperClasses,
|
|
80
|
-
innerClasses,
|
|
81
|
-
inputClass,
|
|
82
|
-
isChecked,
|
|
83
|
-
handleChange,
|
|
84
|
-
show,
|
|
85
|
-
slotEl
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
</script>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// src/components/radio-group/types.ts
|
|
2
|
-
import type { Ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
type RadioValue = string | number | boolean
|
|
5
|
-
|
|
6
|
-
export interface RadioGroupProps {
|
|
7
|
-
modelValue?: RadioValue
|
|
8
|
-
vertical?: boolean
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface RadioGroupProvide {
|
|
12
|
-
currentValue: Ref<RadioValue>
|
|
13
|
-
change: (val: RadioValue) => void
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type RadioBoxValue = string | number
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface RadioBoxProps {
|
|
21
|
-
label: RadioBoxValue
|
|
22
|
-
modelValue?: boolean
|
|
23
|
-
disable?: boolean
|
|
24
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2025/10/31.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import Rater from './raters'
|
|
6
|
-
Rater.install = (app: App): void => {
|
|
7
|
-
app.component('Rater', Rater); // 注册全局组件
|
|
8
|
-
}
|
|
9
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
-
const _Rater=Rater as IWithInstall<typeof Rater>;
|
|
11
|
-
export default _Rater
|
|
12
|
-
export type { RaterProps } from './types'
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/components/badge/badge.d.ts
|
|
2
|
-
|
|
3
|
-
import type { App } from 'vue'
|
|
4
|
-
import type { RaterProps } from './types' // 引入同级 types.ts 中的 BadgeProps
|
|
5
|
-
|
|
6
|
-
/** Badge 组件实例类型,带 install 方法 */
|
|
7
|
-
declare const Rater: {
|
|
8
|
-
/** Vue 组件本身 */
|
|
9
|
-
new (): any
|
|
10
|
-
/** props 类型引用 */
|
|
11
|
-
__props?: RaterProps
|
|
12
|
-
/** install 方法,用于全量注册 */
|
|
13
|
-
install(app: App): void
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default ActionSheet
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// src/components/rater/rater.tsx
|
|
2
|
-
// src/components/rater/rater.tsx
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { defineComponent, ref, watch, computed, PropType } from 'vue'
|
|
6
|
-
import type { RaterProps } from './types'
|
|
7
|
-
export type { RaterProps }
|
|
8
|
-
const prefixCls = 'dpzvc3-rater'
|
|
9
|
-
|
|
10
|
-
export default defineComponent({
|
|
11
|
-
name: 'Dpzvc3Rater',
|
|
12
|
-
|
|
13
|
-
props: {
|
|
14
|
-
modelValue: { type: Number as PropType<number>, default: -1 },
|
|
15
|
-
distance: { type: Number as PropType<number>, default: 10 },
|
|
16
|
-
max: { type: Number as PropType<number>, default: 5 },
|
|
17
|
-
size: { type: Number as PropType<number>, default: 18 },
|
|
18
|
-
star: { type: String as PropType<string>, default: '★' },
|
|
19
|
-
defaultColor: { type: String as PropType<string>, default: '#ccc' },
|
|
20
|
-
activeColor: { type: String as PropType<string>, default: '#f5a623' },
|
|
21
|
-
disabled: { type: Boolean as PropType<boolean>, default: false }
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
emits: ['update:modelValue'],
|
|
25
|
-
|
|
26
|
-
setup(props, { emit }) {
|
|
27
|
-
const currentValue = ref(props.modelValue)
|
|
28
|
-
|
|
29
|
-
watch(() => props.modelValue, v => {
|
|
30
|
-
currentValue.value = v
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const classes = computed(() => [prefixCls])
|
|
34
|
-
const starClass = `${prefixCls}-star`
|
|
35
|
-
|
|
36
|
-
/** ⭐️ 关键:提前算好 stars 数组 */
|
|
37
|
-
const stars = computed(() => {
|
|
38
|
-
return Array.from({ length: props.max }).map((_, index) => {
|
|
39
|
-
const baseStyle: Record<string, string> = {
|
|
40
|
-
fontSize: `${props.size}px`,
|
|
41
|
-
marginRight: index + 1 < props.max ? `${props.distance}px` : '0px',
|
|
42
|
-
color: props.defaultColor
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const activeStyle: Record<string, string> = {
|
|
46
|
-
fontSize: `${props.size}px`,
|
|
47
|
-
marginRight: baseStyle.marginRight
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const [int, decimal] = String(currentValue.value).split('.')
|
|
51
|
-
|
|
52
|
-
if (index + 1 <= Number(int)) {
|
|
53
|
-
activeStyle.color = props.activeColor
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
decimal &&
|
|
58
|
-
Number(decimal) >= 5 &&
|
|
59
|
-
index + 1 === Number(int) + 1
|
|
60
|
-
) {
|
|
61
|
-
activeStyle.width = '50%'
|
|
62
|
-
activeStyle.color = props.activeColor
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
index,
|
|
67
|
-
baseStyle,
|
|
68
|
-
activeStyle
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
const onClickStar = (index: number) => {
|
|
74
|
-
if (props.disabled) return
|
|
75
|
-
const value = index + 1
|
|
76
|
-
currentValue.value = value
|
|
77
|
-
emit('update:modelValue', value)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** ✅ render 里只“消费数据”,不计算 */
|
|
81
|
-
return () => (
|
|
82
|
-
<div class={classes.value}>
|
|
83
|
-
{stars.value.map(item => (
|
|
84
|
-
<span
|
|
85
|
-
key={item.index}
|
|
86
|
-
class={starClass}
|
|
87
|
-
style={item.baseStyle}
|
|
88
|
-
>
|
|
89
|
-
{props.star}
|
|
90
|
-
<span
|
|
91
|
-
style={item.activeStyle}
|
|
92
|
-
onClick={() => onClickStar(item.index)}
|
|
93
|
-
>
|
|
94
|
-
{props.star}
|
|
95
|
-
</span>
|
|
96
|
-
</span>
|
|
97
|
-
))}
|
|
98
|
-
</div>
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by admin on 2017/4/21.
|
|
3
|
-
*/
|
|
4
|
-
import type { App } from 'vue'
|
|
5
|
-
import SlideBar from './slideBar'
|
|
6
|
-
SlideBar.install = (app: App): void => {
|
|
7
|
-
app.component('SlideBar', SlideBar); // 注册全局组件
|
|
8
|
-
}
|
|
9
|
-
type IWithInstall<T> = T & { install(app: App): void };
|
|
10
|
-
const _SlideBar=SlideBar as IWithInstall<typeof SlideBar>;
|
|
11
|
-
export default _SlideBar
|
|
12
|
-
// export default SlideBar
|
|
13
|
-
export type { SlideBarProps } from './types'
|