vant 4.6.4-beta.2 → 4.6.4
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/floating-panel/FloatingPanel.d.ts +13 -0
- package/es/floating-panel/FloatingPanel.mjs +2 -1
- package/es/floating-panel/index.d.ts +9 -0
- package/es/image-preview/ImagePreview.d.ts +13 -0
- package/es/image-preview/ImagePreview.mjs +2 -0
- package/es/image-preview/ImagePreviewItem.d.ts +3 -0
- package/es/image-preview/ImagePreviewItem.mjs +8 -3
- package/es/image-preview/function-call.mjs +1 -0
- package/es/image-preview/index.d.ts +9 -0
- package/es/image-preview/types.d.ts +1 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/list/List.d.ts +7 -4
- package/es/list/List.mjs +5 -3
- package/es/list/index.d.ts +2 -0
- package/es/locale/lang/sr-RS.d.ts +63 -0
- package/es/locale/lang/sr-RS.mjs +73 -0
- package/es/text-ellipsis/TextEllipsis.mjs +7 -7
- package/lib/floating-panel/FloatingPanel.d.ts +13 -0
- package/lib/floating-panel/FloatingPanel.js +2 -1
- package/lib/floating-panel/index.d.ts +9 -0
- package/lib/image-preview/ImagePreview.d.ts +13 -0
- package/lib/image-preview/ImagePreview.js +2 -0
- package/lib/image-preview/ImagePreviewItem.d.ts +3 -0
- package/lib/image-preview/ImagePreviewItem.js +8 -3
- package/lib/image-preview/function-call.js +1 -0
- package/lib/image-preview/index.d.ts +9 -0
- package/lib/image-preview/types.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/list/List.d.ts +7 -4
- package/lib/list/List.js +4 -2
- package/lib/list/index.d.ts +2 -0
- package/lib/locale/lang/sr-RS.d.ts +63 -0
- package/lib/locale/lang/sr-RS.js +92 -0
- package/lib/text-ellipsis/TextEllipsis.js +7 -7
- package/lib/vant.cjs.js +25 -14
- package/lib/vant.es.js +25 -14
- package/lib/vant.js +25 -14
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
package/lib/vant.es.js
CHANGED
@@ -9885,6 +9885,7 @@ const floatingPanelProps = {
|
|
9885
9885
|
anchors: makeArrayProp(),
|
9886
9886
|
duration: makeNumericProp(0.2),
|
9887
9887
|
contentDraggable: truthProp,
|
9888
|
+
lockScroll: truthProp,
|
9888
9889
|
safeAreaInsetBottom: truthProp
|
9889
9890
|
};
|
9890
9891
|
const [name$H, bem$H] = createNamespace("floating-panel");
|
@@ -9967,7 +9968,7 @@ var stdin_default$Q = defineComponent({
|
|
9967
9968
|
}, {
|
9968
9969
|
immediate: true
|
9969
9970
|
});
|
9970
|
-
useLockScroll(rootRef, () =>
|
9971
|
+
useLockScroll(rootRef, () => props2.lockScroll);
|
9971
9972
|
useEventListener("touchmove", onTouchmove, {
|
9972
9973
|
target: rootRef
|
9973
9974
|
});
|
@@ -10184,7 +10185,8 @@ var stdin_default$N = defineComponent({
|
|
10184
10185
|
maxZoom: makeRequiredProp(numericProp),
|
10185
10186
|
rootWidth: makeRequiredProp(Number),
|
10186
10187
|
rootHeight: makeRequiredProp(Number),
|
10187
|
-
disableZoom: Boolean
|
10188
|
+
disableZoom: Boolean,
|
10189
|
+
closeOnClickOverlay: Boolean
|
10188
10190
|
},
|
10189
10191
|
emits: ["scale", "close", "longPress"],
|
10190
10192
|
setup(props2, {
|
@@ -10344,7 +10346,8 @@ var stdin_default$N = defineComponent({
|
|
10344
10346
|
}
|
10345
10347
|
}
|
10346
10348
|
};
|
10347
|
-
const checkTap = () => {
|
10349
|
+
const checkTap = (event) => {
|
10350
|
+
var _a;
|
10348
10351
|
if (fingerNum > 1) {
|
10349
10352
|
return;
|
10350
10353
|
}
|
@@ -10361,6 +10364,9 @@ var stdin_default$N = defineComponent({
|
|
10361
10364
|
doubleTapTimer = null;
|
10362
10365
|
toggleScale();
|
10363
10366
|
} else {
|
10367
|
+
if (!props2.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
|
10368
|
+
return;
|
10369
|
+
}
|
10364
10370
|
doubleTapTimer = setTimeout(() => {
|
10365
10371
|
emit("close");
|
10366
10372
|
doubleTapTimer = null;
|
@@ -10398,7 +10404,7 @@ var stdin_default$N = defineComponent({
|
|
10398
10404
|
}
|
10399
10405
|
}
|
10400
10406
|
preventDefault(event, stopPropagation2);
|
10401
|
-
checkTap();
|
10407
|
+
checkTap(event);
|
10402
10408
|
touch.reset();
|
10403
10409
|
};
|
10404
10410
|
const resize = () => {
|
@@ -10495,6 +10501,7 @@ const imagePreviewProps = {
|
|
10495
10501
|
startPosition: makeNumericProp(0),
|
10496
10502
|
showIndicators: Boolean,
|
10497
10503
|
closeOnPopstate: truthProp,
|
10504
|
+
closeOnClickOverlay: truthProp,
|
10498
10505
|
closeIconPosition: makeStringProp("top-right"),
|
10499
10506
|
teleport: [String, Object]
|
10500
10507
|
};
|
@@ -10579,6 +10586,7 @@ var stdin_default$M = defineComponent({
|
|
10579
10586
|
"rootWidth": state.rootWidth,
|
10580
10587
|
"rootHeight": state.rootHeight,
|
10581
10588
|
"disableZoom": state.disableZoom,
|
10589
|
+
"closeOnClickOverlay": props2.closeOnClickOverlay,
|
10582
10590
|
"onScale": emitScale,
|
10583
10591
|
"onClose": emitClose,
|
10584
10592
|
"onLongPress": () => emit("longPress", {
|
@@ -10661,6 +10669,7 @@ const defaultConfig = {
|
|
10661
10669
|
swipeDuration: 300,
|
10662
10670
|
showIndicators: false,
|
10663
10671
|
closeOnPopstate: true,
|
10672
|
+
closeOnClickOverlay: true,
|
10664
10673
|
closeIconPosition: "top-right"
|
10665
10674
|
};
|
10666
10675
|
function initInstance$1() {
|
@@ -10999,6 +11008,7 @@ const listProps = {
|
|
10999
11008
|
loading: Boolean,
|
11000
11009
|
disabled: Boolean,
|
11001
11010
|
finished: Boolean,
|
11011
|
+
scroller: Object,
|
11002
11012
|
errorText: String,
|
11003
11013
|
direction: makeStringProp("down"),
|
11004
11014
|
loadingText: String,
|
@@ -11018,6 +11028,7 @@ var stdin_default$J = defineComponent({
|
|
11018
11028
|
const placeholder = ref();
|
11019
11029
|
const tabStatus = useTabStatus();
|
11020
11030
|
const scrollParent = useScrollParent(root);
|
11031
|
+
const scroller = computed(() => props2.scroller || scrollParent.value);
|
11021
11032
|
const check = () => {
|
11022
11033
|
nextTick(() => {
|
11023
11034
|
if (loading.value || props2.finished || props2.disabled || props2.error || // skip check when inside an inactive tab
|
@@ -11028,7 +11039,7 @@ var stdin_default$J = defineComponent({
|
|
11028
11039
|
direction
|
11029
11040
|
} = props2;
|
11030
11041
|
const offset = +props2.offset;
|
11031
|
-
const scrollParentRect = useRect(
|
11042
|
+
const scrollParentRect = useRect(scroller);
|
11032
11043
|
if (!scrollParentRect.height || isHidden(root)) {
|
11033
11044
|
return;
|
11034
11045
|
}
|
@@ -11104,7 +11115,7 @@ var stdin_default$J = defineComponent({
|
|
11104
11115
|
check
|
11105
11116
|
});
|
11106
11117
|
useEventListener("scroll", check, {
|
11107
|
-
target:
|
11118
|
+
target: scroller,
|
11108
11119
|
passive: true
|
11109
11120
|
});
|
11110
11121
|
return () => {
|
@@ -14622,7 +14633,7 @@ var stdin_default$9 = defineComponent({
|
|
14622
14633
|
const expanded = ref(false);
|
14623
14634
|
const hasAction = ref(false);
|
14624
14635
|
const root = ref();
|
14625
|
-
const actionText = computed(() => expanded.value ? props2.
|
14636
|
+
const actionText = computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
14626
14637
|
const pxToNum = (value) => {
|
14627
14638
|
if (!value)
|
14628
14639
|
return 0;
|
@@ -14664,7 +14675,7 @@ var stdin_default$9 = defineComponent({
|
|
14664
14675
|
}
|
14665
14676
|
return dots + content.slice(right, end);
|
14666
14677
|
}
|
14667
|
-
const middle2 = Math.round(left + right
|
14678
|
+
const middle2 = Math.round((left + right) / 2);
|
14668
14679
|
if (position === "end") {
|
14669
14680
|
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
14670
14681
|
} else {
|
@@ -14685,11 +14696,11 @@ var stdin_default$9 = defineComponent({
|
|
14685
14696
|
};
|
14686
14697
|
const middleTail = (leftPart, rightPart) => {
|
14687
14698
|
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
14688
|
-
return content.slice(0, leftPart[
|
14699
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
14689
14700
|
}
|
14690
|
-
const leftMiddle = Math.floor(leftPart[0] + leftPart[1]
|
14691
|
-
const rightMiddle = Math.ceil(rightPart[0] + rightPart[1]
|
14692
|
-
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots +
|
14701
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
14702
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
14703
|
+
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end) + props2.expandText;
|
14693
14704
|
if (container2.offsetHeight >= maxHeight2) {
|
14694
14705
|
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
14695
14706
|
}
|
@@ -14724,7 +14735,7 @@ var stdin_default$9 = defineComponent({
|
|
14724
14735
|
const renderAction = () => createVNode("span", {
|
14725
14736
|
"class": bem$3("action"),
|
14726
14737
|
"onClick": onClickAction
|
14727
|
-
}, [
|
14738
|
+
}, [actionText.value]);
|
14728
14739
|
onMounted(calcEllipsised);
|
14729
14740
|
watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
|
14730
14741
|
useEventListener("resize", calcEllipsised);
|
@@ -16385,7 +16396,7 @@ const Lazyload = {
|
|
16385
16396
|
});
|
16386
16397
|
}
|
16387
16398
|
};
|
16388
|
-
const version = "4.6.4
|
16399
|
+
const version = "4.6.4";
|
16389
16400
|
function install(app) {
|
16390
16401
|
const components = [
|
16391
16402
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -10320,6 +10320,7 @@
|
|
10320
10320
|
anchors: makeArrayProp(),
|
10321
10321
|
duration: makeNumericProp(0.2),
|
10322
10322
|
contentDraggable: truthProp,
|
10323
|
+
lockScroll: truthProp,
|
10323
10324
|
safeAreaInsetBottom: truthProp
|
10324
10325
|
};
|
10325
10326
|
const [name$H, bem$H] = createNamespace("floating-panel");
|
@@ -10402,7 +10403,7 @@
|
|
10402
10403
|
}, {
|
10403
10404
|
immediate: true
|
10404
10405
|
});
|
10405
|
-
useLockScroll(rootRef, () =>
|
10406
|
+
useLockScroll(rootRef, () => props2.lockScroll);
|
10406
10407
|
useEventListener("touchmove", onTouchmove, {
|
10407
10408
|
target: rootRef
|
10408
10409
|
});
|
@@ -10616,7 +10617,8 @@
|
|
10616
10617
|
maxZoom: makeRequiredProp(numericProp),
|
10617
10618
|
rootWidth: makeRequiredProp(Number),
|
10618
10619
|
rootHeight: makeRequiredProp(Number),
|
10619
|
-
disableZoom: Boolean
|
10620
|
+
disableZoom: Boolean,
|
10621
|
+
closeOnClickOverlay: Boolean
|
10620
10622
|
},
|
10621
10623
|
emits: ["scale", "close", "longPress"],
|
10622
10624
|
setup(props2, {
|
@@ -10776,7 +10778,8 @@
|
|
10776
10778
|
}
|
10777
10779
|
}
|
10778
10780
|
};
|
10779
|
-
const checkTap = () => {
|
10781
|
+
const checkTap = (event) => {
|
10782
|
+
var _a;
|
10780
10783
|
if (fingerNum > 1) {
|
10781
10784
|
return;
|
10782
10785
|
}
|
@@ -10793,6 +10796,9 @@
|
|
10793
10796
|
doubleTapTimer = null;
|
10794
10797
|
toggleScale();
|
10795
10798
|
} else {
|
10799
|
+
if (!props2.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
|
10800
|
+
return;
|
10801
|
+
}
|
10796
10802
|
doubleTapTimer = setTimeout(() => {
|
10797
10803
|
emit("close");
|
10798
10804
|
doubleTapTimer = null;
|
@@ -10830,7 +10836,7 @@
|
|
10830
10836
|
}
|
10831
10837
|
}
|
10832
10838
|
preventDefault(event, stopPropagation2);
|
10833
|
-
checkTap();
|
10839
|
+
checkTap(event);
|
10834
10840
|
touch.reset();
|
10835
10841
|
};
|
10836
10842
|
const resize = () => {
|
@@ -10927,6 +10933,7 @@
|
|
10927
10933
|
startPosition: makeNumericProp(0),
|
10928
10934
|
showIndicators: Boolean,
|
10929
10935
|
closeOnPopstate: truthProp,
|
10936
|
+
closeOnClickOverlay: truthProp,
|
10930
10937
|
closeIconPosition: makeStringProp("top-right"),
|
10931
10938
|
teleport: [String, Object]
|
10932
10939
|
};
|
@@ -11011,6 +11018,7 @@
|
|
11011
11018
|
"rootWidth": state.rootWidth,
|
11012
11019
|
"rootHeight": state.rootHeight,
|
11013
11020
|
"disableZoom": state.disableZoom,
|
11021
|
+
"closeOnClickOverlay": props2.closeOnClickOverlay,
|
11014
11022
|
"onScale": emitScale,
|
11015
11023
|
"onClose": emitClose,
|
11016
11024
|
"onLongPress": () => emit("longPress", {
|
@@ -11093,6 +11101,7 @@
|
|
11093
11101
|
swipeDuration: 300,
|
11094
11102
|
showIndicators: false,
|
11095
11103
|
closeOnPopstate: true,
|
11104
|
+
closeOnClickOverlay: true,
|
11096
11105
|
closeIconPosition: "top-right"
|
11097
11106
|
};
|
11098
11107
|
function initInstance$1() {
|
@@ -11428,6 +11437,7 @@
|
|
11428
11437
|
loading: Boolean,
|
11429
11438
|
disabled: Boolean,
|
11430
11439
|
finished: Boolean,
|
11440
|
+
scroller: Object,
|
11431
11441
|
errorText: String,
|
11432
11442
|
direction: makeStringProp("down"),
|
11433
11443
|
loadingText: String,
|
@@ -11447,6 +11457,7 @@
|
|
11447
11457
|
const placeholder = vue.ref();
|
11448
11458
|
const tabStatus = useTabStatus();
|
11449
11459
|
const scrollParent = useScrollParent(root);
|
11460
|
+
const scroller = vue.computed(() => props2.scroller || scrollParent.value);
|
11450
11461
|
const check = () => {
|
11451
11462
|
vue.nextTick(() => {
|
11452
11463
|
if (loading.value || props2.finished || props2.disabled || props2.error || // skip check when inside an inactive tab
|
@@ -11457,7 +11468,7 @@
|
|
11457
11468
|
direction
|
11458
11469
|
} = props2;
|
11459
11470
|
const offset2 = +props2.offset;
|
11460
|
-
const scrollParentRect = useRect(
|
11471
|
+
const scrollParentRect = useRect(scroller);
|
11461
11472
|
if (!scrollParentRect.height || isHidden(root)) {
|
11462
11473
|
return;
|
11463
11474
|
}
|
@@ -11533,7 +11544,7 @@
|
|
11533
11544
|
check
|
11534
11545
|
});
|
11535
11546
|
useEventListener("scroll", check, {
|
11536
|
-
target:
|
11547
|
+
target: scroller,
|
11537
11548
|
passive: true
|
11538
11549
|
});
|
11539
11550
|
return () => {
|
@@ -15854,7 +15865,7 @@
|
|
15854
15865
|
const expanded = vue.ref(false);
|
15855
15866
|
const hasAction = vue.ref(false);
|
15856
15867
|
const root = vue.ref();
|
15857
|
-
const actionText = vue.computed(() => expanded.value ? props2.
|
15868
|
+
const actionText = vue.computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
15858
15869
|
const pxToNum = (value) => {
|
15859
15870
|
if (!value)
|
15860
15871
|
return 0;
|
@@ -15896,7 +15907,7 @@
|
|
15896
15907
|
}
|
15897
15908
|
return dots + content.slice(right2, end2);
|
15898
15909
|
}
|
15899
|
-
const middle2 = Math.round(left2 + right2
|
15910
|
+
const middle2 = Math.round((left2 + right2) / 2);
|
15900
15911
|
if (position === "end") {
|
15901
15912
|
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
15902
15913
|
} else {
|
@@ -15917,11 +15928,11 @@
|
|
15917
15928
|
};
|
15918
15929
|
const middleTail = (leftPart, rightPart) => {
|
15919
15930
|
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
15920
|
-
return content.slice(0, leftPart[
|
15931
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
|
15921
15932
|
}
|
15922
|
-
const leftMiddle = Math.floor(leftPart[0] + leftPart[1]
|
15923
|
-
const rightMiddle = Math.ceil(rightPart[0] + rightPart[1]
|
15924
|
-
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots +
|
15933
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
15934
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
15935
|
+
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end2) + props2.expandText;
|
15925
15936
|
if (container2.offsetHeight >= maxHeight2) {
|
15926
15937
|
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
15927
15938
|
}
|
@@ -15956,7 +15967,7 @@
|
|
15956
15967
|
const renderAction = () => vue.createVNode("span", {
|
15957
15968
|
"class": bem$3("action"),
|
15958
15969
|
"onClick": onClickAction
|
15959
|
-
}, [
|
15970
|
+
}, [actionText.value]);
|
15960
15971
|
vue.onMounted(calcEllipsised);
|
15961
15972
|
vue.watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
|
15962
15973
|
useEventListener("resize", calcEllipsised);
|
@@ -17597,7 +17608,7 @@
|
|
17597
17608
|
});
|
17598
17609
|
}
|
17599
17610
|
};
|
17600
|
-
const version = "4.6.4
|
17611
|
+
const version = "4.6.4";
|
17601
17612
|
function install(app) {
|
17602
17613
|
const components = [
|
17603
17614
|
ActionBar,
|