vxe-pc-ui 4.7.7 → 4.7.9
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/icon/{iconfont.1752462949194.ttf → iconfont.1752551365876.ttf} +0 -0
- package/{lib/icon/style/iconfont.1752462949194.woff → es/icon/iconfont.1752551365876.woff} +0 -0
- package/es/icon/iconfont.1752551365876.woff2 +0 -0
- package/es/icon/style.css +3 -3
- package/es/icon/style.min.css +1 -1
- package/{lib/icon/style/iconfont.1752462949194.ttf → es/iconfont.1752551365876.ttf} +0 -0
- package/es/{icon/iconfont.1752462949194.woff → iconfont.1752551365876.woff} +0 -0
- package/es/iconfont.1752551365876.woff2 +0 -0
- package/es/image/src/group.js +21 -5
- package/es/image/src/image.js +25 -5
- package/es/image/src/preview.js +20 -13
- package/es/image/src/util.js +11 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-icon/style.css +3 -3
- package/es/vxe-icon/style.min.css +1 -1
- package/lib/{iconfont.1752462949194.ttf → icon/style/iconfont.1752551365876.ttf} +0 -0
- package/{es/iconfont.1752462949194.woff → lib/icon/style/iconfont.1752551365876.woff} +0 -0
- package/lib/icon/style/iconfont.1752551365876.woff2 +0 -0
- package/lib/icon/style/style.css +3 -3
- package/lib/icon/style/style.min.css +3 -3
- package/{es/iconfont.1752462949194.ttf → lib/iconfont.1752551365876.ttf} +0 -0
- package/lib/{iconfont.1752462949194.woff → iconfont.1752551365876.woff} +0 -0
- package/lib/iconfont.1752551365876.woff2 +0 -0
- package/lib/image/src/group.js +19 -5
- package/lib/image/src/group.min.js +1 -1
- package/lib/image/src/image.js +23 -5
- package/lib/image/src/image.min.js +1 -1
- package/lib/image/src/preview.js +28 -14
- package/lib/image/src/preview.min.js +1 -1
- package/lib/image/src/util.js +14 -0
- package/lib/image/src/util.min.js +1 -1
- package/lib/index.umd.js +86 -26
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-icon/style/style.css +3 -3
- package/lib/vxe-icon/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/image/src/group.ts +22 -5
- package/packages/image/src/image.ts +26 -5
- package/packages/image/src/preview.ts +20 -13
- package/packages/image/src/util.ts +12 -1
- package/styles/components/icon.scss +3 -3
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/types/components/image-group.d.ts +23 -2
- package/types/components/image-preview.d.ts +12 -2
- package/types/components/image.d.ts +27 -3
- package/types/components/table.d.ts +4 -1
- package/es/icon/iconfont.1752462949194.woff2 +0 -0
- package/es/iconfont.1752462949194.woff2 +0 -0
- package/lib/icon/style/iconfont.1752462949194.woff2 +0 -0
- package/lib/iconfont.1752462949194.woff2 +0 -0
package/es/image/src/preview.js
CHANGED
|
@@ -37,6 +37,7 @@ export default defineVxeComponent({
|
|
|
37
37
|
'change',
|
|
38
38
|
'download',
|
|
39
39
|
'download-fail',
|
|
40
|
+
'rotate',
|
|
40
41
|
'close'
|
|
41
42
|
],
|
|
42
43
|
setup(props, context) {
|
|
@@ -215,7 +216,7 @@ export default defineVxeComponent({
|
|
|
215
216
|
reactData.offsetScale = Number(Math.max(-0.9, offsetScale - stepNum).toFixed(2));
|
|
216
217
|
}
|
|
217
218
|
};
|
|
218
|
-
const
|
|
219
|
+
const handleChangeEvent = (evnt, isNext) => {
|
|
219
220
|
let activeIndex = reactData.activeIndex || 0;
|
|
220
221
|
const imgList = computeImgList.value;
|
|
221
222
|
if (isNext) {
|
|
@@ -234,11 +235,16 @@ export default defineVxeComponent({
|
|
|
234
235
|
activeIndex--;
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
|
-
|
|
238
|
+
const imgUrl = imgList[activeIndex || 0];
|
|
238
239
|
reactData.activeIndex = activeIndex;
|
|
240
|
+
resetStyle();
|
|
239
241
|
emitModel(activeIndex);
|
|
242
|
+
dispatchEvent('change', { url: imgUrl, activeIndex }, evnt);
|
|
240
243
|
};
|
|
241
|
-
const
|
|
244
|
+
const handleRotateImgEvent = (evnt, isRight) => {
|
|
245
|
+
const imgList = computeImgList.value;
|
|
246
|
+
const { activeIndex } = reactData;
|
|
247
|
+
const imgUrl = imgList[activeIndex || 0];
|
|
242
248
|
let offsetRotate = reactData.offsetRotate;
|
|
243
249
|
if (isRight) {
|
|
244
250
|
offsetRotate += 90;
|
|
@@ -247,6 +253,7 @@ export default defineVxeComponent({
|
|
|
247
253
|
offsetRotate -= 90;
|
|
248
254
|
}
|
|
249
255
|
reactData.offsetRotate = offsetRotate;
|
|
256
|
+
dispatchEvent('rotate', { url: imgUrl, rotateValue: offsetRotate }, evnt);
|
|
250
257
|
};
|
|
251
258
|
const handlePct11 = () => {
|
|
252
259
|
resetStyle();
|
|
@@ -341,10 +348,10 @@ export default defineVxeComponent({
|
|
|
341
348
|
handlePct11();
|
|
342
349
|
break;
|
|
343
350
|
case 'rotateLeft':
|
|
344
|
-
|
|
351
|
+
handleRotateImgEvent(evnt, false);
|
|
345
352
|
break;
|
|
346
353
|
case 'rotateRight':
|
|
347
|
-
|
|
354
|
+
handleRotateImgEvent(evnt, true);
|
|
348
355
|
break;
|
|
349
356
|
case 'print':
|
|
350
357
|
handlePrintImg();
|
|
@@ -423,7 +430,7 @@ export default defineVxeComponent({
|
|
|
423
430
|
reactData.offsetLeft -= 1;
|
|
424
431
|
}
|
|
425
432
|
else {
|
|
426
|
-
|
|
433
|
+
handleChangeEvent(evnt, false);
|
|
427
434
|
}
|
|
428
435
|
}
|
|
429
436
|
else if (isRightArrow) {
|
|
@@ -432,16 +439,16 @@ export default defineVxeComponent({
|
|
|
432
439
|
reactData.offsetLeft += 1;
|
|
433
440
|
}
|
|
434
441
|
else {
|
|
435
|
-
|
|
442
|
+
handleChangeEvent(evnt, true);
|
|
436
443
|
}
|
|
437
444
|
}
|
|
438
445
|
else if (isR && isControlKey) {
|
|
439
446
|
evnt.preventDefault();
|
|
440
447
|
if (hasShiftKey) {
|
|
441
|
-
|
|
448
|
+
handleRotateImgEvent(evnt, false);
|
|
442
449
|
}
|
|
443
450
|
else {
|
|
444
|
-
|
|
451
|
+
handleRotateImgEvent(evnt, true);
|
|
445
452
|
}
|
|
446
453
|
}
|
|
447
454
|
else if (isP && isControlKey) {
|
|
@@ -529,8 +536,8 @@ export default defineVxeComponent({
|
|
|
529
536
|
imgList.length > 1
|
|
530
537
|
? h('div', {
|
|
531
538
|
class: 'vxe-image-preview--previous-btn',
|
|
532
|
-
onClick() {
|
|
533
|
-
|
|
539
|
+
onClick(evnt) {
|
|
540
|
+
handleChangeEvent(evnt, false);
|
|
534
541
|
}
|
|
535
542
|
}, [
|
|
536
543
|
h('i', {
|
|
@@ -541,8 +548,8 @@ export default defineVxeComponent({
|
|
|
541
548
|
imgList.length > 1
|
|
542
549
|
? h('div', {
|
|
543
550
|
class: 'vxe-image-preview--next-btn',
|
|
544
|
-
onClick() {
|
|
545
|
-
|
|
551
|
+
onClick(evnt) {
|
|
552
|
+
handleChangeEvent(evnt, true);
|
|
546
553
|
}
|
|
547
554
|
}, [
|
|
548
555
|
h('i', {
|
package/es/image/src/util.js
CHANGED
|
@@ -8,6 +8,7 @@ export const openPreviewImage = (options) => {
|
|
|
8
8
|
escClosable: true
|
|
9
9
|
}, options);
|
|
10
10
|
const { urlList, activeIndex } = opts;
|
|
11
|
+
const { rotate, change } = opts.events || {};
|
|
11
12
|
const modalId = XEUtils.uniqueId('image-preview');
|
|
12
13
|
VxeUI.modal.open({
|
|
13
14
|
id: modalId,
|
|
@@ -34,6 +35,16 @@ export const openPreviewImage = (options) => {
|
|
|
34
35
|
downloadMethod: opts.downloadMethod,
|
|
35
36
|
onClose() {
|
|
36
37
|
VxeUI.modal.close(modalId);
|
|
38
|
+
},
|
|
39
|
+
onChange(eventParams) {
|
|
40
|
+
if (change) {
|
|
41
|
+
change.call(this, eventParams);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
onRotate(eventParams) {
|
|
45
|
+
if (rotate) {
|
|
46
|
+
rotate.call(this, eventParams);
|
|
47
|
+
}
|
|
37
48
|
}
|
|
38
49
|
});
|
|
39
50
|
}
|