vant 4.6.4-beta.2 → 4.6.5
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 +4 -1
- package/es/dropdown-menu/DropdownMenu.d.ts +3 -0
- package/es/dropdown-menu/DropdownMenu.mjs +7 -3
- package/es/dropdown-menu/index.css +1 -1
- package/es/dropdown-menu/index.d.ts +2 -0
- package/es/floating-bubble/FloatingBubble.mjs +6 -4
- package/es/floating-panel/FloatingPanel.d.ts +4 -0
- package/es/floating-panel/FloatingPanel.mjs +14 -8
- package/es/floating-panel/index.d.ts +3 -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/es/toast/index.d.ts +1 -1
- package/lib/dropdown-menu/DropdownMenu.d.ts +3 -0
- package/lib/dropdown-menu/DropdownMenu.js +7 -3
- package/lib/dropdown-menu/index.css +1 -1
- package/lib/dropdown-menu/index.d.ts +2 -0
- package/lib/floating-bubble/FloatingBubble.js +5 -3
- package/lib/floating-panel/FloatingPanel.d.ts +4 -0
- package/lib/floating-panel/FloatingPanel.js +12 -6
- package/lib/floating-panel/index.d.ts +3 -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.css +1 -1
- 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/toast/index.d.ts +1 -1
- package/lib/vant.cjs.js +47 -25
- package/lib/vant.es.js +47 -25
- package/lib/vant.js +47 -25
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +3 -3
package/lib/vant.es.js
CHANGED
@@ -9416,7 +9416,8 @@ const dropdownMenuProps = {
|
|
9416
9416
|
direction: makeStringProp("down"),
|
9417
9417
|
activeColor: String,
|
9418
9418
|
closeOnClickOutside: truthProp,
|
9419
|
-
closeOnClickOverlay: truthProp
|
9419
|
+
closeOnClickOverlay: truthProp,
|
9420
|
+
swipeThreshold: numericProp
|
9420
9421
|
};
|
9421
9422
|
const DROPDOWN_KEY = Symbol(name$K);
|
9422
9423
|
var stdin_default$T = defineComponent({
|
@@ -9435,6 +9436,7 @@ var stdin_default$T = defineComponent({
|
|
9435
9436
|
} = useChildren(DROPDOWN_KEY);
|
9436
9437
|
const scrollParent = useScrollParent(root);
|
9437
9438
|
const opened = computed(() => children.some((item) => item.state.showWrapper));
|
9439
|
+
const scrollable = computed(() => props2.swipeThreshold && children.length > +props2.swipeThreshold);
|
9438
9440
|
const barStyle = computed(() => {
|
9439
9441
|
if (opened.value && isDef(props2.zIndex)) {
|
9440
9442
|
return {
|
@@ -9491,7 +9493,8 @@ var stdin_default$T = defineComponent({
|
|
9491
9493
|
"role": "button",
|
9492
9494
|
"tabindex": disabled ? void 0 : 0,
|
9493
9495
|
"class": [bem$K("item", {
|
9494
|
-
disabled
|
9496
|
+
disabled,
|
9497
|
+
grow: scrollable.value
|
9495
9498
|
}), {
|
9496
9499
|
[HAPTICS_FEEDBACK]: !disabled
|
9497
9500
|
}],
|
@@ -9535,7 +9538,8 @@ var stdin_default$T = defineComponent({
|
|
9535
9538
|
"ref": barRef,
|
9536
9539
|
"style": barStyle.value,
|
9537
9540
|
"class": bem$K("bar", {
|
9538
|
-
opened: opened.value
|
9541
|
+
opened: opened.value,
|
9542
|
+
scrollable: scrollable.value
|
9539
9543
|
})
|
9540
9544
|
}, [children.map(renderTitle)]), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
9541
9545
|
};
|
@@ -9734,11 +9738,13 @@ const floatingBubbleProps = {
|
|
9734
9738
|
const [name$I, bem$I] = createNamespace("floating-bubble");
|
9735
9739
|
var stdin_default$R = defineComponent({
|
9736
9740
|
name: name$I,
|
9741
|
+
inheritAttrs: false,
|
9737
9742
|
props: floatingBubbleProps,
|
9738
9743
|
emits: ["click", "update:offset", "offsetChange"],
|
9739
9744
|
setup(props2, {
|
9740
9745
|
slots,
|
9741
|
-
emit
|
9746
|
+
emit,
|
9747
|
+
attrs
|
9742
9748
|
}) {
|
9743
9749
|
const rootRef = ref();
|
9744
9750
|
const state = ref({
|
@@ -9859,7 +9865,7 @@ var stdin_default$R = defineComponent({
|
|
9859
9865
|
}
|
9860
9866
|
});
|
9861
9867
|
return () => {
|
9862
|
-
const Content = withDirectives(createVNode("div", {
|
9868
|
+
const Content = withDirectives(createVNode("div", mergeProps({
|
9863
9869
|
"class": bem$I(),
|
9864
9870
|
"ref": rootRef,
|
9865
9871
|
"onTouchstartPassive": onTouchStart,
|
@@ -9867,7 +9873,7 @@ var stdin_default$R = defineComponent({
|
|
9867
9873
|
"onTouchcancel": onTouchEnd,
|
9868
9874
|
"onClick": onClick,
|
9869
9875
|
"style": rootStyle.value
|
9870
|
-
}, [slots.default ? slots.default() : createVNode(stdin_default$1P, {
|
9876
|
+
}, attrs), [slots.default ? slots.default() : createVNode(stdin_default$1P, {
|
9871
9877
|
"name": props2.icon,
|
9872
9878
|
"class": bem$I("icon")
|
9873
9879
|
}, null)]), [[vShow, show.value]]);
|
@@ -9885,10 +9891,10 @@ const floatingPanelProps = {
|
|
9885
9891
|
anchors: makeArrayProp(),
|
9886
9892
|
duration: makeNumericProp(0.2),
|
9887
9893
|
contentDraggable: truthProp,
|
9894
|
+
lockScroll: Boolean,
|
9888
9895
|
safeAreaInsetBottom: truthProp
|
9889
9896
|
};
|
9890
9897
|
const [name$H, bem$H] = createNamespace("floating-panel");
|
9891
|
-
const DAMP = 0.2;
|
9892
9898
|
var stdin_default$Q = defineComponent({
|
9893
9899
|
name: name$H,
|
9894
9900
|
props: floatingPanelProps,
|
@@ -9897,6 +9903,7 @@ var stdin_default$Q = defineComponent({
|
|
9897
9903
|
emit,
|
9898
9904
|
slots
|
9899
9905
|
}) {
|
9906
|
+
const DAMP = 0.2;
|
9900
9907
|
const rootRef = ref();
|
9901
9908
|
const contentRef = ref();
|
9902
9909
|
const height = useSyncPropRef(() => +props2.height, (value) => emit("update:height", value));
|
@@ -9929,24 +9936,28 @@ var stdin_default$Q = defineComponent({
|
|
9929
9936
|
return moveY;
|
9930
9937
|
};
|
9931
9938
|
let startY;
|
9939
|
+
let maxScroll = -1;
|
9932
9940
|
const touch = useTouch();
|
9933
9941
|
const onTouchstart = (e) => {
|
9934
9942
|
touch.start(e);
|
9935
9943
|
dragging.value = true;
|
9936
9944
|
startY = -height.value;
|
9945
|
+
maxScroll = -1;
|
9937
9946
|
};
|
9938
9947
|
const onTouchmove = (e) => {
|
9939
9948
|
var _a;
|
9940
9949
|
touch.move(e);
|
9941
9950
|
const target = e.target;
|
9942
9951
|
if (contentRef.value === target || ((_a = contentRef.value) == null ? void 0 : _a.contains(target))) {
|
9952
|
+
const {
|
9953
|
+
scrollTop
|
9954
|
+
} = contentRef.value;
|
9955
|
+
maxScroll = Math.max(maxScroll, scrollTop);
|
9943
9956
|
if (!props2.contentDraggable)
|
9944
9957
|
return;
|
9945
9958
|
if (-startY < boundary.value.max) {
|
9946
|
-
|
9947
|
-
|
9948
|
-
e.stopPropagation();
|
9949
|
-
} else if (!(contentRef.value.scrollTop <= 0 && touch.deltaY.value > 0)) {
|
9959
|
+
preventDefault(e, true);
|
9960
|
+
} else if (!(scrollTop <= 0 && touch.deltaY.value > 0) || maxScroll > 0) {
|
9950
9961
|
return;
|
9951
9962
|
}
|
9952
9963
|
}
|
@@ -9954,6 +9965,7 @@ var stdin_default$Q = defineComponent({
|
|
9954
9965
|
height.value = -ease(moveY);
|
9955
9966
|
};
|
9956
9967
|
const onTouchend = () => {
|
9968
|
+
maxScroll = -1;
|
9957
9969
|
dragging.value = false;
|
9958
9970
|
height.value = closest(anchors.value, height.value);
|
9959
9971
|
if (height.value !== -startY) {
|
@@ -9967,7 +9979,7 @@ var stdin_default$Q = defineComponent({
|
|
9967
9979
|
}, {
|
9968
9980
|
immediate: true
|
9969
9981
|
});
|
9970
|
-
useLockScroll(rootRef, () =>
|
9982
|
+
useLockScroll(rootRef, () => props2.lockScroll);
|
9971
9983
|
useEventListener("touchmove", onTouchmove, {
|
9972
9984
|
target: rootRef
|
9973
9985
|
});
|
@@ -10184,7 +10196,8 @@ var stdin_default$N = defineComponent({
|
|
10184
10196
|
maxZoom: makeRequiredProp(numericProp),
|
10185
10197
|
rootWidth: makeRequiredProp(Number),
|
10186
10198
|
rootHeight: makeRequiredProp(Number),
|
10187
|
-
disableZoom: Boolean
|
10199
|
+
disableZoom: Boolean,
|
10200
|
+
closeOnClickOverlay: Boolean
|
10188
10201
|
},
|
10189
10202
|
emits: ["scale", "close", "longPress"],
|
10190
10203
|
setup(props2, {
|
@@ -10344,7 +10357,8 @@ var stdin_default$N = defineComponent({
|
|
10344
10357
|
}
|
10345
10358
|
}
|
10346
10359
|
};
|
10347
|
-
const checkTap = () => {
|
10360
|
+
const checkTap = (event) => {
|
10361
|
+
var _a;
|
10348
10362
|
if (fingerNum > 1) {
|
10349
10363
|
return;
|
10350
10364
|
}
|
@@ -10361,6 +10375,9 @@ var stdin_default$N = defineComponent({
|
|
10361
10375
|
doubleTapTimer = null;
|
10362
10376
|
toggleScale();
|
10363
10377
|
} else {
|
10378
|
+
if (!props2.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
|
10379
|
+
return;
|
10380
|
+
}
|
10364
10381
|
doubleTapTimer = setTimeout(() => {
|
10365
10382
|
emit("close");
|
10366
10383
|
doubleTapTimer = null;
|
@@ -10398,7 +10415,7 @@ var stdin_default$N = defineComponent({
|
|
10398
10415
|
}
|
10399
10416
|
}
|
10400
10417
|
preventDefault(event, stopPropagation2);
|
10401
|
-
checkTap();
|
10418
|
+
checkTap(event);
|
10402
10419
|
touch.reset();
|
10403
10420
|
};
|
10404
10421
|
const resize = () => {
|
@@ -10495,6 +10512,7 @@ const imagePreviewProps = {
|
|
10495
10512
|
startPosition: makeNumericProp(0),
|
10496
10513
|
showIndicators: Boolean,
|
10497
10514
|
closeOnPopstate: truthProp,
|
10515
|
+
closeOnClickOverlay: truthProp,
|
10498
10516
|
closeIconPosition: makeStringProp("top-right"),
|
10499
10517
|
teleport: [String, Object]
|
10500
10518
|
};
|
@@ -10579,6 +10597,7 @@ var stdin_default$M = defineComponent({
|
|
10579
10597
|
"rootWidth": state.rootWidth,
|
10580
10598
|
"rootHeight": state.rootHeight,
|
10581
10599
|
"disableZoom": state.disableZoom,
|
10600
|
+
"closeOnClickOverlay": props2.closeOnClickOverlay,
|
10582
10601
|
"onScale": emitScale,
|
10583
10602
|
"onClose": emitClose,
|
10584
10603
|
"onLongPress": () => emit("longPress", {
|
@@ -10661,6 +10680,7 @@ const defaultConfig = {
|
|
10661
10680
|
swipeDuration: 300,
|
10662
10681
|
showIndicators: false,
|
10663
10682
|
closeOnPopstate: true,
|
10683
|
+
closeOnClickOverlay: true,
|
10664
10684
|
closeIconPosition: "top-right"
|
10665
10685
|
};
|
10666
10686
|
function initInstance$1() {
|
@@ -10999,6 +11019,7 @@ const listProps = {
|
|
10999
11019
|
loading: Boolean,
|
11000
11020
|
disabled: Boolean,
|
11001
11021
|
finished: Boolean,
|
11022
|
+
scroller: Object,
|
11002
11023
|
errorText: String,
|
11003
11024
|
direction: makeStringProp("down"),
|
11004
11025
|
loadingText: String,
|
@@ -11018,6 +11039,7 @@ var stdin_default$J = defineComponent({
|
|
11018
11039
|
const placeholder = ref();
|
11019
11040
|
const tabStatus = useTabStatus();
|
11020
11041
|
const scrollParent = useScrollParent(root);
|
11042
|
+
const scroller = computed(() => props2.scroller || scrollParent.value);
|
11021
11043
|
const check = () => {
|
11022
11044
|
nextTick(() => {
|
11023
11045
|
if (loading.value || props2.finished || props2.disabled || props2.error || // skip check when inside an inactive tab
|
@@ -11028,7 +11050,7 @@ var stdin_default$J = defineComponent({
|
|
11028
11050
|
direction
|
11029
11051
|
} = props2;
|
11030
11052
|
const offset = +props2.offset;
|
11031
|
-
const scrollParentRect = useRect(
|
11053
|
+
const scrollParentRect = useRect(scroller);
|
11032
11054
|
if (!scrollParentRect.height || isHidden(root)) {
|
11033
11055
|
return;
|
11034
11056
|
}
|
@@ -11104,7 +11126,7 @@ var stdin_default$J = defineComponent({
|
|
11104
11126
|
check
|
11105
11127
|
});
|
11106
11128
|
useEventListener("scroll", check, {
|
11107
|
-
target:
|
11129
|
+
target: scroller,
|
11108
11130
|
passive: true
|
11109
11131
|
});
|
11110
11132
|
return () => {
|
@@ -14622,7 +14644,7 @@ var stdin_default$9 = defineComponent({
|
|
14622
14644
|
const expanded = ref(false);
|
14623
14645
|
const hasAction = ref(false);
|
14624
14646
|
const root = ref();
|
14625
|
-
const actionText = computed(() => expanded.value ? props2.
|
14647
|
+
const actionText = computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
14626
14648
|
const pxToNum = (value) => {
|
14627
14649
|
if (!value)
|
14628
14650
|
return 0;
|
@@ -14664,7 +14686,7 @@ var stdin_default$9 = defineComponent({
|
|
14664
14686
|
}
|
14665
14687
|
return dots + content.slice(right, end);
|
14666
14688
|
}
|
14667
|
-
const middle2 = Math.round(left + right
|
14689
|
+
const middle2 = Math.round((left + right) / 2);
|
14668
14690
|
if (position === "end") {
|
14669
14691
|
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
14670
14692
|
} else {
|
@@ -14685,11 +14707,11 @@ var stdin_default$9 = defineComponent({
|
|
14685
14707
|
};
|
14686
14708
|
const middleTail = (leftPart, rightPart) => {
|
14687
14709
|
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
14688
|
-
return content.slice(0, leftPart[
|
14710
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
14689
14711
|
}
|
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 +
|
14712
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
14713
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
14714
|
+
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end) + props2.expandText;
|
14693
14715
|
if (container2.offsetHeight >= maxHeight2) {
|
14694
14716
|
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
14695
14717
|
}
|
@@ -14724,7 +14746,7 @@ var stdin_default$9 = defineComponent({
|
|
14724
14746
|
const renderAction = () => createVNode("span", {
|
14725
14747
|
"class": bem$3("action"),
|
14726
14748
|
"onClick": onClickAction
|
14727
|
-
}, [
|
14749
|
+
}, [actionText.value]);
|
14728
14750
|
onMounted(calcEllipsised);
|
14729
14751
|
watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
|
14730
14752
|
useEventListener("resize", calcEllipsised);
|
@@ -16385,7 +16407,7 @@ const Lazyload = {
|
|
16385
16407
|
});
|
16386
16408
|
}
|
16387
16409
|
};
|
16388
|
-
const version = "4.6.
|
16410
|
+
const version = "4.6.5";
|
16389
16411
|
function install(app) {
|
16390
16412
|
const components = [
|
16391
16413
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -9854,7 +9854,8 @@
|
|
9854
9854
|
direction: makeStringProp("down"),
|
9855
9855
|
activeColor: String,
|
9856
9856
|
closeOnClickOutside: truthProp,
|
9857
|
-
closeOnClickOverlay: truthProp
|
9857
|
+
closeOnClickOverlay: truthProp,
|
9858
|
+
swipeThreshold: numericProp
|
9858
9859
|
};
|
9859
9860
|
const DROPDOWN_KEY = Symbol(name$K);
|
9860
9861
|
var stdin_default$T = vue.defineComponent({
|
@@ -9873,6 +9874,7 @@
|
|
9873
9874
|
} = useChildren(DROPDOWN_KEY);
|
9874
9875
|
const scrollParent = useScrollParent(root);
|
9875
9876
|
const opened = vue.computed(() => children.some((item) => item.state.showWrapper));
|
9877
|
+
const scrollable = vue.computed(() => props2.swipeThreshold && children.length > +props2.swipeThreshold);
|
9876
9878
|
const barStyle = vue.computed(() => {
|
9877
9879
|
if (opened.value && isDef(props2.zIndex)) {
|
9878
9880
|
return {
|
@@ -9929,7 +9931,8 @@
|
|
9929
9931
|
"role": "button",
|
9930
9932
|
"tabindex": disabled ? void 0 : 0,
|
9931
9933
|
"class": [bem$K("item", {
|
9932
|
-
disabled
|
9934
|
+
disabled,
|
9935
|
+
grow: scrollable.value
|
9933
9936
|
}), {
|
9934
9937
|
[HAPTICS_FEEDBACK]: !disabled
|
9935
9938
|
}],
|
@@ -9973,7 +9976,8 @@
|
|
9973
9976
|
"ref": barRef,
|
9974
9977
|
"style": barStyle.value,
|
9975
9978
|
"class": bem$K("bar", {
|
9976
|
-
opened: opened.value
|
9979
|
+
opened: opened.value,
|
9980
|
+
scrollable: scrollable.value
|
9977
9981
|
})
|
9978
9982
|
}, [children.map(renderTitle)]), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
9979
9983
|
};
|
@@ -10169,11 +10173,13 @@
|
|
10169
10173
|
const [name$I, bem$I] = createNamespace("floating-bubble");
|
10170
10174
|
var stdin_default$R = vue.defineComponent({
|
10171
10175
|
name: name$I,
|
10176
|
+
inheritAttrs: false,
|
10172
10177
|
props: floatingBubbleProps,
|
10173
10178
|
emits: ["click", "update:offset", "offsetChange"],
|
10174
10179
|
setup(props2, {
|
10175
10180
|
slots,
|
10176
|
-
emit
|
10181
|
+
emit,
|
10182
|
+
attrs
|
10177
10183
|
}) {
|
10178
10184
|
const rootRef = vue.ref();
|
10179
10185
|
const state = vue.ref({
|
@@ -10294,7 +10300,7 @@
|
|
10294
10300
|
}
|
10295
10301
|
});
|
10296
10302
|
return () => {
|
10297
|
-
const Content = vue.withDirectives(vue.createVNode("div", {
|
10303
|
+
const Content = vue.withDirectives(vue.createVNode("div", vue.mergeProps({
|
10298
10304
|
"class": bem$I(),
|
10299
10305
|
"ref": rootRef,
|
10300
10306
|
"onTouchstartPassive": onTouchStart,
|
@@ -10302,7 +10308,7 @@
|
|
10302
10308
|
"onTouchcancel": onTouchEnd,
|
10303
10309
|
"onClick": onClick,
|
10304
10310
|
"style": rootStyle.value
|
10305
|
-
}, [slots.default ? slots.default() : vue.createVNode(stdin_default$1P, {
|
10311
|
+
}, attrs), [slots.default ? slots.default() : vue.createVNode(stdin_default$1P, {
|
10306
10312
|
"name": props2.icon,
|
10307
10313
|
"class": bem$I("icon")
|
10308
10314
|
}, null)]), [[vue.vShow, show.value]]);
|
@@ -10320,10 +10326,10 @@
|
|
10320
10326
|
anchors: makeArrayProp(),
|
10321
10327
|
duration: makeNumericProp(0.2),
|
10322
10328
|
contentDraggable: truthProp,
|
10329
|
+
lockScroll: Boolean,
|
10323
10330
|
safeAreaInsetBottom: truthProp
|
10324
10331
|
};
|
10325
10332
|
const [name$H, bem$H] = createNamespace("floating-panel");
|
10326
|
-
const DAMP = 0.2;
|
10327
10333
|
var stdin_default$Q = vue.defineComponent({
|
10328
10334
|
name: name$H,
|
10329
10335
|
props: floatingPanelProps,
|
@@ -10332,6 +10338,7 @@
|
|
10332
10338
|
emit,
|
10333
10339
|
slots
|
10334
10340
|
}) {
|
10341
|
+
const DAMP = 0.2;
|
10335
10342
|
const rootRef = vue.ref();
|
10336
10343
|
const contentRef = vue.ref();
|
10337
10344
|
const height2 = useSyncPropRef(() => +props2.height, (value) => emit("update:height", value));
|
@@ -10364,24 +10371,28 @@
|
|
10364
10371
|
return moveY;
|
10365
10372
|
};
|
10366
10373
|
let startY;
|
10374
|
+
let maxScroll = -1;
|
10367
10375
|
const touch = useTouch();
|
10368
10376
|
const onTouchstart = (e) => {
|
10369
10377
|
touch.start(e);
|
10370
10378
|
dragging.value = true;
|
10371
10379
|
startY = -height2.value;
|
10380
|
+
maxScroll = -1;
|
10372
10381
|
};
|
10373
10382
|
const onTouchmove = (e) => {
|
10374
10383
|
var _a;
|
10375
10384
|
touch.move(e);
|
10376
10385
|
const target = e.target;
|
10377
10386
|
if (contentRef.value === target || ((_a = contentRef.value) == null ? void 0 : _a.contains(target))) {
|
10387
|
+
const {
|
10388
|
+
scrollTop
|
10389
|
+
} = contentRef.value;
|
10390
|
+
maxScroll = Math.max(maxScroll, scrollTop);
|
10378
10391
|
if (!props2.contentDraggable)
|
10379
10392
|
return;
|
10380
10393
|
if (-startY < boundary.value.max) {
|
10381
|
-
|
10382
|
-
|
10383
|
-
e.stopPropagation();
|
10384
|
-
} else if (!(contentRef.value.scrollTop <= 0 && touch.deltaY.value > 0)) {
|
10394
|
+
preventDefault(e, true);
|
10395
|
+
} else if (!(scrollTop <= 0 && touch.deltaY.value > 0) || maxScroll > 0) {
|
10385
10396
|
return;
|
10386
10397
|
}
|
10387
10398
|
}
|
@@ -10389,6 +10400,7 @@
|
|
10389
10400
|
height2.value = -ease(moveY);
|
10390
10401
|
};
|
10391
10402
|
const onTouchend = () => {
|
10403
|
+
maxScroll = -1;
|
10392
10404
|
dragging.value = false;
|
10393
10405
|
height2.value = closest(anchors.value, height2.value);
|
10394
10406
|
if (height2.value !== -startY) {
|
@@ -10402,7 +10414,7 @@
|
|
10402
10414
|
}, {
|
10403
10415
|
immediate: true
|
10404
10416
|
});
|
10405
|
-
useLockScroll(rootRef, () =>
|
10417
|
+
useLockScroll(rootRef, () => props2.lockScroll);
|
10406
10418
|
useEventListener("touchmove", onTouchmove, {
|
10407
10419
|
target: rootRef
|
10408
10420
|
});
|
@@ -10616,7 +10628,8 @@
|
|
10616
10628
|
maxZoom: makeRequiredProp(numericProp),
|
10617
10629
|
rootWidth: makeRequiredProp(Number),
|
10618
10630
|
rootHeight: makeRequiredProp(Number),
|
10619
|
-
disableZoom: Boolean
|
10631
|
+
disableZoom: Boolean,
|
10632
|
+
closeOnClickOverlay: Boolean
|
10620
10633
|
},
|
10621
10634
|
emits: ["scale", "close", "longPress"],
|
10622
10635
|
setup(props2, {
|
@@ -10776,7 +10789,8 @@
|
|
10776
10789
|
}
|
10777
10790
|
}
|
10778
10791
|
};
|
10779
|
-
const checkTap = () => {
|
10792
|
+
const checkTap = (event) => {
|
10793
|
+
var _a;
|
10780
10794
|
if (fingerNum > 1) {
|
10781
10795
|
return;
|
10782
10796
|
}
|
@@ -10793,6 +10807,9 @@
|
|
10793
10807
|
doubleTapTimer = null;
|
10794
10808
|
toggleScale();
|
10795
10809
|
} else {
|
10810
|
+
if (!props2.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
|
10811
|
+
return;
|
10812
|
+
}
|
10796
10813
|
doubleTapTimer = setTimeout(() => {
|
10797
10814
|
emit("close");
|
10798
10815
|
doubleTapTimer = null;
|
@@ -10830,7 +10847,7 @@
|
|
10830
10847
|
}
|
10831
10848
|
}
|
10832
10849
|
preventDefault(event, stopPropagation2);
|
10833
|
-
checkTap();
|
10850
|
+
checkTap(event);
|
10834
10851
|
touch.reset();
|
10835
10852
|
};
|
10836
10853
|
const resize = () => {
|
@@ -10927,6 +10944,7 @@
|
|
10927
10944
|
startPosition: makeNumericProp(0),
|
10928
10945
|
showIndicators: Boolean,
|
10929
10946
|
closeOnPopstate: truthProp,
|
10947
|
+
closeOnClickOverlay: truthProp,
|
10930
10948
|
closeIconPosition: makeStringProp("top-right"),
|
10931
10949
|
teleport: [String, Object]
|
10932
10950
|
};
|
@@ -11011,6 +11029,7 @@
|
|
11011
11029
|
"rootWidth": state.rootWidth,
|
11012
11030
|
"rootHeight": state.rootHeight,
|
11013
11031
|
"disableZoom": state.disableZoom,
|
11032
|
+
"closeOnClickOverlay": props2.closeOnClickOverlay,
|
11014
11033
|
"onScale": emitScale,
|
11015
11034
|
"onClose": emitClose,
|
11016
11035
|
"onLongPress": () => emit("longPress", {
|
@@ -11093,6 +11112,7 @@
|
|
11093
11112
|
swipeDuration: 300,
|
11094
11113
|
showIndicators: false,
|
11095
11114
|
closeOnPopstate: true,
|
11115
|
+
closeOnClickOverlay: true,
|
11096
11116
|
closeIconPosition: "top-right"
|
11097
11117
|
};
|
11098
11118
|
function initInstance$1() {
|
@@ -11428,6 +11448,7 @@
|
|
11428
11448
|
loading: Boolean,
|
11429
11449
|
disabled: Boolean,
|
11430
11450
|
finished: Boolean,
|
11451
|
+
scroller: Object,
|
11431
11452
|
errorText: String,
|
11432
11453
|
direction: makeStringProp("down"),
|
11433
11454
|
loadingText: String,
|
@@ -11447,6 +11468,7 @@
|
|
11447
11468
|
const placeholder = vue.ref();
|
11448
11469
|
const tabStatus = useTabStatus();
|
11449
11470
|
const scrollParent = useScrollParent(root);
|
11471
|
+
const scroller = vue.computed(() => props2.scroller || scrollParent.value);
|
11450
11472
|
const check = () => {
|
11451
11473
|
vue.nextTick(() => {
|
11452
11474
|
if (loading.value || props2.finished || props2.disabled || props2.error || // skip check when inside an inactive tab
|
@@ -11457,7 +11479,7 @@
|
|
11457
11479
|
direction
|
11458
11480
|
} = props2;
|
11459
11481
|
const offset2 = +props2.offset;
|
11460
|
-
const scrollParentRect = useRect(
|
11482
|
+
const scrollParentRect = useRect(scroller);
|
11461
11483
|
if (!scrollParentRect.height || isHidden(root)) {
|
11462
11484
|
return;
|
11463
11485
|
}
|
@@ -11533,7 +11555,7 @@
|
|
11533
11555
|
check
|
11534
11556
|
});
|
11535
11557
|
useEventListener("scroll", check, {
|
11536
|
-
target:
|
11558
|
+
target: scroller,
|
11537
11559
|
passive: true
|
11538
11560
|
});
|
11539
11561
|
return () => {
|
@@ -15854,7 +15876,7 @@
|
|
15854
15876
|
const expanded = vue.ref(false);
|
15855
15877
|
const hasAction = vue.ref(false);
|
15856
15878
|
const root = vue.ref();
|
15857
|
-
const actionText = vue.computed(() => expanded.value ? props2.
|
15879
|
+
const actionText = vue.computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
15858
15880
|
const pxToNum = (value) => {
|
15859
15881
|
if (!value)
|
15860
15882
|
return 0;
|
@@ -15896,7 +15918,7 @@
|
|
15896
15918
|
}
|
15897
15919
|
return dots + content.slice(right2, end2);
|
15898
15920
|
}
|
15899
|
-
const middle2 = Math.round(left2 + right2
|
15921
|
+
const middle2 = Math.round((left2 + right2) / 2);
|
15900
15922
|
if (position === "end") {
|
15901
15923
|
container2.innerText = content.slice(0, middle2) + dots + actionText.value;
|
15902
15924
|
} else {
|
@@ -15917,11 +15939,11 @@
|
|
15917
15939
|
};
|
15918
15940
|
const middleTail = (leftPart, rightPart) => {
|
15919
15941
|
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
15920
|
-
return content.slice(0, leftPart[
|
15942
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
|
15921
15943
|
}
|
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 +
|
15944
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
15945
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
15946
|
+
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end2) + props2.expandText;
|
15925
15947
|
if (container2.offsetHeight >= maxHeight2) {
|
15926
15948
|
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
15927
15949
|
}
|
@@ -15956,7 +15978,7 @@
|
|
15956
15978
|
const renderAction = () => vue.createVNode("span", {
|
15957
15979
|
"class": bem$3("action"),
|
15958
15980
|
"onClick": onClickAction
|
15959
|
-
}, [
|
15981
|
+
}, [actionText.value]);
|
15960
15982
|
vue.onMounted(calcEllipsised);
|
15961
15983
|
vue.watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
|
15962
15984
|
useEventListener("resize", calcEllipsised);
|
@@ -17597,7 +17619,7 @@
|
|
17597
17619
|
});
|
17598
17620
|
}
|
17599
17621
|
};
|
17600
|
-
const version = "4.6.
|
17622
|
+
const version = "4.6.5";
|
17601
17623
|
function install(app) {
|
17602
17624
|
const components = [
|
17603
17625
|
ActionBar,
|