vxe-pc-ui 1.8.13 → 1.9.0
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/es/alert/index.js +10 -0
- package/es/alert/src/alert.js +103 -0
- package/es/alert/style.css +129 -0
- package/es/alert/style.min.css +1 -0
- package/es/components.js +3 -0
- package/es/drawer/src/drawer.js +3 -1
- package/es/drawer/style.css +3 -2
- package/es/drawer/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/image/src/image.js +14 -3
- package/es/image/src/preview.js +217 -47
- package/es/image/src/util.js +1 -2
- package/es/image-preview/style.css +6 -4
- package/es/image-preview/style.min.css +1 -1
- package/es/modal/src/modal.js +3 -1
- package/es/modal/style.css +3 -1
- package/es/modal/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tag/style.css +6 -6
- package/es/tag/style.min.css +1 -1
- package/es/tips/style.css +10 -9
- package/es/tips/style.min.css +1 -1
- package/es/ui/index.js +14 -3
- package/es/vxe-alert/index.js +3 -0
- package/es/vxe-alert/style.css +129 -0
- package/es/vxe-alert/style.min.css +1 -0
- package/es/vxe-drawer/style.css +3 -2
- package/es/vxe-drawer/style.min.css +1 -1
- package/es/vxe-image-preview/style.css +6 -4
- package/es/vxe-image-preview/style.min.css +1 -1
- package/es/vxe-modal/style.css +3 -1
- package/es/vxe-modal/style.min.css +1 -1
- package/es/vxe-tag/style.css +6 -6
- package/es/vxe-tag/style.min.css +1 -1
- package/es/vxe-tips/style.css +10 -9
- package/es/vxe-tips/style.min.css +1 -1
- package/lib/alert/index.js +17 -0
- package/lib/alert/index.min.js +1 -0
- package/lib/alert/src/alert.js +101 -0
- package/lib/alert/src/alert.min.js +1 -0
- package/lib/alert/style/index.js +1 -0
- package/lib/alert/style/style.css +129 -0
- package/lib/alert/style/style.min.css +1 -0
- package/lib/components.js +13 -1
- package/lib/components.min.js +1 -1
- package/lib/drawer/src/drawer.js +6 -0
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/drawer/style/style.css +3 -2
- package/lib/drawer/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/image/src/image.js +16 -3
- package/lib/image/src/image.min.js +1 -1
- package/lib/image/src/preview.js +195 -28
- package/lib/image/src/preview.min.js +1 -1
- package/lib/image/src/util.js +0 -2
- package/lib/image/src/util.min.js +1 -1
- package/lib/image-preview/style/style.css +6 -4
- package/lib/image-preview/style/style.min.css +1 -1
- package/lib/index.umd.js +756 -399
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +6 -0
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +3 -1
- package/lib/modal/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tag/style/style.css +6 -6
- package/lib/tag/style/style.min.css +1 -1
- package/lib/tips/style/style.css +10 -9
- package/lib/tips/style/style.min.css +1 -1
- package/lib/ui/index.js +14 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/vxe-alert/index.js +22 -0
- package/lib/vxe-alert/index.min.js +1 -0
- package/lib/vxe-alert/style/index.js +1 -0
- package/lib/vxe-alert/style/style.css +129 -0
- package/lib/vxe-alert/style/style.min.css +1 -0
- package/lib/vxe-drawer/style/style.css +3 -2
- package/lib/vxe-drawer/style/style.min.css +1 -1
- package/lib/vxe-image-preview/style/style.css +6 -4
- package/lib/vxe-image-preview/style/style.min.css +1 -1
- package/lib/vxe-modal/style/style.css +3 -1
- package/lib/vxe-modal/style/style.min.css +1 -1
- package/lib/vxe-tag/style/style.css +6 -6
- package/lib/vxe-tag/style/style.min.css +1 -1
- package/lib/vxe-tips/style/style.css +10 -9
- package/lib/vxe-tips/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/alert/index.ts +14 -0
- package/packages/alert/src/alert.ts +123 -0
- package/packages/components.ts +3 -0
- package/packages/drawer/src/drawer.ts +3 -1
- package/packages/image/src/image.ts +15 -3
- package/packages/image/src/preview.ts +212 -46
- package/packages/image/src/util.ts +1 -2
- package/packages/modal/src/modal.ts +3 -1
- package/packages/tips/src/tips.ts +3 -2
- package/packages/ui/index.ts +14 -2
- package/styles/all.scss +1 -0
- package/styles/components/alert.scss +99 -0
- package/styles/components/drawer.scss +9 -7
- package/styles/components/image-preview.scss +7 -4
- package/styles/components/modal.scss +5 -1
- package/styles/components/tag.scss +6 -6
- package/styles/components/tips.scss +10 -9
- package/styles/theme/base.scss +0 -53
- package/styles/theme/dark.scss +46 -12
- package/styles/theme/light.scss +46 -12
- package/types/all.d.ts +3 -0
- package/types/components/alert.d.ts +85 -0
- package/types/components/drawer.d.ts +2 -0
- package/types/components/image-preview.d.ts +6 -1
- package/types/components/image.d.ts +0 -1
- package/types/components/modal.d.ts +2 -0
- package/types/ui/global-config.d.ts +5 -1
- package/types/ui/global-icon.d.ts +7 -0
- /package/es/icon/style/{iconfont.1717233455609.ttf → iconfont.1717313412020.ttf} +0 -0
- /package/es/icon/style/{iconfont.1717233455609.woff → iconfont.1717313412020.woff} +0 -0
- /package/es/icon/style/{iconfont.1717233455609.woff2 → iconfont.1717313412020.woff2} +0 -0
- /package/es/{iconfont.1717233455609.ttf → iconfont.1717313412020.ttf} +0 -0
- /package/es/{iconfont.1717233455609.woff → iconfont.1717313412020.woff} +0 -0
- /package/es/{iconfont.1717233455609.woff2 → iconfont.1717313412020.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1717233455609.ttf → iconfont.1717313412020.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1717233455609.woff → iconfont.1717313412020.woff} +0 -0
- /package/lib/icon/style/{iconfont.1717233455609.woff2 → iconfont.1717313412020.woff2} +0 -0
- /package/lib/{iconfont.1717233455609.ttf → iconfont.1717313412020.ttf} +0 -0
- /package/lib/{iconfont.1717233455609.woff → iconfont.1717313412020.woff} +0 -0
- /package/lib/{iconfont.1717233455609.woff2 → iconfont.1717313412020.woff2} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, h, provide, PropType, reactive, computed, watch, onMounted, onUnmounted } from 'vue'
|
|
2
|
-
import { VxeUI, createEvent, getIcon, globalEvents, GLOBAL_EVENT_KEYS } from '@vxe-ui/core'
|
|
1
|
+
import { defineComponent, h, provide, PropType, reactive, computed, watch, onMounted, onUnmounted, createCommentVNode } from 'vue'
|
|
2
|
+
import { VxeUI, getConfig, createEvent, getIcon, globalEvents, GLOBAL_EVENT_KEYS } from '@vxe-ui/core'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
|
+
import { getDomNode } from '../..//ui/src/dom'
|
|
4
5
|
|
|
5
6
|
import type { VxeImagePreviewConstructor, ImagePreviewReactData, VxeGlobalIcon, VxeImagePreviewEmits, VxeImagePreviewPrivateMethods, ImagePreviewPrivateMethods, ImagePreviewPrivateComputed, ImagePreviewMethods, VxeImagePreviewPropTypes } from '../../../types'
|
|
6
7
|
|
|
@@ -8,8 +9,15 @@ export default defineComponent({
|
|
|
8
9
|
name: 'VxeImagePreview',
|
|
9
10
|
props: {
|
|
10
11
|
modelValue: Number as PropType<VxeImagePreviewPropTypes.ModelValue>,
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
urlList: Array as PropType<VxeImagePreviewPropTypes.UrlList>,
|
|
13
|
+
urlField: {
|
|
14
|
+
type: String as PropType<VxeImagePreviewPropTypes.UrlField>,
|
|
15
|
+
default: () => getConfig().imagePreview.urlField
|
|
16
|
+
},
|
|
17
|
+
marginSize: {
|
|
18
|
+
type: String as PropType<VxeImagePreviewPropTypes.MarginSize>,
|
|
19
|
+
default: () => getConfig().imagePreview.marginSize
|
|
20
|
+
}
|
|
13
21
|
},
|
|
14
22
|
emits: [
|
|
15
23
|
'update:modelValue',
|
|
@@ -22,7 +30,9 @@ export default defineComponent({
|
|
|
22
30
|
const xID = XEUtils.uniqueId()
|
|
23
31
|
|
|
24
32
|
const reactData = reactive<ImagePreviewReactData>({
|
|
25
|
-
activeIndex: props.modelValue,
|
|
33
|
+
activeIndex: props.modelValue || 0,
|
|
34
|
+
targetHeight: 0,
|
|
35
|
+
targetWidth: 0,
|
|
26
36
|
offsetPct11: false,
|
|
27
37
|
offsetScale: 0,
|
|
28
38
|
offsetRotate: 0,
|
|
@@ -30,26 +40,71 @@ export default defineComponent({
|
|
|
30
40
|
offsetTop: 0
|
|
31
41
|
})
|
|
32
42
|
|
|
43
|
+
const computeUrlProp = computed(() => {
|
|
44
|
+
return props.urlField || 'url'
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const computeMarginSize = computed(() => {
|
|
48
|
+
return XEUtils.toNumber(props.marginSize || 0) || 16
|
|
49
|
+
})
|
|
50
|
+
|
|
33
51
|
const computeImgList = computed(() => {
|
|
34
|
-
const {
|
|
35
|
-
|
|
52
|
+
const { urlList } = props
|
|
53
|
+
const urlProp = computeUrlProp.value
|
|
36
54
|
if (urlList && urlList.length) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
55
|
+
return urlList.map(item => {
|
|
56
|
+
if (XEUtils.isString(item)) {
|
|
57
|
+
return item
|
|
58
|
+
}
|
|
59
|
+
if (item[urlProp]) {
|
|
60
|
+
return item[urlProp]
|
|
61
|
+
}
|
|
62
|
+
return ''
|
|
63
|
+
})
|
|
40
64
|
}
|
|
41
|
-
return
|
|
65
|
+
return []
|
|
42
66
|
})
|
|
43
67
|
|
|
44
68
|
const computeImgTransform = computed(() => {
|
|
45
|
-
|
|
69
|
+
let { offsetScale, offsetRotate, offsetLeft, offsetTop } = reactData
|
|
46
70
|
const stys: string[] = []
|
|
47
|
-
|
|
48
|
-
|
|
71
|
+
let targetScale = 1
|
|
72
|
+
if (targetScale) {
|
|
73
|
+
targetScale = 1 + offsetScale
|
|
74
|
+
stys.push(`scale(${targetScale})`)
|
|
49
75
|
}
|
|
50
76
|
if (offsetRotate) {
|
|
51
77
|
stys.push(`rotate(${offsetRotate}deg)`)
|
|
52
78
|
}
|
|
79
|
+
if (offsetLeft || offsetTop) {
|
|
80
|
+
// 缩放与位移
|
|
81
|
+
offsetLeft /= targetScale
|
|
82
|
+
offsetTop /= targetScale
|
|
83
|
+
|
|
84
|
+
let targetOffsetLeft = offsetLeft
|
|
85
|
+
let targetOffsetTop = offsetTop
|
|
86
|
+
if (offsetRotate) {
|
|
87
|
+
// 转向与位移
|
|
88
|
+
switch (offsetRotate % 360) {
|
|
89
|
+
case 90:
|
|
90
|
+
case -270:
|
|
91
|
+
targetOffsetLeft = offsetTop
|
|
92
|
+
targetOffsetTop = -offsetLeft
|
|
93
|
+
break
|
|
94
|
+
case 180:
|
|
95
|
+
case -180:
|
|
96
|
+
targetOffsetLeft = -offsetLeft
|
|
97
|
+
targetOffsetTop = -offsetTop
|
|
98
|
+
break
|
|
99
|
+
case 270:
|
|
100
|
+
case -90:
|
|
101
|
+
targetOffsetLeft = -offsetTop
|
|
102
|
+
targetOffsetTop = offsetLeft
|
|
103
|
+
break
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
stys.push(`translate(${targetOffsetLeft}px, ${targetOffsetTop}px)`)
|
|
107
|
+
}
|
|
53
108
|
return stys.length ? stys.join(' ') : ''
|
|
54
109
|
})
|
|
55
110
|
|
|
@@ -85,19 +140,46 @@ export default defineComponent({
|
|
|
85
140
|
}
|
|
86
141
|
|
|
87
142
|
const resetStyle = () => {
|
|
88
|
-
reactData
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
143
|
+
Object.assign(reactData, {
|
|
144
|
+
targetHeight: 0,
|
|
145
|
+
targetWidth: 0,
|
|
146
|
+
offsetPct11: false,
|
|
147
|
+
offsetScale: 0,
|
|
148
|
+
offsetRotate: 0,
|
|
149
|
+
offsetLeft: 0,
|
|
150
|
+
offsetTop: 0
|
|
151
|
+
})
|
|
93
152
|
}
|
|
94
153
|
|
|
95
154
|
const handleZoom = (isAdd: boolean) => {
|
|
96
155
|
const { offsetScale } = reactData
|
|
156
|
+
let stepNum = 0.02
|
|
157
|
+
console.log(offsetScale)
|
|
158
|
+
if (offsetScale >= -0.6) {
|
|
159
|
+
stepNum = 0.04
|
|
160
|
+
if (offsetScale >= -0.4) {
|
|
161
|
+
stepNum = 0.07
|
|
162
|
+
if (offsetScale >= 0) {
|
|
163
|
+
stepNum = 0.1
|
|
164
|
+
if (offsetScale >= 3) {
|
|
165
|
+
stepNum = 0.2
|
|
166
|
+
if (offsetScale >= 8) {
|
|
167
|
+
stepNum = 0.3
|
|
168
|
+
if (offsetScale >= 18) {
|
|
169
|
+
stepNum = 0.4
|
|
170
|
+
if (offsetScale >= 38) {
|
|
171
|
+
stepNum = 0.5
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
97
179
|
if (isAdd) {
|
|
98
|
-
reactData.offsetScale = Number(Math.min(
|
|
180
|
+
reactData.offsetScale = Number(Math.min(50, offsetScale + stepNum).toFixed(2))
|
|
99
181
|
} else {
|
|
100
|
-
reactData.offsetScale = Number(Math.max(-0.
|
|
182
|
+
reactData.offsetScale = Number(Math.max(-0.9, offsetScale - stepNum).toFixed(2))
|
|
101
183
|
}
|
|
102
184
|
}
|
|
103
185
|
|
|
@@ -117,6 +199,7 @@ export default defineComponent({
|
|
|
117
199
|
activeIndex--
|
|
118
200
|
}
|
|
119
201
|
}
|
|
202
|
+
resetStyle()
|
|
120
203
|
reactData.activeIndex = activeIndex
|
|
121
204
|
emitModel(activeIndex)
|
|
122
205
|
}
|
|
@@ -132,6 +215,7 @@ export default defineComponent({
|
|
|
132
215
|
}
|
|
133
216
|
|
|
134
217
|
const handlePct11 = () => {
|
|
218
|
+
resetStyle()
|
|
135
219
|
reactData.offsetPct11 = true
|
|
136
220
|
}
|
|
137
221
|
|
|
@@ -178,13 +262,87 @@ export default defineComponent({
|
|
|
178
262
|
}
|
|
179
263
|
}
|
|
180
264
|
|
|
265
|
+
const wheelEvent = (evnt: WheelEvent) => {
|
|
266
|
+
const delta = evnt.deltaY
|
|
267
|
+
if (delta > 0) {
|
|
268
|
+
handleZoom(false)
|
|
269
|
+
} else if (delta < 0) {
|
|
270
|
+
handleZoom(true)
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const moveEvent = (evnt: MouseEvent) => {
|
|
275
|
+
const { offsetTop, offsetLeft } = reactData
|
|
276
|
+
evnt.preventDefault()
|
|
277
|
+
const domMousemove = document.onmousemove
|
|
278
|
+
const domMouseup = document.onmouseup
|
|
279
|
+
const startX = evnt.pageX
|
|
280
|
+
const startY = evnt.pageY
|
|
281
|
+
const marginSize = computeMarginSize.value
|
|
282
|
+
document.onmousemove = et => {
|
|
283
|
+
const { pageX, pageY } = et
|
|
284
|
+
const { visibleHeight, visibleWidth } = getDomNode()
|
|
285
|
+
et.preventDefault()
|
|
286
|
+
console.log(et.pageX)
|
|
287
|
+
// 限制边界值
|
|
288
|
+
if (pageX > marginSize && pageY > marginSize && pageX < (visibleWidth - marginSize) && pageY < (visibleHeight - marginSize)) {
|
|
289
|
+
reactData.offsetLeft = offsetLeft + pageX - startX
|
|
290
|
+
reactData.offsetTop = offsetTop + pageY - startY
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
document.onmouseup = () => {
|
|
294
|
+
document.onmousemove = domMousemove
|
|
295
|
+
document.onmouseup = domMouseup
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
181
299
|
const handleGlobalKeydownEvent = (evnt: KeyboardEvent) => {
|
|
300
|
+
const hasCtrlKey = evnt.ctrlKey
|
|
301
|
+
const hasShiftKey = evnt.shiftKey
|
|
302
|
+
const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP)
|
|
303
|
+
const isDownArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN)
|
|
182
304
|
const isLeftArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT)
|
|
183
305
|
const isRightArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT)
|
|
184
|
-
|
|
185
|
-
|
|
306
|
+
const isR = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.R)
|
|
307
|
+
const isP = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.P)
|
|
308
|
+
if (isUpArrow) {
|
|
309
|
+
evnt.preventDefault()
|
|
310
|
+
if (hasShiftKey) {
|
|
311
|
+
reactData.offsetTop -= 1
|
|
312
|
+
} else {
|
|
313
|
+
handleZoom(true)
|
|
314
|
+
}
|
|
315
|
+
} else if (isDownArrow) {
|
|
316
|
+
evnt.preventDefault()
|
|
317
|
+
if (hasShiftKey) {
|
|
318
|
+
reactData.offsetTop += 1
|
|
319
|
+
} else {
|
|
320
|
+
handleZoom(false)
|
|
321
|
+
}
|
|
322
|
+
} else if (isLeftArrow) {
|
|
323
|
+
evnt.preventDefault()
|
|
324
|
+
if (hasShiftKey) {
|
|
325
|
+
reactData.offsetLeft -= 1
|
|
326
|
+
} else {
|
|
327
|
+
handleChange(false)
|
|
328
|
+
}
|
|
186
329
|
} else if (isRightArrow) {
|
|
187
|
-
|
|
330
|
+
evnt.preventDefault()
|
|
331
|
+
if (hasShiftKey) {
|
|
332
|
+
reactData.offsetLeft += 1
|
|
333
|
+
} else {
|
|
334
|
+
handleChange(true)
|
|
335
|
+
}
|
|
336
|
+
} else if (isR && hasCtrlKey) {
|
|
337
|
+
evnt.preventDefault()
|
|
338
|
+
if (hasShiftKey) {
|
|
339
|
+
handleRotateImg(false)
|
|
340
|
+
} else {
|
|
341
|
+
handleRotateImg(true)
|
|
342
|
+
}
|
|
343
|
+
} else if (isP && hasCtrlKey) {
|
|
344
|
+
evnt.preventDefault()
|
|
345
|
+
handlePrintImg()
|
|
188
346
|
}
|
|
189
347
|
}
|
|
190
348
|
|
|
@@ -207,7 +365,10 @@ export default defineComponent({
|
|
|
207
365
|
? {
|
|
208
366
|
transform: imgTransform
|
|
209
367
|
}
|
|
210
|
-
: null
|
|
368
|
+
: null,
|
|
369
|
+
onMousedown (evnt) {
|
|
370
|
+
moveEvent(evnt)
|
|
371
|
+
}
|
|
211
372
|
})
|
|
212
373
|
}))
|
|
213
374
|
}
|
|
@@ -247,26 +408,30 @@ export default defineComponent({
|
|
|
247
408
|
class: 'vxe-image-preview--close-bg'
|
|
248
409
|
})
|
|
249
410
|
]),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
|
|
411
|
+
imgList.length > 1
|
|
412
|
+
? h('div', {
|
|
413
|
+
class: 'vxe-image-preview--previous-btn',
|
|
414
|
+
onClick () {
|
|
415
|
+
handleChange(false)
|
|
416
|
+
}
|
|
417
|
+
}, [
|
|
418
|
+
h('i', {
|
|
419
|
+
class: getIcon().IMAGE_PREVIEW_PREVIOUS
|
|
420
|
+
})
|
|
421
|
+
])
|
|
422
|
+
: createCommentVNode(),
|
|
423
|
+
imgList.length > 1
|
|
424
|
+
? h('div', {
|
|
425
|
+
class: 'vxe-image-preview--next-btn',
|
|
426
|
+
onClick () {
|
|
427
|
+
handleChange(true)
|
|
428
|
+
}
|
|
429
|
+
}, [
|
|
430
|
+
h('i', {
|
|
431
|
+
class: getIcon().IMAGE_PREVIEW_NEXT
|
|
432
|
+
})
|
|
433
|
+
])
|
|
434
|
+
: createCommentVNode(),
|
|
270
435
|
h('div', {
|
|
271
436
|
class: 'vxe-image-preview--operation-wrapper'
|
|
272
437
|
}, [
|
|
@@ -289,7 +454,8 @@ export default defineComponent({
|
|
|
289
454
|
return h('div', {
|
|
290
455
|
class: ['vxe-image-preview', {
|
|
291
456
|
'is--pct11': offsetPct11
|
|
292
|
-
}]
|
|
457
|
+
}],
|
|
458
|
+
onWheel: wheelEvent
|
|
293
459
|
}, [
|
|
294
460
|
renderImgWrapper(),
|
|
295
461
|
renderBtnWrapper()
|
|
@@ -8,7 +8,7 @@ import type { VxeImageDefines } from '../../../types'
|
|
|
8
8
|
export const openPreviewImage: VxeImageDefines.PreviewImageFunction = (options) => {
|
|
9
9
|
if (VxeUI.modal) {
|
|
10
10
|
const opts = Object.assign({}, options)
|
|
11
|
-
const {
|
|
11
|
+
const { urlList, activeIndex } = opts
|
|
12
12
|
const modalId = XEUtils.uniqueId('image-preview')
|
|
13
13
|
VxeUI.modal.open({
|
|
14
14
|
id: modalId,
|
|
@@ -24,7 +24,6 @@ export const openPreviewImage: VxeImageDefines.PreviewImageFunction = (options)
|
|
|
24
24
|
return h(VxeImagePreviewComponent, {
|
|
25
25
|
modelValue: activeIndex,
|
|
26
26
|
urlList,
|
|
27
|
-
url,
|
|
28
27
|
onClose () {
|
|
29
28
|
VxeUI.modal.close(modalId)
|
|
30
29
|
}
|
|
@@ -57,6 +57,7 @@ export default defineComponent({
|
|
|
57
57
|
transfer: { type: Boolean as PropType<VxeModalPropTypes.Transfer>, default: () => getConfig().modal.transfer },
|
|
58
58
|
storage: { type: Boolean as PropType<VxeModalPropTypes.Storage>, default: () => getConfig().modal.storage },
|
|
59
59
|
storageKey: { type: String as PropType<VxeModalPropTypes.StorageKey>, default: () => getConfig().modal.storageKey },
|
|
60
|
+
padding: { type: Boolean as PropType<VxeModalPropTypes.Padding>, default: () => getConfig().modal.padding },
|
|
60
61
|
animat: { type: Boolean as PropType<VxeModalPropTypes.Animat>, default: () => getConfig().modal.animat },
|
|
61
62
|
size: { type: String as PropType<VxeModalPropTypes.Size>, default: () => getConfig().modal.size || getConfig().size },
|
|
62
63
|
beforeHideMethod: { type: Function as PropType<VxeModalPropTypes.BeforeHideMethod>, default: () => getConfig().modal.beforeHideMethod },
|
|
@@ -876,7 +877,7 @@ export default defineComponent({
|
|
|
876
877
|
}
|
|
877
878
|
|
|
878
879
|
const renderVN = () => {
|
|
879
|
-
const { className, type, animat, loading, status, lockScroll, lockView, mask, resize } = props
|
|
880
|
+
const { className, type, animat, loading, status, lockScroll, padding, lockView, mask, resize } = props
|
|
880
881
|
const { inited, zoomLocat, modalTop, contentVisible, visible } = reactData
|
|
881
882
|
const vSize = computeSize.value
|
|
882
883
|
return h(Teleport, {
|
|
@@ -888,6 +889,7 @@ export default defineComponent({
|
|
|
888
889
|
class: ['vxe-modal--wrapper', `type--${type}`, className || '', {
|
|
889
890
|
[`size--${vSize}`]: vSize,
|
|
890
891
|
[`status--${status}`]: status,
|
|
892
|
+
'is--padding': padding,
|
|
891
893
|
'is--animat': animat,
|
|
892
894
|
'lock--scroll': lockScroll,
|
|
893
895
|
'lock--view': lockView,
|
|
@@ -3,7 +3,7 @@ import XEUtils from 'xe-utils'
|
|
|
3
3
|
import { getConfig } from '@vxe-ui/core'
|
|
4
4
|
import { getSlotVNs } from '../..//ui/src/vn'
|
|
5
5
|
|
|
6
|
-
import type { VxeTipsPropTypes, TipsReactData, TipsPrivateRef, VxeTipsPrivateComputed, VxeTipsConstructor, VxeTipsPrivateMethods } from '../../../types'
|
|
6
|
+
import type { VxeTipsPropTypes, TipsReactData, VxeTipsEmits, TipsPrivateRef, VxeTipsPrivateComputed, VxeTipsConstructor, VxeTipsPrivateMethods } from '../../../types'
|
|
7
7
|
|
|
8
8
|
export default defineComponent({
|
|
9
9
|
name: 'VxeTips',
|
|
@@ -19,7 +19,8 @@ export default defineComponent({
|
|
|
19
19
|
default: () => getConfig().tips.icon
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
emits: [
|
|
22
|
+
emits: [
|
|
23
|
+
] as VxeTipsEmits,
|
|
23
24
|
setup (props, context) {
|
|
24
25
|
const { slots } = context
|
|
25
26
|
|
package/packages/ui/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ export const globalStore = {}
|
|
|
32
32
|
VxeUI.globalStore = globalStore
|
|
33
33
|
|
|
34
34
|
setConfig({
|
|
35
|
+
alert: {},
|
|
35
36
|
anchor: {},
|
|
36
37
|
anchorLink: {},
|
|
37
38
|
breadcrumb: {
|
|
@@ -54,7 +55,8 @@ setConfig({
|
|
|
54
55
|
lockView: true,
|
|
55
56
|
mask: true,
|
|
56
57
|
showTitleOverflow: true,
|
|
57
|
-
showClose: true
|
|
58
|
+
showClose: true,
|
|
59
|
+
padding: true
|
|
58
60
|
},
|
|
59
61
|
form: {
|
|
60
62
|
// preventSubmit: false,
|
|
@@ -75,9 +77,11 @@ setConfig({
|
|
|
75
77
|
},
|
|
76
78
|
formGather: {},
|
|
77
79
|
formItem: {},
|
|
80
|
+
formView: {},
|
|
78
81
|
grid: {},
|
|
79
82
|
icon: {},
|
|
80
83
|
image: {},
|
|
84
|
+
imagePreview: {},
|
|
81
85
|
input: {
|
|
82
86
|
// size: null,
|
|
83
87
|
// transfer: false
|
|
@@ -126,6 +130,7 @@ setConfig({
|
|
|
126
130
|
showTitleOverflow: true,
|
|
127
131
|
animat: true,
|
|
128
132
|
showClose: true,
|
|
133
|
+
padding: true,
|
|
129
134
|
draggable: true,
|
|
130
135
|
showConfirmButton: null,
|
|
131
136
|
// storage: false,
|
|
@@ -289,7 +294,14 @@ setIcon({
|
|
|
289
294
|
IMAGE_PREVIEW_ZOOM_IN: iconPrefix + 'search-zoom-in',
|
|
290
295
|
IMAGE_PREVIEW_ROTATE_LEFT: iconPrefix + 'rotate-left',
|
|
291
296
|
IMAGE_PREVIEW_ROTATE_RIGHT: iconPrefix + 'rotate-right',
|
|
292
|
-
IMAGE_PREVIEW_PRINT: iconPrefix + 'print'
|
|
297
|
+
IMAGE_PREVIEW_PRINT: iconPrefix + 'print',
|
|
298
|
+
|
|
299
|
+
// alert
|
|
300
|
+
ALERT_CLOSE: iconPrefix + 'close',
|
|
301
|
+
ALERT_INFO: iconPrefix + 'info-circle-fill',
|
|
302
|
+
ALERT_SUCCESS: iconPrefix + 'success-circle-fill',
|
|
303
|
+
ALERT_WARNING: iconPrefix + 'warning-circle-fill',
|
|
304
|
+
ALERT_ERROR: iconPrefix + 'error-circle-fill'
|
|
293
305
|
})
|
|
294
306
|
|
|
295
307
|
export * from '@vxe-ui/core'
|
package/styles/all.scss
CHANGED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
$btnThemeList: (
|
|
2
|
+
(
|
|
3
|
+
name: "primary",
|
|
4
|
+
ftColor: var(--vxe-ui-font-primary-color),
|
|
5
|
+
brColor: var(--vxe-ui-font-primary-lighten-color),
|
|
6
|
+
bgColor: var(--vxe-ui-font-primary-tinge-color)
|
|
7
|
+
),
|
|
8
|
+
(
|
|
9
|
+
name: "success",
|
|
10
|
+
ftColor: var(--vxe-ui-status-success-color),
|
|
11
|
+
brColor: var(--vxe-ui-status-success-lighten-color),
|
|
12
|
+
bgColor: var(--vxe-ui-status-success-tinge-color)
|
|
13
|
+
),
|
|
14
|
+
(
|
|
15
|
+
name: "info",
|
|
16
|
+
ftColor: var(--vxe-ui-status-info-color),
|
|
17
|
+
brColor: var(--vxe-ui-status-info-lighten-color),
|
|
18
|
+
bgColor: var(--vxe-ui-status-info-tinge-color)
|
|
19
|
+
),
|
|
20
|
+
(
|
|
21
|
+
name: "warning",
|
|
22
|
+
ftColor: var(--vxe-ui-status-warning-color),
|
|
23
|
+
brColor: var(--vxe-ui-status-warning-lighten-color),
|
|
24
|
+
bgColor: var(--vxe-ui-status-warning-tinge-color)
|
|
25
|
+
),
|
|
26
|
+
(
|
|
27
|
+
name: "danger",
|
|
28
|
+
ftColor: var(--vxe-ui-status-danger-color),
|
|
29
|
+
brColor: var(--vxe-ui-status-danger-lighten-color),
|
|
30
|
+
bgColor: var(--vxe-ui-status-danger-tinge-color)
|
|
31
|
+
),
|
|
32
|
+
(
|
|
33
|
+
name: "error",
|
|
34
|
+
ftColor: var(--vxe-ui-status-error-color),
|
|
35
|
+
brColor: var(--vxe-ui-status-error-lighten-color),
|
|
36
|
+
bgColor: var(--vxe-ui-status-error-tinge-color)
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
.vxe-alert {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
color: var(--vxe-ui-font-color);
|
|
45
|
+
padding: var(--vxe-ui-layout-padding-default);
|
|
46
|
+
margin-bottom: var(--vxe-ui-layout-padding-default);
|
|
47
|
+
font-size: var(--vxe-ui-font-size-default);
|
|
48
|
+
border-radius: var(--vxe-ui-base-border-radius);
|
|
49
|
+
@for $index from 0 to length($btnThemeList) {
|
|
50
|
+
$item: nth($btnThemeList, $index + 1);
|
|
51
|
+
&.theme--#{map-get($item, name)} {
|
|
52
|
+
color: map-get($item, ftColor);
|
|
53
|
+
border: 1px solid map-get($item, brColor);
|
|
54
|
+
background-color: map-get($item, bgColor);
|
|
55
|
+
&::after {
|
|
56
|
+
background-color: map-get($item, ftColor);
|
|
57
|
+
}
|
|
58
|
+
.vxe-alert--icon {
|
|
59
|
+
color: map-get($item, ftColor);
|
|
60
|
+
}
|
|
61
|
+
.vxe-alert--close-btn {
|
|
62
|
+
&:hover {
|
|
63
|
+
color: map-get($item, brColor);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
&.size--medium {
|
|
69
|
+
font-size: var(--vxe-ui-font-size-medium);
|
|
70
|
+
}
|
|
71
|
+
&.size--small {
|
|
72
|
+
font-size: var(--vxe-ui-font-size-small);
|
|
73
|
+
}
|
|
74
|
+
&.size--mini {
|
|
75
|
+
font-size: var(--vxe-ui-font-size-mini);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
.vxe-alert--icon {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: row;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
font-size: 1.5em;
|
|
85
|
+
padding: 0 var(--vxe-ui-layout-padding-default);
|
|
86
|
+
}
|
|
87
|
+
.vxe-alert--body {
|
|
88
|
+
flex-grow: 1;
|
|
89
|
+
}
|
|
90
|
+
.vxe-alert--title {
|
|
91
|
+
font-size: 1.1em;
|
|
92
|
+
font-weight: 700;
|
|
93
|
+
line-height: 2em;
|
|
94
|
+
}
|
|
95
|
+
.vxe-alert--close-btn {
|
|
96
|
+
padding: 0 0.4em;
|
|
97
|
+
line-height: 2.2em;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
}
|
|
@@ -19,12 +19,11 @@
|
|
|
19
19
|
background-color: rgba(0, 0, 0, 0.5);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
&.pos--left {
|
|
23
|
+
.vxe-drawer--box {
|
|
24
|
+
left: 0;
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
27
|
&.pos--right {
|
|
29
28
|
.vxe-drawer--box {
|
|
30
29
|
right: 0;
|
|
@@ -132,6 +131,11 @@
|
|
|
132
131
|
height: 30%;
|
|
133
132
|
}
|
|
134
133
|
}
|
|
134
|
+
&.is--padding {
|
|
135
|
+
.vxe-drawer--content {
|
|
136
|
+
padding: 0.8em 1em;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
135
139
|
|
|
136
140
|
.vxe-drawer--box {
|
|
137
141
|
display: flex;
|
|
@@ -146,7 +150,6 @@
|
|
|
146
150
|
}
|
|
147
151
|
.vxe-drawer--content {
|
|
148
152
|
flex-grow: 1;
|
|
149
|
-
padding: 0.8em 1em;
|
|
150
153
|
white-space: pre-line;
|
|
151
154
|
}
|
|
152
155
|
.vxe-drawer--header,
|
|
@@ -169,7 +172,6 @@
|
|
|
169
172
|
font-size: 1.1em;
|
|
170
173
|
font-weight: 700;
|
|
171
174
|
border-bottom: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
172
|
-
background-color: var(--vxe-ui-drawer-header-background-color);
|
|
173
175
|
&.is--ellipsis {
|
|
174
176
|
.vxe-drawer--header-title {
|
|
175
177
|
overflow: hidden;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
.vxe-image-preview--img-item {
|
|
24
24
|
display: none;
|
|
25
25
|
cursor: grabbing;
|
|
26
|
-
@include createAnimationTransition(transform, 0.3s);
|
|
26
|
+
// @include createAnimationTransition(transform, 0.3s);
|
|
27
27
|
&.is--active {
|
|
28
28
|
display: block;
|
|
29
29
|
}
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
justify-content: center;
|
|
83
83
|
top: 50%;
|
|
84
84
|
border-radius: 50%;
|
|
85
|
-
font-size:
|
|
85
|
+
font-size: 1.6em;
|
|
86
86
|
padding: 0.5em;
|
|
87
87
|
transform: translateY(-50%);
|
|
88
88
|
background-color: rgba(0, 0, 0, 0.8);
|
|
@@ -117,11 +117,12 @@
|
|
|
117
117
|
display: flex;
|
|
118
118
|
flex-direction: row;
|
|
119
119
|
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
120
121
|
font-size: 1.2em;
|
|
121
|
-
|
|
122
|
+
min-width: 2.5em;
|
|
122
123
|
}
|
|
123
124
|
.vxe-image-preview--operation-btn {
|
|
124
|
-
font-size:
|
|
125
|
+
font-size: 1.6em;
|
|
125
126
|
padding: 0.5em;
|
|
126
127
|
cursor: pointer;
|
|
127
128
|
@include createAnimationTransition(all, 0.1s);
|
|
@@ -139,7 +140,9 @@
|
|
|
139
140
|
&.vxe-modal--wrapper {
|
|
140
141
|
&.type--modal {
|
|
141
142
|
.vxe-modal--box {
|
|
143
|
+
border: 0;
|
|
142
144
|
background-color: rgba(0, 0, 0, 0.1);
|
|
145
|
+
box-shadow: none;
|
|
143
146
|
}
|
|
144
147
|
.vxe-modal--content {
|
|
145
148
|
padding: 0;
|
|
@@ -212,6 +212,11 @@
|
|
|
212
212
|
color: var(--vxe-ui-font-disabled-color);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
+
&.is--padding {
|
|
216
|
+
.vxe-modal--content {
|
|
217
|
+
padding: 0.8em 1em;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
215
220
|
.vxe-modal--status-wrapper {
|
|
216
221
|
flex-shrink: 0;
|
|
217
222
|
display: flex;
|
|
@@ -219,7 +224,6 @@
|
|
|
219
224
|
}
|
|
220
225
|
.vxe-modal--content {
|
|
221
226
|
flex-grow: 1;
|
|
222
|
-
padding: 0.8em 1em;
|
|
223
227
|
white-space: pre-line;
|
|
224
228
|
}
|
|
225
229
|
.vxe-modal--header,
|