@wfrog/vc-ui 1.1.0 → 1.2.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/README.md +3 -3
- package/dist/es/chunk/{OEa4tYPF.mjs → -ga82G_B.mjs} +1 -1
- package/dist/es/chunk/B1BnPYNG.mjs +163 -0
- package/dist/es/chunk/{DFOLES4O.mjs → BA2yoAwy.mjs} +403 -502
- package/dist/es/chunk/{BpqBBo4z.mjs → BDyXj_90.mjs} +2 -2
- package/dist/es/chunk/{BI0vrXwX.mjs → BI-fNJhk.mjs} +6 -3
- package/dist/es/chunk/{BsGCX4td.mjs → BK4T_2ha.mjs} +1 -1
- package/dist/es/chunk/{73YgKz3H.mjs → BLLKi_0v.mjs} +1 -1
- package/dist/es/chunk/{DTLPXrjb.mjs → BTsEMnf_.mjs} +1 -1
- package/dist/es/chunk/{B5UQmWXg.mjs → BUf50Y7Y.mjs} +41 -21
- package/dist/es/chunk/{BzedaLtg.mjs → BYVaz5Or.mjs} +2 -2
- package/dist/es/chunk/BaJ7k5Lg.mjs +209 -0
- package/dist/es/chunk/{Bp9jXKX0.mjs → BambM7zX.mjs} +2 -2
- package/dist/es/chunk/{CizMbf5K.mjs → Bl0WQiki.mjs} +1 -1
- package/dist/es/chunk/{CLbj8G-F.mjs → Bnot0Gwc.mjs} +12 -4
- package/dist/es/chunk/{4eyJqDa9.mjs → BoGGHTrJ.mjs} +4 -2
- package/dist/es/chunk/C7Dgjpd1.mjs +242 -0
- package/dist/es/chunk/{D0LB3gF-.mjs → CKbkzlkO.mjs} +104 -72
- package/dist/es/chunk/{DrgvuOYH.mjs → CL5WTCB3.mjs} +4 -2
- package/dist/es/chunk/{XwSiBVsA.mjs → CM_I1FoA.mjs} +2 -2
- package/dist/es/chunk/{DouIsSPi.mjs → CNILa-hz.mjs} +1 -1
- package/dist/es/chunk/{DRoyW749.mjs → CcKUdl3e.mjs} +12 -6
- package/dist/es/chunk/CidLkmft.mjs +188 -0
- package/dist/es/chunk/{HAog8AWU.mjs → CitH0taR.mjs} +816 -539
- package/dist/es/chunk/{Cu6erWl4.mjs → CzqeSQn4.mjs} +73 -38
- package/dist/es/chunk/{CLCfXfvv.mjs → D7JQbDFE.mjs} +154 -118
- package/dist/es/chunk/{DaCDeO95.mjs → D9iEroQw.mjs} +1 -207
- package/dist/es/chunk/{cPBw23yt.mjs → DEPZhJ0Z.mjs} +21 -16
- package/dist/es/chunk/{CPERtDRX.mjs → DHpbQMGk.mjs} +32 -22
- package/dist/es/chunk/{BHsNc7jl.mjs → DKpRXDRE.mjs} +82 -55
- package/dist/es/chunk/{CLMc8GzD.mjs → DMYHOxhk.mjs} +462 -311
- package/dist/es/chunk/{CBSopeeE.mjs → DQHGjqG5.mjs} +9 -4
- package/dist/es/chunk/DTEM_vYZ.mjs +23 -0
- package/dist/es/chunk/{NQBKROII.mjs → DWcIzeMM.mjs} +1 -1
- package/dist/es/chunk/{FHvLvzEB.mjs → DX38FfmL.mjs} +1088 -697
- package/dist/es/chunk/{DZD-YnCt.mjs → Dcm-lOj8.mjs} +4 -4
- package/dist/es/chunk/{09Ec85_u.mjs → DdmNdV7I.mjs} +398 -278
- package/dist/es/chunk/{f0-vIQGp.mjs → DfHTA5LW.mjs} +3 -3
- package/dist/es/chunk/DgFT6snA.mjs +835 -0
- package/dist/es/chunk/{DwKWIlzw.mjs → DgSzI6Fw.mjs} +106 -71
- package/dist/es/chunk/{BcTuAX8r.mjs → Dsye5ZEp.mjs} +5 -3
- package/dist/es/chunk/{BsLJxiSC.mjs → Dw-yyl2m.mjs} +1 -1
- package/dist/es/chunk/{DXPWe_a5.mjs → U13Qpiki.mjs} +19 -13
- package/dist/es/chunk/{axpwSky6.mjs → _8u_XVHh.mjs} +168 -120
- package/dist/es/chunk/egk9EEzo.mjs +66 -0
- package/dist/es/chunk/{BUEEWLrd.mjs → ezK_XQQd.mjs} +15 -6
- package/dist/es/chunk/{Bl2KlMdP.mjs → oW98L-44.mjs} +8 -3
- package/dist/es/chunk/{Dk6Bx0KT.mjs → plK2vnjp.mjs} +8 -5
- package/dist/es/components/awesome-icon/awesome-icon.mjs +2 -1
- package/dist/es/components/backbottom/backbottom.mjs +2 -2
- package/dist/es/components/button/button.mjs +105 -76
- package/dist/es/components/choice/choice.mjs +2 -2
- package/dist/es/components/config-provider/config-provider.d.ts +1 -0
- package/dist/es/components/config-provider/config-provider.mjs +13 -5
- package/dist/es/components/cropper/cropper.mjs +44 -33
- package/dist/es/components/currency/currency.mjs +5 -5
- package/dist/es/components/daterange-picker/daterange-picker.mjs +2267 -1522
- package/dist/es/components/dialog/dialog.mjs +213 -172
- package/dist/es/components/dialog/index.css +1 -1
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +11 -11
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +5 -4
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +495 -314
- package/dist/es/components/dialog-upload-images/index.css +1 -1
- package/dist/es/components/drag-verify/drag-verify.mjs +3 -3
- package/dist/es/components/drawer/drawer.mjs +136 -94
- package/dist/es/components/drawer/index.css +1 -1
- package/dist/es/components/easy-pagination/easy-pagination.mjs +2 -2
- package/dist/es/components/el-icon/el-icon.mjs +1 -1
- package/dist/es/components/el-icon/index.css +3 -2
- package/dist/es/components/flag/flag.mjs +2 -1
- package/dist/es/components/icon/icon.mjs +10 -31
- package/dist/es/components/icon/icon.vue.d.ts +1 -1
- package/dist/es/components/icon/icon2.mjs +1 -1
- package/dist/es/components/icon/index.mjs +2 -2
- package/dist/es/components/icon-picker/components/collections.vue.d.ts +625 -0
- package/dist/es/components/icon-picker/components/panel.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/icon-picker.d.ts +40 -0
- package/dist/es/components/icon-picker/icon-picker.mjs +1375 -0
- package/dist/es/components/icon-picker/icon-picker.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/index.css +121 -0
- package/dist/es/components/icon-picker/index.d.ts +4 -0
- package/dist/es/components/icon-picker/index.mjs +6 -0
- package/dist/es/components/iconify-icon/iconify-icon.d.ts +5 -0
- package/dist/es/components/iconify-icon/iconify-icon.mjs +1860 -0
- package/dist/es/components/iconify-icon/iconify-icon.vue.d.ts +6 -0
- package/dist/es/components/iconify-icon/index.css +11 -0
- package/dist/es/components/iconify-icon/index.d.ts +4 -0
- package/dist/es/components/iconify-icon/index.mjs +6 -0
- package/dist/es/components/image/image.mjs +5 -5
- package/dist/es/components/input/input.mjs +4 -4
- package/dist/es/components/input/input.vue.d.ts +63 -54
- package/dist/es/components/input-number/input-number.mjs +5 -5
- package/dist/es/components/pca-picker/components/c.vue.d.ts +4 -4
- package/dist/es/components/pca-picker/index.css +1 -1
- package/dist/es/components/pca-picker/pca-picker.mjs +154 -160
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +12 -11
- package/dist/es/components/qr-code/qr-code.mjs +2 -1
- package/dist/es/components/screenfull/screenfull.mjs +6 -5
- package/dist/es/components/scrollbar/index.css +18 -0
- package/dist/es/components/scrollbar/index.d.ts +4 -0
- package/dist/es/components/scrollbar/index.mjs +6 -0
- package/dist/es/components/scrollbar/scrollbar.d.ts +4 -0
- package/dist/es/components/scrollbar/scrollbar.mjs +65 -0
- package/dist/es/components/scrollbar/scrollbar.vue.d.ts +588 -0
- package/dist/es/components/select/select.mjs +7 -7
- package/dist/es/components/single-player/index.css +1 -1
- package/dist/es/components/single-player/single-player.mjs +265 -166
- package/dist/es/components/svg-icon/index.css +3 -2
- package/dist/es/components/svg-icon/svg-icon.mjs +3 -3
- package/dist/es/components/switch/switch.mjs +2 -2
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +2 -2
- package/dist/es/components/tags/tags.mjs +9 -9
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +4 -4
- package/dist/es/components/thousand-input/thousand-input.mjs +5 -4
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +126 -108
- package/dist/es/components/tinymce/index.css +1 -1
- package/dist/es/components/tinymce/tinymce.mjs +9 -8
- package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +179 -141
- package/dist/es/components/tree-picker/popover-cascader.css +1 -1
- package/dist/es/components/tree-picker/tree-picker.mjs +10 -10
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +12 -11
- package/dist/es/components/upload-file/upload-file.mjs +3 -3
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.mjs +41 -31
- package/dist/global.d.ts +3 -0
- package/dist/index.css +166 -22
- package/package.json +8 -2
- package/dist/es/chunk/BtTIs3tG.mjs +0 -138
- package/dist/es/chunk/C7wQNvSS.mjs +0 -728
- package/dist/es/chunk/Cbhe4I9Z.mjs +0 -16
- package/dist/es/chunk/DihosKp1.mjs +0 -140
- package/dist/es/components/icon/index.css +0 -9
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { defineComponent, markRaw, ref, effectScope, computed, shallowRef, watch, nextTick, onMounted, createBlock, openBlock, unref, withCtx, createVNode, Transition, createElementVNode, normalizeStyle, normalizeClass, createCommentVNode, createElementBlock, renderSlot, withModifiers, Fragment, createTextVNode, toDisplayString, resolveDynamicComponent, useAttrs, mergeProps, createSlots, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
2
|
import { clamp, useEventListener, isClient, useThrottleFn, useIntersectionObserver } from '@vueuse/core';
|
|
3
|
-
import { b as ElTeleport, d as ElFocusTrap } from './
|
|
4
|
-
import { E as ElIcon } from './
|
|
3
|
+
import { b as ElTeleport, d as ElFocusTrap } from './DMYHOxhk.mjs';
|
|
4
|
+
import { E as ElIcon } from './DEPZhJ0Z.mjs';
|
|
5
5
|
import { ScaleToOriginal, FullScreen, Close, ArrowLeft, ArrowRight, ZoomOut, ZoomIn, RefreshLeft, RefreshRight } from '@element-plus/icons-vue';
|
|
6
|
-
import { f as isNumber, c as buildProps, d as definePropType, u as useNamespace, m as fromPairs, i as isArray, n as isElement, h as isString, o as isWindow } from './
|
|
6
|
+
import { f as isNumber, c as buildProps, d as definePropType, u as useNamespace, m as fromPairs, i as isArray, n as isElement, h as isString, o as isWindow } from './CcKUdl3e.mjs';
|
|
7
7
|
import { m as mutable } from './B-rxnVJv.mjs';
|
|
8
|
-
import { _ as _export_sfc, w as withInstall } from './
|
|
9
|
-
import { u as useLocale } from './
|
|
10
|
-
import { u as useZIndex } from './
|
|
11
|
-
import { u as useLockscreen } from './
|
|
8
|
+
import { _ as _export_sfc, w as withInstall } from './BTsEMnf_.mjs';
|
|
9
|
+
import { u as useLocale } from './plK2vnjp.mjs';
|
|
10
|
+
import { u as useZIndex } from './BI-fNJhk.mjs';
|
|
11
|
+
import { u as useLockscreen } from './Bnot0Gwc.mjs';
|
|
12
12
|
import { g as getEventCode, E as EVENT_CODE } from './BTpNRPQW.mjs';
|
|
13
13
|
import { k as keysOf } from './DVNTpOBR.mjs';
|
|
14
|
-
import { d as debounce } from './
|
|
15
|
-
import { i as isObject } from './
|
|
16
|
-
import { u as useAttrs$1 } from './
|
|
17
|
-
import { g as getScrollContainer } from './
|
|
14
|
+
import { d as debounce } from './BambM7zX.mjs';
|
|
15
|
+
import { i as isObject } from './DWcIzeMM.mjs';
|
|
16
|
+
import { u as useAttrs$1 } from './ezK_XQQd.mjs';
|
|
17
|
+
import { g as getScrollContainer } from './oW98L-44.mjs';
|
|
18
18
|
|
|
19
19
|
/** Error message constants. */
|
|
20
20
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
@@ -131,16 +131,16 @@ const imageViewerEmits = {
|
|
|
131
131
|
rotate: (deg) => isNumber(deg)
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
const _hoisted_1$1 = ["src", "crossorigin"];
|
|
135
|
+
const _sfc_main$1 = defineComponent({
|
|
136
|
+
...{
|
|
137
|
+
name: "ElImageViewer"
|
|
138
|
+
},
|
|
139
|
+
__name: "image-viewer",
|
|
139
140
|
props: imageViewerProps,
|
|
140
141
|
emits: imageViewerEmits,
|
|
141
|
-
setup(__props, { expose, emit }) {
|
|
142
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
142
143
|
var _a;
|
|
143
|
-
const props = __props;
|
|
144
144
|
const modes = {
|
|
145
145
|
CONTAIN: {
|
|
146
146
|
name: "contain",
|
|
@@ -151,6 +151,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
151
151
|
icon: markRaw(ScaleToOriginal)
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
+
const props = __props;
|
|
155
|
+
const emit = __emit;
|
|
154
156
|
let stopWheelListener;
|
|
155
157
|
const { t } = useLocale();
|
|
156
158
|
const ns = useNamespace("image-viewer");
|
|
@@ -211,7 +213,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
211
213
|
}
|
|
212
214
|
return style;
|
|
213
215
|
});
|
|
214
|
-
const progress = computed(
|
|
216
|
+
const progress = computed(
|
|
217
|
+
() => `${activeIndex.value + 1} / ${props.urlList.length}`
|
|
218
|
+
);
|
|
215
219
|
function hide() {
|
|
216
220
|
unregisterEventListener();
|
|
217
221
|
stopWheelListener == null ? void 0 : stopWheelListener();
|
|
@@ -356,12 +360,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
356
360
|
switch (action) {
|
|
357
361
|
case "zoomOut":
|
|
358
362
|
if (transform.value.scale > minScale) {
|
|
359
|
-
transform.value.scale = Number.parseFloat(
|
|
363
|
+
transform.value.scale = Number.parseFloat(
|
|
364
|
+
(transform.value.scale / zoomRate).toFixed(3)
|
|
365
|
+
);
|
|
360
366
|
}
|
|
361
367
|
break;
|
|
362
368
|
case "zoomIn":
|
|
363
369
|
if (transform.value.scale < maxScale) {
|
|
364
|
-
transform.value.scale = Number.parseFloat(
|
|
370
|
+
transform.value.scale = Number.parseFloat(
|
|
371
|
+
(transform.value.scale * zoomRate).toFixed(3)
|
|
372
|
+
);
|
|
365
373
|
}
|
|
366
374
|
break;
|
|
367
375
|
case "clockwise":
|
|
@@ -397,9 +405,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
397
405
|
return false;
|
|
398
406
|
}
|
|
399
407
|
}
|
|
400
|
-
watch(
|
|
401
|
-
|
|
402
|
-
|
|
408
|
+
watch(
|
|
409
|
+
() => scaleClamped.value,
|
|
410
|
+
(val) => {
|
|
411
|
+
transform.value.scale = val;
|
|
412
|
+
}
|
|
413
|
+
);
|
|
403
414
|
watch(currentImg, () => {
|
|
404
415
|
nextTick(() => {
|
|
405
416
|
const $img = imgRef.value;
|
|
@@ -419,7 +430,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
419
430
|
passive: false
|
|
420
431
|
});
|
|
421
432
|
});
|
|
422
|
-
|
|
433
|
+
__expose({
|
|
423
434
|
setActiveItem
|
|
424
435
|
});
|
|
425
436
|
return (_ctx, _cache) => {
|
|
@@ -433,163 +444,226 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
433
444
|
appear: ""
|
|
434
445
|
}, {
|
|
435
446
|
default: withCtx(() => [
|
|
436
|
-
createElementVNode(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}, [
|
|
474
|
-
createVNode(unref(ElIcon), null, {
|
|
475
|
-
default: withCtx(() => [
|
|
476
|
-
createVNode(unref(ArrowLeft))
|
|
477
|
-
]),
|
|
478
|
-
_: 1
|
|
479
|
-
})
|
|
480
|
-
], 2),
|
|
481
|
-
createElementVNode("span", {
|
|
482
|
-
class: normalizeClass(unref(arrowNextKls)),
|
|
483
|
-
onClick: next
|
|
484
|
-
}, [
|
|
485
|
-
createVNode(unref(ElIcon), null, {
|
|
486
|
-
default: withCtx(() => [
|
|
487
|
-
createVNode(unref(ArrowRight))
|
|
488
|
-
]),
|
|
489
|
-
_: 1
|
|
490
|
-
})
|
|
491
|
-
], 2)
|
|
492
|
-
], 64)) : createCommentVNode("v-if", true),
|
|
493
|
-
_ctx.$slots.progress || _ctx.showProgress ? (openBlock(), createElementBlock("div", {
|
|
494
|
-
key: 1,
|
|
495
|
-
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("progress")])
|
|
496
|
-
}, [
|
|
497
|
-
renderSlot(_ctx.$slots, "progress", {
|
|
498
|
-
activeIndex: activeIndex.value,
|
|
499
|
-
total: _ctx.urlList.length
|
|
500
|
-
}, () => [
|
|
501
|
-
createTextVNode(toDisplayString(unref(progress)), 1)
|
|
502
|
-
])
|
|
503
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
504
|
-
createCommentVNode(" ACTIONS "),
|
|
505
|
-
createElementVNode("div", {
|
|
506
|
-
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("actions")])
|
|
507
|
-
}, [
|
|
508
|
-
createElementVNode("div", {
|
|
509
|
-
class: normalizeClass(unref(ns).e("actions__inner"))
|
|
510
|
-
}, [
|
|
511
|
-
renderSlot(_ctx.$slots, "toolbar", {
|
|
512
|
-
actions: handleActions,
|
|
513
|
-
prev,
|
|
514
|
-
next,
|
|
515
|
-
reset: toggleMode,
|
|
516
|
-
activeIndex: activeIndex.value,
|
|
517
|
-
setActiveItem
|
|
518
|
-
}, () => [
|
|
519
|
-
createVNode(unref(ElIcon), {
|
|
520
|
-
onClick: ($event) => handleActions("zoomOut")
|
|
521
|
-
}, {
|
|
522
|
-
default: withCtx(() => [
|
|
523
|
-
createVNode(unref(ZoomOut))
|
|
524
|
-
]),
|
|
525
|
-
_: 1
|
|
526
|
-
}, 8, ["onClick"]),
|
|
527
|
-
createVNode(unref(ElIcon), {
|
|
528
|
-
onClick: ($event) => handleActions("zoomIn")
|
|
529
|
-
}, {
|
|
447
|
+
createElementVNode(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
ref_key: "wrapper",
|
|
451
|
+
ref: wrapper,
|
|
452
|
+
tabindex: -1,
|
|
453
|
+
class: normalizeClass(unref(ns).e("wrapper")),
|
|
454
|
+
style: normalizeStyle({ zIndex: zIndex.value })
|
|
455
|
+
},
|
|
456
|
+
[
|
|
457
|
+
createVNode(unref(ElFocusTrap), {
|
|
458
|
+
loop: "",
|
|
459
|
+
trapped: "",
|
|
460
|
+
"focus-trap-el": wrapper.value,
|
|
461
|
+
"focus-start-el": "container",
|
|
462
|
+
onFocusoutPrevented,
|
|
463
|
+
onReleaseRequested: onCloseRequested
|
|
464
|
+
}, {
|
|
465
|
+
default: withCtx(() => [
|
|
466
|
+
createElementVNode(
|
|
467
|
+
"div",
|
|
468
|
+
{
|
|
469
|
+
class: normalizeClass(unref(ns).e("mask")),
|
|
470
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.hideOnClickModal && hide(), ["self"]))
|
|
471
|
+
},
|
|
472
|
+
null,
|
|
473
|
+
2
|
|
474
|
+
),
|
|
475
|
+
createCommentVNode(" CLOSE "),
|
|
476
|
+
createElementVNode(
|
|
477
|
+
"span",
|
|
478
|
+
{
|
|
479
|
+
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("close")]),
|
|
480
|
+
onClick: hide
|
|
481
|
+
},
|
|
482
|
+
[
|
|
483
|
+
createVNode(unref(ElIcon), null, {
|
|
530
484
|
default: withCtx(() => [
|
|
531
|
-
createVNode(unref(
|
|
485
|
+
createVNode(unref(Close))
|
|
532
486
|
]),
|
|
533
487
|
_: 1
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
488
|
+
})
|
|
489
|
+
],
|
|
490
|
+
2
|
|
491
|
+
),
|
|
492
|
+
createCommentVNode(" ARROW "),
|
|
493
|
+
!isSingle.value ? (openBlock(), createElementBlock(
|
|
494
|
+
Fragment,
|
|
495
|
+
{ key: 0 },
|
|
496
|
+
[
|
|
497
|
+
createElementVNode(
|
|
498
|
+
"span",
|
|
499
|
+
{
|
|
500
|
+
class: normalizeClass(arrowPrevKls.value),
|
|
501
|
+
onClick: prev
|
|
502
|
+
},
|
|
503
|
+
[
|
|
504
|
+
createVNode(unref(ElIcon), null, {
|
|
505
|
+
default: withCtx(() => [
|
|
506
|
+
createVNode(unref(ArrowLeft))
|
|
507
|
+
]),
|
|
508
|
+
_: 1
|
|
509
|
+
})
|
|
510
|
+
],
|
|
511
|
+
2
|
|
512
|
+
),
|
|
513
|
+
createElementVNode(
|
|
514
|
+
"span",
|
|
515
|
+
{
|
|
516
|
+
class: normalizeClass(arrowNextKls.value),
|
|
517
|
+
onClick: next
|
|
518
|
+
},
|
|
519
|
+
[
|
|
520
|
+
createVNode(unref(ElIcon), null, {
|
|
521
|
+
default: withCtx(() => [
|
|
522
|
+
createVNode(unref(ArrowRight))
|
|
523
|
+
]),
|
|
524
|
+
_: 1
|
|
525
|
+
})
|
|
526
|
+
],
|
|
527
|
+
2
|
|
528
|
+
)
|
|
529
|
+
],
|
|
530
|
+
64
|
|
531
|
+
)) : createCommentVNode("v-if", true),
|
|
532
|
+
_ctx.$slots.progress || _ctx.showProgress ? (openBlock(), createElementBlock(
|
|
533
|
+
"div",
|
|
534
|
+
{
|
|
535
|
+
key: 1,
|
|
536
|
+
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("progress")])
|
|
537
|
+
},
|
|
538
|
+
[
|
|
539
|
+
renderSlot(_ctx.$slots, "progress", {
|
|
540
|
+
activeIndex: activeIndex.value,
|
|
541
|
+
total: _ctx.urlList.length
|
|
542
|
+
}, () => [
|
|
543
|
+
createTextVNode(
|
|
544
|
+
toDisplayString(progress.value),
|
|
545
|
+
1
|
|
546
|
+
)
|
|
547
|
+
])
|
|
548
|
+
],
|
|
549
|
+
2
|
|
550
|
+
)) : createCommentVNode("v-if", true),
|
|
551
|
+
createCommentVNode(" ACTIONS "),
|
|
552
|
+
createElementVNode(
|
|
553
|
+
"div",
|
|
554
|
+
{
|
|
555
|
+
class: normalizeClass([unref(ns).e("btn"), unref(ns).e("actions")])
|
|
556
|
+
},
|
|
557
|
+
[
|
|
558
|
+
createElementVNode(
|
|
559
|
+
"div",
|
|
560
|
+
{
|
|
561
|
+
class: normalizeClass(unref(ns).e("actions__inner"))
|
|
562
|
+
},
|
|
563
|
+
[
|
|
564
|
+
renderSlot(_ctx.$slots, "toolbar", {
|
|
565
|
+
actions: handleActions,
|
|
566
|
+
prev,
|
|
567
|
+
next,
|
|
568
|
+
reset: toggleMode,
|
|
569
|
+
activeIndex: activeIndex.value,
|
|
570
|
+
setActiveItem
|
|
571
|
+
}, () => [
|
|
572
|
+
createVNode(unref(ElIcon), {
|
|
573
|
+
onClick: _cache[1] || (_cache[1] = ($event) => handleActions("zoomOut"))
|
|
574
|
+
}, {
|
|
575
|
+
default: withCtx(() => [
|
|
576
|
+
createVNode(unref(ZoomOut))
|
|
577
|
+
]),
|
|
578
|
+
_: 1
|
|
579
|
+
}),
|
|
580
|
+
createVNode(unref(ElIcon), {
|
|
581
|
+
onClick: _cache[2] || (_cache[2] = ($event) => handleActions("zoomIn"))
|
|
582
|
+
}, {
|
|
583
|
+
default: withCtx(() => [
|
|
584
|
+
createVNode(unref(ZoomIn))
|
|
585
|
+
]),
|
|
586
|
+
_: 1
|
|
587
|
+
}),
|
|
588
|
+
createElementVNode(
|
|
589
|
+
"i",
|
|
590
|
+
{
|
|
591
|
+
class: normalizeClass(unref(ns).e("actions__divider"))
|
|
592
|
+
},
|
|
593
|
+
null,
|
|
594
|
+
2
|
|
595
|
+
),
|
|
596
|
+
createVNode(unref(ElIcon), { onClick: toggleMode }, {
|
|
597
|
+
default: withCtx(() => [
|
|
598
|
+
(openBlock(), createBlock(resolveDynamicComponent(mode.value.icon)))
|
|
599
|
+
]),
|
|
600
|
+
_: 1
|
|
601
|
+
}),
|
|
602
|
+
createElementVNode(
|
|
603
|
+
"i",
|
|
604
|
+
{
|
|
605
|
+
class: normalizeClass(unref(ns).e("actions__divider"))
|
|
606
|
+
},
|
|
607
|
+
null,
|
|
608
|
+
2
|
|
609
|
+
),
|
|
610
|
+
createVNode(unref(ElIcon), {
|
|
611
|
+
onClick: _cache[3] || (_cache[3] = ($event) => handleActions("anticlockwise"))
|
|
612
|
+
}, {
|
|
613
|
+
default: withCtx(() => [
|
|
614
|
+
createVNode(unref(RefreshLeft))
|
|
615
|
+
]),
|
|
616
|
+
_: 1
|
|
617
|
+
}),
|
|
618
|
+
createVNode(unref(ElIcon), {
|
|
619
|
+
onClick: _cache[4] || (_cache[4] = ($event) => handleActions("clockwise"))
|
|
620
|
+
}, {
|
|
621
|
+
default: withCtx(() => [
|
|
622
|
+
createVNode(unref(RefreshRight))
|
|
623
|
+
]),
|
|
624
|
+
_: 1
|
|
625
|
+
})
|
|
626
|
+
])
|
|
627
|
+
],
|
|
628
|
+
2
|
|
629
|
+
)
|
|
630
|
+
],
|
|
631
|
+
2
|
|
632
|
+
),
|
|
633
|
+
createCommentVNode(" CANVAS "),
|
|
634
|
+
createElementVNode(
|
|
635
|
+
"div",
|
|
636
|
+
{
|
|
637
|
+
class: normalizeClass(unref(ns).e("canvas"))
|
|
638
|
+
},
|
|
639
|
+
[
|
|
640
|
+
loadError.value && _ctx.$slots["viewer-error"] ? renderSlot(_ctx.$slots, "viewer-error", {
|
|
641
|
+
key: 0,
|
|
642
|
+
activeIndex: activeIndex.value,
|
|
643
|
+
src: currentImg.value
|
|
644
|
+
}) : (openBlock(), createElementBlock("img", {
|
|
645
|
+
ref_key: "imgRef",
|
|
646
|
+
ref: imgRef,
|
|
647
|
+
key: currentImg.value,
|
|
648
|
+
src: currentImg.value,
|
|
649
|
+
style: normalizeStyle(imgStyle.value),
|
|
650
|
+
class: normalizeClass(unref(ns).e("img")),
|
|
651
|
+
crossorigin: _ctx.crossorigin,
|
|
652
|
+
onLoad: handleImgLoad,
|
|
653
|
+
onError: handleImgError,
|
|
654
|
+
onMousedown: handleMouseDown,
|
|
655
|
+
onTouchstart: handleTouchStart
|
|
656
|
+
}, null, 46, _hoisted_1$1))
|
|
657
|
+
],
|
|
658
|
+
2
|
|
659
|
+
),
|
|
660
|
+
renderSlot(_ctx.$slots, "default")
|
|
661
|
+
]),
|
|
662
|
+
_: 3
|
|
663
|
+
}, 8, ["focus-trap-el"])
|
|
664
|
+
],
|
|
665
|
+
6
|
|
666
|
+
)
|
|
593
667
|
]),
|
|
594
668
|
_: 3
|
|
595
669
|
})
|
|
@@ -599,7 +673,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
599
673
|
};
|
|
600
674
|
}
|
|
601
675
|
});
|
|
602
|
-
var ImageViewer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "image-viewer.vue"]]);
|
|
676
|
+
var ImageViewer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/image-viewer/src/image-viewer.vue"]]);
|
|
603
677
|
|
|
604
678
|
const ElImageViewer = withInstall(ImageViewer);
|
|
605
679
|
|
|
@@ -671,21 +745,28 @@ const imageEmits = {
|
|
|
671
745
|
show: () => true
|
|
672
746
|
};
|
|
673
747
|
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
748
|
+
const _hoisted_1 = ["src", "loading", "crossorigin"];
|
|
749
|
+
const _hoisted_2 = { key: 0 };
|
|
750
|
+
const _sfc_main = defineComponent({
|
|
751
|
+
...{
|
|
752
|
+
name: "ElImage",
|
|
753
|
+
inheritAttrs: false
|
|
754
|
+
},
|
|
755
|
+
__name: "image",
|
|
680
756
|
props: imageProps,
|
|
681
757
|
emits: imageEmits,
|
|
682
|
-
setup(__props, { expose, emit }) {
|
|
758
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
683
759
|
const props = __props;
|
|
760
|
+
const emit = __emit;
|
|
684
761
|
const { t } = useLocale();
|
|
685
762
|
const ns = useNamespace("image");
|
|
686
763
|
const rawAttrs = useAttrs();
|
|
687
764
|
const containerAttrs = computed(() => {
|
|
688
|
-
return fromPairs(
|
|
765
|
+
return fromPairs(
|
|
766
|
+
Object.entries(rawAttrs).filter(
|
|
767
|
+
([key]) => /^(data-|on[A-Z])/i.test(key) || ["id", "style"].includes(key)
|
|
768
|
+
)
|
|
769
|
+
);
|
|
689
770
|
});
|
|
690
771
|
const imgAttrs = useAttrs$1({
|
|
691
772
|
excludeListeners: true,
|
|
@@ -768,9 +849,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
768
849
|
const scrollContainer2 = getScrollContainer(container.value);
|
|
769
850
|
_scrollContainer.value = isWindow(scrollContainer2) ? void 0 : scrollContainer2;
|
|
770
851
|
}
|
|
771
|
-
const { stop } = useIntersectionObserver(
|
|
772
|
-
|
|
773
|
-
|
|
852
|
+
const { stop } = useIntersectionObserver(
|
|
853
|
+
container,
|
|
854
|
+
([entry]) => {
|
|
855
|
+
lazyLoadHandler(entry.isIntersecting);
|
|
856
|
+
},
|
|
857
|
+
{ root: _scrollContainer }
|
|
858
|
+
);
|
|
774
859
|
stopScrollListener = stop;
|
|
775
860
|
}
|
|
776
861
|
function removeLazyLoadListener() {
|
|
@@ -793,16 +878,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
793
878
|
function switchViewer(val) {
|
|
794
879
|
emit("switch", val);
|
|
795
880
|
}
|
|
796
|
-
watch(
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
881
|
+
watch(
|
|
882
|
+
() => props.src,
|
|
883
|
+
() => {
|
|
884
|
+
if (isManual.value) {
|
|
885
|
+
isLoading.value = true;
|
|
886
|
+
hasLoadError.value = false;
|
|
887
|
+
removeLazyLoadListener();
|
|
888
|
+
addLazyLoadListener();
|
|
889
|
+
} else {
|
|
890
|
+
loadImage();
|
|
891
|
+
}
|
|
804
892
|
}
|
|
805
|
-
|
|
893
|
+
);
|
|
806
894
|
onMounted(() => {
|
|
807
895
|
if (isManual.value) {
|
|
808
896
|
addLazyLoadListener();
|
|
@@ -810,90 +898,122 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
810
898
|
loadImage();
|
|
811
899
|
}
|
|
812
900
|
});
|
|
813
|
-
|
|
901
|
+
__expose({
|
|
814
902
|
showPreview: clickHandler
|
|
815
903
|
});
|
|
816
904
|
return (_ctx, _cache) => {
|
|
817
|
-
return openBlock(), createElementBlock(
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
905
|
+
return openBlock(), createElementBlock(
|
|
906
|
+
"div",
|
|
907
|
+
mergeProps({
|
|
908
|
+
ref_key: "container",
|
|
909
|
+
ref: container
|
|
910
|
+
}, containerAttrs.value, {
|
|
911
|
+
class: [unref(ns).b(), _ctx.$attrs.class]
|
|
912
|
+
}),
|
|
913
|
+
[
|
|
914
|
+
hasLoadError.value ? renderSlot(_ctx.$slots, "error", { key: 0 }, () => [
|
|
915
|
+
createElementVNode(
|
|
916
|
+
"div",
|
|
917
|
+
{
|
|
918
|
+
class: normalizeClass(unref(ns).e("error"))
|
|
919
|
+
},
|
|
920
|
+
toDisplayString(unref(t)("el.image.error")),
|
|
921
|
+
3
|
|
922
|
+
)
|
|
923
|
+
]) : (openBlock(), createElementBlock(
|
|
924
|
+
Fragment,
|
|
925
|
+
{ key: 1 },
|
|
926
|
+
[
|
|
927
|
+
imageSrc.value !== void 0 ? (openBlock(), createElementBlock("img", mergeProps({ key: 0 }, unref(imgAttrs), {
|
|
928
|
+
src: imageSrc.value,
|
|
929
|
+
loading: _ctx.loading,
|
|
930
|
+
style: imageStyle.value,
|
|
931
|
+
class: imageKls.value,
|
|
932
|
+
crossorigin: _ctx.crossorigin,
|
|
933
|
+
onClick: clickHandler,
|
|
934
|
+
onLoad: handleLoad,
|
|
935
|
+
onError: handleError
|
|
936
|
+
}), null, 16, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
937
|
+
isLoading.value ? (openBlock(), createElementBlock(
|
|
938
|
+
"div",
|
|
939
|
+
{
|
|
940
|
+
key: 1,
|
|
941
|
+
class: normalizeClass(unref(ns).e("wrapper"))
|
|
942
|
+
},
|
|
943
|
+
[
|
|
944
|
+
renderSlot(_ctx.$slots, "placeholder", {}, () => [
|
|
945
|
+
createElementVNode(
|
|
946
|
+
"div",
|
|
947
|
+
{
|
|
948
|
+
class: normalizeClass(unref(ns).e("placeholder"))
|
|
949
|
+
},
|
|
950
|
+
null,
|
|
951
|
+
2
|
|
952
|
+
)
|
|
953
|
+
])
|
|
954
|
+
],
|
|
955
|
+
2
|
|
956
|
+
)) : createCommentVNode("v-if", true)
|
|
957
|
+
],
|
|
958
|
+
64
|
|
959
|
+
)),
|
|
960
|
+
preview.value ? (openBlock(), createElementBlock(
|
|
961
|
+
Fragment,
|
|
962
|
+
{ key: 2 },
|
|
963
|
+
[
|
|
964
|
+
showViewer.value ? (openBlock(), createBlock(unref(ElImageViewer), {
|
|
965
|
+
key: 0,
|
|
966
|
+
"z-index": _ctx.zIndex,
|
|
967
|
+
"initial-index": imageIndex.value,
|
|
968
|
+
infinite: _ctx.infinite,
|
|
969
|
+
"zoom-rate": _ctx.zoomRate,
|
|
970
|
+
"min-scale": _ctx.minScale,
|
|
971
|
+
"max-scale": _ctx.maxScale,
|
|
972
|
+
"show-progress": _ctx.showProgress,
|
|
973
|
+
"url-list": _ctx.previewSrcList,
|
|
974
|
+
scale: _ctx.scale,
|
|
975
|
+
crossorigin: _ctx.crossorigin,
|
|
976
|
+
"hide-on-click-modal": _ctx.hideOnClickModal,
|
|
977
|
+
teleported: _ctx.previewTeleported,
|
|
978
|
+
"close-on-press-escape": _ctx.closeOnPressEscape,
|
|
979
|
+
onClose: closeViewer,
|
|
980
|
+
onSwitch: switchViewer
|
|
981
|
+
}, createSlots({
|
|
982
|
+
toolbar: withCtx((toolbar) => [
|
|
983
|
+
renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps(toolbar)))
|
|
984
|
+
]),
|
|
985
|
+
default: withCtx(() => [
|
|
986
|
+
_ctx.$slots.viewer ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
987
|
+
renderSlot(_ctx.$slots, "viewer")
|
|
988
|
+
])) : createCommentVNode("v-if", true)
|
|
989
|
+
]),
|
|
990
|
+
_: 2
|
|
991
|
+
}, [
|
|
992
|
+
_ctx.$slots.progress ? {
|
|
993
|
+
name: "progress",
|
|
994
|
+
fn: withCtx((progress) => [
|
|
995
|
+
renderSlot(_ctx.$slots, "progress", normalizeProps(guardReactiveProps(progress)))
|
|
996
|
+
]),
|
|
997
|
+
key: "0"
|
|
998
|
+
} : void 0,
|
|
999
|
+
_ctx.$slots["viewer-error"] ? {
|
|
1000
|
+
name: "viewer-error",
|
|
1001
|
+
fn: withCtx((viewerError) => [
|
|
1002
|
+
renderSlot(_ctx.$slots, "viewer-error", normalizeProps(guardReactiveProps(viewerError)))
|
|
1003
|
+
]),
|
|
1004
|
+
key: "1"
|
|
1005
|
+
} : void 0
|
|
1006
|
+
]), 1032, ["z-index", "initial-index", "infinite", "zoom-rate", "min-scale", "max-scale", "show-progress", "url-list", "scale", "crossorigin", "hide-on-click-modal", "teleported", "close-on-press-escape"])) : createCommentVNode("v-if", true)
|
|
1007
|
+
],
|
|
1008
|
+
64
|
|
1009
|
+
)) : createCommentVNode("v-if", true)
|
|
1010
|
+
],
|
|
1011
|
+
16
|
|
1012
|
+
);
|
|
893
1013
|
};
|
|
894
1014
|
}
|
|
895
1015
|
});
|
|
896
|
-
var Image = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "image.vue"]]);
|
|
1016
|
+
var Image = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/image/src/image.vue"]]);
|
|
897
1017
|
|
|
898
1018
|
const ElImage = withInstall(Image);
|
|
899
1019
|
|