vant 4.9.18 → 4.9.20
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 -0
- package/es/action-sheet/ActionSheet.d.ts +3 -0
- package/es/action-sheet/index.d.ts +2 -0
- package/es/barrage/Barrage.mjs +1 -1
- package/es/dialog/Dialog.d.ts +3 -0
- package/es/dialog/index.d.ts +2 -0
- package/es/dialog/types.d.ts +2 -0
- package/es/dropdown-item/DropdownItem.mjs +3 -0
- package/es/dropdown-menu/DropdownMenu.mjs +3 -1
- package/es/dropdown-menu/types.d.ts +2 -0
- package/es/floating-bubble/FloatingBubble.d.ts +5 -5
- package/es/floating-bubble/FloatingBubble.mjs +14 -9
- package/es/floating-bubble/index.d.ts +3 -3
- package/es/floating-bubble/types.d.ts +4 -0
- package/es/image/Image.d.ts +3 -0
- package/es/image/Image.mjs +3 -1
- package/es/image/index.d.ts +2 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/notify/Notify.d.ts +3 -0
- package/es/notify/index.d.ts +2 -0
- package/es/overlay/Overlay.mjs +5 -3
- package/es/picker/Picker.mjs +8 -3
- package/es/picker/utils.mjs +1 -1
- package/es/popup/Popup.d.ts +3 -0
- package/es/popup/Popup.mjs +10 -9
- package/es/popup/index.d.ts +2 -0
- package/es/popup/shared.d.ts +2 -0
- package/es/popup/shared.mjs +2 -0
- package/es/share-sheet/ShareSheet.d.ts +3 -0
- package/es/share-sheet/index.d.ts +2 -0
- package/es/tabbar-item/TabbarItem.mjs +1 -1
- package/es/tabs/Tabs.mjs +2 -3
- package/es/watermark/Watermark.mjs +17 -17
- package/lib/action-sheet/ActionSheet.d.ts +3 -0
- package/lib/action-sheet/index.d.ts +2 -0
- package/lib/barrage/Barrage.js +1 -1
- package/lib/dialog/Dialog.d.ts +3 -0
- package/lib/dialog/index.d.ts +2 -0
- package/lib/dialog/types.d.ts +2 -0
- package/lib/dropdown-item/DropdownItem.js +3 -0
- package/lib/dropdown-menu/DropdownMenu.js +3 -1
- package/lib/dropdown-menu/types.d.ts +2 -0
- package/lib/floating-bubble/FloatingBubble.d.ts +5 -5
- package/lib/floating-bubble/FloatingBubble.js +13 -8
- package/lib/floating-bubble/index.d.ts +3 -3
- package/lib/floating-bubble/types.d.ts +4 -0
- package/lib/image/Image.d.ts +3 -0
- package/lib/image/Image.js +3 -1
- package/lib/image/index.d.ts +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/notify/Notify.d.ts +3 -0
- package/lib/notify/index.d.ts +2 -0
- package/lib/overlay/Overlay.js +4 -2
- package/lib/picker/Picker.js +8 -3
- package/lib/picker/utils.js +1 -1
- package/lib/popup/Popup.d.ts +3 -0
- package/lib/popup/Popup.js +10 -9
- package/lib/popup/index.d.ts +2 -0
- package/lib/popup/shared.d.ts +2 -0
- package/lib/popup/shared.js +2 -0
- package/lib/share-sheet/ShareSheet.d.ts +3 -0
- package/lib/share-sheet/index.d.ts +2 -0
- package/lib/tabbar-item/TabbarItem.js +1 -1
- package/lib/tabs/Tabs.js +2 -3
- package/lib/vant.cjs.js +69 -48
- package/lib/vant.es.js +71 -50
- package/lib/vant.js +1333 -1330
- package/lib/vant.min.js +3 -3
- package/lib/watermark/Watermark.js +16 -16
- package/lib/web-types.json +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
@@ -133,6 +133,7 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
|
|
133
133
|
| [vscode-common-intellisense](https://github.com/Simon-He95/vscode-common-intellisense) | A VS Code extension that provides better intellisense to Vant developers |
|
134
134
|
| [nuxt-vant-mobile](https://github.com/easy-temps/nuxt-vant-mobile) | Nuxt _⁴_ project template based on Vant, out of the box |
|
135
135
|
| [mobvue](https://github.com/un-pany/mobvue) | A well-crafted mobile web app template |
|
136
|
+
| [novlan1/press-ui](https://github.com/novlan1/press-ui) | Uni APP mobile UI Components based on Vant |
|
136
137
|
|
137
138
|
## Links
|
138
139
|
|
@@ -27,6 +27,7 @@ export declare const actionSheetProps: {
|
|
27
27
|
default: true;
|
28
28
|
};
|
29
29
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
30
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
30
31
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
31
32
|
overlayClass: import("vue").PropType<unknown>;
|
32
33
|
transitionAppear: BooleanConstructor;
|
@@ -83,6 +84,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
83
84
|
default: true;
|
84
85
|
};
|
85
86
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
87
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
86
88
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
87
89
|
overlayClass: import("vue").PropType<unknown>;
|
88
90
|
transitionAppear: BooleanConstructor;
|
@@ -137,6 +139,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
137
139
|
default: true;
|
138
140
|
};
|
139
141
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
142
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
140
143
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
141
144
|
overlayClass: import("vue").PropType<unknown>;
|
142
145
|
transitionAppear: BooleanConstructor;
|
@@ -16,6 +16,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
19
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
19
20
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
20
21
|
overlayClass: import("vue").PropType<unknown>;
|
21
22
|
transitionAppear: BooleanConstructor;
|
@@ -70,6 +71,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
|
|
70
71
|
default: true;
|
71
72
|
};
|
72
73
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
74
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
73
75
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
74
76
|
overlayClass: import("vue").PropType<unknown>;
|
75
77
|
transitionAppear: BooleanConstructor;
|
package/es/barrage/Barrage.mjs
CHANGED
@@ -95,7 +95,7 @@ var stdin_default = defineComponent({
|
|
95
95
|
deep: true
|
96
96
|
});
|
97
97
|
const rootStyle = ref({});
|
98
|
-
onMounted(() => __async(
|
98
|
+
onMounted(() => __async(null, null, function* () {
|
99
99
|
var _a;
|
100
100
|
rootStyle.value["--move-distance"] = `-${(_a = barrageWrapper.value) == null ? void 0 : _a.offsetWidth}px`;
|
101
101
|
yield nextTick();
|
package/es/dialog/Dialog.d.ts
CHANGED
@@ -18,6 +18,7 @@ export declare const dialogProps: {
|
|
18
18
|
default: true;
|
19
19
|
};
|
20
20
|
beforeClose: PropType<import("../utils").Interceptor>;
|
21
|
+
overlayProps: PropType<Partial<import("..").OverlayProps>>;
|
21
22
|
overlayStyle: PropType<import("vue").CSSProperties>;
|
22
23
|
overlayClass: PropType<unknown>;
|
23
24
|
transitionAppear: BooleanConstructor;
|
@@ -79,6 +80,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
79
80
|
default: true;
|
80
81
|
};
|
81
82
|
beforeClose: PropType<import("../utils").Interceptor>;
|
83
|
+
overlayProps: PropType<Partial<import("..").OverlayProps>>;
|
82
84
|
overlayStyle: PropType<import("vue").CSSProperties>;
|
83
85
|
overlayClass: PropType<unknown>;
|
84
86
|
transitionAppear: BooleanConstructor;
|
@@ -138,6 +140,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
138
140
|
default: true;
|
139
141
|
};
|
140
142
|
beforeClose: PropType<import("../utils").Interceptor>;
|
143
|
+
overlayProps: PropType<Partial<import("..").OverlayProps>>;
|
141
144
|
overlayStyle: PropType<import("vue").CSSProperties>;
|
142
145
|
overlayClass: PropType<unknown>;
|
143
146
|
transitionAppear: BooleanConstructor;
|
package/es/dialog/index.d.ts
CHANGED
@@ -16,6 +16,7 @@ export declare const Dialog: import("../utils").WithInstall<import("vue").Define
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
19
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
19
20
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
20
21
|
overlayClass: import("vue").PropType<unknown>;
|
21
22
|
transitionAppear: BooleanConstructor;
|
@@ -75,6 +76,7 @@ export declare const Dialog: import("../utils").WithInstall<import("vue").Define
|
|
75
76
|
default: true;
|
76
77
|
};
|
77
78
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
79
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
78
80
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
79
81
|
overlayClass: import("vue").PropType<unknown>;
|
80
82
|
transitionAppear: BooleanConstructor;
|
package/es/dialog/types.d.ts
CHANGED
@@ -158,6 +158,9 @@ var stdin_default = defineComponent({
|
|
158
158
|
"role": "menu",
|
159
159
|
"class": bem("content"),
|
160
160
|
"overlay": overlay,
|
161
|
+
"overlayProps": {
|
162
|
+
duration: state.transition && !parent.opened.value ? duration : 0
|
163
|
+
},
|
161
164
|
"position": direction === "down" ? "top" : "bottom",
|
162
165
|
"duration": state.transition ? duration : 0,
|
163
166
|
"lazyRender": props.lazyRender,
|
@@ -113,12 +113,14 @@ var stdin_default = defineComponent({
|
|
113
113
|
}, [item.renderTitle()])])]);
|
114
114
|
};
|
115
115
|
useExpose({
|
116
|
-
close
|
116
|
+
close,
|
117
|
+
opened
|
117
118
|
});
|
118
119
|
linkChildren({
|
119
120
|
id,
|
120
121
|
props,
|
121
122
|
offset,
|
123
|
+
opened,
|
122
124
|
updateOffset
|
123
125
|
});
|
124
126
|
useClickAway(root, onClickAway);
|
@@ -5,9 +5,11 @@ export type DropdownMenuProvide = {
|
|
5
5
|
id: string;
|
6
6
|
props: DropdownMenuProps;
|
7
7
|
offset: Ref<number>;
|
8
|
+
opened: Ref<boolean>;
|
8
9
|
updateOffset: () => void;
|
9
10
|
};
|
10
11
|
export type DropdownMenuExpose = {
|
12
|
+
opened: Ref<boolean>;
|
11
13
|
close: () => void;
|
12
14
|
};
|
13
15
|
export type DropdownMenuInstance = ComponentPublicInstance<DropdownMenuProps, DropdownMenuExpose>;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { PropType, TeleportProps, type ExtractPropTypes } from 'vue';
|
2
|
-
import { FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset } from './types';
|
2
|
+
import { FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset, FloatingBubbleGap } from './types';
|
3
3
|
export declare const floatingBubbleProps: {
|
4
4
|
gap: {
|
5
|
-
type:
|
5
|
+
type: PropType<FloatingBubbleGap>;
|
6
6
|
default: number;
|
7
7
|
};
|
8
8
|
icon: StringConstructor;
|
@@ -26,7 +26,7 @@ export declare const floatingBubbleProps: {
|
|
26
26
|
export type FloatingBubbleProps = ExtractPropTypes<typeof floatingBubbleProps>;
|
27
27
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
28
28
|
gap: {
|
29
|
-
type:
|
29
|
+
type: PropType<FloatingBubbleGap>;
|
30
30
|
default: number;
|
31
31
|
};
|
32
32
|
icon: StringConstructor;
|
@@ -48,7 +48,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
48
48
|
};
|
49
49
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
50
50
|
gap: {
|
51
|
-
type:
|
51
|
+
type: PropType<FloatingBubbleGap>;
|
52
52
|
default: number;
|
53
53
|
};
|
54
54
|
icon: StringConstructor;
|
@@ -75,7 +75,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
75
75
|
}>, {
|
76
76
|
offset: FloatingBubbleOffset;
|
77
77
|
teleport: string | import("vue").RendererElement | null | undefined;
|
78
|
-
gap:
|
78
|
+
gap: FloatingBubbleGap;
|
79
79
|
axis: FloatingBubbleAxis;
|
80
80
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
81
81
|
export default _default;
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import { Teleport, computed, defineComponent, nextTick, onMounted, ref, watch, onActivated, onDeactivated, createVNode as _createVNode, vShow as _vShow, mergeProps as _mergeProps, withDirectives as _withDirectives } from "vue";
|
2
|
-
import { pick, addUnit, closest, createNamespace,
|
2
|
+
import { pick, addUnit, closest, createNamespace, isObject, makeStringProp, windowWidth, windowHeight } from "../utils/index.mjs";
|
3
3
|
import { useRect, useEventListener } from "@vant/use";
|
4
4
|
import { useTouch } from "../composables/use-touch.mjs";
|
5
5
|
import Icon from "../icon/index.mjs";
|
6
6
|
const floatingBubbleProps = {
|
7
|
-
gap:
|
7
|
+
gap: {
|
8
|
+
type: [Number, Object],
|
9
|
+
default: 24
|
10
|
+
},
|
8
11
|
icon: String,
|
9
12
|
axis: makeStringProp("y"),
|
10
13
|
magnetic: String,
|
@@ -38,11 +41,13 @@ var stdin_default = defineComponent({
|
|
38
41
|
width: 0,
|
39
42
|
height: 0
|
40
43
|
});
|
44
|
+
const gapX = computed(() => isObject(props.gap) ? props.gap.x : props.gap);
|
45
|
+
const gapY = computed(() => isObject(props.gap) ? props.gap.y : props.gap);
|
41
46
|
const boundary = computed(() => ({
|
42
|
-
top:
|
43
|
-
right: windowWidth.value - state.value.width -
|
44
|
-
bottom: windowHeight.value - state.value.height -
|
45
|
-
left:
|
47
|
+
top: gapY.value,
|
48
|
+
right: windowWidth.value - state.value.width - gapX.value,
|
49
|
+
bottom: windowHeight.value - state.value.height - gapY.value,
|
50
|
+
left: gapX.value
|
46
51
|
}));
|
47
52
|
const dragging = ref(false);
|
48
53
|
let initialized = false;
|
@@ -66,8 +71,8 @@ var stdin_default = defineComponent({
|
|
66
71
|
offset
|
67
72
|
} = props;
|
68
73
|
state.value = {
|
69
|
-
x: offset.x > -1 ? offset.x : windowWidth.value - width -
|
70
|
-
y: offset.y > -1 ? offset.y : windowHeight.value - height -
|
74
|
+
x: offset.x > -1 ? offset.x : windowWidth.value - width - gapX.value,
|
75
|
+
y: offset.y > -1 ? offset.y : windowHeight.value - height - gapY.value,
|
71
76
|
width,
|
72
77
|
height
|
73
78
|
};
|
@@ -135,7 +140,7 @@ var stdin_default = defineComponent({
|
|
135
140
|
initialized = true;
|
136
141
|
});
|
137
142
|
});
|
138
|
-
watch([windowWidth, windowHeight,
|
143
|
+
watch([windowWidth, windowHeight, gapX, gapY, () => props.offset], updateState, {
|
139
144
|
deep: true
|
140
145
|
});
|
141
146
|
const show = ref(true);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export declare const FloatingBubble: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
2
2
|
gap: {
|
3
|
-
type:
|
3
|
+
type: import("vue").PropType<import("./types").FloatingBubbleGap>;
|
4
4
|
default: number;
|
5
5
|
};
|
6
6
|
icon: StringConstructor;
|
@@ -22,7 +22,7 @@ export declare const FloatingBubble: import("../utils").WithInstall<import("vue"
|
|
22
22
|
};
|
23
23
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
24
24
|
gap: {
|
25
|
-
type:
|
25
|
+
type: import("vue").PropType<import("./types").FloatingBubbleGap>;
|
26
26
|
default: number;
|
27
27
|
};
|
28
28
|
icon: StringConstructor;
|
@@ -49,7 +49,7 @@ export declare const FloatingBubble: import("../utils").WithInstall<import("vue"
|
|
49
49
|
}>, {
|
50
50
|
offset: import("./types").FloatingBubbleOffset;
|
51
51
|
teleport: string | import("vue").RendererElement | null | undefined;
|
52
|
-
gap:
|
52
|
+
gap: import("./types").FloatingBubbleGap;
|
53
53
|
axis: import("./types").FloatingBubbleAxis;
|
54
54
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
55
55
|
export default FloatingBubble;
|
package/es/image/Image.d.ts
CHANGED
@@ -31,6 +31,7 @@ export declare const imageProps: {
|
|
31
31
|
};
|
32
32
|
crossorigin: PropType<ImgHTMLAttributes["crossorigin"]>;
|
33
33
|
referrerpolicy: PropType<ImgHTMLAttributes["referrerpolicy"]>;
|
34
|
+
decoding: PropType<ImgHTMLAttributes["decoding"]>;
|
34
35
|
};
|
35
36
|
export type ImageProps = ExtractPropTypes<typeof imageProps>;
|
36
37
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
@@ -64,6 +65,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
64
65
|
};
|
65
66
|
crossorigin: PropType<ImgHTMLAttributes["crossorigin"]>;
|
66
67
|
referrerpolicy: PropType<ImgHTMLAttributes["referrerpolicy"]>;
|
68
|
+
decoding: PropType<ImgHTMLAttributes["decoding"]>;
|
67
69
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "load")[], "error" | "load", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
68
70
|
src: StringConstructor;
|
69
71
|
alt: StringConstructor;
|
@@ -95,6 +97,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
95
97
|
};
|
96
98
|
crossorigin: PropType<ImgHTMLAttributes["crossorigin"]>;
|
97
99
|
referrerpolicy: PropType<ImgHTMLAttributes["referrerpolicy"]>;
|
100
|
+
decoding: PropType<ImgHTMLAttributes["decoding"]>;
|
98
101
|
}>> & Readonly<{
|
99
102
|
onLoad?: ((...args: any[]) => any) | undefined;
|
100
103
|
onError?: ((...args: any[]) => any) | undefined;
|
package/es/image/Image.mjs
CHANGED
@@ -20,7 +20,8 @@ const imageProps = {
|
|
20
20
|
showLoading: truthProp,
|
21
21
|
loadingIcon: makeStringProp("photo"),
|
22
22
|
crossorigin: String,
|
23
|
-
referrerpolicy: String
|
23
|
+
referrerpolicy: String,
|
24
|
+
decoding: String
|
24
25
|
};
|
25
26
|
var stdin_default = defineComponent({
|
26
27
|
name,
|
@@ -100,6 +101,7 @@ var stdin_default = defineComponent({
|
|
100
101
|
const attrs = {
|
101
102
|
alt: props.alt,
|
102
103
|
class: bem("img"),
|
104
|
+
decoding: props.decoding,
|
103
105
|
style: {
|
104
106
|
objectFit: props.fit,
|
105
107
|
objectPosition: props.position
|
package/es/image/index.d.ts
CHANGED
@@ -29,6 +29,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
|
|
29
29
|
};
|
30
30
|
crossorigin: import("vue").PropType<import("vue").ImgHTMLAttributes["crossorigin"]>;
|
31
31
|
referrerpolicy: import("vue").PropType<import("vue").ImgHTMLAttributes["referrerpolicy"]>;
|
32
|
+
decoding: import("vue").PropType<import("vue").ImgHTMLAttributes["decoding"]>;
|
32
33
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "load")[], "error" | "load", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
33
34
|
src: StringConstructor;
|
34
35
|
alt: StringConstructor;
|
@@ -60,6 +61,7 @@ export declare const Image: import("../utils").WithInstall<import("vue").DefineC
|
|
60
61
|
};
|
61
62
|
crossorigin: import("vue").PropType<import("vue").ImgHTMLAttributes["crossorigin"]>;
|
62
63
|
referrerpolicy: import("vue").PropType<import("vue").ImgHTMLAttributes["referrerpolicy"]>;
|
64
|
+
decoding: import("vue").PropType<import("vue").ImgHTMLAttributes["decoding"]>;
|
63
65
|
}>> & Readonly<{
|
64
66
|
onLoad?: ((...args: any[]) => any) | undefined;
|
65
67
|
onError?: ((...args: any[]) => any) | undefined;
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
@@ -99,7 +99,7 @@ import { Toast } from "./toast/index.mjs";
|
|
99
99
|
import { TreeSelect } from "./tree-select/index.mjs";
|
100
100
|
import { Uploader } from "./uploader/index.mjs";
|
101
101
|
import { Watermark } from "./watermark/index.mjs";
|
102
|
-
const version = "4.9.
|
102
|
+
const version = "4.9.20";
|
103
103
|
function install(app) {
|
104
104
|
const components = [
|
105
105
|
ActionBar,
|
package/es/notify/Notify.d.ts
CHANGED
@@ -18,6 +18,7 @@ export declare const notifyProps: {
|
|
18
18
|
default: true;
|
19
19
|
};
|
20
20
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
21
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
21
22
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
22
23
|
overlayClass: import("vue").PropType<unknown>;
|
23
24
|
transitionAppear: BooleanConstructor;
|
@@ -59,6 +60,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
59
60
|
default: true;
|
60
61
|
};
|
61
62
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
63
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
62
64
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
63
65
|
overlayClass: import("vue").PropType<unknown>;
|
64
66
|
transitionAppear: BooleanConstructor;
|
@@ -98,6 +100,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
98
100
|
default: true;
|
99
101
|
};
|
100
102
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
103
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
101
104
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
102
105
|
overlayClass: import("vue").PropType<unknown>;
|
103
106
|
transitionAppear: BooleanConstructor;
|
package/es/notify/index.d.ts
CHANGED
@@ -16,6 +16,7 @@ export declare const Notify: import("../utils").WithInstall<import("vue").Define
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
19
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
19
20
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
20
21
|
overlayClass: import("vue").PropType<unknown>;
|
21
22
|
transitionAppear: BooleanConstructor;
|
@@ -55,6 +56,7 @@ export declare const Notify: import("../utils").WithInstall<import("vue").Define
|
|
55
56
|
default: true;
|
56
57
|
};
|
57
58
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
59
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
58
60
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
59
61
|
overlayClass: import("vue").PropType<unknown>;
|
60
62
|
transitionAppear: BooleanConstructor;
|
package/es/overlay/Overlay.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ref, defineComponent, Teleport, Transition, vShow as _vShow, createVNode as _createVNode, withDirectives as _withDirectives } from "vue";
|
1
|
+
import { ref, defineComponent, Teleport, Transition, vShow as _vShow, mergeProps as _mergeProps, createVNode as _createVNode, withDirectives as _withDirectives } from "vue";
|
2
2
|
import { isDef, extend, truthProp, numericProp, unknownProp, preventDefault, createNamespace, getZIndexStyle } from "../utils/index.mjs";
|
3
3
|
import { useEventListener } from "@vant/use";
|
4
4
|
import { useLazyRender } from "../composables/use-lazy-render.mjs";
|
@@ -15,8 +15,10 @@ const overlayProps = {
|
|
15
15
|
};
|
16
16
|
var stdin_default = defineComponent({
|
17
17
|
name,
|
18
|
+
inheritAttrs: false,
|
18
19
|
props: overlayProps,
|
19
20
|
setup(props, {
|
21
|
+
attrs,
|
20
22
|
slots
|
21
23
|
}) {
|
22
24
|
const root = ref();
|
@@ -32,11 +34,11 @@ var stdin_default = defineComponent({
|
|
32
34
|
if (isDef(props.duration)) {
|
33
35
|
style.animationDuration = `${props.duration}s`;
|
34
36
|
}
|
35
|
-
return _withDirectives(_createVNode("div", {
|
37
|
+
return _withDirectives(_createVNode("div", _mergeProps({
|
36
38
|
"ref": root,
|
37
39
|
"style": style,
|
38
40
|
"class": [bem(), props.className]
|
39
|
-
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[_vShow, props.show]]);
|
41
|
+
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]), [[_vShow, props.show]]);
|
40
42
|
});
|
41
43
|
useEventListener("touchmove", onTouchMove, {
|
42
44
|
target: root
|
package/es/picker/Picker.mjs
CHANGED
@@ -99,7 +99,8 @@ var stdin_default = defineComponent({
|
|
99
99
|
children.forEach((child) => child.stopMomentum());
|
100
100
|
const params = getEventParams();
|
101
101
|
nextTick(() => {
|
102
|
-
|
102
|
+
const params2 = getEventParams();
|
103
|
+
emit("confirm", params2);
|
103
104
|
});
|
104
105
|
return params;
|
105
106
|
};
|
@@ -163,13 +164,14 @@ var stdin_default = defineComponent({
|
|
163
164
|
}), pick(slots, pickerToolbarSlots));
|
164
165
|
}
|
165
166
|
};
|
166
|
-
|
167
|
+
const resetSelectedValues = (columns) => {
|
167
168
|
columns.forEach((options, index) => {
|
168
169
|
if (options.length && !isOptionExist(options, selectedValues.value[index], fields.value)) {
|
169
170
|
setValue(index, getFirstEnabledOption(options)[fields.value.value]);
|
170
171
|
}
|
171
172
|
});
|
172
|
-
}
|
173
|
+
};
|
174
|
+
watch(currentColumns, (columns) => resetSelectedValues(columns), {
|
173
175
|
immediate: true
|
174
176
|
});
|
175
177
|
let lastEmittedModelValue;
|
@@ -178,6 +180,9 @@ var stdin_default = defineComponent({
|
|
178
180
|
selectedValues.value = newValues.slice(0);
|
179
181
|
lastEmittedModelValue = newValues.slice(0);
|
180
182
|
}
|
183
|
+
if (props.modelValue.length === 0) {
|
184
|
+
resetSelectedValues(currentColumns.value);
|
185
|
+
}
|
181
186
|
}, {
|
182
187
|
deep: true
|
183
188
|
});
|
package/es/picker/utils.mjs
CHANGED
@@ -23,7 +23,7 @@ function findIndexOfEnabledOption(options, index) {
|
|
23
23
|
}
|
24
24
|
return 0;
|
25
25
|
}
|
26
|
-
const isOptionExist = (options, value, fields) => value !== void 0 &&
|
26
|
+
const isOptionExist = (options, value, fields) => value !== void 0 && options.some((option) => option[fields.value] === value);
|
27
27
|
function findOptionByValue(options, value, fields) {
|
28
28
|
const index = options.findIndex((option) => option[fields.value] === value);
|
29
29
|
const enabledIndex = findIndexOfEnabledOption(options, index);
|
package/es/popup/Popup.d.ts
CHANGED
@@ -18,6 +18,7 @@ export declare const popupProps: {
|
|
18
18
|
default: true;
|
19
19
|
};
|
20
20
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
21
|
+
overlayProps: import("vue").PropType<Partial<import("../overlay").OverlayProps>>;
|
21
22
|
overlayStyle: import("vue").PropType<CSSProperties>;
|
22
23
|
overlayClass: import("vue").PropType<unknown>;
|
23
24
|
transitionAppear: BooleanConstructor;
|
@@ -66,6 +67,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
66
67
|
default: true;
|
67
68
|
};
|
68
69
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
70
|
+
overlayProps: import("vue").PropType<Partial<import("../overlay").OverlayProps>>;
|
69
71
|
overlayStyle: import("vue").PropType<CSSProperties>;
|
70
72
|
overlayClass: import("vue").PropType<unknown>;
|
71
73
|
transitionAppear: BooleanConstructor;
|
@@ -112,6 +114,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
112
114
|
default: true;
|
113
115
|
};
|
114
116
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
117
|
+
overlayProps: import("vue").PropType<Partial<import("../overlay").OverlayProps>>;
|
115
118
|
overlayStyle: import("vue").PropType<CSSProperties>;
|
116
119
|
overlayClass: import("vue").PropType<unknown>;
|
117
120
|
transitionAppear: BooleanConstructor;
|
package/es/popup/Popup.mjs
CHANGED
@@ -75,15 +75,16 @@ var stdin_default = defineComponent({
|
|
75
75
|
};
|
76
76
|
const renderOverlay = () => {
|
77
77
|
if (props.overlay) {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
},
|
78
|
+
const overlayProps = extend({
|
79
|
+
show: props.show,
|
80
|
+
class: props.overlayClass,
|
81
|
+
zIndex: zIndex.value,
|
82
|
+
duration: props.duration,
|
83
|
+
customStyle: props.overlayStyle,
|
84
|
+
role: props.closeOnClickOverlay ? "button" : void 0,
|
85
|
+
tabindex: props.closeOnClickOverlay ? 0 : void 0
|
86
|
+
}, props.overlayProps);
|
87
|
+
return _createVNode(Overlay, _mergeProps(overlayProps, useScopeId(), {
|
87
88
|
"onClick": onClickOverlay
|
88
89
|
}), {
|
89
90
|
default: slots["overlay-content"]
|
package/es/popup/index.d.ts
CHANGED
@@ -16,6 +16,7 @@ export declare const Popup: import("../utils").WithInstall<import("vue").DefineC
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
19
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
19
20
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
20
21
|
overlayClass: import("vue").PropType<unknown>;
|
21
22
|
transitionAppear: BooleanConstructor;
|
@@ -62,6 +63,7 @@ export declare const Popup: import("../utils").WithInstall<import("vue").DefineC
|
|
62
63
|
default: true;
|
63
64
|
};
|
64
65
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
66
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
65
67
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
66
68
|
overlayClass: import("vue").PropType<unknown>;
|
67
69
|
transitionAppear: BooleanConstructor;
|
package/es/popup/shared.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { OverlayProps } from '../overlay';
|
1
2
|
import { Interceptor } from '../utils';
|
2
3
|
import type { PropType, CSSProperties, TeleportProps } from 'vue';
|
3
4
|
export declare const popupSharedProps: {
|
@@ -18,6 +19,7 @@ export declare const popupSharedProps: {
|
|
18
19
|
default: true;
|
19
20
|
};
|
20
21
|
beforeClose: PropType<Interceptor>;
|
22
|
+
overlayProps: PropType<Partial<OverlayProps>>;
|
21
23
|
overlayStyle: PropType<CSSProperties>;
|
22
24
|
overlayClass: PropType<unknown>;
|
23
25
|
transitionAppear: BooleanConstructor;
|
package/es/popup/shared.mjs
CHANGED
@@ -24,6 +24,7 @@ export declare const shareSheetProps: {
|
|
24
24
|
default: true;
|
25
25
|
};
|
26
26
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
27
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
27
28
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
28
29
|
overlayClass: import("vue").PropType<unknown>;
|
29
30
|
transitionAppear: BooleanConstructor;
|
@@ -71,6 +72,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
71
72
|
default: true;
|
72
73
|
};
|
73
74
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
75
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
74
76
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
75
77
|
overlayClass: import("vue").PropType<unknown>;
|
76
78
|
transitionAppear: BooleanConstructor;
|
@@ -116,6 +118,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
116
118
|
default: true;
|
117
119
|
};
|
118
120
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
121
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
119
122
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
120
123
|
overlayClass: import("vue").PropType<unknown>;
|
121
124
|
transitionAppear: BooleanConstructor;
|
@@ -16,6 +16,7 @@ export declare const ShareSheet: import("../utils").WithInstall<import("vue").De
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
19
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
19
20
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
20
21
|
overlayClass: import("vue").PropType<unknown>;
|
21
22
|
transitionAppear: BooleanConstructor;
|
@@ -61,6 +62,7 @@ export declare const ShareSheet: import("../utils").WithInstall<import("vue").De
|
|
61
62
|
default: true;
|
62
63
|
};
|
63
64
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
65
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
64
66
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
65
67
|
overlayClass: import("vue").PropType<unknown>;
|
66
68
|
transitionAppear: BooleanConstructor;
|
@@ -50,7 +50,7 @@ var stdin_default = defineComponent({
|
|
50
50
|
const config = isObject(to) ? to : {
|
51
51
|
path: to
|
52
52
|
};
|
53
|
-
return
|
53
|
+
return $route.matched.some((val) => {
|
54
54
|
const pathMatched = "path" in config && config.path === val.path;
|
55
55
|
const nameMatched = "name" in config && config.name === val.name;
|
56
56
|
return pathMatched || nameMatched;
|
package/es/tabs/Tabs.mjs
CHANGED
@@ -162,9 +162,8 @@ var stdin_default = defineComponent({
|
|
162
162
|
}
|
163
163
|
};
|
164
164
|
const setCurrentIndexByName = (name2, skipScrollIntoView) => {
|
165
|
-
const
|
166
|
-
|
167
|
-
setCurrentIndex(index, skipScrollIntoView);
|
165
|
+
const index = children.findIndex((tab, index2) => getTabName(tab, index2) === name2);
|
166
|
+
setCurrentIndex(index === -1 ? 0 : index, skipScrollIntoView);
|
168
167
|
};
|
169
168
|
const scrollToCurrentContent = (immediate = false) => {
|
170
169
|
if (props.scrollspy) {
|