dpzvc3-ui 3.1.4 → 3.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/README.md +1 -1
  2. package/dist/dpzvc3.esm.js +5 -4
  3. package/dist/dpzvc3.esm.js.map +1 -1
  4. package/dist/dpzvc3.esm.min.js +1 -1
  5. package/dist/dpzvc3.esm.min.js.map +1 -1
  6. package/dist/dpzvc3.js +5 -4
  7. package/dist/dpzvc3.js.map +1 -1
  8. package/dist/dpzvc3.min.js +1 -1
  9. package/dist/dpzvc3.min.js.map +1 -1
  10. package/dist/types/components/actionSheet/index.d.ts +6 -1
  11. package/dist/types/components/actionSheet/index.d.ts.map +1 -1
  12. package/dist/types/index.d.ts +2 -2
  13. package/package.json +7 -2
  14. package/build-style.js +0 -58
  15. package/dist-prod/91.05c8ec5277a15f939b0f.js +0 -3
  16. package/dist-prod/91.05c8ec5277a15f939b0f.js.LICENSE.txt +0 -25
  17. package/dist-prod/91.05c8ec5277a15f939b0f.js.map +0 -1
  18. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js +0 -2
  19. package/dist-prod/actionsheet.0d67b6b08a62cf9360be.chunk.js.map +0 -1
  20. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js +0 -2
  21. package/dist-prod/badge.16ab5c05734fe1530701.chunk.js.map +0 -1
  22. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js +0 -2
  23. package/dist-prod/button.39ac33aa7aaccc24b6a1.chunk.js.map +0 -1
  24. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js +0 -2
  25. package/dist-prod/card.16ed7eafe471bcc60ec6.chunk.js.map +0 -1
  26. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js +0 -2
  27. package/dist-prod/cell.70ff74fba57e27df7f5a.chunk.js.map +0 -1
  28. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js +0 -2
  29. package/dist-prod/cellswipe.f3ec62abd60729d8bc5a.chunk.js.map +0 -1
  30. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js +0 -2
  31. package/dist-prod/checkbox.05c63a947ac98293c9f2.chunk.js.map +0 -1
  32. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js +0 -2
  33. package/dist-prod/guide.24f1968a568f20fbc84b.chunk.js.map +0 -1
  34. package/dist-prod/header.eb10433dd892738ee95a.chunk.js +0 -2
  35. package/dist-prod/header.eb10433dd892738ee95a.chunk.js.map +0 -1
  36. package/dist-prod/index.html +0 -19
  37. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js +0 -2
  38. package/dist-prod/indicator.0c09e3f238791cb478e0.chunk.js.map +0 -1
  39. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js +0 -2
  40. package/dist-prod/loadmore.9bad88767cc43603f473.chunk.js.map +0 -1
  41. package/dist-prod/main.662ad15361e7f3d20234.js +0 -2
  42. package/dist-prod/main.662ad15361e7f3d20234.js.map +0 -1
  43. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js +0 -2
  44. package/dist-prod/message.de17fea3de4daa70bab4.chunk.js.map +0 -1
  45. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js +0 -2
  46. package/dist-prod/modal.f9ec857acd9fbdf53f3b.chunk.js.map +0 -1
  47. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js +0 -2
  48. package/dist-prod/picker.bca059ef59e3c42a401f.chunk.js.map +0 -1
  49. package/dist-prod/popup.538422c7e188363a468d.chunk.js +0 -2
  50. package/dist-prod/popup.538422c7e188363a468d.chunk.js.map +0 -1
  51. package/dist-prod/progress.240de4b633002f573030.chunk.js +0 -2
  52. package/dist-prod/progress.240de4b633002f573030.chunk.js.map +0 -1
  53. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js +0 -2
  54. package/dist-prod/prompt.dcda0b05ea02d59106b7.chunk.js.map +0 -1
  55. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js +0 -2
  56. package/dist-prod/radiobox.7c10f77aba5ae04b2e5c.chunk.js.map +0 -1
  57. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js +0 -2
  58. package/dist-prod/rater.d46ae462c598c458e5a8.chunk.js.map +0 -1
  59. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js +0 -2
  60. package/dist-prod/slidebar.833e75b9eb0abef92453.chunk.js.map +0 -1
  61. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js +0 -2
  62. package/dist-prod/spinner.6afb4f84cc29f0e2f8eb.chunk.js.map +0 -1
  63. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js +0 -2
  64. package/dist-prod/swipe.3fe6ee6638765ec52d94.chunk.js.map +0 -1
  65. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js +0 -2
  66. package/dist-prod/switchbar.f24c76a03120f1bd961a.chunk.js.map +0 -1
  67. package/dist-prod/tab.29f19483f699b7811259.chunk.js +0 -2
  68. package/dist-prod/tab.29f19483f699b7811259.chunk.js.map +0 -1
  69. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js +0 -2
  70. package/dist-prod/text.a6e4251f772d23843e2b.chunk.js.map +0 -1
  71. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js +0 -2
  72. package/dist-prod/totop.713c5ab7f7dbcffbf2a3.chunk.js.map +0 -1
  73. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js +0 -2
  74. package/dist-prod/upload.0638581e551ed9afaba2.chunk.js.map +0 -1
  75. package/postcss.config.js +0 -5
  76. package/src/components/Indicator/Indicator.tsx +0 -67
  77. package/src/components/Indicator/Indicator.vue +0 -82
  78. package/src/components/Indicator/index.ts +0 -111
  79. package/src/components/Indicator/types.ts +0 -15
  80. package/src/components/Text/index.ts +0 -14
  81. package/src/components/Text/textBar.tsx +0 -104
  82. package/src/components/Text/types.ts +0 -13
  83. package/src/components/actionSheet/actionSheet.d.ts +0 -16
  84. package/src/components/actionSheet/actionSheet.tsx +0 -86
  85. package/src/components/actionSheet/index.ts +0 -6
  86. package/src/components/actionSheet/types.ts +0 -10
  87. package/src/components/app.vue +0 -59
  88. package/src/components/badge/badge.tsx +0 -80
  89. package/src/components/badge/index.ts +0 -12
  90. package/src/components/badge/types.ts +0 -8
  91. package/src/components/button/button.tsx +0 -105
  92. package/src/components/button/index.ts +0 -13
  93. package/src/components/button/types.ts +0 -13
  94. package/src/components/card/card.d.ts +0 -16
  95. package/src/components/card/card.tsx +0 -38
  96. package/src/components/card/index.ts +0 -12
  97. package/src/components/card/types.ts +0 -3
  98. package/src/components/cell/cell.tsx +0 -89
  99. package/src/components/cell/index.ts +0 -12
  100. package/src/components/cell/types.ts +0 -8
  101. package/src/components/cellSwipe/cellSwipe.tsx +0 -188
  102. package/src/components/cellSwipe/index.ts +0 -13
  103. package/src/components/cellSwipe/types.ts +0 -17
  104. package/src/components/checkBox/checkbox-group.tsx +0 -75
  105. package/src/components/checkBox/checkbox.tsx +0 -107
  106. package/src/components/checkBox/index.ts +0 -29
  107. package/src/components/checkBox/types.ts +0 -32
  108. package/src/components/header/header.tsx +0 -119
  109. package/src/components/header/index.ts +0 -13
  110. package/src/components/header/types.ts +0 -7
  111. package/src/components/loadMore/index.ts +0 -14
  112. package/src/components/loadMore/loadMore.tsx +0 -265
  113. package/src/components/loadMore/types.ts +0 -26
  114. package/src/components/message/confirm.ts +0 -104
  115. package/src/components/message/index.ts +0 -113
  116. package/src/components/message/message.tsx +0 -100
  117. package/src/components/message/messageGroup.tsx +0 -59
  118. package/src/components/message/types.ts +0 -48
  119. package/src/components/modal/confirm.ts +0 -123
  120. package/src/components/modal/index.ts +0 -68
  121. package/src/components/modal/modal.tsx +0 -248
  122. package/src/components/modal/types.ts +0 -51
  123. package/src/components/number/Number.tsx +0 -143
  124. package/src/components/number/index.ts +0 -10
  125. package/src/components/number/types.ts +0 -13
  126. package/src/components/picker/area-picker/area-picker.vue +0 -230
  127. package/src/components/picker/area-picker/props.js +0 -17
  128. package/src/components/picker/date-picker/date-picker.vue +0 -191
  129. package/src/components/picker/date-picker/props.js +0 -24
  130. package/src/components/picker/index.ts +0 -12
  131. package/src/components/picker/normal-picker/normal-picker.vue +0 -120
  132. package/src/components/picker/normal-picker/props.js +0 -20
  133. package/src/components/picker/picker-slot.vue +0 -217
  134. package/src/components/picker/picker.tsx +0 -112
  135. package/src/components/picker/types.ts +0 -17
  136. package/src/components/popup/index.ts +0 -12
  137. package/src/components/popup/popup.d.ts +0 -16
  138. package/src/components/popup/popup.tsx +0 -68
  139. package/src/components/popup/types.ts +0 -9
  140. package/src/components/progress/index.ts +0 -12
  141. package/src/components/progress/progress.tsx +0 -81
  142. package/src/components/progress/types.ts +0 -9
  143. package/src/components/prompt/confirm.ts +0 -104
  144. package/src/components/prompt/index.ts +0 -50
  145. package/src/components/prompt/prompt.tsx +0 -161
  146. package/src/components/prompt/types.ts +0 -45
  147. package/src/components/radioBox/index.ts +0 -34
  148. package/src/components/radioBox/radiobox-group.tsx +0 -66
  149. package/src/components/radioBox/radiobox-group1.vue +0 -66
  150. package/src/components/radioBox/radiobox.tsx +0 -115
  151. package/src/components/radioBox/radiobox1.vue +0 -89
  152. package/src/components/radioBox/types.ts +0 -24
  153. package/src/components/rater/index.ts +0 -12
  154. package/src/components/rater/rater.d.ts +0 -16
  155. package/src/components/rater/raters.tsx +0 -101
  156. package/src/components/rater/types.ts +0 -10
  157. package/src/components/slideBar/index.ts +0 -13
  158. package/src/components/slideBar/slideBar.tsx +0 -288
  159. package/src/components/slideBar/types.ts +0 -20
  160. package/src/components/spinner/behavior/blade.vue +0 -42
  161. package/src/components/spinner/behavior/double-bounce.vue +0 -38
  162. package/src/components/spinner/behavior/fading-circle.vue +0 -55
  163. package/src/components/spinner/behavior/snake.vue +0 -41
  164. package/src/components/spinner/behavior/triple-bounce.vue +0 -52
  165. package/src/components/spinner/index.ts +0 -13
  166. package/src/components/spinner/props.js +0 -28
  167. package/src/components/spinner/spinner.tsx +0 -85
  168. package/src/components/spinner/types.ts +0 -20
  169. package/src/components/swipe/index.ts +0 -13
  170. package/src/components/swipe/swipe.tsx +0 -292
  171. package/src/components/swipe/types.ts +0 -21
  172. package/src/components/switchbar/index.ts +0 -13
  173. package/src/components/switchbar/switchbar.tsx +0 -58
  174. package/src/components/switchbar/types.ts +0 -6
  175. package/src/components/tab/index.ts +0 -12
  176. package/src/components/tab/tab.tsx +0 -71
  177. package/src/components/tab/types.ts +0 -15
  178. package/src/components/toTop/index.ts +0 -13
  179. package/src/components/toTop/toTop.tsx +0 -54
  180. package/src/components/toTop/types.ts +0 -7
  181. package/src/components/upload/index.ts +0 -13
  182. package/src/components/upload/types.ts +0 -9
  183. package/src/components/upload/upload.tsx +0 -180
  184. package/src/config/config.js +0 -16
  185. package/src/directives/clickoutside.js +0 -42
  186. package/src/directives/tranferDom.js +0 -66
  187. package/src/index.d.ts +0 -131
  188. package/src/index.ts +0 -136
  189. package/src/lib/MegaPixImage.js +0 -164
  190. package/src/lib/MegaPixImageOld.js +0 -153
  191. package/src/lib/exif-js.js +0 -235
  192. package/src/lib/exif.js +0 -789
  193. package/src/lib/lib.js +0 -22
  194. package/src/main.ts +0 -33
  195. package/src/mixin/emitter.js +0 -72
  196. package/src/mixin/input.js +0 -41
  197. package/src/router.ts +0 -36
  198. package/src/shims-vue.d.ts +0 -37
  199. package/src/styles/base/font.less +0 -99
  200. package/src/styles/base/reset.less +0 -135
  201. package/src/styles/base/variable.less +0 -108
  202. package/src/styles/components/actionSheet.less +0 -43
  203. package/src/styles/components/badge.less +0 -81
  204. package/src/styles/components/button.less +0 -124
  205. package/src/styles/components/card.less +0 -31
  206. package/src/styles/components/cell-swipe.less +0 -20
  207. package/src/styles/components/cell.less +0 -75
  208. package/src/styles/components/checkBox.less +0 -113
  209. package/src/styles/components/editor.less +0 -3
  210. package/src/styles/components/header.less +0 -72
  211. package/src/styles/components/indicator.less +0 -39
  212. package/src/styles/components/loadmore.less +0 -48
  213. package/src/styles/components/message.less +0 -57
  214. package/src/styles/components/modal.less +0 -84
  215. package/src/styles/components/number.less +0 -60
  216. package/src/styles/components/picker.less +0 -152
  217. package/src/styles/components/popup.less +0 -46
  218. package/src/styles/components/progress.less +0 -52
  219. package/src/styles/components/prompt.less +0 -37
  220. package/src/styles/components/radioBox.less +0 -142
  221. package/src/styles/components/rater.less +0 -16
  222. package/src/styles/components/slide-Bar.less +0 -149
  223. package/src/styles/components/spinner.less +0 -329
  224. package/src/styles/components/swipe.less +0 -125
  225. package/src/styles/components/switchBar.less +0 -88
  226. package/src/styles/components/tab.less +0 -71
  227. package/src/styles/components/text.less +0 -82
  228. package/src/styles/components/toTop.less +0 -28
  229. package/src/styles/components/upload.less +0 -23
  230. package/src/styles/index.less +0 -39
  231. package/src/styles/utils/1px.less +0 -206
  232. package/src/styles/utils/animation.less +0 -165
  233. package/src/styles/utils/nowrap.less +0 -19
  234. package/src/template/index.ejs +0 -40
  235. package/src/types/index.d.ts +0 -127
  236. package/src/types/js-shims.d.ts +0 -36
  237. package/src/utils/test.ts +0 -2
  238. package/src/utils/util.ts +0 -168
  239. package/src/utils/util1.js +0 -202
  240. package/src/vconsole-resources.min.js +0 -6
  241. package/src/vconsole-sources.min.js +0 -6
  242. package/src/vconsole.min.js +0 -7
  243. package/src/views/ActionSheet.vue +0 -46
  244. package/src/views/Badge/Badge.less +0 -12
  245. package/src/views/Badge/Badge.tsx +0 -23
  246. package/src/views/Badge.vue +0 -53
  247. package/src/views/Button.vue +0 -69
  248. package/src/views/Card.vue +0 -89
  249. package/src/views/Cell.vue +0 -31
  250. package/src/views/CellSwipe.vue +0 -80
  251. package/src/views/CheckBox.vue +0 -78
  252. package/src/views/Header.vue +0 -71
  253. package/src/views/Indicator.vue +0 -82
  254. package/src/views/LoadMore.vue +0 -76
  255. package/src/views/Message.vue +0 -61
  256. package/src/views/Modal.vue +0 -69
  257. package/src/views/Picker.vue +0 -142
  258. package/src/views/Popup.vue +0 -103
  259. package/src/views/Progress.vue +0 -49
  260. package/src/views/Prompt.vue +0 -43
  261. package/src/views/RadioBox.vue +0 -70
  262. package/src/views/Rater.vue +0 -53
  263. package/src/views/SlideBar.vue +0 -62
  264. package/src/views/Spinner.vue +0 -27
  265. package/src/views/Swipe.vue +0 -59
  266. package/src/views/SwitchBar.vue +0 -49
  267. package/src/views/Tab.vue +0 -55
  268. package/src/views/Text.vue +0 -97
  269. package/src/views/ToTop.vue +0 -31
  270. package/src/views/Upload.vue +0 -65
  271. package/src/views/guide.vue +0 -164
  272. package/src/views/index.vue +0 -554
  273. package/tsconfig.build.json +0 -31
  274. package/tsconfig.json +0 -41
  275. package/webpack.base.config.js +0 -85
  276. package/webpack.dev.config.js +0 -43
  277. package/webpack.dist.dev.config.js +0 -76
  278. package/webpack.dist.prod.config.js +0 -90
  279. package/webpack.prod.config.js +0 -52
@@ -1,248 +0,0 @@
1
- // src/components/modal/modal.tsx
2
- import {
3
- defineComponent,
4
- ref,
5
- computed,
6
- watch,
7
- Transition,
8
- PropType
9
- } from 'vue'
10
- import VButton from '../button'
11
- import type { ModalProps } from './types'
12
-
13
- export type { ModalProps }
14
-
15
- const prefixCls = 'dpzvc3-modal'
16
-
17
- export default defineComponent({
18
- name: 'Dpzvc3Modal',
19
-
20
- props: {
21
- modelValue: {
22
- type: Boolean,
23
- default: false
24
- },
25
- maskClosable: {
26
- type: Boolean,
27
- default: true
28
- },
29
- title: String,
30
- width: {
31
- type: String,
32
- default: '70%'
33
- },
34
- okText: {
35
- type: String,
36
- default: '确定'
37
- },
38
- cancleText: {
39
- type: String,
40
- default: '取消'
41
- },
42
- loading: {
43
- type: Boolean,
44
- default: false
45
- },
46
- styles: {
47
- type: Object as PropType<Record<string, any>>,
48
- default: () => ({})
49
- },
50
- showHead: {
51
- type: Boolean,
52
- default: true
53
- },
54
- footerHide: {
55
- type: Boolean,
56
- default: false
57
- },
58
- body: String
59
- },
60
-
61
- emits: [
62
- 'update:modelValue',
63
- 'on-ok',
64
- 'on-cancle'
65
- ],
66
-
67
- setup(props: ModalProps, { emit, slots }) {
68
- const visible = ref(!!props.modelValue)
69
- const isHead = ref(!!props.showHead)
70
- const buttonLoading = ref(false)
71
-
72
- const getWrapperStyle = computed(() => ({
73
- width: props.width,
74
- ...(props.styles || {})
75
- }))
76
-
77
- /* watch props */
78
- watch(
79
- () => props.modelValue,
80
- val => (visible.value = !!val)
81
- )
82
-
83
- watch(
84
- () => props.showHead,
85
- val => (isHead.value = !!val)
86
- )
87
-
88
- /* methods */
89
- const close = () => {
90
- emit('update:modelValue', false)
91
- emit('on-cancle')
92
- }
93
-
94
- const mask = () => {
95
- if (props.maskClosable && !buttonLoading.value) {
96
- close()
97
- }
98
- }
99
-
100
- const ok = () => {
101
- if (props.loading) {
102
- buttonLoading.value = true
103
- } else {
104
- emit('update:modelValue', false)
105
- }
106
- emit('on-ok')
107
- }
108
-
109
- return () => (
110
- <>
111
- {/* mask */}
112
- <Transition name="dpzvc3-ani-fade"
113
- v-slots={{
114
- default: () =>visible.value && (
115
- <div
116
- class="dpzvc3-modal-mask"
117
- onClick={mask}
118
- onTouchstart={(e:any) => e.preventDefault()}
119
- onTouchmove={(e:any) => e.preventDefault()}
120
- onTouchend={(e:any) => e.preventDefault()}
121
- />)
122
- }}
123
- />
124
- {/* </Transition> */}
125
- {/* <Transition
126
- name="dpzvc3-ani-fade"
127
- v-slots={{
128
- default: () =>
129
- mask.value && visible.value && (
130
- <div
131
- class={`${prefixCls}-mask`}
132
- onClick={close}
133
- onTouchMove={(e:any) => e.preventDefault()}
134
- />
135
- )
136
- }}
137
- /> */}
138
-
139
-
140
- {/* modal */}
141
- <Transition name="dpzvc3-ani-scale"
142
- v-slots={{
143
- default: () =>visible.value && (
144
- <div
145
- class={prefixCls}
146
- style={getWrapperStyle.value}
147
- >
148
- {/* header */}
149
- {isHead.value && (
150
- <div class={`${prefixCls}-header`}>
151
- {slots.header ? (
152
- slots.header()
153
- ) : (
154
- <div class={`${prefixCls}-header-inner ellipse-fir`}>
155
- {props.title}
156
- </div>
157
- )}
158
- </div>
159
- )}
160
-
161
- {/* body */}
162
- <div class={`${prefixCls}-body`}>
163
- {slots.body ? slots.body() : props.body}
164
- </div>
165
-
166
- {/* footer */}
167
- {!props.footerHide && (
168
- <div class={`${prefixCls}-footer`}>
169
- {slots.footer ? (
170
- slots.footer()
171
- ) : (
172
- <>
173
- {props.cancleText && (
174
- <VButton type="primary" onClick={close}>
175
- {props.cancleText}
176
- </VButton>
177
- )}
178
- <VButton
179
- type="normal"
180
- loading={buttonLoading.value}
181
- onClick={ok}
182
- >
183
- {props.okText}
184
- </VButton>
185
- </>
186
- )}
187
- </div>
188
- )}
189
- </div>
190
- )
191
- }}
192
-
193
- />
194
- </>
195
- )
196
- }
197
- })
198
-
199
- // {/* <Transition name="dpzvc3-ani-scale"> */}
200
- // {visible.value && (
201
- // <div
202
- // class={prefixCls}
203
- // style={getWrapperStyle.value}
204
- // >
205
- // {/* header */}
206
- // {isHead.value && (
207
- // <div class={`${prefixCls}-header`}>
208
- // {slots.header ? (
209
- // slots.header()
210
- // ) : (
211
- // <div class={`${prefixCls}-header-inner ellipse-fir`}>
212
- // {props.title}
213
- // </div>
214
- // )}
215
- // </div>
216
- // )}
217
-
218
- // {/* body */}
219
- // <div class={`${prefixCls}-body`}>
220
- // {slots.body ? slots.body() : props.body}
221
- // </div>
222
-
223
- // {/* footer */}
224
- // {!props.footerHide && (
225
- // <div class={`${prefixCls}-footer`}>
226
- // {slots.footer ? (
227
- // slots.footer()
228
- // ) : (
229
- // <>
230
- // {props.cancleText && (
231
- // <VButton type="primary" onClick={close}>
232
- // {props.cancleText}
233
- // </VButton>
234
- // )}
235
- // <VButton
236
- // type="normal"
237
- // loading={buttonLoading.value}
238
- // onClick={ok}
239
- // >
240
- // {props.okText}
241
- // </VButton>
242
- // </>
243
- // )}
244
- // </div>
245
- // )}
246
- // </div>
247
- // )}
248
- // {/* </Transition> */}
@@ -1,51 +0,0 @@
1
- // src/components/modal/types.ts
2
- export type ModalProps ={
3
- modelValue?: boolean
4
- maskClosable?: boolean
5
- title?: string
6
- width?: string
7
- okText?: string
8
- cancleText?: string
9
- loading?: boolean
10
- styles?: Record<string, any>
11
- showHead?: boolean
12
- footerHide?: boolean
13
- body?: string
14
- }
15
- // modal函数调用 传参数与modal props类型声明合并
16
- export type MergeOptions<T = ModalProps> = {
17
- [K in keyof T]: T[K]
18
- } & {
19
- onOk?: () => void
20
- onCancle?: () => void
21
- onRemove?: () => void
22
- showCancle?: boolean,
23
- buttonLoading?: boolean,
24
- }
25
-
26
- // modal实例
27
- export type ModalInstance = {
28
- confirm: (options: MergeOptions) => DefaultProps
29
- remove: () => void,
30
- info: (props: MergeOptions) => DefaultProps
31
- }
32
- //开启
33
- export type DefaultProps = {
34
- show: (options: MergeOptions) => any,
35
- remove: () => void,
36
- component: MergeOptions
37
- } | null
38
- // visible: false,
39
- // modelValue: false,
40
- // width: '70%',
41
- // body: '',
42
- // title: '',
43
- // okText: '确定',
44
- // cancleText: '取消',
45
- // loading: false,
46
- // buttonLoading: false,
47
- // showCancle: true,
48
- // showHead: true,
49
- // onOk: () => {},
50
- // onCancle: () => {},
51
- // onRemove: () => {}
@@ -1,143 +0,0 @@
1
- import { defineComponent, ref, computed, watch, onMounted, PropType } from 'vue'
2
-
3
- const prefixCls = 'dpzvc3-number'
4
-
5
- import { NumberProps, NumberEmits } from './types' // 引入类型
6
- export type { NumberProps } from './types' // 导出类型
7
- export default defineComponent({
8
- name: 'Dpzvc3Number',
9
- props: {
10
- modelValue: [Number, String],
11
- min: { type: [Number, String], default: -Infinity },
12
- max: { type: [Number, String], default: Infinity },
13
- step: { type: Number, default: 1 },
14
- width: { type: Number, default: 60 },
15
- height: { type: Number, default: 35 },
16
- numberStyle: { type: Object, default: () => ({}) },
17
- containerStyle: { type: Object, default: () => ({}) }
18
- }, // 强制使用类型as unknown as Record<keyof NumberProps, any>
19
- emits: ['update:modelValue', 'input', 'on-input'] as NumberEmits[],
20
- setup(props, { emit, slots }) {
21
- const currentValue = ref(props.modelValue)
22
- const upDisabled = ref(false)
23
- const downDisabled = ref(false)
24
-
25
- const classes = computed(() => [prefixCls])
26
- const reduceClasses = computed(() => [
27
- `${prefixCls}-changevalue`,
28
- 'left',
29
- { disabled: downDisabled.value }
30
- ])
31
- const addtionClasses = computed(() => [
32
- `${prefixCls}-changevalue`,
33
- 'right',
34
- { disabled: upDisabled.value }
35
- ])
36
- const wrapperClasses = computed(() => [`${prefixCls}-wrapper`])
37
- const getChangeStyle = computed(() => ({
38
- width: `${props.height}px`,
39
- height: `${props.height}px`,
40
- lineHeight: `${props.height}px`
41
- }))
42
- const inputStyle = computed(() => ({
43
- ...props.numberStyle,
44
- width: `${props.width}px`,
45
- height: `${props.height}px`
46
- }))
47
-
48
- // 改变值时计算按钮状态
49
- const changeVal = (val: number | string) => {
50
- const numberVal = Number(val)
51
- if (!isNaN(numberVal) || numberVal === 0) {
52
- upDisabled.value = numberVal + props.step > Number(props.max)
53
- downDisabled.value = numberVal - props.step < Number(props.min)
54
- } else {
55
- upDisabled.value = true
56
- downDisabled.value = true
57
- }
58
- }
59
-
60
- const setValue = (val: number) => {
61
- currentValue.value = val
62
- emit('input', val)
63
- emit('update:modelValue', val)
64
- }
65
-
66
- const changeInput = (e: Event) => {
67
- const target = e.target as HTMLInputElement
68
- let val = Number(target.value.trim())
69
- if (val < Number(props.min)) val = Number(props.min)
70
- if (val > Number(props.max)) val = Number(props.max)
71
- setValue(val)
72
- target.value = String(currentValue.value)
73
- emit('on-input', e)
74
- emit('update:modelValue', val)
75
- }
76
-
77
- const change = (type: 'add' | 'reduce', disabled: boolean) => {
78
- if (disabled) return
79
- let val = Number(currentValue.value)
80
- if (isNaN(val)) return
81
- if (type === 'reduce') val -= props.step
82
- else val += props.step
83
- if (val < Number(props.min)) val = Number(props.min)
84
- if (val > Number(props.max)) val = Number(props.max)
85
- setValue(val)
86
- }
87
-
88
- watch(() => props.modelValue, val => {
89
- currentValue.value = val
90
- })
91
-
92
- watch(currentValue, val => {
93
- changeVal(val!)
94
- })
95
-
96
- onMounted(() => {
97
- changeVal(currentValue.value!)
98
- })
99
-
100
- return () => (
101
- <div class={classes.value} style={props.containerStyle}>
102
- {/* 减按钮 */}
103
- <div
104
- class={reduceClasses.value}
105
- style={getChangeStyle.value}
106
- onClick={() => change('reduce', downDisabled.value)}
107
- >
108
- {slots.reduce ? slots.reduce() : '-'}
109
- </div>
110
-
111
- {/* 输入框 */}
112
- <div class={wrapperClasses.value}>
113
- <input
114
- type="number"
115
- style={inputStyle.value}
116
- min={props.min}
117
- max={props.max}
118
- step={props.step}
119
- value={currentValue.value}
120
- autocomplete="off"
121
- onInput={changeInput}
122
- onFocus={changeInput}
123
- onBlur={changeInput}
124
- onChange={changeInput}
125
- onKeyup={(e: KeyboardEvent) => {
126
- if (e.key === 'ArrowUp') change('add', upDisabled.value)
127
- if (e.key === 'ArrowDown') change('reduce', downDisabled.value)
128
- }}
129
- />
130
- </div>
131
-
132
- {/* 加按钮 */}
133
- <div
134
- class={addtionClasses.value}
135
- style={getChangeStyle.value}
136
- onClick={() => change('add', upDisabled.value)}
137
- >
138
- {slots.add ? slots.add() : '+'}
139
- </div>
140
- </div>
141
- )
142
- }
143
- })
@@ -1,10 +0,0 @@
1
- import type { App } from 'vue'
2
- import Number from './Number'
3
- Number.install = (app: App): void => {
4
- app.component('Number', Number); // 注册全局组件
5
- }
6
- type IWithInstall<T> = T & { install(app: App): void };
7
- const _Number=Number as IWithInstall<typeof Number>;
8
- export default _Number
9
- // export default Number
10
- export type { NumberProps } from './types'
@@ -1,13 +0,0 @@
1
- // Number/types.ts
2
- export interface NumberProps {
3
- modelValue?: number | string
4
- min?: number | string
5
- max?: number | string
6
- step?: number
7
- width?: number
8
- height?: number
9
- numberStyle?: Record<string, any>
10
- containerStyle?: Record<string, any>
11
- }
12
-
13
- export type NumberEmits = 'update:modelValue' | 'input' | 'on-input'
@@ -1,230 +0,0 @@
1
- <template>
2
- <div :class="classes">
3
- <div class="header">
4
- <div
5
- class="left"
6
- @click="cancle"
7
- >
8
- 取消
9
- </div>
10
- <div class="title">
11
- 请选择区域
12
- </div>
13
- <div
14
- class="right"
15
- @click="sure"
16
- >
17
- 确定
18
- </div>
19
- </div>
20
-
21
- <div class="main">
22
- <PickerSlot
23
- :list="provinces"
24
- :init-item="province.code"
25
- target="province"
26
- @change="change"
27
- />
28
- <PickerSlot
29
- :list="citys"
30
- :init-item="city.code"
31
- target="city"
32
- @change="change"
33
- />
34
- <PickerSlot
35
- :list="districts"
36
- :init-item="district.code"
37
- target="district"
38
- @change="change"
39
- />
40
- </div>
41
- </div>
42
- </template>
43
-
44
- <script>
45
- import { defineComponent, ref, computed, watch, inject } from 'vue'
46
- import CHINA_AREA from 'china-area-data'
47
- import PickerSlot from '../picker-slot'
48
- import props from './props'
49
-
50
- const prefixCls = 'dpzvc3-picker'
51
- const rootCode = '86'
52
-
53
- export default defineComponent({
54
- name: 'AreaPicker',
55
- components: { PickerSlot },
56
- props: {
57
- ...props,
58
- addressValue: String,
59
- valueSeparator: {
60
- type: String,
61
- default: '-'
62
- }
63
- },
64
- setup (props, { emit }) {
65
- const { pickerOnOk, pickeronFail } = inject('DpzVc3Picker')
66
- const currentValue = ref(props.addressValue || '')
67
-
68
- const province = ref({
69
- value: '北京市',
70
- code: '110000',
71
- target: 'province',
72
- index: 0
73
- })
74
-
75
- const city = ref({
76
- value: '市辖区',
77
- code: '110100',
78
- target: 'city',
79
- index: 0
80
- })
81
-
82
- const district = ref({
83
- value: '东城区',
84
- code: '110101',
85
- target: 'district',
86
- index: 0
87
- })
88
-
89
- const classes = computed(() => [prefixCls])
90
-
91
- // 计算省、市、区列表
92
- const provinces = computed(() => filter('province'))
93
- const citys = computed(() => filter('city', province.value))
94
- const districts = computed(() => filter('district', city.value))
95
-
96
- watch(
97
- () => props.addressValue,
98
- (val) => {
99
- currentValue.value = val
100
- initVal()
101
- },
102
- { immediate: true }
103
- )
104
-
105
- function initVal () {
106
- if (!currentValue.value) return
107
- const [provinceName, cityName, districtName] = currentValue.value.split(
108
- props.valueSeparator
109
- )
110
-
111
- // 省份
112
- const provincesData = CHINA_AREA[rootCode]
113
- if (provincesData) {
114
- Object.keys(provincesData).forEach((item) => {
115
- if (provinceName === item || provinceName === provincesData[item]) {
116
- province.value.value = provincesData[item]
117
- province.value.code = item
118
- }
119
- })
120
- }
121
-
122
- // 城市
123
- const cityData = CHINA_AREA[province.value.code]
124
- if (cityData) {
125
- Object.keys(cityData).forEach((item) => {
126
- if (cityName === item || cityName === cityData[item]) {
127
- city.value.value = cityData[item]
128
- city.value.code = item
129
- }
130
- })
131
- }
132
-
133
- // 区县
134
- const districtData = CHINA_AREA[city.value.code]
135
- if (districtData) {
136
- Object.keys(districtData).forEach((item) => {
137
- if (districtName === item || districtName === districtData[item]) {
138
- district.value.value = districtData[item]
139
- district.value.code = item
140
- }
141
- })
142
- }
143
- }
144
-
145
- function filter (target, val = {}) {
146
- switch (target) {
147
- case 'province': {
148
- const data = CHINA_AREA[rootCode]
149
- if (!data) return []
150
- return Object.keys(data).map((item, index) => ({
151
- code: item,
152
- value: data[item],
153
- target,
154
- index
155
- }))
156
- }
157
- case 'city':
158
- case 'district': {
159
- const listData = CHINA_AREA[val.code]
160
- if (!listData) {
161
- if (target) {
162
- if (target === 'city') city.value = { value: '', code: '', target, index: 0 }
163
- if (target === 'district') district.value = { value: '', code: '', target, index: 0 }
164
- }
165
- return []
166
- }
167
- return Object.keys(listData).map((item, index) => ({
168
- code: item,
169
- value: listData[item],
170
- target,
171
- index
172
- }))
173
- }
174
- }
175
- }
176
-
177
- function change (target, current) {
178
- if (target === 'province') province.value = { ...province.value, ...current }
179
- if (target === 'city') city.value = { ...city.value, ...current }
180
- if (target === 'district') district.value = { ...district.value, ...current }
181
-
182
- emit('update:addressValue', [
183
- province.value.value,
184
- city.value.value,
185
- district.value.value
186
- ].filter(Boolean).join(props.valueSeparator))
187
-
188
- emit('change', {
189
- province: { code: province.value.code, name: province.value.value },
190
- city: { code: city.value.code, name: city.value.value },
191
- district: { code: district.value.code, name: district.value.value }
192
- })
193
- }
194
-
195
- function sure () {
196
- // emit('sure', {
197
- // province: { code: province.value.code, name: province.value.value },
198
- // city: { code: city.value.code, name: city.value.value },
199
- // district: { code: district.value.code, name: district.value.value },
200
- // formArea: [province.value.value, city.value.value, district.value.value].filter(Boolean).join(props.valueSeparator)
201
- // })
202
- pickerOnOk({
203
- province: { code: province.value.code, name: province.value.value },
204
- city: { code: city.value.code, name: city.value.value },
205
- district: { code: district.value.code, name: district.value.value },
206
- formArea: [province.value.value, city.value.value, district.value.value].filter(Boolean).join(props.valueSeparator)
207
- })
208
- }
209
-
210
- function cancle () {
211
- // emit('cancle')
212
- pickeronFail()
213
- }
214
-
215
- return {
216
- classes,
217
- province,
218
- city,
219
- district,
220
- provinces,
221
- citys,
222
- districts,
223
- currentValue,
224
- change,
225
- sure,
226
- cancle
227
- }
228
- }
229
- })
230
- </script>