vant 4.5.0 → 4.6.1
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 +6 -6
- package/es/barrage/index.d.ts +1 -1
- package/es/barrage/types.d.ts +6 -0
- package/es/composables/use-touch.d.ts +1 -0
- package/es/composables/use-touch.mjs +8 -1
- package/es/config-provider/types.d.ts +1 -1
- package/es/dropdown-menu/index.d.ts +1 -1
- package/es/field/Field.mjs +1 -1
- package/es/floating-bubble/FloatingBubble.d.ts +86 -0
- package/es/floating-bubble/FloatingBubble.mjs +177 -0
- package/es/floating-bubble/index.css +1 -0
- package/es/floating-bubble/index.d.ts +63 -0
- package/es/floating-bubble/index.mjs +10 -0
- package/es/floating-bubble/style/index.d.ts +1 -0
- package/es/floating-bubble/style/index.mjs +4 -0
- package/es/floating-bubble/types.d.ts +8 -0
- package/es/floating-bubble/types.mjs +0 -0
- package/es/floating-panel/FloatingPanel.mjs +5 -7
- package/es/floating-panel/index.d.ts +3 -2
- package/es/floating-panel/index.mjs +3 -1
- package/es/floating-panel/types.d.ts +9 -0
- package/es/floating-panel/types.mjs +0 -0
- package/es/image-preview/ImagePreviewItem.mjs +1 -2
- package/es/index.d.ts +3 -1
- package/es/index.mjs +7 -1
- package/es/lazyload/vue-lazyload/util.d.ts +2 -2
- package/es/picker/PickerColumn.mjs +7 -2
- package/es/rate/Rate.d.ts +4 -0
- package/es/rate/Rate.mjs +16 -10
- package/es/rate/index.css +1 -1
- package/es/rate/index.d.ts +3 -0
- package/es/rolling-text/RollingText.d.ts +104 -0
- package/es/rolling-text/RollingText.mjs +98 -0
- package/es/rolling-text/RollingTextItem.d.ts +67 -0
- package/es/rolling-text/RollingTextItem.mjs +47 -0
- package/es/rolling-text/index.css +1 -0
- package/es/rolling-text/index.d.ts +79 -0
- package/es/rolling-text/index.mjs +10 -0
- package/es/rolling-text/style/index.d.ts +1 -0
- package/es/rolling-text/style/index.mjs +2 -0
- package/es/rolling-text/types.d.ts +17 -0
- package/es/rolling-text/types.mjs +0 -0
- package/es/signature/index.d.ts +1 -0
- package/es/signature/types.d.ts +6 -0
- package/es/signature/types.mjs +0 -0
- package/es/slider/Slider.d.ts +1 -1
- package/es/slider/index.d.ts +1 -1
- package/es/stepper/Stepper.d.ts +1 -1
- package/es/stepper/index.d.ts +1 -1
- package/es/style/base.css +1 -1
- package/es/submit-bar/types.d.ts +0 -1
- package/es/uploader/Uploader.mjs +6 -4
- package/es/uploader/UploaderPreviewItem.mjs +1 -1
- package/es/uploader/types.d.ts +1 -0
- package/es/utils/closest.d.ts +1 -0
- package/es/utils/closest.mjs +8 -0
- package/es/utils/constant.d.ts +1 -0
- package/es/utils/constant.mjs +3 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +1 -0
- package/es/watermark/index.d.ts +1 -0
- package/es/watermark/types.d.ts +3 -0
- package/es/watermark/types.mjs +0 -0
- package/lib/barrage/index.d.ts +1 -1
- package/lib/barrage/types.d.ts +6 -0
- package/lib/composables/use-touch.d.ts +1 -0
- package/lib/composables/use-touch.js +8 -1
- package/lib/config-provider/types.d.ts +1 -1
- package/lib/dropdown-menu/index.d.ts +1 -1
- package/lib/field/Field.js +1 -1
- package/lib/floating-bubble/FloatingBubble.d.ts +86 -0
- package/lib/floating-bubble/FloatingBubble.js +206 -0
- package/lib/floating-bubble/index.css +1 -0
- package/lib/floating-bubble/index.d.ts +63 -0
- package/lib/floating-bubble/index.js +39 -0
- package/lib/floating-bubble/style/index.d.ts +1 -0
- package/lib/floating-bubble/style/index.js +4 -0
- package/lib/floating-bubble/types.d.ts +8 -0
- package/lib/floating-bubble/types.js +15 -0
- package/lib/floating-panel/FloatingPanel.js +6 -8
- package/lib/floating-panel/index.d.ts +3 -2
- package/lib/floating-panel/index.js +3 -1
- package/lib/floating-panel/types.d.ts +9 -0
- package/lib/floating-panel/types.js +15 -0
- package/lib/image-preview/ImagePreviewItem.js +1 -2
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +7 -1
- package/lib/lazyload/vue-lazyload/util.d.ts +2 -2
- package/lib/picker/PickerColumn.js +7 -2
- package/lib/rate/Rate.d.ts +4 -0
- package/lib/rate/Rate.js +16 -10
- package/lib/rate/index.css +1 -1
- package/lib/rate/index.d.ts +3 -0
- package/lib/rolling-text/RollingText.d.ts +104 -0
- package/lib/rolling-text/RollingText.js +127 -0
- package/lib/rolling-text/RollingTextItem.d.ts +67 -0
- package/lib/rolling-text/RollingTextItem.js +66 -0
- package/lib/rolling-text/index.css +1 -0
- package/lib/rolling-text/index.d.ts +79 -0
- package/lib/rolling-text/index.js +39 -0
- package/lib/rolling-text/style/index.d.ts +1 -0
- package/lib/rolling-text/style/index.js +2 -0
- package/lib/rolling-text/types.d.ts +17 -0
- package/lib/rolling-text/types.js +15 -0
- package/lib/signature/index.d.ts +1 -0
- package/lib/signature/types.d.ts +6 -0
- package/lib/signature/types.js +15 -0
- package/lib/slider/Slider.d.ts +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/stepper/Stepper.d.ts +1 -1
- package/lib/stepper/index.d.ts +1 -1
- package/lib/style/base.css +1 -1
- package/lib/submit-bar/types.d.ts +0 -1
- package/lib/uploader/Uploader.js +6 -4
- package/lib/uploader/UploaderPreviewItem.js +1 -1
- package/lib/uploader/types.d.ts +1 -0
- package/lib/utils/closest.d.ts +1 -0
- package/lib/utils/closest.js +27 -0
- package/lib/utils/constant.d.ts +1 -0
- package/lib/utils/constant.js +3 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/vant.cjs.js +2355 -2028
- package/lib/vant.es.js +2355 -2028
- package/lib/vant.js +2366 -2166
- package/lib/vant.min.js +1 -1
- package/lib/watermark/index.d.ts +1 -0
- package/lib/watermark/types.d.ts +3 -0
- package/lib/watermark/types.js +15 -0
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
@@ -0,0 +1,63 @@
|
|
1
|
+
export declare const FloatingBubble: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
axis: {
|
3
|
+
type: import("vue").PropType<import("./FloatingBubble").FloatingBubbleAxis>;
|
4
|
+
default: import("./FloatingBubble").FloatingBubbleAxis;
|
5
|
+
};
|
6
|
+
magnetic: import("vue").PropType<import("./FloatingBubble").FloatingBubbleMagnetic>;
|
7
|
+
icon: StringConstructor;
|
8
|
+
gap: {
|
9
|
+
type: NumberConstructor;
|
10
|
+
default: number;
|
11
|
+
};
|
12
|
+
offset: {
|
13
|
+
type: import("vue").PropType<import("./FloatingBubble").FloatingBubbleOffset>;
|
14
|
+
default: () => {
|
15
|
+
x: number;
|
16
|
+
y: number;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
teleport: {
|
20
|
+
type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
24
|
+
axis: {
|
25
|
+
type: import("vue").PropType<import("./FloatingBubble").FloatingBubbleAxis>;
|
26
|
+
default: import("./FloatingBubble").FloatingBubbleAxis;
|
27
|
+
};
|
28
|
+
magnetic: import("vue").PropType<import("./FloatingBubble").FloatingBubbleMagnetic>;
|
29
|
+
icon: StringConstructor;
|
30
|
+
gap: {
|
31
|
+
type: NumberConstructor;
|
32
|
+
default: number;
|
33
|
+
};
|
34
|
+
offset: {
|
35
|
+
type: import("vue").PropType<import("./FloatingBubble").FloatingBubbleOffset>;
|
36
|
+
default: () => {
|
37
|
+
x: number;
|
38
|
+
y: number;
|
39
|
+
};
|
40
|
+
};
|
41
|
+
teleport: {
|
42
|
+
type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
43
|
+
default: string;
|
44
|
+
};
|
45
|
+
}>> & {
|
46
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
47
|
+
"onUpdate:offset"?: ((...args: any[]) => any) | undefined;
|
48
|
+
onOffsetChange?: ((...args: any[]) => any) | undefined;
|
49
|
+
}, {
|
50
|
+
offset: import("./FloatingBubble").FloatingBubbleOffset;
|
51
|
+
teleport: string | import("vue").RendererElement | null | undefined;
|
52
|
+
gap: number;
|
53
|
+
axis: import("./FloatingBubble").FloatingBubbleAxis;
|
54
|
+
}, {}>>;
|
55
|
+
export default FloatingBubble;
|
56
|
+
export { floatingBubbleProps } from './FloatingBubble';
|
57
|
+
export type { FloatingBubbleProps, FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset, } from './FloatingBubble';
|
58
|
+
export type { FloatingBubbleThemeVars } from './types';
|
59
|
+
declare module 'vue' {
|
60
|
+
interface GlobalComponents {
|
61
|
+
FloatingBubble: typeof FloatingBubble;
|
62
|
+
}
|
63
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
+
mod
|
26
|
+
));
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
|
+
var stdin_exports = {};
|
29
|
+
__export(stdin_exports, {
|
30
|
+
FloatingBubble: () => FloatingBubble,
|
31
|
+
default: () => stdin_default,
|
32
|
+
floatingBubbleProps: () => import_FloatingBubble2.floatingBubbleProps
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(stdin_exports);
|
35
|
+
var import_utils = require("../utils");
|
36
|
+
var import_FloatingBubble = __toESM(require("./FloatingBubble"));
|
37
|
+
var import_FloatingBubble2 = require("./FloatingBubble");
|
38
|
+
const FloatingBubble = (0, import_utils.withInstall)(import_FloatingBubble.default);
|
39
|
+
var stdin_default = FloatingBubble;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
7
|
+
for (let key of __getOwnPropNames(from))
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
10
|
+
}
|
11
|
+
return to;
|
12
|
+
};
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
14
|
+
var stdin_exports = {};
|
15
|
+
module.exports = __toCommonJS(stdin_exports);
|
@@ -28,9 +28,6 @@ var import_use = require("@vant/use");
|
|
28
28
|
var import_use_lock_scroll = require("../composables/use-lock-scroll");
|
29
29
|
var import_use_touch = require("../composables/use-touch");
|
30
30
|
var import_use_sync_prop_ref = require("../composables/use-sync-prop-ref");
|
31
|
-
const {
|
32
|
-
height: windowHeight
|
33
|
-
} = (0, import_use.useWindowSize)();
|
34
31
|
const floatingPanelProps = {
|
35
32
|
height: (0, import_utils.makeNumericProp)(0),
|
36
33
|
anchors: (0, import_utils.makeArrayProp)(),
|
@@ -55,7 +52,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
55
52
|
var _a, _b;
|
56
53
|
return {
|
57
54
|
min: (_a = props.anchors[0]) != null ? _a : 100,
|
58
|
-
max: (_b = props.anchors[props.anchors.length - 1]) != null ? _b : Math.round(windowHeight.value * 0.6)
|
55
|
+
max: (_b = props.anchors[props.anchors.length - 1]) != null ? _b : Math.round(import_utils.windowHeight.value * 0.6)
|
59
56
|
};
|
60
57
|
});
|
61
58
|
const anchors = (0, import_vue2.computed)(() => props.anchors.length >= 2 ? props.anchors : [boundary.value.min, boundary.value.max]);
|
@@ -79,7 +76,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
79
76
|
}
|
80
77
|
return moveY;
|
81
78
|
};
|
82
|
-
const closest = (arr, target) => arr.reduce((pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur);
|
83
79
|
let startY;
|
84
80
|
const touch = (0, import_use_touch.useTouch)();
|
85
81
|
const onTouchstart = (e) => {
|
@@ -107,7 +103,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
107
103
|
};
|
108
104
|
const onTouchend = () => {
|
109
105
|
dragging.value = false;
|
110
|
-
height.value = closest(anchors.value, height.value);
|
106
|
+
height.value = (0, import_utils.closest)(anchors.value, height.value);
|
111
107
|
if (height.value !== -startY) {
|
112
108
|
emit("heightChange", {
|
113
109
|
height: height.value
|
@@ -115,11 +111,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
115
111
|
}
|
116
112
|
};
|
117
113
|
(0, import_vue2.watch)(boundary, () => {
|
118
|
-
height.value = closest(anchors.value, height.value);
|
114
|
+
height.value = (0, import_utils.closest)(anchors.value, height.value);
|
119
115
|
}, {
|
120
116
|
immediate: true
|
121
117
|
});
|
122
118
|
(0, import_use_lock_scroll.useLockScroll)(rootRef, () => true);
|
119
|
+
(0, import_use.useEventListener)("touchmove", onTouchmove, {
|
120
|
+
target: rootRef
|
121
|
+
});
|
123
122
|
return () => {
|
124
123
|
var _a;
|
125
124
|
return (0, import_vue.createVNode)("div", {
|
@@ -129,7 +128,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
129
128
|
"ref": rootRef,
|
130
129
|
"style": rootStyle.value,
|
131
130
|
"onTouchstartPassive": onTouchstart,
|
132
|
-
"onTouchmove": onTouchmove,
|
133
131
|
"onTouchend": onTouchend,
|
134
132
|
"onTouchcancel": onTouchend
|
135
133
|
}, [(0, import_vue.createVNode)("div", {
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { FloatingPanelProps } from './FloatingPanel';
|
2
1
|
export declare const FloatingPanel: import("../utils").WithInstall<import("vue").DefineComponent<{
|
3
2
|
height: {
|
4
3
|
type: (NumberConstructor | StringConstructor)[];
|
@@ -52,7 +51,9 @@ export declare const FloatingPanel: import("../utils").WithInstall<import("vue")
|
|
52
51
|
contentDraggable: boolean;
|
53
52
|
}, {}>>;
|
54
53
|
export default FloatingPanel;
|
55
|
-
export
|
54
|
+
export { floatingPanelProps } from './FloatingPanel';
|
55
|
+
export type { FloatingPanelProps } from './FloatingPanel';
|
56
|
+
export type { FloatingPanelThemeVars } from './types';
|
56
57
|
declare module 'vue' {
|
57
58
|
interface GlobalComponents {
|
58
59
|
VanFloatingPanel: typeof FloatingPanel;
|
@@ -28,10 +28,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
28
28
|
var stdin_exports = {};
|
29
29
|
__export(stdin_exports, {
|
30
30
|
FloatingPanel: () => FloatingPanel,
|
31
|
-
default: () => stdin_default
|
31
|
+
default: () => stdin_default,
|
32
|
+
floatingPanelProps: () => import_FloatingPanel2.floatingPanelProps
|
32
33
|
});
|
33
34
|
module.exports = __toCommonJS(stdin_exports);
|
34
35
|
var import_utils = require("../utils");
|
35
36
|
var import_FloatingPanel = __toESM(require("./FloatingPanel"));
|
37
|
+
var import_FloatingPanel2 = require("./FloatingPanel");
|
36
38
|
const FloatingPanel = (0, import_utils.withInstall)(import_FloatingPanel.default);
|
37
39
|
var stdin_default = FloatingPanel;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export type FloatingPanelThemeVars = {
|
2
|
+
floatingPanelBorderRadius?: string;
|
3
|
+
floatingPanelHeaderHeight?: string;
|
4
|
+
floatingPanelZIndex?: number | string;
|
5
|
+
floatingPanelBackground?: string;
|
6
|
+
floatingPanelBarWidth?: string;
|
7
|
+
floatingPanelBarHeight?: string;
|
8
|
+
floatingPanelBarColor?: string;
|
9
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
7
|
+
for (let key of __getOwnPropNames(from))
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
10
|
+
}
|
11
|
+
return to;
|
12
|
+
};
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
14
|
+
var stdin_exports = {};
|
15
|
+
module.exports = __toCommonJS(stdin_exports);
|
@@ -214,8 +214,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
214
214
|
} = touch;
|
215
215
|
const deltaTime = Date.now() - touchStartTime;
|
216
216
|
const TAP_TIME = 250;
|
217
|
-
|
218
|
-
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET) {
|
217
|
+
if (offsetX.value < import_utils.TAP_OFFSET && offsetY.value < import_utils.TAP_OFFSET) {
|
219
218
|
if (deltaTime < TAP_TIME) {
|
220
219
|
if (doubleTapTimer) {
|
221
220
|
clearTimeout(doubleTapTimer);
|