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.
Files changed (61) hide show
  1. package/es/icon/{iconfont.1752462949194.ttf → iconfont.1752551365876.ttf} +0 -0
  2. package/{lib/icon/style/iconfont.1752462949194.woff → es/icon/iconfont.1752551365876.woff} +0 -0
  3. package/es/icon/iconfont.1752551365876.woff2 +0 -0
  4. package/es/icon/style.css +3 -3
  5. package/es/icon/style.min.css +1 -1
  6. package/{lib/icon/style/iconfont.1752462949194.ttf → es/iconfont.1752551365876.ttf} +0 -0
  7. package/es/{icon/iconfont.1752462949194.woff → iconfont.1752551365876.woff} +0 -0
  8. package/es/iconfont.1752551365876.woff2 +0 -0
  9. package/es/image/src/group.js +21 -5
  10. package/es/image/src/image.js +25 -5
  11. package/es/image/src/preview.js +20 -13
  12. package/es/image/src/util.js +11 -0
  13. package/es/style.css +1 -1
  14. package/es/style.min.css +1 -1
  15. package/es/ui/index.js +1 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-icon/style.css +3 -3
  18. package/es/vxe-icon/style.min.css +1 -1
  19. package/lib/{iconfont.1752462949194.ttf → icon/style/iconfont.1752551365876.ttf} +0 -0
  20. package/{es/iconfont.1752462949194.woff → lib/icon/style/iconfont.1752551365876.woff} +0 -0
  21. package/lib/icon/style/iconfont.1752551365876.woff2 +0 -0
  22. package/lib/icon/style/style.css +3 -3
  23. package/lib/icon/style/style.min.css +3 -3
  24. package/{es/iconfont.1752462949194.ttf → lib/iconfont.1752551365876.ttf} +0 -0
  25. package/lib/{iconfont.1752462949194.woff → iconfont.1752551365876.woff} +0 -0
  26. package/lib/iconfont.1752551365876.woff2 +0 -0
  27. package/lib/image/src/group.js +19 -5
  28. package/lib/image/src/group.min.js +1 -1
  29. package/lib/image/src/image.js +23 -5
  30. package/lib/image/src/image.min.js +1 -1
  31. package/lib/image/src/preview.js +28 -14
  32. package/lib/image/src/preview.min.js +1 -1
  33. package/lib/image/src/util.js +14 -0
  34. package/lib/image/src/util.min.js +1 -1
  35. package/lib/index.umd.js +86 -26
  36. package/lib/index.umd.min.js +1 -1
  37. package/lib/style.css +1 -1
  38. package/lib/style.min.css +1 -1
  39. package/lib/ui/index.js +1 -1
  40. package/lib/ui/index.min.js +1 -1
  41. package/lib/ui/src/log.js +1 -1
  42. package/lib/ui/src/log.min.js +1 -1
  43. package/lib/vxe-icon/style/style.css +3 -3
  44. package/lib/vxe-icon/style/style.min.css +1 -1
  45. package/package.json +1 -1
  46. package/packages/image/src/group.ts +22 -5
  47. package/packages/image/src/image.ts +26 -5
  48. package/packages/image/src/preview.ts +20 -13
  49. package/packages/image/src/util.ts +12 -1
  50. package/styles/components/icon.scss +3 -3
  51. package/styles/icon/iconfont.ttf +0 -0
  52. package/styles/icon/iconfont.woff +0 -0
  53. package/styles/icon/iconfont.woff2 +0 -0
  54. package/types/components/image-group.d.ts +23 -2
  55. package/types/components/image-preview.d.ts +12 -2
  56. package/types/components/image.d.ts +27 -3
  57. package/types/components/table.d.ts +4 -1
  58. package/es/icon/iconfont.1752462949194.woff2 +0 -0
  59. package/es/iconfont.1752462949194.woff2 +0 -0
  60. package/lib/icon/style/iconfont.1752462949194.woff2 +0 -0
  61. package/lib/iconfont.1752462949194.woff2 +0 -0
@@ -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 handleChange = (isNext) => {
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
- resetStyle();
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 handleRotateImg = (isRight) => {
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
- handleRotateImg(false);
351
+ handleRotateImgEvent(evnt, false);
345
352
  break;
346
353
  case 'rotateRight':
347
- handleRotateImg(true);
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
- handleChange(false);
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
- handleChange(true);
442
+ handleChangeEvent(evnt, true);
436
443
  }
437
444
  }
438
445
  else if (isR && isControlKey) {
439
446
  evnt.preventDefault();
440
447
  if (hasShiftKey) {
441
- handleRotateImg(false);
448
+ handleRotateImgEvent(evnt, false);
442
449
  }
443
450
  else {
444
- handleRotateImg(true);
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
- handleChange(false);
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
- handleChange(true);
551
+ onClick(evnt) {
552
+ handleChangeEvent(evnt, true);
546
553
  }
547
554
  }, [
548
555
  h('i', {
@@ -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
  }