vant 4.0.0-rc.6 → 4.0.0-rc.7
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/action-sheet/index.css +1 -1
- package/es/composables/use-sync-prop-ref.d.ts +2 -0
- package/es/composables/use-sync-prop-ref.mjs +18 -0
- package/es/date-picker/DatePicker.mjs +4 -1
- package/es/image-preview/ImagePreview.d.ts +2 -1
- package/es/image-preview/ImagePreview.mjs +6 -3
- package/es/image-preview/ImagePreviewItem.d.ts +2 -1
- package/es/image-preview/ImagePreviewItem.mjs +15 -11
- package/es/image-preview/index.d.ts +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/lazyload/vue-lazyload/lazy-image.mjs +5 -5
- package/es/picker/Picker.mjs +4 -2
- package/es/picker/PickerColumn.mjs +5 -4
- package/es/popover/Popover.mjs +13 -8
- package/es/skeleton/Skeleton.d.ts +23 -23
- package/es/skeleton/Skeleton.mjs +28 -23
- package/es/skeleton/SkeletonAvatar.d.ts +26 -0
- package/es/skeleton/SkeletonAvatar.mjs +22 -0
- package/es/skeleton/SkeletonImage.d.ts +26 -0
- package/es/skeleton/SkeletonImage.mjs +26 -0
- package/es/skeleton/SkeletonParagraph.d.ts +27 -0
- package/es/skeleton/SkeletonParagraph.mjs +31 -0
- package/es/skeleton/SkeletonTitle.d.ts +16 -0
- package/es/skeleton/SkeletonTitle.mjs +26 -0
- package/es/skeleton/index.css +1 -1
- package/es/skeleton/index.d.ts +85 -18
- package/es/skeleton/index.mjs +22 -2
- package/es/skeleton/style/index.mjs +2 -0
- package/es/skeleton/types.d.ts +7 -3
- package/es/stepper/Stepper.d.ts +1 -1
- package/es/stepper/Stepper.mjs +1 -2
- package/es/stepper/index.d.ts +1 -1
- package/es/time-picker/TimePicker.mjs +4 -1
- package/es/uploader/Uploader.mjs +4 -4
- package/es/utils/constant.d.ts +1 -0
- package/es/utils/constant.mjs +3 -1
- package/lib/action-sheet/index.css +1 -1
- package/lib/composables/use-sync-prop-ref.d.ts +2 -0
- package/lib/composables/use-sync-prop-ref.js +37 -0
- package/lib/date-picker/DatePicker.js +4 -1
- package/lib/image-preview/ImagePreview.d.ts +2 -1
- package/lib/image-preview/ImagePreview.js +6 -3
- package/lib/image-preview/ImagePreviewItem.d.ts +2 -1
- package/lib/image-preview/ImagePreviewItem.js +14 -10
- package/lib/image-preview/index.d.ts +2 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/vue-lazyload/lazy-image.js +6 -6
- package/lib/picker/Picker.js +3 -1
- package/lib/picker/PickerColumn.js +5 -4
- package/lib/popover/Popover.js +13 -8
- package/lib/skeleton/Skeleton.d.ts +23 -23
- package/lib/skeleton/Skeleton.js +34 -23
- package/lib/skeleton/SkeletonAvatar.d.ts +26 -0
- package/lib/skeleton/SkeletonAvatar.js +41 -0
- package/lib/skeleton/SkeletonImage.d.ts +26 -0
- package/lib/skeleton/SkeletonImage.js +45 -0
- package/lib/skeleton/SkeletonParagraph.d.ts +27 -0
- package/lib/skeleton/SkeletonParagraph.js +50 -0
- package/lib/skeleton/SkeletonTitle.d.ts +16 -0
- package/lib/skeleton/SkeletonTitle.js +45 -0
- package/lib/skeleton/index.css +1 -1
- package/lib/skeleton/index.d.ts +85 -18
- package/lib/skeleton/index.js +22 -2
- package/lib/skeleton/style/index.js +2 -0
- package/lib/skeleton/types.d.ts +7 -3
- package/lib/stepper/Stepper.d.ts +1 -1
- package/lib/stepper/Stepper.js +1 -2
- package/lib/stepper/index.d.ts +1 -1
- package/lib/time-picker/TimePicker.js +4 -1
- package/lib/uploader/Uploader.js +3 -3
- package/lib/utils/constant.d.ts +1 -0
- package/lib/utils/constant.js +3 -1
- package/lib/vant.cjs.js +900 -778
- package/lib/vant.es.js +900 -778
- package/lib/vant.js +894 -778
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -12164
- package/package.json +1 -1
@@ -0,0 +1,26 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { defineComponent } from "vue";
|
3
|
+
import { numericProp, getSizeStyle, makeStringProp, createNamespace } from "../utils/index.mjs";
|
4
|
+
import { Icon } from "../icon/index.mjs";
|
5
|
+
const [name, bem] = createNamespace("skeleton-image");
|
6
|
+
const skeletonImageProps = {
|
7
|
+
imageSize: numericProp,
|
8
|
+
imageShape: makeStringProp("square")
|
9
|
+
};
|
10
|
+
var stdin_default = defineComponent({
|
11
|
+
name,
|
12
|
+
props: skeletonImageProps,
|
13
|
+
setup(props) {
|
14
|
+
return () => _createVNode("div", {
|
15
|
+
"class": bem([props.imageShape]),
|
16
|
+
"style": getSizeStyle(props.imageSize)
|
17
|
+
}, [_createVNode(Icon, {
|
18
|
+
"name": "photo",
|
19
|
+
"class": bem("icon")
|
20
|
+
}, null)]);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
export {
|
24
|
+
stdin_default as default,
|
25
|
+
skeletonImageProps
|
26
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
2
|
+
export declare const DEFAULT_ROW_WIDTH = "100%";
|
3
|
+
export declare const skeletonParagraphProps: {
|
4
|
+
round: BooleanConstructor;
|
5
|
+
rowWidth: {
|
6
|
+
type: (NumberConstructor | StringConstructor)[];
|
7
|
+
default: string;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
export declare type SkeletonParagraphProps = ExtractPropTypes<typeof skeletonParagraphProps>;
|
11
|
+
declare const _default: import("vue").DefineComponent<{
|
12
|
+
round: BooleanConstructor;
|
13
|
+
rowWidth: {
|
14
|
+
type: (NumberConstructor | StringConstructor)[];
|
15
|
+
default: string;
|
16
|
+
};
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
18
|
+
round: BooleanConstructor;
|
19
|
+
rowWidth: {
|
20
|
+
type: (NumberConstructor | StringConstructor)[];
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
}>>, {
|
24
|
+
round: boolean;
|
25
|
+
rowWidth: string | number;
|
26
|
+
}>;
|
27
|
+
export default _default;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { defineComponent } from "vue";
|
3
|
+
import { createNamespace, numericProp } from "../utils/index.mjs";
|
4
|
+
const DEFAULT_ROW_WIDTH = "100%";
|
5
|
+
const skeletonParagraphProps = {
|
6
|
+
round: Boolean,
|
7
|
+
rowWidth: {
|
8
|
+
type: numericProp,
|
9
|
+
default: DEFAULT_ROW_WIDTH
|
10
|
+
}
|
11
|
+
};
|
12
|
+
const [name, bem] = createNamespace("skeleton-paragraph");
|
13
|
+
var stdin_default = defineComponent({
|
14
|
+
name,
|
15
|
+
props: skeletonParagraphProps,
|
16
|
+
setup(props) {
|
17
|
+
return () => _createVNode("div", {
|
18
|
+
"class": bem([{
|
19
|
+
round: props.round
|
20
|
+
}]),
|
21
|
+
"style": {
|
22
|
+
width: props.rowWidth
|
23
|
+
}
|
24
|
+
}, null);
|
25
|
+
}
|
26
|
+
});
|
27
|
+
export {
|
28
|
+
DEFAULT_ROW_WIDTH,
|
29
|
+
stdin_default as default,
|
30
|
+
skeletonParagraphProps
|
31
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { type ExtractPropTypes } from 'vue';
|
2
|
+
export declare const skeletonTitleProps: {
|
3
|
+
round: BooleanConstructor;
|
4
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
5
|
+
};
|
6
|
+
export declare type SkeletonTitleProps = ExtractPropTypes<typeof skeletonTitleProps>;
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
8
|
+
round: BooleanConstructor;
|
9
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
10
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
11
|
+
round: BooleanConstructor;
|
12
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
13
|
+
}>>, {
|
14
|
+
round: boolean;
|
15
|
+
}>;
|
16
|
+
export default _default;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { defineComponent } from "vue";
|
3
|
+
import { createNamespace, numericProp, addUnit } from "../utils/index.mjs";
|
4
|
+
const [name, bem] = createNamespace("skeleton-title");
|
5
|
+
const skeletonTitleProps = {
|
6
|
+
round: Boolean,
|
7
|
+
titleWidth: numericProp
|
8
|
+
};
|
9
|
+
var stdin_default = defineComponent({
|
10
|
+
name,
|
11
|
+
props: skeletonTitleProps,
|
12
|
+
setup(props) {
|
13
|
+
return () => _createVNode("h3", {
|
14
|
+
"class": bem([{
|
15
|
+
round: props.round
|
16
|
+
}]),
|
17
|
+
"style": {
|
18
|
+
width: addUnit(props.titleWidth)
|
19
|
+
}
|
20
|
+
}, null);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
export {
|
24
|
+
stdin_default as default,
|
25
|
+
skeletonTitleProps
|
26
|
+
};
|
package/es/skeleton/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-skeleton-
|
1
|
+
:root{--van-skeleton-paragraph-height: 16px;--van-skeleton-paragraph-background: var(--van-active-color);--van-skeleton-paragraph-margin-top: var(--van-padding-sm);--van-skeleton-title-width: 40%;--van-skeleton-avatar-size: 32px;--van-skeleton-avatar-background: var(--van-active-color);--van-skeleton-image-size: 96px;--van-skeleton-image-radius: 24px;--van-skeleton-duration: 1.2s}.van-skeleton{display:flex;padding:0 var(--van-padding-md)}.van-skeleton-avatar{flex-shrink:0;width:var(--van-skeleton-avatar-size);height:var(--van-skeleton-avatar-size);margin-right:var(--van-padding-md);background:var(--van-skeleton-avatar-background)}.van-skeleton-avatar--round{border-radius:var(--van-radius-max)}.van-skeleton__content{width:100%}.van-skeleton-avatar+.van-skeleton__content{padding-top:var(--van-padding-xs)}.van-skeleton-paragraph,.van-skeleton-title{height:var(--van-skeleton-paragraph-height);background:var(--van-skeleton-paragraph-background)}.van-skeleton-paragraph--round,.van-skeleton-title--round{border-radius:var(--van-radius-max)}.van-skeleton-title{width:var(--van-skeleton-title-width);margin:0}.van-skeleton-paragraph:not(:first-child){margin-top:var(--van-skeleton-paragraph-margin-top)}.van-skeleton-title+.van-skeleton-paragraph{margin-top:20px}.van-skeleton--animate{animation:van-skeleton-blink var(--van-skeleton-duration) ease-in-out infinite}.van-skeleton-image{display:flex;width:var(--van-skeleton-image-size);height:var(--van-skeleton-image-size);align-items:center;justify-content:center;background:var(--van-active-color)}.van-skeleton-image--round{border-radius:var(--van-skeleton-image-radius)}.van-skeleton-image__icon{width:calc(var(--van-skeleton-image-size) / 2);height:calc(var(--van-skeleton-image-size) / 2);font-size:calc(var(--van-skeleton-image-size) / 2);color:var(--van-gray-5)}@keyframes van-skeleton-blink{50%{opacity:.6}}
|
package/es/skeleton/index.d.ts
CHANGED
@@ -1,11 +1,72 @@
|
|
1
|
+
export declare const SkeletonImage: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
imageSize: (NumberConstructor | StringConstructor)[];
|
3
|
+
imageShape: {
|
4
|
+
type: import("vue").PropType<import("./types").SkeletonImageShape>;
|
5
|
+
default: import("./types").SkeletonImageShape;
|
6
|
+
};
|
7
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
8
|
+
imageSize: (NumberConstructor | StringConstructor)[];
|
9
|
+
imageShape: {
|
10
|
+
type: import("vue").PropType<import("./types").SkeletonImageShape>;
|
11
|
+
default: import("./types").SkeletonImageShape;
|
12
|
+
};
|
13
|
+
}>>, {
|
14
|
+
imageShape: import("./types").SkeletonImageShape;
|
15
|
+
}>>;
|
16
|
+
export declare const SkeletonTitle: import("../utils").WithInstall<import("vue").DefineComponent<{
|
17
|
+
round: BooleanConstructor;
|
18
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
19
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
20
|
+
round: BooleanConstructor;
|
21
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
22
|
+
}>>, {
|
23
|
+
round: boolean;
|
24
|
+
}>>;
|
25
|
+
export declare const SkeletonAvatar: import("../utils").WithInstall<import("vue").DefineComponent<{
|
26
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
27
|
+
avatarShape: {
|
28
|
+
type: import("vue").PropType<import("./types").SkeletonAvatarShape>;
|
29
|
+
default: import("./types").SkeletonAvatarShape;
|
30
|
+
};
|
31
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
32
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
33
|
+
avatarShape: {
|
34
|
+
type: import("vue").PropType<import("./types").SkeletonAvatarShape>;
|
35
|
+
default: import("./types").SkeletonAvatarShape;
|
36
|
+
};
|
37
|
+
}>>, {
|
38
|
+
avatarShape: import("./types").SkeletonAvatarShape;
|
39
|
+
}>>;
|
40
|
+
export declare const SkeletonParagraph: import("../utils").WithInstall<import("vue").DefineComponent<{
|
41
|
+
round: BooleanConstructor;
|
42
|
+
rowWidth: {
|
43
|
+
type: (NumberConstructor | StringConstructor)[];
|
44
|
+
default: string;
|
45
|
+
};
|
46
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
47
|
+
round: BooleanConstructor;
|
48
|
+
rowWidth: {
|
49
|
+
type: (NumberConstructor | StringConstructor)[];
|
50
|
+
default: string;
|
51
|
+
};
|
52
|
+
}>>, {
|
53
|
+
round: boolean;
|
54
|
+
rowWidth: string | number;
|
55
|
+
}>>;
|
1
56
|
export declare const Skeleton: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
57
|
row: {
|
3
58
|
type: (NumberConstructor | StringConstructor)[];
|
4
59
|
default: number;
|
5
60
|
};
|
6
|
-
title: BooleanConstructor;
|
7
61
|
round: BooleanConstructor;
|
62
|
+
title: BooleanConstructor;
|
63
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
8
64
|
avatar: BooleanConstructor;
|
65
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
66
|
+
avatarShape: {
|
67
|
+
type: import("vue").PropType<import("./types").SkeletonAvatarShape>;
|
68
|
+
default: import("./types").SkeletonAvatarShape;
|
69
|
+
};
|
9
70
|
loading: {
|
10
71
|
type: BooleanConstructor;
|
11
72
|
default: true;
|
@@ -14,12 +75,6 @@ export declare const Skeleton: import("../utils").WithInstall<import("vue").Defi
|
|
14
75
|
type: BooleanConstructor;
|
15
76
|
default: true;
|
16
77
|
};
|
17
|
-
avatarSize: (NumberConstructor | StringConstructor)[];
|
18
|
-
titleWidth: (NumberConstructor | StringConstructor)[];
|
19
|
-
avatarShape: {
|
20
|
-
type: import("vue").PropType<import("./Skeleton").SkeletonAvatarShape>;
|
21
|
-
default: import("./Skeleton").SkeletonAvatarShape;
|
22
|
-
};
|
23
78
|
rowWidth: {
|
24
79
|
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
25
80
|
default: string;
|
@@ -31,9 +86,15 @@ export declare const Skeleton: import("../utils").WithInstall<import("vue").Defi
|
|
31
86
|
type: (NumberConstructor | StringConstructor)[];
|
32
87
|
default: number;
|
33
88
|
};
|
34
|
-
title: BooleanConstructor;
|
35
89
|
round: BooleanConstructor;
|
90
|
+
title: BooleanConstructor;
|
91
|
+
titleWidth: (NumberConstructor | StringConstructor)[];
|
36
92
|
avatar: BooleanConstructor;
|
93
|
+
avatarSize: (NumberConstructor | StringConstructor)[];
|
94
|
+
avatarShape: {
|
95
|
+
type: import("vue").PropType<import("./types").SkeletonAvatarShape>;
|
96
|
+
default: import("./types").SkeletonAvatarShape;
|
97
|
+
};
|
37
98
|
loading: {
|
38
99
|
type: BooleanConstructor;
|
39
100
|
default: true;
|
@@ -42,12 +103,6 @@ export declare const Skeleton: import("../utils").WithInstall<import("vue").Defi
|
|
42
103
|
type: BooleanConstructor;
|
43
104
|
default: true;
|
44
105
|
};
|
45
|
-
avatarSize: (NumberConstructor | StringConstructor)[];
|
46
|
-
titleWidth: (NumberConstructor | StringConstructor)[];
|
47
|
-
avatarShape: {
|
48
|
-
type: import("vue").PropType<import("./Skeleton").SkeletonAvatarShape>;
|
49
|
-
default: import("./Skeleton").SkeletonAvatarShape;
|
50
|
-
};
|
51
106
|
rowWidth: {
|
52
107
|
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
53
108
|
default: string;
|
@@ -58,16 +113,28 @@ export declare const Skeleton: import("../utils").WithInstall<import("vue").Defi
|
|
58
113
|
round: boolean;
|
59
114
|
loading: boolean;
|
60
115
|
row: string | number;
|
61
|
-
|
62
|
-
avatarShape: import("./Skeleton").SkeletonAvatarShape;
|
116
|
+
avatarShape: import("./types").SkeletonAvatarShape;
|
63
117
|
rowWidth: import("../utils").Numeric | import("../utils").Numeric[];
|
118
|
+
avatar: boolean;
|
64
119
|
}>>;
|
65
120
|
export default Skeleton;
|
66
121
|
export { skeletonProps } from './Skeleton';
|
67
|
-
export type { SkeletonProps
|
68
|
-
export
|
122
|
+
export type { SkeletonProps } from './Skeleton';
|
123
|
+
export { skeletonImageProps } from './SkeletonImage';
|
124
|
+
export type { SkeletonImageProps } from './SkeletonImage';
|
125
|
+
export { skeletonAvatarProps } from './SkeletonAvatar';
|
126
|
+
export type { SkeletonAvatarProps } from './SkeletonAvatar';
|
127
|
+
export { skeletonParagraphProps } from './SkeletonParagraph';
|
128
|
+
export type { SkeletonParagraphProps } from './SkeletonParagraph';
|
129
|
+
export { skeletonTitleProps } from './SkeletonTitle';
|
130
|
+
export type { SkeletonTitleProps } from './SkeletonTitle';
|
131
|
+
export type { SkeletonThemeVars, SkeletonImageShape, SkeletonAvatarShape, } from './types';
|
69
132
|
declare module 'vue' {
|
70
133
|
interface GlobalComponents {
|
71
134
|
VanSkeleton: typeof Skeleton;
|
135
|
+
VanSkeletonImage: typeof SkeletonImage;
|
136
|
+
VanSkeletonTitle: typeof SkeletonTitle;
|
137
|
+
VanSkeletonAvatar: typeof SkeletonAvatar;
|
138
|
+
VanSkeletonParagraph: typeof SkeletonParagraph;
|
72
139
|
}
|
73
140
|
}
|
package/es/skeleton/index.mjs
CHANGED
@@ -1,10 +1,30 @@
|
|
1
|
-
import { withInstall } from "../utils/index.mjs";
|
2
1
|
import _Skeleton from "./Skeleton.mjs";
|
2
|
+
import _SkeletonImage from "./SkeletonImage.mjs";
|
3
|
+
import _SkeletonTitle from "./SkeletonTitle.mjs";
|
4
|
+
import _SkeletonAvatar from "./SkeletonAvatar.mjs";
|
5
|
+
import _SkeletonParagraph from "./SkeletonParagraph.mjs";
|
6
|
+
import { withInstall } from "../utils/index.mjs";
|
7
|
+
const SkeletonImage = withInstall(_SkeletonImage);
|
8
|
+
const SkeletonTitle = withInstall(_SkeletonTitle);
|
9
|
+
const SkeletonAvatar = withInstall(_SkeletonAvatar);
|
10
|
+
const SkeletonParagraph = withInstall(_SkeletonParagraph);
|
3
11
|
const Skeleton = withInstall(_Skeleton);
|
4
12
|
var stdin_default = Skeleton;
|
5
13
|
import { skeletonProps } from "./Skeleton.mjs";
|
14
|
+
import { skeletonImageProps } from "./SkeletonImage.mjs";
|
15
|
+
import { skeletonAvatarProps } from "./SkeletonAvatar.mjs";
|
16
|
+
import { skeletonParagraphProps } from "./SkeletonParagraph.mjs";
|
17
|
+
import { skeletonTitleProps } from "./SkeletonTitle.mjs";
|
6
18
|
export {
|
7
19
|
Skeleton,
|
20
|
+
SkeletonAvatar,
|
21
|
+
SkeletonImage,
|
22
|
+
SkeletonParagraph,
|
23
|
+
SkeletonTitle,
|
8
24
|
stdin_default as default,
|
9
|
-
|
25
|
+
skeletonAvatarProps,
|
26
|
+
skeletonImageProps,
|
27
|
+
skeletonParagraphProps,
|
28
|
+
skeletonProps,
|
29
|
+
skeletonTitleProps
|
10
30
|
};
|
package/es/skeleton/types.d.ts
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
+
export declare type SkeletonAvatarShape = 'square' | 'round';
|
2
|
+
export declare type SkeletonImageShape = 'square' | 'round';
|
1
3
|
export declare type SkeletonThemeVars = {
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
skeletonParagraphHeight?: string;
|
5
|
+
skeletonParagraphBackground?: string;
|
6
|
+
skeletonParagraphMarginTop?: string;
|
5
7
|
skeletonTitleWidth?: string;
|
6
8
|
skeletonAvatarSize?: string;
|
7
9
|
skeletonAvatarBackground?: string;
|
10
|
+
SkeletonImageSize?: string;
|
11
|
+
SkeletonImageRadius?: string;
|
8
12
|
skeletonDuration?: string;
|
9
13
|
};
|
package/es/stepper/Stepper.d.ts
CHANGED
@@ -177,13 +177,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
177
177
|
name: string | number;
|
178
178
|
max: string | number;
|
179
179
|
disabled: boolean;
|
180
|
+
longPress: boolean;
|
180
181
|
step: string | number;
|
181
182
|
min: string | number;
|
182
183
|
integer: boolean;
|
183
184
|
showPlus: boolean;
|
184
185
|
showMinus: boolean;
|
185
186
|
showInput: boolean;
|
186
|
-
longPress: boolean;
|
187
187
|
autoFixed: boolean;
|
188
188
|
allowEmpty: boolean;
|
189
189
|
disablePlus: boolean;
|
package/es/stepper/Stepper.mjs
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
import { withDirectives as _withDirectives, createVNode as _createVNode, mergeProps as _mergeProps, vShow as _vShow } from "vue";
|
2
2
|
import { ref, watch, computed, nextTick, defineComponent } from "vue";
|
3
|
-
import { isDef, addUnit, addNumber, truthProp, resetScroll, numericProp, formatNumber, getSizeStyle, preventDefault, createNamespace, callInterceptor, makeNumericProp, HAPTICS_FEEDBACK } from "../utils/index.mjs";
|
3
|
+
import { isDef, addUnit, addNumber, truthProp, resetScroll, numericProp, formatNumber, getSizeStyle, preventDefault, createNamespace, callInterceptor, makeNumericProp, HAPTICS_FEEDBACK, LONG_PRESS_START_TIME } from "../utils/index.mjs";
|
4
4
|
import { useCustomFieldValue } from "@vant/use";
|
5
5
|
const [name, bem] = createNamespace("stepper");
|
6
6
|
const LONG_PRESS_INTERVAL = 200;
|
7
|
-
const LONG_PRESS_START_TIME = 600;
|
8
7
|
const isEqual = (value1, value2) => String(value1) === String(value2);
|
9
8
|
const stepperProps = {
|
10
9
|
min: makeNumericProp(1),
|
package/es/stepper/index.d.ts
CHANGED
@@ -118,13 +118,13 @@ export declare const Stepper: import("../utils").WithInstall<import("vue").Defin
|
|
118
118
|
name: string | number;
|
119
119
|
max: string | number;
|
120
120
|
disabled: boolean;
|
121
|
+
longPress: boolean;
|
121
122
|
step: string | number;
|
122
123
|
min: string | number;
|
123
124
|
integer: boolean;
|
124
125
|
showPlus: boolean;
|
125
126
|
showMinus: boolean;
|
126
127
|
showInput: boolean;
|
127
|
-
longPress: boolean;
|
128
128
|
autoFixed: boolean;
|
129
129
|
allowEmpty: boolean;
|
130
130
|
disablePlus: boolean;
|
@@ -38,7 +38,10 @@ var stdin_default = defineComponent({
|
|
38
38
|
case "second":
|
39
39
|
return genOptions(+props.minSecond, +props.maxSecond, type, formatter, filter);
|
40
40
|
default:
|
41
|
-
|
41
|
+
if (process.env.NODE_ENV !== "production") {
|
42
|
+
throw new Error(`[Vant] DatePicker: unsupported columns type: ${type}`);
|
43
|
+
}
|
44
|
+
return [];
|
42
45
|
}
|
43
46
|
}));
|
44
47
|
watch(currentValues, (newValues) => {
|
package/es/uploader/Uploader.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
1
|
+
import { withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
2
2
|
import { ref, reactive, defineComponent, onBeforeUnmount } from "vue";
|
3
3
|
import { pick, extend, toArray, isPromise, truthProp, getSizeStyle, makeArrayProp, makeStringProp, makeNumericProp } from "../utils/index.mjs";
|
4
4
|
import { bem, name, isOversize, filterFiles, isImageFile, readFileContent } from "./utils.mjs";
|
@@ -189,7 +189,7 @@ var stdin_default = defineComponent({
|
|
189
189
|
};
|
190
190
|
const onClickUpload = (event) => emit("clickUpload", event);
|
191
191
|
const renderUpload = () => {
|
192
|
-
if (props.modelValue.length >= props.maxCount
|
192
|
+
if (props.modelValue.length >= props.maxCount) {
|
193
193
|
return;
|
194
194
|
}
|
195
195
|
const Input = props.readonly ? null : _createVNode("input", {
|
@@ -208,7 +208,7 @@ var stdin_default = defineComponent({
|
|
208
208
|
"onClick": onClickUpload
|
209
209
|
}, [slots.default(), Input]);
|
210
210
|
}
|
211
|
-
return _createVNode("div", {
|
211
|
+
return _withDirectives(_createVNode("div", {
|
212
212
|
"class": bem("upload", {
|
213
213
|
readonly: props.readonly
|
214
214
|
}),
|
@@ -219,7 +219,7 @@ var stdin_default = defineComponent({
|
|
219
219
|
"class": bem("upload-icon")
|
220
220
|
}, null), props.uploadText && _createVNode("span", {
|
221
221
|
"class": bem("upload-text")
|
222
|
-
}, [props.uploadText]), Input]);
|
222
|
+
}, [props.uploadText]), Input]), [[_vShow, props.showUpload]]);
|
223
223
|
};
|
224
224
|
const chooseFile = () => {
|
225
225
|
if (inputRef.value && !props.disabled) {
|
package/es/utils/constant.d.ts
CHANGED
@@ -9,3 +9,4 @@ export declare const BORDER_TOP_BOTTOM: string;
|
|
9
9
|
export declare const BORDER_UNSET_TOP_BOTTOM: string;
|
10
10
|
export declare const HAPTICS_FEEDBACK = "van-haptics-feedback";
|
11
11
|
export declare const FORM_KEY: InjectionKey<FormProvide>;
|
12
|
+
export declare const LONG_PRESS_START_TIME = 500;
|
package/es/utils/constant.mjs
CHANGED
@@ -7,6 +7,7 @@ const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;
|
|
7
7
|
const BORDER_UNSET_TOP_BOTTOM = `${BORDER}-unset--top-bottom`;
|
8
8
|
const HAPTICS_FEEDBACK = "van-haptics-feedback";
|
9
9
|
const FORM_KEY = Symbol("van-form");
|
10
|
+
const LONG_PRESS_START_TIME = 500;
|
10
11
|
export {
|
11
12
|
BORDER,
|
12
13
|
BORDER_BOTTOM,
|
@@ -16,5 +17,6 @@ export {
|
|
16
17
|
BORDER_TOP_BOTTOM,
|
17
18
|
BORDER_UNSET_TOP_BOTTOM,
|
18
19
|
FORM_KEY,
|
19
|
-
HAPTICS_FEEDBACK
|
20
|
+
HAPTICS_FEEDBACK,
|
21
|
+
LONG_PRESS_START_TIME
|
20
22
|
};
|
@@ -1 +1 @@
|
|
1
|
-
:root{--van-action-sheet-max-height: 80%;--van-action-sheet-header-height: 48px;--van-action-sheet-header-font-size: var(--van-font-size-lg);--van-action-sheet-description-color: var(--van-text-color-2);--van-action-sheet-description-font-size: var(--van-font-size-md);--van-action-sheet-description-line-height: var(--van-line-height-md);--van-action-sheet-item-background: var(--van-background-2);--van-action-sheet-item-font-size: var(--van-font-size-lg);--van-action-sheet-item-line-height: var(--van-line-height-lg);--van-action-sheet-item-text-color: var(--van-text-color);--van-action-sheet-item-disabled-text-color: var(--van-text-color-3);--van-action-sheet-subname-color: var(--van-text-color-2);--van-action-sheet-subname-font-size: var(--van-font-size-sm);--van-action-sheet-subname-line-height: var(--van-line-height-sm);--van-action-sheet-close-icon-size: 22px;--van-action-sheet-close-icon-color: var(--van-gray-5);--van-action-sheet-close-icon-padding: 0 var(--van-padding-md);--van-action-sheet-cancel-text-color: var(--van-gray-7);--van-action-sheet-cancel-padding-top: var(--van-padding-xs);--van-action-sheet-cancel-padding-color: var(--van-background);--van-action-sheet-loading-icon-size: 22px}.van-action-sheet{display:flex;flex-direction:column;max-height:var(--van-action-sheet-max-height);overflow:hidden;color:var(--van-action-sheet-item-text-color)}.van-action-sheet__content{flex:1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__item,.van-action-sheet__cancel{display:block;width:100%;padding:14px var(--van-padding-md);font-size:var(--van-action-sheet-item-font-size);background:var(--van-action-sheet-item-background);border:none;cursor:pointer}.van-action-sheet__item:active,.van-action-sheet__cancel:active{background-color:var(--van-active-color)}.van-action-sheet__item{line-height:var(--van-action-sheet-item-line-height)}.van-action-sheet__item--loading,.van-action-sheet__item--disabled{color:var(--van-action-sheet-item-disabled-text-color)}.van-action-sheet__item--loading:active,.van-action-sheet__item--disabled:active{background-color:var(--van-action-sheet-item-background)}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{flex-shrink:0;box-sizing:border-box;color:var(--van-action-sheet-cancel-text-color)}.van-action-sheet__subname{margin-top:var(--van-padding-xs);color:var(--van-action-sheet-subname-color);font-size:var(--van-action-sheet-subname-font-size);line-height:var(--van-action-sheet-subname-line-height)}.van-action-sheet__gap{display:block;height:var(--van-action-sheet-cancel-padding-top);background:var(--van-action-sheet-cancel-padding-color)}.van-action-sheet__header{flex-shrink:0;font-weight:var(--van-font-bold);font-size:var(--van-action-sheet-header-font-size);line-height:var(--van-action-sheet-header-height);text-align:center}.van-action-sheet__description{position:relative;flex-shrink:0;padding:20px var(--van-padding-md);color:var(--van-action-sheet-description-color);font-size:var(--van-action-sheet-description-font-size);line-height:var(--van-action-sheet-description-line-height);text-align:center}.van-action-sheet__description:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__loading-icon .van-loading__spinner{width:var(--van-action-sheet-loading-icon-size);height:var(--van-action-sheet-loading-icon-size)}.van-action-sheet__close{position:absolute;top:0;right:0;padding:var(--van-action-sheet-close-icon-padding);color:var(--van-action-sheet-close-icon-color);font-size:var(--van-action-sheet-close-icon-size);line-height:inherit}
|
1
|
+
:root{--van-action-sheet-max-height: 80%;--van-action-sheet-header-height: 48px;--van-action-sheet-header-font-size: var(--van-font-size-lg);--van-action-sheet-description-color: var(--van-text-color-2);--van-action-sheet-description-font-size: var(--van-font-size-md);--van-action-sheet-description-line-height: var(--van-line-height-md);--van-action-sheet-item-background: var(--van-background-2);--van-action-sheet-item-font-size: var(--van-font-size-lg);--van-action-sheet-item-line-height: var(--van-line-height-lg);--van-action-sheet-item-text-color: var(--van-text-color);--van-action-sheet-item-disabled-text-color: var(--van-text-color-3);--van-action-sheet-subname-color: var(--van-text-color-2);--van-action-sheet-subname-font-size: var(--van-font-size-sm);--van-action-sheet-subname-line-height: var(--van-line-height-sm);--van-action-sheet-close-icon-size: 22px;--van-action-sheet-close-icon-color: var(--van-gray-5);--van-action-sheet-close-icon-padding: 0 var(--van-padding-md);--van-action-sheet-cancel-text-color: var(--van-gray-7);--van-action-sheet-cancel-padding-top: var(--van-padding-xs);--van-action-sheet-cancel-padding-color: var(--van-background);--van-action-sheet-loading-icon-size: 22px}.van-action-sheet{display:flex;flex-direction:column;max-height:var(--van-action-sheet-max-height);overflow:hidden;color:var(--van-action-sheet-item-text-color)}.van-action-sheet__content{flex:1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__item,.van-action-sheet__cancel{display:block;width:100%;padding:14px var(--van-padding-md);font-size:var(--van-action-sheet-item-font-size);background:var(--van-action-sheet-item-background);border:none;cursor:pointer}.van-action-sheet__item:active,.van-action-sheet__cancel:active{background-color:var(--van-active-color)}.van-action-sheet__item{line-height:var(--van-action-sheet-item-line-height)}.van-action-sheet__item--loading,.van-action-sheet__item--disabled{color:var(--van-action-sheet-item-disabled-text-color)}.van-action-sheet__item--loading:active,.van-action-sheet__item--disabled:active{background-color:var(--van-action-sheet-item-background)}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{flex-shrink:0;box-sizing:border-box;color:var(--van-action-sheet-cancel-text-color)}.van-action-sheet__subname{margin-top:var(--van-padding-xs);color:var(--van-action-sheet-subname-color);font-size:var(--van-action-sheet-subname-font-size);line-height:var(--van-action-sheet-subname-line-height)}.van-action-sheet__gap{display:block;height:var(--van-action-sheet-cancel-padding-top);background:var(--van-action-sheet-cancel-padding-color)}.van-action-sheet__header{flex-shrink:0;font-weight:var(--van-font-bold);font-size:var(--van-action-sheet-header-font-size);line-height:var(--van-action-sheet-header-height);text-align:center}.van-action-sheet__description{position:relative;flex-shrink:0;padding:20px var(--van-padding-md);color:var(--van-action-sheet-description-color);font-size:var(--van-action-sheet-description-font-size);line-height:var(--van-action-sheet-description-line-height);text-align:center}.van-action-sheet__description:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__loading-icon .van-loading__spinner{width:var(--van-action-sheet-loading-icon-size);height:var(--van-action-sheet-loading-icon-size)}.van-action-sheet__close{position:absolute;top:0;right:0;z-index:1;padding:var(--van-action-sheet-close-icon-padding);color:var(--van-action-sheet-close-icon-color);font-size:var(--van-action-sheet-close-icon-size);line-height:inherit}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __export = (target, all) => {
|
6
|
+
for (var name in all)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
8
|
+
};
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
11
|
+
for (let key of __getOwnPropNames(from))
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
+
}
|
15
|
+
return to;
|
16
|
+
};
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
|
+
var stdin_exports = {};
|
19
|
+
__export(stdin_exports, {
|
20
|
+
useSyncPropRef: () => useSyncPropRef
|
21
|
+
});
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
23
|
+
var import_vue = require("vue");
|
24
|
+
const useSyncPropRef = (getProp, setProp) => {
|
25
|
+
const propRef = (0, import_vue.ref)(getProp());
|
26
|
+
(0, import_vue.watch)(getProp, (value) => {
|
27
|
+
if (value !== propRef.value) {
|
28
|
+
propRef.value = value;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
(0, import_vue.watch)(propRef, (value) => {
|
32
|
+
if (value !== getProp()) {
|
33
|
+
setProp(value);
|
34
|
+
}
|
35
|
+
});
|
36
|
+
return propRef;
|
37
|
+
};
|
@@ -103,7 +103,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
103
103
|
case "day":
|
104
104
|
return genDayOptions();
|
105
105
|
default:
|
106
|
-
|
106
|
+
if (process.env.NODE_ENV !== "production") {
|
107
|
+
throw new Error(`[Vant] DatePicker: unsupported columns type: ${type}`);
|
108
|
+
}
|
109
|
+
return [];
|
107
110
|
}
|
108
111
|
}));
|
109
112
|
(0, import_vue2.watch)(currentValues, (newValues) => {
|
@@ -109,7 +109,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
109
109
|
type: PropType<PopupCloseIconPosition>;
|
110
110
|
default: PopupCloseIconPosition;
|
111
111
|
};
|
112
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "closed" | "update:show" | "scale")[], "change" | "close" | "closed" | "update:show" | "scale", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
112
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "closed" | "update:show" | "scale" | "longPress")[], "change" | "close" | "closed" | "update:show" | "scale" | "longPress", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
113
113
|
show: BooleanConstructor;
|
114
114
|
loop: {
|
115
115
|
type: BooleanConstructor;
|
@@ -168,6 +168,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
168
168
|
onClosed?: ((...args: any[]) => any) | undefined;
|
169
169
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
170
170
|
onScale?: ((...args: any[]) => any) | undefined;
|
171
|
+
onLongPress?: ((...args: any[]) => any) | undefined;
|
171
172
|
}, {
|
172
173
|
loop: boolean;
|
173
174
|
overlay: boolean;
|
@@ -62,7 +62,7 @@ const imagePreviewProps = {
|
|
62
62
|
var stdin_default = (0, import_vue2.defineComponent)({
|
63
63
|
name,
|
64
64
|
props: imagePreviewProps,
|
65
|
-
emits: ["scale", "close", "closed", "change", "update:show"],
|
65
|
+
emits: ["scale", "close", "closed", "change", "longPress", "update:show"],
|
66
66
|
setup(props, {
|
67
67
|
emit,
|
68
68
|
slots
|
@@ -122,7 +122,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
122
122
|
"indicatorColor": "white",
|
123
123
|
"onChange": setActive
|
124
124
|
}, {
|
125
|
-
default: () => [props.images.map((image) => (0, import_vue.createVNode)(import_ImagePreviewItem.default, {
|
125
|
+
default: () => [props.images.map((image, index) => (0, import_vue.createVNode)(import_ImagePreviewItem.default, {
|
126
126
|
"src": image,
|
127
127
|
"show": props.show,
|
128
128
|
"active": state.active,
|
@@ -131,7 +131,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
131
131
|
"rootWidth": state.rootWidth,
|
132
132
|
"rootHeight": state.rootHeight,
|
133
133
|
"onScale": emitScale,
|
134
|
-
"onClose": emitClose
|
134
|
+
"onClose": emitClose,
|
135
|
+
"onLongPress": () => emit("longPress", {
|
136
|
+
index
|
137
|
+
})
|
135
138
|
}, {
|
136
139
|
image: slots.image
|
137
140
|
}))]
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
18
18
|
type: NumberConstructor;
|
19
19
|
required: true;
|
20
20
|
};
|
21
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "scale")[], "close" | "scale", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
21
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "scale" | "longPress")[], "close" | "scale" | "longPress", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
22
22
|
src: StringConstructor;
|
23
23
|
show: BooleanConstructor;
|
24
24
|
active: NumberConstructor;
|
@@ -41,6 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
41
41
|
}>> & {
|
42
42
|
onClose?: ((...args: any[]) => any) | undefined;
|
43
43
|
onScale?: ((...args: any[]) => any) | undefined;
|
44
|
+
onLongPress?: ((...args: any[]) => any) | undefined;
|
44
45
|
}, {
|
45
46
|
show: boolean;
|
46
47
|
}>;
|
@@ -40,7 +40,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
40
40
|
rootWidth: (0, import_utils.makeRequiredProp)(Number),
|
41
41
|
rootHeight: (0, import_utils.makeRequiredProp)(Number)
|
42
42
|
},
|
43
|
-
emits: ["scale", "close"],
|
43
|
+
emits: ["scale", "close", "longPress"],
|
44
44
|
setup(props, {
|
45
45
|
emit,
|
46
46
|
slots
|
@@ -187,16 +187,20 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
187
187
|
const deltaTime = Date.now() - touchStartTime;
|
188
188
|
const TAP_TIME = 250;
|
189
189
|
const TAP_OFFSET = 5;
|
190
|
-
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET
|
191
|
-
if (
|
192
|
-
|
193
|
-
|
194
|
-
toggleScale();
|
195
|
-
} else {
|
196
|
-
doubleTapTimer = setTimeout(() => {
|
197
|
-
emit("close");
|
190
|
+
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET) {
|
191
|
+
if (deltaTime < TAP_TIME) {
|
192
|
+
if (doubleTapTimer) {
|
193
|
+
clearTimeout(doubleTapTimer);
|
198
194
|
doubleTapTimer = null;
|
199
|
-
|
195
|
+
toggleScale();
|
196
|
+
} else {
|
197
|
+
doubleTapTimer = setTimeout(() => {
|
198
|
+
emit("close");
|
199
|
+
doubleTapTimer = null;
|
200
|
+
}, TAP_TIME);
|
201
|
+
}
|
202
|
+
} else if (deltaTime > import_utils.LONG_PRESS_START_TIME) {
|
203
|
+
emit("longPress");
|
200
204
|
}
|
201
205
|
}
|
202
206
|
};
|