vant 4.0.0-rc.5 → 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/calendar/Calendar.mjs +10 -3
- package/es/calendar/CalendarHeader.d.ts +2 -0
- package/es/calendar/CalendarHeader.mjs +5 -1
- package/es/cell/Cell.d.ts +17 -0
- package/es/cell/Cell.mjs +11 -4
- package/es/cell/index.d.ts +9 -0
- package/es/collapse-item/CollapseItem.d.ts +13 -0
- package/es/collapse-item/index.d.ts +9 -0
- package/es/composables/use-sync-prop-ref.d.ts +2 -0
- package/es/composables/use-sync-prop-ref.mjs +18 -0
- package/es/coupon/index.css +1 -1
- package/es/coupon-list/index.css +1 -1
- package/es/date-picker/DatePicker.mjs +4 -1
- package/es/field/Field.d.ts +13 -0
- package/es/field/index.d.ts +9 -0
- package/es/image-preview/ImagePreview.d.ts +2 -1
- package/es/image-preview/ImagePreview.mjs +9 -4
- package/es/image-preview/ImagePreviewItem.d.ts +2 -1
- package/es/image-preview/ImagePreviewItem.mjs +22 -13
- package/es/image-preview/index.css +1 -1
- 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/swipe/Swipe.mjs +1 -1
- package/es/time-picker/TimePicker.mjs +4 -1
- package/es/toast/Toast.d.ts +4 -1
- package/es/toast/Toast.mjs +2 -1
- package/es/toast/index.css +1 -1
- package/es/toast/index.d.ts +3 -1
- package/es/toast/types.d.ts +2 -0
- 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/calendar/Calendar.js +10 -3
- package/lib/calendar/CalendarHeader.d.ts +2 -0
- package/lib/calendar/CalendarHeader.js +5 -1
- package/lib/cell/Cell.d.ts +17 -0
- package/lib/cell/Cell.js +10 -3
- package/lib/cell/index.d.ts +9 -0
- package/lib/collapse-item/CollapseItem.d.ts +13 -0
- package/lib/collapse-item/index.d.ts +9 -0
- package/lib/composables/use-sync-prop-ref.d.ts +2 -0
- package/lib/composables/use-sync-prop-ref.js +37 -0
- package/lib/coupon/index.css +1 -1
- package/lib/coupon-list/index.css +1 -1
- package/lib/date-picker/DatePicker.js +4 -1
- package/lib/field/Field.d.ts +13 -0
- package/lib/field/index.d.ts +9 -0
- package/lib/image-preview/ImagePreview.d.ts +2 -1
- package/lib/image-preview/ImagePreview.js +9 -4
- package/lib/image-preview/ImagePreviewItem.d.ts +2 -1
- package/lib/image-preview/ImagePreviewItem.js +21 -12
- package/lib/image-preview/index.css +1 -1
- 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/swipe/Swipe.js +1 -1
- package/lib/time-picker/TimePicker.js +4 -1
- package/lib/toast/Toast.d.ts +4 -1
- package/lib/toast/Toast.js +2 -1
- package/lib/toast/index.css +1 -1
- package/lib/toast/index.d.ts +3 -1
- package/lib/toast/types.d.ts +2 -0
- 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 +936 -788
- package/lib/vant.es.js +936 -788
- package/lib/vant.js +930 -788
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -12150
- package/package.json +1 -1
- package/changelog.generated.md +0 -71
@@ -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}
|
package/es/calendar/Calendar.mjs
CHANGED
@@ -106,7 +106,10 @@ var stdin_default = defineComponent({
|
|
106
106
|
};
|
107
107
|
let bodyHeight;
|
108
108
|
const bodyRef = ref();
|
109
|
-
const subtitle = ref(
|
109
|
+
const subtitle = ref({
|
110
|
+
text: "",
|
111
|
+
date: void 0
|
112
|
+
});
|
110
113
|
const currentDate = ref(getInitialDate());
|
111
114
|
const [monthRefs, setMonthRefs] = useRefs();
|
112
115
|
const dayOffset = computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
|
@@ -167,7 +170,10 @@ var stdin_default = defineComponent({
|
|
167
170
|
monthRefs.value[index].setVisible(visible);
|
168
171
|
});
|
169
172
|
if (currentMonth) {
|
170
|
-
subtitle.value =
|
173
|
+
subtitle.value = {
|
174
|
+
text: currentMonth.getTitle(),
|
175
|
+
date: currentMonth.date
|
176
|
+
};
|
171
177
|
}
|
172
178
|
};
|
173
179
|
const scrollToDate = (targetDate) => {
|
@@ -357,8 +363,9 @@ var stdin_default = defineComponent({
|
|
357
363
|
const renderCalendar = () => _createVNode("div", {
|
358
364
|
"class": bem()
|
359
365
|
}, [_createVNode(CalendarHeader, {
|
366
|
+
"date": subtitle.value.date,
|
360
367
|
"title": props.title,
|
361
|
-
"subtitle": subtitle.value,
|
368
|
+
"subtitle": subtitle.value.text,
|
362
369
|
"showTitle": props.showTitle,
|
363
370
|
"showSubtitle": props.showSubtitle,
|
364
371
|
"firstDayOfWeek": dayOffset.value,
|
@@ -1,10 +1,12 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
2
|
+
date: DateConstructor;
|
2
3
|
title: StringConstructor;
|
3
4
|
subtitle: StringConstructor;
|
4
5
|
showTitle: BooleanConstructor;
|
5
6
|
showSubtitle: BooleanConstructor;
|
6
7
|
firstDayOfWeek: NumberConstructor;
|
7
8
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "clickSubtitle"[], "clickSubtitle", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
9
|
+
date: DateConstructor;
|
8
10
|
title: StringConstructor;
|
9
11
|
subtitle: StringConstructor;
|
10
12
|
showTitle: BooleanConstructor;
|
@@ -6,6 +6,7 @@ const [name] = createNamespace("calendar-header");
|
|
6
6
|
var stdin_default = defineComponent({
|
7
7
|
name,
|
8
8
|
props: {
|
9
|
+
date: Date,
|
9
10
|
title: String,
|
10
11
|
subtitle: String,
|
11
12
|
showTitle: Boolean,
|
@@ -29,7 +30,10 @@ var stdin_default = defineComponent({
|
|
29
30
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
30
31
|
const renderSubtitle = () => {
|
31
32
|
if (props.showSubtitle) {
|
32
|
-
const title = slots.subtitle ? slots.subtitle(
|
33
|
+
const title = slots.subtitle ? slots.subtitle({
|
34
|
+
date: props.date,
|
35
|
+
text: props.subtitle
|
36
|
+
}) : props.subtitle;
|
33
37
|
return _createVNode("div", {
|
34
38
|
"class": bem("header-subtitle"),
|
35
39
|
"onClick": onClickSubtitle
|
package/es/cell/Cell.d.ts
CHANGED
@@ -2,6 +2,10 @@ import { type PropType, type CSSProperties, type ExtractPropTypes } from 'vue';
|
|
2
2
|
export declare type CellSize = 'normal' | 'large';
|
3
3
|
export declare type CellArrowDirection = 'up' | 'down' | 'left' | 'right';
|
4
4
|
export declare const cellSharedProps: {
|
5
|
+
tag: {
|
6
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
7
|
+
default: keyof HTMLElementTagNameMap;
|
8
|
+
};
|
5
9
|
icon: StringConstructor;
|
6
10
|
size: PropType<CellSize>;
|
7
11
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -26,6 +30,10 @@ export declare const cellSharedProps: {
|
|
26
30
|
};
|
27
31
|
};
|
28
32
|
export declare const cellProps: {
|
33
|
+
tag: {
|
34
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
35
|
+
default: keyof HTMLElementTagNameMap;
|
36
|
+
};
|
29
37
|
icon: StringConstructor;
|
30
38
|
size: PropType<CellSize>;
|
31
39
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -55,6 +63,10 @@ export declare const cellProps: {
|
|
55
63
|
};
|
56
64
|
export declare type CellProps = ExtractPropTypes<typeof cellProps>;
|
57
65
|
declare const _default: import("vue").DefineComponent<{
|
66
|
+
tag: {
|
67
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
68
|
+
default: keyof HTMLElementTagNameMap;
|
69
|
+
};
|
58
70
|
icon: StringConstructor;
|
59
71
|
size: PropType<CellSize>;
|
60
72
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -82,6 +94,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
82
94
|
url: StringConstructor;
|
83
95
|
replace: BooleanConstructor;
|
84
96
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
97
|
+
tag: {
|
98
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
99
|
+
default: keyof HTMLElementTagNameMap;
|
100
|
+
};
|
85
101
|
icon: StringConstructor;
|
86
102
|
size: PropType<CellSize>;
|
87
103
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -111,6 +127,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
111
127
|
}>>, {
|
112
128
|
replace: boolean;
|
113
129
|
required: boolean;
|
130
|
+
tag: keyof HTMLElementTagNameMap;
|
114
131
|
center: boolean;
|
115
132
|
isLink: boolean;
|
116
133
|
border: boolean;
|
package/es/cell/Cell.mjs
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
2
|
import { defineComponent } from "vue";
|
3
|
-
import { isDef, extend, truthProp, unknownProp, numericProp, createNamespace } from "../utils/index.mjs";
|
3
|
+
import { isDef, extend, truthProp, unknownProp, numericProp, makeStringProp, createNamespace } from "../utils/index.mjs";
|
4
4
|
import { useRoute, routeProps } from "../composables/use-route.mjs";
|
5
5
|
import { Icon } from "../icon/index.mjs";
|
6
6
|
const [name, bem] = createNamespace("cell");
|
7
7
|
const cellSharedProps = {
|
8
|
+
tag: makeStringProp("div"),
|
8
9
|
icon: String,
|
9
10
|
size: String,
|
10
11
|
title: numericProp,
|
@@ -83,8 +84,9 @@ var stdin_default = defineComponent({
|
|
83
84
|
}
|
84
85
|
};
|
85
86
|
return () => {
|
86
|
-
var _a
|
87
|
+
var _a;
|
87
88
|
const {
|
89
|
+
tag,
|
88
90
|
size,
|
89
91
|
center,
|
90
92
|
border,
|
@@ -101,12 +103,17 @@ var stdin_default = defineComponent({
|
|
101
103
|
if (size) {
|
102
104
|
classes[size] = !!size;
|
103
105
|
}
|
104
|
-
return _createVNode(
|
106
|
+
return _createVNode(tag, {
|
105
107
|
"class": bem(classes),
|
106
108
|
"role": clickable ? "button" : void 0,
|
107
109
|
"tabindex": clickable ? 0 : void 0,
|
108
110
|
"onClick": route
|
109
|
-
},
|
111
|
+
}, {
|
112
|
+
default: () => {
|
113
|
+
var _a2;
|
114
|
+
return [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_a2 = slots.extra) == null ? void 0 : _a2.call(slots)];
|
115
|
+
}
|
116
|
+
});
|
110
117
|
};
|
111
118
|
}
|
112
119
|
});
|
package/es/cell/index.d.ts
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
export declare const Cell: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
tag: {
|
3
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
4
|
+
default: keyof HTMLElementTagNameMap;
|
5
|
+
};
|
2
6
|
icon: StringConstructor;
|
3
7
|
size: import("vue").PropType<import("./Cell").CellSize>;
|
4
8
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -26,6 +30,10 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
|
|
26
30
|
url: StringConstructor;
|
27
31
|
replace: BooleanConstructor;
|
28
32
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
33
|
+
tag: {
|
34
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
35
|
+
default: keyof HTMLElementTagNameMap;
|
36
|
+
};
|
29
37
|
icon: StringConstructor;
|
30
38
|
size: import("vue").PropType<import("./Cell").CellSize>;
|
31
39
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -55,6 +63,7 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
|
|
55
63
|
}>>, {
|
56
64
|
replace: boolean;
|
57
65
|
required: boolean;
|
66
|
+
tag: keyof HTMLElementTagNameMap;
|
58
67
|
center: boolean;
|
59
68
|
isLink: boolean;
|
60
69
|
border: boolean;
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import { type ExtractPropTypes } from 'vue';
|
2
2
|
export declare const collapseItemProps: {
|
3
|
+
tag: {
|
4
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
5
|
+
default: keyof HTMLElementTagNameMap;
|
6
|
+
};
|
3
7
|
icon: StringConstructor;
|
4
8
|
size: import("vue").PropType<import("../cell").CellSize>;
|
5
9
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -37,6 +41,10 @@ export declare const collapseItemProps: {
|
|
37
41
|
};
|
38
42
|
export declare type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>;
|
39
43
|
declare const _default: import("vue").DefineComponent<{
|
44
|
+
tag: {
|
45
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
46
|
+
default: keyof HTMLElementTagNameMap;
|
47
|
+
};
|
40
48
|
icon: StringConstructor;
|
41
49
|
size: import("vue").PropType<import("../cell").CellSize>;
|
42
50
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -72,6 +80,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
72
80
|
default: true;
|
73
81
|
};
|
74
82
|
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
83
|
+
tag: {
|
84
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
85
|
+
default: keyof HTMLElementTagNameMap;
|
86
|
+
};
|
75
87
|
icon: StringConstructor;
|
76
88
|
size: import("vue").PropType<import("../cell").CellSize>;
|
77
89
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -108,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
108
120
|
};
|
109
121
|
}>>, {
|
110
122
|
required: boolean;
|
123
|
+
tag: keyof HTMLElementTagNameMap;
|
111
124
|
center: boolean;
|
112
125
|
disabled: boolean;
|
113
126
|
isLink: boolean;
|
@@ -1,4 +1,8 @@
|
|
1
1
|
export declare const CollapseItem: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
tag: {
|
3
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
4
|
+
default: keyof HTMLElementTagNameMap;
|
5
|
+
};
|
2
6
|
icon: StringConstructor;
|
3
7
|
size: import("vue").PropType<import("..").CellSize>;
|
4
8
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -34,6 +38,10 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
|
|
34
38
|
default: true;
|
35
39
|
};
|
36
40
|
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
41
|
+
tag: {
|
42
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
43
|
+
default: keyof HTMLElementTagNameMap;
|
44
|
+
};
|
37
45
|
icon: StringConstructor;
|
38
46
|
size: import("vue").PropType<import("..").CellSize>;
|
39
47
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -70,6 +78,7 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
|
|
70
78
|
};
|
71
79
|
}>>, {
|
72
80
|
required: boolean;
|
81
|
+
tag: keyof HTMLElementTagNameMap;
|
73
82
|
center: boolean;
|
74
83
|
disabled: boolean;
|
75
84
|
isLink: boolean;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { ref, watch } from "vue";
|
2
|
+
const useSyncPropRef = (getProp, setProp) => {
|
3
|
+
const propRef = ref(getProp());
|
4
|
+
watch(getProp, (value) => {
|
5
|
+
if (value !== propRef.value) {
|
6
|
+
propRef.value = value;
|
7
|
+
}
|
8
|
+
});
|
9
|
+
watch(propRef, (value) => {
|
10
|
+
if (value !== getProp()) {
|
11
|
+
setProp(value);
|
12
|
+
}
|
13
|
+
});
|
14
|
+
return propRef;
|
15
|
+
};
|
16
|
+
export {
|
17
|
+
useSyncPropRef
|
18
|
+
};
|
package/es/coupon/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-coupon-margin: 0 var(--van-padding-sm) var(--van-padding-sm);--van-coupon-content-height: 84px;--van-coupon-content-padding: 14px 0;--van-coupon-content-text-color: var(--van-text-color);--van-coupon-background: var(--van-background-2);--van-coupon-active-background: var(--van-active-color);--van-coupon-radius: var(--van-radius-lg);--van-coupon-shadow: 0 0 4px rgba(0, 0, 0, .1);--van-coupon-head-width: 96px;--van-coupon-amount-color: var(--van-primary-color);--van-coupon-amount-font-size: 30px;--van-coupon-currency-font-size: 40%;--van-coupon-name-font-size: var(--van-font-size-md);--van-coupon-disabled-text-color: var(--van-text-color-2);--van-coupon-description-padding: var(--van-padding-xs) var(--van-padding-md);--van-coupon-description-border-color: var(--van-border-color);--van-coupon-checkbox-color: var(--van-primary-color)}.van-coupon{margin:var(--van-coupon-margin);overflow:hidden;background:var(--van-coupon-background);border-radius:var(--van-coupon-radius);box-shadow:var(--van-coupon-shadow)}.van-coupon:active{background-color:var(--van-coupon-active-background)}.van-coupon__content{display:flex;align-items:center;box-sizing:border-box;min-height:var(--van-coupon-content-height);padding:var(--van-coupon-content-padding);color:var(--van-coupon-content-text-color)}.van-coupon__head{position:relative;min-width:var(--van-coupon-head-width);padding:0 var(--van-padding-xs);color:var(--van-coupon-amount-color);text-align:center}.van-coupon__amount,.van-coupon__condition,.van-coupon__name,.van-coupon__valid{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-coupon__amount{margin-bottom:6px;font-weight:var(--van-font-bold);font-size:var(--van-coupon-amount-font-size);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-coupon__amount span{font-size:var(--van-coupon-currency-font-size)}.van-coupon__amount span:not(:empty){margin-left:2px}.van-coupon__condition{font-size:var(--van-font-size-sm);line-height:16px;white-space:pre-wrap}.van-
|
1
|
+
:root{--van-coupon-margin: 0 var(--van-padding-sm) var(--van-padding-sm);--van-coupon-content-height: 84px;--van-coupon-content-padding: 14px 0;--van-coupon-content-text-color: var(--van-text-color);--van-coupon-background: var(--van-background-2);--van-coupon-active-background: var(--van-active-color);--van-coupon-radius: var(--van-radius-lg);--van-coupon-shadow: 0 0 4px rgba(0, 0, 0, .1);--van-coupon-head-width: 96px;--van-coupon-amount-color: var(--van-primary-color);--van-coupon-amount-font-size: 30px;--van-coupon-currency-font-size: 40%;--van-coupon-name-font-size: var(--van-font-size-md);--van-coupon-disabled-text-color: var(--van-text-color-2);--van-coupon-description-padding: var(--van-padding-xs) var(--van-padding-md);--van-coupon-description-border-color: var(--van-border-color);--van-coupon-checkbox-color: var(--van-primary-color)}.van-coupon{margin:var(--van-coupon-margin);overflow:hidden;background:var(--van-coupon-background);border-radius:var(--van-coupon-radius);box-shadow:var(--van-coupon-shadow)}.van-coupon:active{background-color:var(--van-coupon-active-background)}.van-coupon__content{display:flex;align-items:center;box-sizing:border-box;min-height:var(--van-coupon-content-height);padding:var(--van-coupon-content-padding);color:var(--van-coupon-content-text-color)}.van-coupon__head{position:relative;min-width:var(--van-coupon-head-width);padding:0 var(--van-padding-xs);color:var(--van-coupon-amount-color);text-align:center}.van-coupon__amount,.van-coupon__condition,.van-coupon__name,.van-coupon__valid{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-coupon__amount{margin-bottom:6px;font-weight:var(--van-font-bold);font-size:var(--van-coupon-amount-font-size);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-coupon__amount span{font-size:var(--van-coupon-currency-font-size)}.van-coupon__amount span:not(:empty){margin-left:2px}.van-coupon__condition{font-size:var(--van-font-size-sm);line-height:16px;white-space:pre-wrap}.van-coupon__body{position:relative;flex:1}.van-coupon__name{margin-bottom:10px;font-weight:var(--van-font-bold);font-size:var(--van-coupon-name-font-size);line-height:var(--van-line-height-md)}.van-coupon__valid{font-size:var(--van-font-size-sm)}.van-coupon__corner{position:absolute;top:0;right:var(--van-padding-md);bottom:0}.van-coupon__corner .van-checkbox__icon--checked .van-icon{background-color:var(--van-coupon-checkbox-color);border-color:var(--van-coupon-checkbox-color)}.van-coupon__description{padding:var(--van-coupon-description-padding);font-size:var(--van-font-size-sm);border-top:1px dashed var(--van-coupon-description-border-color)}.van-coupon--disabled:active{background-color:var(--van-coupon-background)}.van-coupon--disabled .van-coupon-item__content{height:calc(var(--van-coupon-content-height) - 10px)}.van-coupon--disabled .van-coupon__head{color:inherit}
|
package/es/coupon-list/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-coupon-list-background: var(--van-background);--van-coupon-list-field-padding: 5px 0 5px var(--van-padding-md);--van-coupon-list-exchange-button-height: 32px;--van-coupon-list-close-button-height: 40px;--van-coupon-list-empty-tip-color: var(--van-text-color-2);--van-coupon-list-empty-tip-font-size: var(--van-font-size-md);--van-coupon-list-empty-tip-line-height: var(--van-line-height-md)}.van-coupon-list{position:relative;height:100%;background:var(--van-coupon-list-background)}.van-coupon-list__field{padding:var(--van-coupon-list-field-padding)}.van-coupon-list__field .van-
|
1
|
+
:root{--van-coupon-list-background: var(--van-background);--van-coupon-list-field-padding: 5px 0 5px var(--van-padding-md);--van-coupon-list-exchange-button-height: 32px;--van-coupon-list-close-button-height: 40px;--van-coupon-list-empty-tip-color: var(--van-text-color-2);--van-coupon-list-empty-tip-font-size: var(--van-font-size-md);--van-coupon-list-empty-tip-line-height: var(--van-line-height-md)}.van-coupon-list{position:relative;height:100%;background:var(--van-coupon-list-background)}.van-coupon-list__field{padding:var(--van-coupon-list-field-padding)}.van-coupon-list__field .van-field__body{height:34px;padding-left:var(--van-padding-sm);line-height:34px;background:var(--van-background);border-radius:var(--van-radius-max)}.van-coupon-list__field .van-field__body::-webkit-input-placeholder{color:var(--van-text-color-3)}.van-coupon-list__field .van-field__body::placeholder{color:var(--van-text-color-3)}.van-coupon-list__field .van-field__clear{margin-right:0}.van-coupon-list__exchange-bar{display:flex;align-items:center;background-color:var(--van-background-2)}.van-coupon-list__exchange{flex:none;height:var(--van-coupon-list-exchange-button-height);font-size:var(--van-font-size-lg);line-height:calc(var(--van-coupon-list-exchange-button-height) - 2px);border:0}.van-coupon-list .van-tabs__wrap{box-shadow:0 6px 12px -12px var(--van-gray-6)}.van-coupon-list__list{box-sizing:border-box;padding:var(--van-padding-md) 0 var(--van-padding-lg);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-coupon-list__list--with-bottom{padding-bottom:50px}.van-coupon-list__bottom{position:absolute;bottom:0;left:0;z-index:999;box-sizing:border-box;width:100%;padding:5px var(--van-padding-md);font-weight:var(--van-font-bold);background-color:var(--van-background-2)}.van-coupon-list__close{height:var(--van-coupon-list-close-button-height)}.van-coupon-list__empty-tip{color:var(--van-coupon-list-empty-tip-color);font-size:var(--van-coupon-list-empty-tip-font-size);line-height:var(--van-coupon-list-empty-tip-line-height)}
|
@@ -80,7 +80,10 @@ var stdin_default = defineComponent({
|
|
80
80
|
case "day":
|
81
81
|
return genDayOptions();
|
82
82
|
default:
|
83
|
-
|
83
|
+
if (process.env.NODE_ENV !== "production") {
|
84
|
+
throw new Error(`[Vant] DatePicker: unsupported columns type: ${type}`);
|
85
|
+
}
|
86
|
+
return [];
|
84
87
|
}
|
85
88
|
}));
|
86
89
|
watch(currentValues, (newValues) => {
|
package/es/field/Field.d.ts
CHANGED
@@ -44,6 +44,10 @@ export declare const fieldSharedProps: {
|
|
44
44
|
};
|
45
45
|
};
|
46
46
|
export declare const fieldProps: {
|
47
|
+
tag: {
|
48
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
49
|
+
default: keyof HTMLElementTagNameMap;
|
50
|
+
};
|
47
51
|
icon: StringConstructor;
|
48
52
|
size: PropType<import("../cell").CellSize>;
|
49
53
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -128,6 +132,10 @@ export declare const fieldProps: {
|
|
128
132
|
};
|
129
133
|
export declare type FieldProps = ExtractPropTypes<typeof fieldProps>;
|
130
134
|
declare const _default: import("vue").DefineComponent<{
|
135
|
+
tag: {
|
136
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
137
|
+
default: keyof HTMLElementTagNameMap;
|
138
|
+
};
|
131
139
|
icon: StringConstructor;
|
132
140
|
size: PropType<import("../cell").CellSize>;
|
133
141
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -210,6 +218,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
210
218
|
default: null;
|
211
219
|
};
|
212
220
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
221
|
+
tag: {
|
222
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
223
|
+
default: keyof HTMLElementTagNameMap;
|
224
|
+
};
|
213
225
|
icon: StringConstructor;
|
214
226
|
size: PropType<import("../cell").CellSize>;
|
215
227
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -305,6 +317,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
305
317
|
}, {
|
306
318
|
type: FieldType;
|
307
319
|
required: boolean;
|
320
|
+
tag: keyof HTMLElementTagNameMap;
|
308
321
|
center: boolean;
|
309
322
|
autofocus: boolean;
|
310
323
|
disabled: boolean;
|
package/es/field/index.d.ts
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
import { FieldProps } from './Field';
|
2
2
|
export declare const Field: import("../utils").WithInstall<import("vue").DefineComponent<{
|
3
|
+
tag: {
|
4
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
5
|
+
default: keyof HTMLElementTagNameMap;
|
6
|
+
};
|
3
7
|
icon: StringConstructor;
|
4
8
|
size: import("vue").PropType<import("..").CellSize>;
|
5
9
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -82,6 +86,10 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
82
86
|
default: null;
|
83
87
|
};
|
84
88
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "clickInput" | "endValidate" | "startValidate" | "clickLeftIcon" | "clickRightIcon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
89
|
+
tag: {
|
90
|
+
type: import("vue").PropType<keyof HTMLElementTagNameMap>;
|
91
|
+
default: keyof HTMLElementTagNameMap;
|
92
|
+
};
|
85
93
|
icon: StringConstructor;
|
86
94
|
size: import("vue").PropType<import("..").CellSize>;
|
87
95
|
title: (NumberConstructor | StringConstructor)[];
|
@@ -177,6 +185,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
177
185
|
}, {
|
178
186
|
type: import("./types").FieldType;
|
179
187
|
required: boolean;
|
188
|
+
tag: keyof HTMLElementTagNameMap;
|
180
189
|
center: boolean;
|
181
190
|
autofocus: boolean;
|
182
191
|
disabled: boolean;
|
@@ -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;
|
@@ -33,7 +33,7 @@ const imagePreviewProps = {
|
|
33
33
|
var stdin_default = defineComponent({
|
34
34
|
name,
|
35
35
|
props: imagePreviewProps,
|
36
|
-
emits: ["scale", "close", "closed", "change", "update:show"],
|
36
|
+
emits: ["scale", "close", "closed", "change", "longPress", "update:show"],
|
37
37
|
setup(props, {
|
38
38
|
emit,
|
39
39
|
slots
|
@@ -93,7 +93,7 @@ var stdin_default = defineComponent({
|
|
93
93
|
"indicatorColor": "white",
|
94
94
|
"onChange": setActive
|
95
95
|
}, {
|
96
|
-
default: () => [props.images.map((image) => _createVNode(ImagePreviewItem, {
|
96
|
+
default: () => [props.images.map((image, index) => _createVNode(ImagePreviewItem, {
|
97
97
|
"src": image,
|
98
98
|
"show": props.show,
|
99
99
|
"active": state.active,
|
@@ -102,8 +102,13 @@ var stdin_default = defineComponent({
|
|
102
102
|
"rootWidth": state.rootWidth,
|
103
103
|
"rootHeight": state.rootHeight,
|
104
104
|
"onScale": emitScale,
|
105
|
-
"onClose": emitClose
|
106
|
-
|
105
|
+
"onClose": emitClose,
|
106
|
+
"onLongPress": () => emit("longPress", {
|
107
|
+
index
|
108
|
+
})
|
109
|
+
}, {
|
110
|
+
image: slots.image
|
111
|
+
}))]
|
107
112
|
});
|
108
113
|
const renderClose = () => {
|
109
114
|
if (props.closeable) {
|
@@ -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
|
}>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
2
2
|
import { ref, watch, computed, reactive, defineComponent } from "vue";
|
3
|
-
import { clamp, numericProp, preventDefault, createNamespace, makeRequiredProp } from "../utils/index.mjs";
|
3
|
+
import { clamp, numericProp, preventDefault, createNamespace, makeRequiredProp, LONG_PRESS_START_TIME } from "../utils/index.mjs";
|
4
4
|
import { useTouch } from "../composables/use-touch.mjs";
|
5
5
|
import { useEventListener } from "@vant/use";
|
6
6
|
import { Image } from "../image/index.mjs";
|
@@ -18,9 +18,10 @@ var stdin_default = defineComponent({
|
|
18
18
|
rootWidth: makeRequiredProp(Number),
|
19
19
|
rootHeight: makeRequiredProp(Number)
|
20
20
|
},
|
21
|
-
emits: ["scale", "close"],
|
21
|
+
emits: ["scale", "close", "longPress"],
|
22
22
|
setup(props, {
|
23
|
-
emit
|
23
|
+
emit,
|
24
|
+
slots
|
24
25
|
}) {
|
25
26
|
const state = reactive({
|
26
27
|
scale: 1,
|
@@ -164,16 +165,20 @@ var stdin_default = defineComponent({
|
|
164
165
|
const deltaTime = Date.now() - touchStartTime;
|
165
166
|
const TAP_TIME = 250;
|
166
167
|
const TAP_OFFSET = 5;
|
167
|
-
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET
|
168
|
-
if (
|
169
|
-
|
170
|
-
|
171
|
-
toggleScale();
|
172
|
-
} else {
|
173
|
-
doubleTapTimer = setTimeout(() => {
|
174
|
-
emit("close");
|
168
|
+
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET) {
|
169
|
+
if (deltaTime < TAP_TIME) {
|
170
|
+
if (doubleTapTimer) {
|
171
|
+
clearTimeout(doubleTapTimer);
|
175
172
|
doubleTapTimer = null;
|
176
|
-
|
173
|
+
toggleScale();
|
174
|
+
} else {
|
175
|
+
doubleTapTimer = setTimeout(() => {
|
176
|
+
emit("close");
|
177
|
+
doubleTapTimer = null;
|
178
|
+
}, TAP_TIME);
|
179
|
+
}
|
180
|
+
} else if (deltaTime > LONG_PRESS_START_TIME) {
|
181
|
+
emit("longPress");
|
177
182
|
}
|
178
183
|
}
|
179
184
|
};
|
@@ -238,7 +243,11 @@ var stdin_default = defineComponent({
|
|
238
243
|
"onTouchend": onTouchEnd,
|
239
244
|
"onTouchcancel": onTouchEnd
|
240
245
|
}, {
|
241
|
-
default: () => [_createVNode(
|
246
|
+
default: () => [slots.image ? _createVNode("div", {
|
247
|
+
"class": bem("image-wrap")
|
248
|
+
}, [slots.image({
|
249
|
+
src: props.src
|
250
|
+
})]) : _createVNode(Image, {
|
242
251
|
"src": props.src,
|
243
252
|
"fit": "contain",
|
244
253
|
"class": bem("image", {
|
@@ -1 +1 @@
|
|
1
|
-
:root{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;max-width:none;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image{width:100%;transition-property:transform}.van-image-preview__image--vertical{width:auto;height:100%}.van-image-preview__image img{-webkit-user-drag:none}.van-image-preview__image .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
|
1
|
+
:root{--van-image-preview-index-text-color: var(--van-white);--van-image-preview-index-font-size: var(--van-font-size-md);--van-image-preview-index-line-height: var(--van-line-height-md);--van-image-preview-index-text-shadow: 0 1px 1px var(--van-gray-8);--van-image-preview-overlay-background: rgba(0, 0, 0, .9);--van-image-preview-close-icon-size: 22px;--van-image-preview-close-icon-color: var(--van-gray-5);--van-image-preview-close-icon-margin: var(--van-padding-md);--van-image-preview-close-icon-z-index: 1}.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%;max-width:none;background-color:transparent;transform:none}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:flex;align-items:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image,.van-image-preview__image-wrap{width:100%;transition-property:transform}.van-image-preview__image--vertical,.van-image-preview__image-wrap--vertical{width:auto;height:100%}.van-image-preview__image img,.van-image-preview__image-wrap img,.van-image-preview__image video,.van-image-preview__image-wrap video{-webkit-user-drag:none}.van-image-preview__image .van-image__error,.van-image-preview__image-wrap .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon,.van-image-preview__image-wrap .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading,.van-image-preview__image-wrap .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:var(--van-padding-md);left:50%;color:var(--van-image-preview-index-text-color);font-size:var(--van-image-preview-index-font-size);line-height:var(--van-image-preview-index-line-height);text-shadow:var(--van-image-preview-index-text-shadow);transform:translate(-50%)}.van-image-preview__overlay{background:var(--van-image-preview-overlay-background)}.van-image-preview__close-icon{position:absolute;z-index:var(--van-image-preview-close-icon-z-index);color:var(--van-image-preview-close-icon-color);font-size:var(--van-image-preview-close-icon-size)}.van-image-preview__close-icon--top-left{top:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--top-right{top:var(--van-image-preview-close-icon-margin);right:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-left{bottom:var(--van-image-preview-close-icon-margin);left:var(--van-image-preview-close-icon-margin)}.van-image-preview__close-icon--bottom-right{right:var(--van-image-preview-close-icon-margin);bottom:var(--van-image-preview-close-icon-margin)}
|
@@ -52,7 +52,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
|
|
52
52
|
type: import("vue").PropType<import("..").PopupCloseIconPosition>;
|
53
53
|
default: import("..").PopupCloseIconPosition;
|
54
54
|
};
|
55
|
-
}, () => 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<import("vue").ExtractPropTypes<{
|
55
|
+
}, () => 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<import("vue").ExtractPropTypes<{
|
56
56
|
show: BooleanConstructor;
|
57
57
|
loop: {
|
58
58
|
type: BooleanConstructor;
|
@@ -111,6 +111,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
|
|
111
111
|
onClosed?: ((...args: any[]) => any) | undefined;
|
112
112
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
113
113
|
onScale?: ((...args: any[]) => any) | undefined;
|
114
|
+
onLongPress?: ((...args: any[]) => any) | undefined;
|
114
115
|
}, {
|
115
116
|
loop: boolean;
|
116
117
|
overlay: boolean;
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
@@ -86,7 +86,7 @@ import { TimePicker } from "./time-picker/index.mjs";
|
|
86
86
|
import { Toast } from "./toast/index.mjs";
|
87
87
|
import { TreeSelect } from "./tree-select/index.mjs";
|
88
88
|
import { Uploader } from "./uploader/index.mjs";
|
89
|
-
const version = "4.0.0-rc.
|
89
|
+
const version = "4.0.0-rc.7";
|
90
90
|
function install(app) {
|
91
91
|
const components = [
|
92
92
|
ActionBar,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { useRect } from "@vant/use";
|
2
2
|
import { loadImageAsync } from "./util.mjs";
|
3
3
|
import { noop } from "../../utils/index.mjs";
|
4
|
+
import { h } from "vue";
|
4
5
|
var stdin_default = (lazyManager) => ({
|
5
6
|
props: {
|
6
7
|
src: [String, Object],
|
@@ -9,15 +10,14 @@ var stdin_default = (lazyManager) => ({
|
|
9
10
|
default: "img"
|
10
11
|
}
|
11
12
|
},
|
12
|
-
render(
|
13
|
+
render() {
|
14
|
+
var _a, _b;
|
13
15
|
return h(
|
14
16
|
this.tag,
|
15
17
|
{
|
16
|
-
|
17
|
-
src: this.renderSrc
|
18
|
-
}
|
18
|
+
src: this.renderSrc
|
19
19
|
},
|
20
|
-
this.$slots.default
|
20
|
+
(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)
|
21
21
|
);
|
22
22
|
},
|
23
23
|
data() {
|