vant 4.0.8 → 4.0.10
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 +1 -1
- package/es/back-top/BackTop.d.ts +4 -0
- package/es/back-top/BackTop.mjs +2 -1
- package/es/back-top/index.d.ts +3 -0
- package/es/calendar/Calendar.mjs +1 -1
- package/es/calendar/CalendarMonth.mjs +4 -1
- package/es/image-preview/ImagePreview.mjs +13 -3
- package/es/image-preview/ImagePreviewItem.d.ts +3 -0
- package/es/image-preview/ImagePreviewItem.mjs +21 -9
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/index.d.ts +1 -0
- package/es/locale/index.mjs +3 -1
- package/es/locale/lang/eo-EO.d.ts +62 -0
- package/es/locale/lang/eo-EO.mjs +64 -0
- package/es/locale/lang/it-IT.mjs +12 -12
- package/es/picker/Picker.mjs +5 -3
- package/es/slider/Slider.d.ts +2 -2
- package/es/slider/Slider.mjs +6 -4
- package/es/slider/index.d.ts +2 -2
- package/es/swipe/Swipe.d.ts +3 -1
- package/es/swipe/Swipe.mjs +10 -2
- package/es/swipe/index.d.ts +3 -1
- package/lib/back-top/BackTop.d.ts +4 -0
- package/lib/back-top/BackTop.js +2 -1
- package/lib/back-top/index.d.ts +3 -0
- package/lib/calendar/Calendar.js +1 -1
- package/lib/calendar/CalendarMonth.js +4 -1
- package/lib/image-preview/ImagePreview.js +13 -3
- package/lib/image-preview/ImagePreviewItem.d.ts +3 -0
- package/lib/image-preview/ImagePreviewItem.js +21 -9
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/index.d.ts +1 -0
- package/lib/locale/index.js +3 -1
- package/lib/locale/lang/eo-EO.d.ts +62 -0
- package/lib/locale/lang/eo-EO.js +83 -0
- package/lib/locale/lang/it-IT.js +12 -12
- package/lib/picker/Picker.js +5 -3
- package/lib/slider/Slider.d.ts +2 -2
- package/lib/slider/Slider.js +6 -4
- package/lib/slider/index.d.ts +2 -2
- package/lib/swipe/Swipe.d.ts +3 -1
- package/lib/swipe/Swipe.js +10 -2
- package/lib/swipe/index.d.ts +3 -1
- package/lib/vant.cjs.js +65 -25
- package/lib/vant.es.js +65 -25
- package/lib/vant.js +65 -25
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
package/lib/vant.cjs.js
CHANGED
@@ -314,6 +314,7 @@ const Locale = {
|
|
314
314
|
deepAssign(messages, newMessages);
|
315
315
|
}
|
316
316
|
};
|
317
|
+
const useCurrentLang = () => lang;
|
317
318
|
var stdin_default$1M = Locale;
|
318
319
|
function createTranslate(name2) {
|
319
320
|
const prefix = camelize(name2) + ".";
|
@@ -2138,7 +2139,7 @@ const SWIPE_KEY = Symbol(name$1l);
|
|
2138
2139
|
var stdin_default$1w = vue.defineComponent({
|
2139
2140
|
name: name$1l,
|
2140
2141
|
props: swipeProps,
|
2141
|
-
emits: ["change"],
|
2142
|
+
emits: ["change", "dragStart", "dragEnd"],
|
2142
2143
|
setup(props, {
|
2143
2144
|
emit,
|
2144
2145
|
slots
|
@@ -2153,6 +2154,7 @@ var stdin_default$1w = vue.defineComponent({
|
|
2153
2154
|
active: 0,
|
2154
2155
|
swiping: false
|
2155
2156
|
});
|
2157
|
+
let dragging = false;
|
2156
2158
|
const touch = useTouch();
|
2157
2159
|
const {
|
2158
2160
|
children,
|
@@ -2323,9 +2325,10 @@ var stdin_default$1w = vue.defineComponent({
|
|
2323
2325
|
const resize = () => initialize(state.active);
|
2324
2326
|
let touchStartTime;
|
2325
2327
|
const onTouchStart = (event) => {
|
2326
|
-
if (!props.touchable)
|
2328
|
+
if (!props.touchable || event.touches.length > 1)
|
2327
2329
|
return;
|
2328
2330
|
touch.start(event);
|
2331
|
+
dragging = false;
|
2329
2332
|
touchStartTime = Date.now();
|
2330
2333
|
stopAutoplay();
|
2331
2334
|
correctPosition();
|
@@ -2340,6 +2343,10 @@ var stdin_default$1w = vue.defineComponent({
|
|
2340
2343
|
move({
|
2341
2344
|
offset: delta.value
|
2342
2345
|
});
|
2346
|
+
if (!dragging) {
|
2347
|
+
emit("dragStart");
|
2348
|
+
dragging = true;
|
2349
|
+
}
|
2343
2350
|
}
|
2344
2351
|
}
|
2345
2352
|
}
|
@@ -2368,7 +2375,9 @@ var stdin_default$1w = vue.defineComponent({
|
|
2368
2375
|
pace: 0
|
2369
2376
|
});
|
2370
2377
|
}
|
2378
|
+
dragging = false;
|
2371
2379
|
state.swiping = false;
|
2380
|
+
emit("dragEnd");
|
2372
2381
|
autoplay();
|
2373
2382
|
};
|
2374
2383
|
const swipeTo = (index, options = {}) => {
|
@@ -3200,9 +3209,11 @@ var stdin_default$1q = vue.defineComponent({
|
|
3200
3209
|
}
|
3201
3210
|
});
|
3202
3211
|
}
|
3203
|
-
|
3204
|
-
|
3205
|
-
|
3212
|
+
vue.nextTick(() => {
|
3213
|
+
emit("change", extend({
|
3214
|
+
columnIndex
|
3215
|
+
}, getEventParams()));
|
3216
|
+
});
|
3206
3217
|
};
|
3207
3218
|
const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend({
|
3208
3219
|
columnIndex,
|
@@ -5589,6 +5600,7 @@ const backTopProps = {
|
|
5589
5600
|
bottom: numericProp,
|
5590
5601
|
target: [String, Object],
|
5591
5602
|
offset: makeNumericProp(200),
|
5603
|
+
immediate: Boolean,
|
5592
5604
|
teleport: {
|
5593
5605
|
type: [String, Object],
|
5594
5606
|
default: "body"
|
@@ -5616,7 +5628,7 @@ var stdin_default$1b = vue.defineComponent({
|
|
5616
5628
|
emit("click", event);
|
5617
5629
|
(_a = scrollParent.value) == null ? void 0 : _a.scrollTo({
|
5618
5630
|
top: 0,
|
5619
|
-
behavior: "smooth"
|
5631
|
+
behavior: props.immediate ? "auto" : "smooth"
|
5620
5632
|
});
|
5621
5633
|
};
|
5622
5634
|
const scroll = () => {
|
@@ -6002,7 +6014,10 @@ var stdin_default$19 = vue.defineComponent({
|
|
6002
6014
|
if (props.showMonthTitle) {
|
6003
6015
|
return vue.createVNode("div", {
|
6004
6016
|
"class": bem$Z("month-title")
|
6005
|
-
}, [title
|
6017
|
+
}, [slots["month-title"] ? slots["month-title"]({
|
6018
|
+
date: props.date,
|
6019
|
+
text: title.value
|
6020
|
+
}) : title.value]);
|
6006
6021
|
}
|
6007
6022
|
};
|
6008
6023
|
const renderMark = () => {
|
@@ -6448,7 +6463,7 @@ var stdin_default$17 = vue.defineComponent({
|
|
6448
6463
|
"firstDayOfWeek": dayOffset.value
|
6449
6464
|
}, pick(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
6450
6465
|
"onClick": onClickDay
|
6451
|
-
}), pick(slots, ["top-info", "bottom-info"]));
|
6466
|
+
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
6452
6467
|
};
|
6453
6468
|
const renderFooterButton = () => {
|
6454
6469
|
if (slots.footer) {
|
@@ -9535,7 +9550,8 @@ var stdin_default$I = vue.defineComponent({
|
|
9535
9550
|
minZoom: makeRequiredProp(numericProp),
|
9536
9551
|
maxZoom: makeRequiredProp(numericProp),
|
9537
9552
|
rootWidth: makeRequiredProp(Number),
|
9538
|
-
rootHeight: makeRequiredProp(Number)
|
9553
|
+
rootHeight: makeRequiredProp(Number),
|
9554
|
+
disableZoom: Boolean
|
9539
9555
|
},
|
9540
9556
|
emits: ["scale", "close", "longPress"],
|
9541
9557
|
setup(props, {
|
@@ -9630,18 +9646,23 @@ var stdin_default$I = vue.defineComponent({
|
|
9630
9646
|
let startDistance;
|
9631
9647
|
let doubleTapTimer;
|
9632
9648
|
let touchStartTime;
|
9649
|
+
let isImageMoved = false;
|
9633
9650
|
const onTouchStart = (event) => {
|
9634
9651
|
const {
|
9635
9652
|
touches
|
9636
9653
|
} = event;
|
9654
|
+
fingerNum = touches.length;
|
9655
|
+
if (fingerNum === 2 && props.disableZoom) {
|
9656
|
+
return;
|
9657
|
+
}
|
9637
9658
|
const {
|
9638
9659
|
offsetX
|
9639
9660
|
} = touch;
|
9640
9661
|
touch.start(event);
|
9641
|
-
fingerNum = touches.length;
|
9642
9662
|
startMoveX = state.moveX;
|
9643
9663
|
startMoveY = state.moveY;
|
9644
9664
|
touchStartTime = Date.now();
|
9665
|
+
isImageMoved = false;
|
9645
9666
|
state.moving = fingerNum === 1 && state.scale !== 1;
|
9646
9667
|
state.zooming = fingerNum === 2 && !offsetX.value;
|
9647
9668
|
if (state.zooming) {
|
@@ -9654,9 +9675,6 @@ var stdin_default$I = vue.defineComponent({
|
|
9654
9675
|
touches
|
9655
9676
|
} = event;
|
9656
9677
|
touch.move(event);
|
9657
|
-
if (state.moving || state.zooming) {
|
9658
|
-
preventDefault(event, true);
|
9659
|
-
}
|
9660
9678
|
if (state.moving) {
|
9661
9679
|
const {
|
9662
9680
|
deltaX,
|
@@ -9664,13 +9682,22 @@ var stdin_default$I = vue.defineComponent({
|
|
9664
9682
|
} = touch;
|
9665
9683
|
const moveX = deltaX.value + startMoveX;
|
9666
9684
|
const moveY = deltaY.value + startMoveY;
|
9685
|
+
if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved) {
|
9686
|
+
state.moving = false;
|
9687
|
+
return;
|
9688
|
+
}
|
9689
|
+
isImageMoved = true;
|
9690
|
+
preventDefault(event, true);
|
9667
9691
|
state.moveX = clamp(moveX, -maxMoveX.value, maxMoveX.value);
|
9668
9692
|
state.moveY = clamp(moveY, -maxMoveY.value, maxMoveY.value);
|
9669
9693
|
}
|
9670
|
-
if (state.zooming
|
9671
|
-
|
9672
|
-
|
9673
|
-
|
9694
|
+
if (state.zooming) {
|
9695
|
+
preventDefault(event, true);
|
9696
|
+
if (touches.length === 2) {
|
9697
|
+
const distance = getDistance(touches);
|
9698
|
+
const scale = startScale * distance / startDistance;
|
9699
|
+
setScale(scale);
|
9700
|
+
}
|
9674
9701
|
}
|
9675
9702
|
};
|
9676
9703
|
const checkTap = () => {
|
@@ -9780,7 +9807,7 @@ var stdin_default$I = vue.defineComponent({
|
|
9780
9807
|
}
|
9781
9808
|
});
|
9782
9809
|
const [name$z, bem$y] = createNamespace("image-preview");
|
9783
|
-
const popupProps$1 = ["show", "
|
9810
|
+
const popupProps$1 = ["show", "teleport", "transition", "overlayStyle", "closeOnPopstate"];
|
9784
9811
|
const imagePreviewProps = {
|
9785
9812
|
show: Boolean,
|
9786
9813
|
loop: truthProp,
|
@@ -9815,7 +9842,8 @@ var stdin_default$H = vue.defineComponent({
|
|
9815
9842
|
const state = vue.reactive({
|
9816
9843
|
active: 0,
|
9817
9844
|
rootWidth: 0,
|
9818
|
-
rootHeight: 0
|
9845
|
+
rootHeight: 0,
|
9846
|
+
disableZoom: false
|
9819
9847
|
});
|
9820
9848
|
const resize = () => {
|
9821
9849
|
if (swipeRef.value) {
|
@@ -9855,6 +9883,12 @@ var stdin_default$H = vue.defineComponent({
|
|
9855
9883
|
}, [slots.cover()]);
|
9856
9884
|
}
|
9857
9885
|
};
|
9886
|
+
const onDragStart = () => {
|
9887
|
+
state.disableZoom = true;
|
9888
|
+
};
|
9889
|
+
const onDragEnd = () => {
|
9890
|
+
state.disableZoom = false;
|
9891
|
+
};
|
9858
9892
|
const renderImages = () => vue.createVNode(Swipe, {
|
9859
9893
|
"ref": swipeRef,
|
9860
9894
|
"lazyRender": true,
|
@@ -9864,7 +9898,9 @@ var stdin_default$H = vue.defineComponent({
|
|
9864
9898
|
"initialSwipe": props.startPosition,
|
9865
9899
|
"showIndicators": props.showIndicators,
|
9866
9900
|
"indicatorColor": "white",
|
9867
|
-
"onChange": setActive
|
9901
|
+
"onChange": setActive,
|
9902
|
+
"onDragEnd": onDragEnd,
|
9903
|
+
"onDragStart": onDragStart
|
9868
9904
|
}, {
|
9869
9905
|
default: () => [props.images.map((image, index) => vue.createVNode(stdin_default$I, {
|
9870
9906
|
"src": image,
|
@@ -9874,6 +9910,7 @@ var stdin_default$H = vue.defineComponent({
|
|
9874
9910
|
"minZoom": props.minZoom,
|
9875
9911
|
"rootWidth": state.rootWidth,
|
9876
9912
|
"rootHeight": state.rootHeight,
|
9913
|
+
"disableZoom": state.disableZoom,
|
9877
9914
|
"onScale": emitScale,
|
9878
9915
|
"onClose": emitClose,
|
9879
9916
|
"onLongPress": () => emit("longPress", {
|
@@ -12447,7 +12484,7 @@ var stdin_default$g = vue.defineComponent({
|
|
12447
12484
|
let current2;
|
12448
12485
|
let startValue;
|
12449
12486
|
const root = vue.ref();
|
12450
|
-
const slider = vue.ref();
|
12487
|
+
const slider = [vue.ref(), vue.ref()];
|
12451
12488
|
const dragStatus = vue.ref();
|
12452
12489
|
const touch = useTouch();
|
12453
12490
|
const scope = vue.computed(() => Number(props.max) - Number(props.min));
|
@@ -12639,7 +12676,7 @@ var stdin_default$g = vue.defineComponent({
|
|
12639
12676
|
const renderButton = (index) => {
|
12640
12677
|
const current22 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
|
12641
12678
|
return vue.createVNode("div", {
|
12642
|
-
"ref": slider,
|
12679
|
+
"ref": slider[index != null ? index : 0],
|
12643
12680
|
"role": "slider",
|
12644
12681
|
"class": getButtonClassName(index),
|
12645
12682
|
"tabindex": props.disabled ? void 0 : 0,
|
@@ -12662,8 +12699,10 @@ var stdin_default$g = vue.defineComponent({
|
|
12662
12699
|
};
|
12663
12700
|
updateValue(props.modelValue);
|
12664
12701
|
use.useCustomFieldValue(() => props.modelValue);
|
12665
|
-
|
12666
|
-
|
12702
|
+
slider.forEach((item) => {
|
12703
|
+
use.useEventListener("touchmove", onTouchMove, {
|
12704
|
+
target: item
|
12705
|
+
});
|
12667
12706
|
});
|
12668
12707
|
return () => vue.createVNode("div", {
|
12669
12708
|
"ref": root,
|
@@ -14919,7 +14958,7 @@ const Lazyload = {
|
|
14919
14958
|
});
|
14920
14959
|
}
|
14921
14960
|
};
|
14922
|
-
const version = "4.0.
|
14961
|
+
const version = "4.0.10";
|
14923
14962
|
function install(app) {
|
14924
14963
|
const components = [
|
14925
14964
|
ActionBar,
|
@@ -15232,4 +15271,5 @@ exports.timePickerProps = timePickerProps;
|
|
15232
15271
|
exports.toastProps = toastProps;
|
15233
15272
|
exports.treeSelectProps = treeSelectProps;
|
15234
15273
|
exports.uploaderProps = uploaderProps;
|
15274
|
+
exports.useCurrentLang = useCurrentLang;
|
15235
15275
|
exports.version = version;
|
package/lib/vant.es.js
CHANGED
@@ -312,6 +312,7 @@ const Locale = {
|
|
312
312
|
deepAssign(messages, newMessages);
|
313
313
|
}
|
314
314
|
};
|
315
|
+
const useCurrentLang = () => lang;
|
315
316
|
var stdin_default$1M = Locale;
|
316
317
|
function createTranslate(name2) {
|
317
318
|
const prefix = camelize(name2) + ".";
|
@@ -2136,7 +2137,7 @@ const SWIPE_KEY = Symbol(name$1l);
|
|
2136
2137
|
var stdin_default$1w = defineComponent({
|
2137
2138
|
name: name$1l,
|
2138
2139
|
props: swipeProps,
|
2139
|
-
emits: ["change"],
|
2140
|
+
emits: ["change", "dragStart", "dragEnd"],
|
2140
2141
|
setup(props, {
|
2141
2142
|
emit,
|
2142
2143
|
slots
|
@@ -2151,6 +2152,7 @@ var stdin_default$1w = defineComponent({
|
|
2151
2152
|
active: 0,
|
2152
2153
|
swiping: false
|
2153
2154
|
});
|
2155
|
+
let dragging = false;
|
2154
2156
|
const touch = useTouch();
|
2155
2157
|
const {
|
2156
2158
|
children,
|
@@ -2321,9 +2323,10 @@ var stdin_default$1w = defineComponent({
|
|
2321
2323
|
const resize = () => initialize(state.active);
|
2322
2324
|
let touchStartTime;
|
2323
2325
|
const onTouchStart = (event) => {
|
2324
|
-
if (!props.touchable)
|
2326
|
+
if (!props.touchable || event.touches.length > 1)
|
2325
2327
|
return;
|
2326
2328
|
touch.start(event);
|
2329
|
+
dragging = false;
|
2327
2330
|
touchStartTime = Date.now();
|
2328
2331
|
stopAutoplay();
|
2329
2332
|
correctPosition();
|
@@ -2338,6 +2341,10 @@ var stdin_default$1w = defineComponent({
|
|
2338
2341
|
move({
|
2339
2342
|
offset: delta.value
|
2340
2343
|
});
|
2344
|
+
if (!dragging) {
|
2345
|
+
emit("dragStart");
|
2346
|
+
dragging = true;
|
2347
|
+
}
|
2341
2348
|
}
|
2342
2349
|
}
|
2343
2350
|
}
|
@@ -2366,7 +2373,9 @@ var stdin_default$1w = defineComponent({
|
|
2366
2373
|
pace: 0
|
2367
2374
|
});
|
2368
2375
|
}
|
2376
|
+
dragging = false;
|
2369
2377
|
state.swiping = false;
|
2378
|
+
emit("dragEnd");
|
2370
2379
|
autoplay();
|
2371
2380
|
};
|
2372
2381
|
const swipeTo = (index, options = {}) => {
|
@@ -3198,9 +3207,11 @@ var stdin_default$1q = defineComponent({
|
|
3198
3207
|
}
|
3199
3208
|
});
|
3200
3209
|
}
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3210
|
+
nextTick(() => {
|
3211
|
+
emit("change", extend({
|
3212
|
+
columnIndex
|
3213
|
+
}, getEventParams()));
|
3214
|
+
});
|
3204
3215
|
};
|
3205
3216
|
const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend({
|
3206
3217
|
columnIndex,
|
@@ -5587,6 +5598,7 @@ const backTopProps = {
|
|
5587
5598
|
bottom: numericProp,
|
5588
5599
|
target: [String, Object],
|
5589
5600
|
offset: makeNumericProp(200),
|
5601
|
+
immediate: Boolean,
|
5590
5602
|
teleport: {
|
5591
5603
|
type: [String, Object],
|
5592
5604
|
default: "body"
|
@@ -5614,7 +5626,7 @@ var stdin_default$1b = defineComponent({
|
|
5614
5626
|
emit("click", event);
|
5615
5627
|
(_a = scrollParent.value) == null ? void 0 : _a.scrollTo({
|
5616
5628
|
top: 0,
|
5617
|
-
behavior: "smooth"
|
5629
|
+
behavior: props.immediate ? "auto" : "smooth"
|
5618
5630
|
});
|
5619
5631
|
};
|
5620
5632
|
const scroll = () => {
|
@@ -6000,7 +6012,10 @@ var stdin_default$19 = defineComponent({
|
|
6000
6012
|
if (props.showMonthTitle) {
|
6001
6013
|
return createVNode("div", {
|
6002
6014
|
"class": bem$Z("month-title")
|
6003
|
-
}, [title
|
6015
|
+
}, [slots["month-title"] ? slots["month-title"]({
|
6016
|
+
date: props.date,
|
6017
|
+
text: title.value
|
6018
|
+
}) : title.value]);
|
6004
6019
|
}
|
6005
6020
|
};
|
6006
6021
|
const renderMark = () => {
|
@@ -6446,7 +6461,7 @@ var stdin_default$17 = defineComponent({
|
|
6446
6461
|
"firstDayOfWeek": dayOffset.value
|
6447
6462
|
}, pick(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
6448
6463
|
"onClick": onClickDay
|
6449
|
-
}), pick(slots, ["top-info", "bottom-info"]));
|
6464
|
+
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
6450
6465
|
};
|
6451
6466
|
const renderFooterButton = () => {
|
6452
6467
|
if (slots.footer) {
|
@@ -9533,7 +9548,8 @@ var stdin_default$I = defineComponent({
|
|
9533
9548
|
minZoom: makeRequiredProp(numericProp),
|
9534
9549
|
maxZoom: makeRequiredProp(numericProp),
|
9535
9550
|
rootWidth: makeRequiredProp(Number),
|
9536
|
-
rootHeight: makeRequiredProp(Number)
|
9551
|
+
rootHeight: makeRequiredProp(Number),
|
9552
|
+
disableZoom: Boolean
|
9537
9553
|
},
|
9538
9554
|
emits: ["scale", "close", "longPress"],
|
9539
9555
|
setup(props, {
|
@@ -9628,18 +9644,23 @@ var stdin_default$I = defineComponent({
|
|
9628
9644
|
let startDistance;
|
9629
9645
|
let doubleTapTimer;
|
9630
9646
|
let touchStartTime;
|
9647
|
+
let isImageMoved = false;
|
9631
9648
|
const onTouchStart = (event) => {
|
9632
9649
|
const {
|
9633
9650
|
touches
|
9634
9651
|
} = event;
|
9652
|
+
fingerNum = touches.length;
|
9653
|
+
if (fingerNum === 2 && props.disableZoom) {
|
9654
|
+
return;
|
9655
|
+
}
|
9635
9656
|
const {
|
9636
9657
|
offsetX
|
9637
9658
|
} = touch;
|
9638
9659
|
touch.start(event);
|
9639
|
-
fingerNum = touches.length;
|
9640
9660
|
startMoveX = state.moveX;
|
9641
9661
|
startMoveY = state.moveY;
|
9642
9662
|
touchStartTime = Date.now();
|
9663
|
+
isImageMoved = false;
|
9643
9664
|
state.moving = fingerNum === 1 && state.scale !== 1;
|
9644
9665
|
state.zooming = fingerNum === 2 && !offsetX.value;
|
9645
9666
|
if (state.zooming) {
|
@@ -9652,9 +9673,6 @@ var stdin_default$I = defineComponent({
|
|
9652
9673
|
touches
|
9653
9674
|
} = event;
|
9654
9675
|
touch.move(event);
|
9655
|
-
if (state.moving || state.zooming) {
|
9656
|
-
preventDefault(event, true);
|
9657
|
-
}
|
9658
9676
|
if (state.moving) {
|
9659
9677
|
const {
|
9660
9678
|
deltaX,
|
@@ -9662,13 +9680,22 @@ var stdin_default$I = defineComponent({
|
|
9662
9680
|
} = touch;
|
9663
9681
|
const moveX = deltaX.value + startMoveX;
|
9664
9682
|
const moveY = deltaY.value + startMoveY;
|
9683
|
+
if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved) {
|
9684
|
+
state.moving = false;
|
9685
|
+
return;
|
9686
|
+
}
|
9687
|
+
isImageMoved = true;
|
9688
|
+
preventDefault(event, true);
|
9665
9689
|
state.moveX = clamp(moveX, -maxMoveX.value, maxMoveX.value);
|
9666
9690
|
state.moveY = clamp(moveY, -maxMoveY.value, maxMoveY.value);
|
9667
9691
|
}
|
9668
|
-
if (state.zooming
|
9669
|
-
|
9670
|
-
|
9671
|
-
|
9692
|
+
if (state.zooming) {
|
9693
|
+
preventDefault(event, true);
|
9694
|
+
if (touches.length === 2) {
|
9695
|
+
const distance = getDistance(touches);
|
9696
|
+
const scale = startScale * distance / startDistance;
|
9697
|
+
setScale(scale);
|
9698
|
+
}
|
9672
9699
|
}
|
9673
9700
|
};
|
9674
9701
|
const checkTap = () => {
|
@@ -9778,7 +9805,7 @@ var stdin_default$I = defineComponent({
|
|
9778
9805
|
}
|
9779
9806
|
});
|
9780
9807
|
const [name$z, bem$y] = createNamespace("image-preview");
|
9781
|
-
const popupProps$1 = ["show", "
|
9808
|
+
const popupProps$1 = ["show", "teleport", "transition", "overlayStyle", "closeOnPopstate"];
|
9782
9809
|
const imagePreviewProps = {
|
9783
9810
|
show: Boolean,
|
9784
9811
|
loop: truthProp,
|
@@ -9813,7 +9840,8 @@ var stdin_default$H = defineComponent({
|
|
9813
9840
|
const state = reactive({
|
9814
9841
|
active: 0,
|
9815
9842
|
rootWidth: 0,
|
9816
|
-
rootHeight: 0
|
9843
|
+
rootHeight: 0,
|
9844
|
+
disableZoom: false
|
9817
9845
|
});
|
9818
9846
|
const resize = () => {
|
9819
9847
|
if (swipeRef.value) {
|
@@ -9853,6 +9881,12 @@ var stdin_default$H = defineComponent({
|
|
9853
9881
|
}, [slots.cover()]);
|
9854
9882
|
}
|
9855
9883
|
};
|
9884
|
+
const onDragStart = () => {
|
9885
|
+
state.disableZoom = true;
|
9886
|
+
};
|
9887
|
+
const onDragEnd = () => {
|
9888
|
+
state.disableZoom = false;
|
9889
|
+
};
|
9856
9890
|
const renderImages = () => createVNode(Swipe, {
|
9857
9891
|
"ref": swipeRef,
|
9858
9892
|
"lazyRender": true,
|
@@ -9862,7 +9896,9 @@ var stdin_default$H = defineComponent({
|
|
9862
9896
|
"initialSwipe": props.startPosition,
|
9863
9897
|
"showIndicators": props.showIndicators,
|
9864
9898
|
"indicatorColor": "white",
|
9865
|
-
"onChange": setActive
|
9899
|
+
"onChange": setActive,
|
9900
|
+
"onDragEnd": onDragEnd,
|
9901
|
+
"onDragStart": onDragStart
|
9866
9902
|
}, {
|
9867
9903
|
default: () => [props.images.map((image, index) => createVNode(stdin_default$I, {
|
9868
9904
|
"src": image,
|
@@ -9872,6 +9908,7 @@ var stdin_default$H = defineComponent({
|
|
9872
9908
|
"minZoom": props.minZoom,
|
9873
9909
|
"rootWidth": state.rootWidth,
|
9874
9910
|
"rootHeight": state.rootHeight,
|
9911
|
+
"disableZoom": state.disableZoom,
|
9875
9912
|
"onScale": emitScale,
|
9876
9913
|
"onClose": emitClose,
|
9877
9914
|
"onLongPress": () => emit("longPress", {
|
@@ -12445,7 +12482,7 @@ var stdin_default$g = defineComponent({
|
|
12445
12482
|
let current2;
|
12446
12483
|
let startValue;
|
12447
12484
|
const root = ref();
|
12448
|
-
const slider = ref();
|
12485
|
+
const slider = [ref(), ref()];
|
12449
12486
|
const dragStatus = ref();
|
12450
12487
|
const touch = useTouch();
|
12451
12488
|
const scope = computed(() => Number(props.max) - Number(props.min));
|
@@ -12637,7 +12674,7 @@ var stdin_default$g = defineComponent({
|
|
12637
12674
|
const renderButton = (index) => {
|
12638
12675
|
const current22 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
|
12639
12676
|
return createVNode("div", {
|
12640
|
-
"ref": slider,
|
12677
|
+
"ref": slider[index != null ? index : 0],
|
12641
12678
|
"role": "slider",
|
12642
12679
|
"class": getButtonClassName(index),
|
12643
12680
|
"tabindex": props.disabled ? void 0 : 0,
|
@@ -12660,8 +12697,10 @@ var stdin_default$g = defineComponent({
|
|
12660
12697
|
};
|
12661
12698
|
updateValue(props.modelValue);
|
12662
12699
|
useCustomFieldValue(() => props.modelValue);
|
12663
|
-
|
12664
|
-
|
12700
|
+
slider.forEach((item) => {
|
12701
|
+
useEventListener("touchmove", onTouchMove, {
|
12702
|
+
target: item
|
12703
|
+
});
|
12665
12704
|
});
|
12666
12705
|
return () => createVNode("div", {
|
12667
12706
|
"ref": root,
|
@@ -14917,7 +14956,7 @@ const Lazyload = {
|
|
14917
14956
|
});
|
14918
14957
|
}
|
14919
14958
|
};
|
14920
|
-
const version = "4.0.
|
14959
|
+
const version = "4.0.10";
|
14921
14960
|
function install(app) {
|
14922
14961
|
const components = [
|
14923
14962
|
ActionBar,
|
@@ -15231,5 +15270,6 @@ export {
|
|
15231
15270
|
toastProps,
|
15232
15271
|
treeSelectProps,
|
15233
15272
|
uploaderProps,
|
15273
|
+
useCurrentLang,
|
15234
15274
|
version
|
15235
15275
|
};
|