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,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,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
|
+
};
|
package/lib/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}
|
@@ -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)}
|
@@ -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) => {
|
package/lib/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/lib/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;
|
@@ -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,8 +131,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
131
131
|
"rootWidth": state.rootWidth,
|
132
132
|
"rootHeight": state.rootHeight,
|
133
133
|
"onScale": emitScale,
|
134
|
-
"onClose": emitClose
|
135
|
-
|
134
|
+
"onClose": emitClose,
|
135
|
+
"onLongPress": () => emit("longPress", {
|
136
|
+
index
|
137
|
+
})
|
138
|
+
}, {
|
139
|
+
image: slots.image
|
140
|
+
}))]
|
136
141
|
});
|
137
142
|
const renderClose = () => {
|
138
143
|
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
|
}>;
|
@@ -40,9 +40,10 @@ 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
|
-
emit
|
45
|
+
emit,
|
46
|
+
slots
|
46
47
|
}) {
|
47
48
|
const state = (0, import_vue2.reactive)({
|
48
49
|
scale: 1,
|
@@ -186,16 +187,20 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
186
187
|
const deltaTime = Date.now() - touchStartTime;
|
187
188
|
const TAP_TIME = 250;
|
188
189
|
const TAP_OFFSET = 5;
|
189
|
-
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET
|
190
|
-
if (
|
191
|
-
|
192
|
-
|
193
|
-
toggleScale();
|
194
|
-
} else {
|
195
|
-
doubleTapTimer = setTimeout(() => {
|
196
|
-
emit("close");
|
190
|
+
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET) {
|
191
|
+
if (deltaTime < TAP_TIME) {
|
192
|
+
if (doubleTapTimer) {
|
193
|
+
clearTimeout(doubleTapTimer);
|
197
194
|
doubleTapTimer = null;
|
198
|
-
|
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");
|
199
204
|
}
|
200
205
|
}
|
201
206
|
};
|
@@ -260,7 +265,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
260
265
|
"onTouchend": onTouchEnd,
|
261
266
|
"onTouchcancel": onTouchEnd
|
262
267
|
}, {
|
263
|
-
default: () => [(0, import_vue.createVNode)(
|
268
|
+
default: () => [slots.image ? (0, import_vue.createVNode)("div", {
|
269
|
+
"class": bem("image-wrap")
|
270
|
+
}, [slots.image({
|
271
|
+
src: props.src
|
272
|
+
})]) : (0, import_vue.createVNode)(import_image.Image, {
|
264
273
|
"src": props.src,
|
265
274
|
"fit": "contain",
|
266
275
|
"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;
|