vant 4.6.8 → 4.7.0
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/address-edit/AddressEdit.d.ts +2 -1
- package/es/address-edit/AddressEdit.mjs +9 -3
- package/es/address-edit/index.d.ts +2 -1
- package/es/calendar/Calendar.d.ts +2 -1
- package/es/calendar/Calendar.mjs +3 -2
- package/es/calendar/CalendarDay.d.ts +2 -1
- package/es/calendar/CalendarDay.mjs +3 -1
- package/es/calendar/CalendarMonth.d.ts +2 -1
- package/es/calendar/CalendarMonth.mjs +3 -2
- package/es/calendar/index.d.ts +2 -1
- package/es/dialog/function-call.d.ts +3 -3
- package/es/dialog/function-call.mjs +1 -1
- package/es/floating-panel/FloatingPanel.mjs +1 -1
- package/es/icon/index.css +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/signature/Signature.mjs +10 -6
- package/es/swipe-cell/SwipeCell.mjs +10 -1
- package/es/uploader/index.css +1 -1
- package/es/utils/interceptor.d.ts +2 -1
- package/es/utils/interceptor.mjs +3 -2
- package/lib/address-edit/AddressEdit.d.ts +2 -1
- package/lib/address-edit/AddressEdit.js +9 -3
- package/lib/address-edit/index.d.ts +2 -1
- package/lib/calendar/Calendar.d.ts +2 -1
- package/lib/calendar/Calendar.js +3 -2
- package/lib/calendar/CalendarDay.d.ts +2 -1
- package/lib/calendar/CalendarDay.js +3 -1
- package/lib/calendar/CalendarMonth.d.ts +2 -1
- package/lib/calendar/CalendarMonth.js +3 -2
- package/lib/calendar/index.d.ts +2 -1
- package/lib/dialog/function-call.d.ts +3 -3
- package/lib/dialog/function-call.js +1 -1
- package/lib/floating-panel/FloatingPanel.js +1 -1
- package/lib/icon/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/signature/Signature.js +10 -6
- package/lib/swipe-cell/SwipeCell.js +10 -1
- package/lib/uploader/index.css +1 -1
- package/lib/utils/interceptor.d.ts +2 -1
- package/lib/utils/interceptor.js +3 -2
- package/lib/vant.cjs.js +44 -20
- package/lib/vant.es.js +44 -20
- package/lib/vant.js +44 -20
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -224,7 +224,7 @@ __reExport(stdin_exports, require("./toast"), module.exports);
|
|
224
224
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
225
225
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
226
226
|
__reExport(stdin_exports, require("./watermark"), module.exports);
|
227
|
-
const version = "4.
|
227
|
+
const version = "4.7.0";
|
228
228
|
function install(app) {
|
229
229
|
const components = [
|
230
230
|
import_action_bar.ActionBar,
|
@@ -91,12 +91,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
91
91
|
const empty = document.createElement("canvas");
|
92
92
|
empty.width = canvas.width;
|
93
93
|
empty.height = canvas.height;
|
94
|
+
if (props.backgroundColor) {
|
95
|
+
const emptyCtx = empty.getContext("2d");
|
96
|
+
setCanvasBgColor(emptyCtx);
|
97
|
+
}
|
94
98
|
return canvas.toDataURL() === empty.toDataURL();
|
95
99
|
};
|
96
|
-
const setCanvasBgColor = () => {
|
97
|
-
if (
|
98
|
-
|
99
|
-
|
100
|
+
const setCanvasBgColor = (ctx) => {
|
101
|
+
if (ctx && props.backgroundColor) {
|
102
|
+
ctx.fillStyle = props.backgroundColor;
|
103
|
+
ctx.fillRect(0, 0, state.width, state.height);
|
100
104
|
}
|
101
105
|
};
|
102
106
|
const submit = () => {
|
@@ -119,7 +123,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
119
123
|
if (state.ctx) {
|
120
124
|
state.ctx.clearRect(0, 0, state.width, state.height);
|
121
125
|
state.ctx.closePath();
|
122
|
-
setCanvasBgColor();
|
126
|
+
setCanvasBgColor(state.ctx);
|
123
127
|
}
|
124
128
|
emit("clear");
|
125
129
|
};
|
@@ -130,7 +134,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
130
134
|
state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
|
131
135
|
state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
|
132
136
|
(0, import_vue2.nextTick)(() => {
|
133
|
-
setCanvasBgColor();
|
137
|
+
setCanvasBgColor(state.ctx);
|
134
138
|
});
|
135
139
|
}
|
136
140
|
});
|
@@ -47,6 +47,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
47
47
|
let opened;
|
48
48
|
let lockClick;
|
49
49
|
let startOffset;
|
50
|
+
let isInBeforeClosing;
|
50
51
|
const root = (0, import_vue2.ref)();
|
51
52
|
const leftRef = (0, import_vue2.ref)();
|
52
53
|
const rightRef = (0, import_vue2.ref)();
|
@@ -123,14 +124,22 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
123
124
|
}
|
124
125
|
};
|
125
126
|
const onClick = (position = "outside") => {
|
127
|
+
if (isInBeforeClosing)
|
128
|
+
return;
|
126
129
|
emit("click", position);
|
127
130
|
if (opened && !lockClick) {
|
131
|
+
isInBeforeClosing = true;
|
128
132
|
(0, import_utils.callInterceptor)(props.beforeClose, {
|
129
133
|
args: [{
|
130
134
|
name: props.name,
|
131
135
|
position
|
132
136
|
}],
|
133
|
-
done: () =>
|
137
|
+
done: () => {
|
138
|
+
isInBeforeClosing = false;
|
139
|
+
close(position);
|
140
|
+
},
|
141
|
+
canceled: () => isInBeforeClosing = false,
|
142
|
+
error: () => isInBeforeClosing = false
|
134
143
|
});
|
135
144
|
}
|
136
145
|
};
|
package/lib/uploader/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-uploader-size: 80px;--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background: rgba(0, 0, 0, .7);--van-uploader-file-background: var(--van-background);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity)}.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:flex;flex-wrap:wrap}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;background:var(--van-uploader-upload-background)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;cursor:pointer}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);overflow:hidden}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
|
1
|
+
:root{--van-uploader-size: 80px;--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background: rgba(0, 0, 0, .7);--van-uploader-file-background: var(--van-background);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity);--van-uploader-border-radius: 0px}.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:flex;flex-wrap:wrap}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;background:var(--van-uploader-upload-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;cursor:pointer}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);overflow:hidden;border-radius:var(--van-uploader-border-radius)}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export type Interceptor = (...args: any[]) => Promise<boolean> | boolean | undefined | void;
|
2
|
-
export declare function callInterceptor(interceptor: Interceptor | undefined, { args, done, canceled, }: {
|
2
|
+
export declare function callInterceptor(interceptor: Interceptor | undefined, { args, done, canceled, error, }: {
|
3
3
|
args?: unknown[];
|
4
4
|
done: () => void;
|
5
5
|
canceled?: () => void;
|
6
|
+
error?: () => void;
|
6
7
|
}): void;
|
package/lib/utils/interceptor.js
CHANGED
@@ -24,7 +24,8 @@ var import_basic = require("./basic");
|
|
24
24
|
function callInterceptor(interceptor, {
|
25
25
|
args = [],
|
26
26
|
done,
|
27
|
-
canceled
|
27
|
+
canceled,
|
28
|
+
error
|
28
29
|
}) {
|
29
30
|
if (interceptor) {
|
30
31
|
const returnVal = interceptor.apply(null, args);
|
@@ -35,7 +36,7 @@ function callInterceptor(interceptor, {
|
|
35
36
|
} else if (canceled) {
|
36
37
|
canceled();
|
37
38
|
}
|
38
|
-
}).catch(import_basic.noop);
|
39
|
+
}).catch(error || import_basic.noop);
|
39
40
|
} else if (returnVal) {
|
40
41
|
done();
|
41
42
|
} else if (canceled) {
|
package/lib/vant.cjs.js
CHANGED
@@ -380,7 +380,8 @@ const TAP_OFFSET = 5;
|
|
380
380
|
function callInterceptor(interceptor, {
|
381
381
|
args = [],
|
382
382
|
done,
|
383
|
-
canceled
|
383
|
+
canceled,
|
384
|
+
error
|
384
385
|
}) {
|
385
386
|
if (interceptor) {
|
386
387
|
const returnVal = interceptor.apply(null, args);
|
@@ -391,7 +392,7 @@ function callInterceptor(interceptor, {
|
|
391
392
|
} else if (canceled) {
|
392
393
|
canceled();
|
393
394
|
}
|
394
|
-
}).catch(noop);
|
395
|
+
}).catch(error || noop);
|
395
396
|
} else if (returnVal) {
|
396
397
|
done();
|
397
398
|
} else if (canceled) {
|
@@ -4992,7 +4993,7 @@ const addressEditProps = {
|
|
4992
4993
|
var stdin_default$1q = vue.defineComponent({
|
4993
4994
|
name: name$1g,
|
4994
4995
|
props: addressEditProps,
|
4995
|
-
emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
4996
|
+
emits: ["save", "focus", "change", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
4996
4997
|
setup(props2, {
|
4997
4998
|
emit,
|
4998
4999
|
slots
|
@@ -5026,6 +5027,12 @@ var stdin_default$1q = vue.defineComponent({
|
|
5026
5027
|
detailFocused.value = key === "addressDetail";
|
5027
5028
|
emit("focus", key);
|
5028
5029
|
};
|
5030
|
+
const onChange = (key, value) => {
|
5031
|
+
emit("change", {
|
5032
|
+
key,
|
5033
|
+
value
|
5034
|
+
});
|
5035
|
+
};
|
5029
5036
|
const rules = vue.computed(() => {
|
5030
5037
|
const {
|
5031
5038
|
validator,
|
@@ -5137,7 +5144,7 @@ var stdin_default$1q = vue.defineComponent({
|
|
5137
5144
|
"class": bem$1c("fields")
|
5138
5145
|
}, [vue.createVNode(Field, {
|
5139
5146
|
"modelValue": data.name,
|
5140
|
-
"onUpdate:modelValue": ($event) => data.name = $event,
|
5147
|
+
"onUpdate:modelValue": [($event) => data.name = $event, (val) => onChange("name", val)],
|
5141
5148
|
"clearable": true,
|
5142
5149
|
"label": t$i("name"),
|
5143
5150
|
"rules": rules.value.name,
|
@@ -5145,7 +5152,7 @@ var stdin_default$1q = vue.defineComponent({
|
|
5145
5152
|
"onFocus": () => onFocus("name")
|
5146
5153
|
}, null), vue.createVNode(Field, {
|
5147
5154
|
"modelValue": data.tel,
|
5148
|
-
"onUpdate:modelValue": ($event) => data.tel = $event,
|
5155
|
+
"onUpdate:modelValue": [($event) => data.tel = $event, (val) => onChange("tel", val)],
|
5149
5156
|
"clearable": true,
|
5150
5157
|
"type": "tel",
|
5151
5158
|
"label": t$i("tel"),
|
@@ -6140,7 +6147,7 @@ var stdin_default$1h = vue.defineComponent({
|
|
6140
6147
|
offset: makeNumberProp(0),
|
6141
6148
|
rowHeight: String
|
6142
6149
|
},
|
6143
|
-
emits: ["click"],
|
6150
|
+
emits: ["click", "clickDisabledDate"],
|
6144
6151
|
setup(props2, {
|
6145
6152
|
emit,
|
6146
6153
|
slots
|
@@ -6186,6 +6193,8 @@ var stdin_default$1h = vue.defineComponent({
|
|
6186
6193
|
const onClick = () => {
|
6187
6194
|
if (props2.item.type !== "disabled") {
|
6188
6195
|
emit("click", props2.item);
|
6196
|
+
} else {
|
6197
|
+
emit("clickDisabledDate", props2.item);
|
6189
6198
|
}
|
6190
6199
|
};
|
6191
6200
|
const renderTopInfo = () => {
|
@@ -6272,7 +6281,7 @@ const calendarMonthProps = {
|
|
6272
6281
|
var stdin_default$1g = vue.defineComponent({
|
6273
6282
|
name: name$16,
|
6274
6283
|
props: calendarMonthProps,
|
6275
|
-
emits: ["click"],
|
6284
|
+
emits: ["click", "clickDisabledDate"],
|
6276
6285
|
setup(props2, {
|
6277
6286
|
emit,
|
6278
6287
|
slots
|
@@ -6431,7 +6440,8 @@ var stdin_default$1g = vue.defineComponent({
|
|
6431
6440
|
"color": props2.color,
|
6432
6441
|
"offset": offset.value,
|
6433
6442
|
"rowHeight": rowHeight.value,
|
6434
|
-
"onClick": (item2) => emit("click", item2)
|
6443
|
+
"onClick": (item2) => emit("click", item2),
|
6444
|
+
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
6435
6445
|
}, pick(slots, ["top-info", "bottom-info"]));
|
6436
6446
|
const renderDays = () => vue.createVNode("div", {
|
6437
6447
|
"ref": daysRef,
|
@@ -6556,7 +6566,7 @@ const calendarProps = {
|
|
6556
6566
|
var stdin_default$1e = vue.defineComponent({
|
6557
6567
|
name: name$18,
|
6558
6568
|
props: calendarProps,
|
6559
|
-
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
|
6569
|
+
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
|
6560
6570
|
setup(props2, {
|
6561
6571
|
emit,
|
6562
6572
|
slots
|
@@ -6824,7 +6834,8 @@ var stdin_default$1e = vue.defineComponent({
|
|
6824
6834
|
"showMonthTitle": showMonthTitle,
|
6825
6835
|
"firstDayOfWeek": dayOffset.value
|
6826
6836
|
}, pick(props2, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
6827
|
-
"onClick": onClickDay
|
6837
|
+
"onClick": onClickDay,
|
6838
|
+
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
6828
6839
|
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
6829
6840
|
};
|
6830
6841
|
const renderFooterButton = () => {
|
@@ -9402,7 +9413,7 @@ function initInstance$2() {
|
|
9402
9413
|
}
|
9403
9414
|
function showDialog(options) {
|
9404
9415
|
if (!inBrowser) {
|
9405
|
-
return Promise.resolve();
|
9416
|
+
return Promise.resolve(void 0);
|
9406
9417
|
}
|
9407
9418
|
return new Promise((resolve, reject) => {
|
9408
9419
|
if (!instance$2) {
|
@@ -10033,7 +10044,7 @@ var stdin_default$Q = vue.defineComponent({
|
|
10033
10044
|
}, {
|
10034
10045
|
immediate: true
|
10035
10046
|
});
|
10036
|
-
useLockScroll(rootRef, () => props2.lockScroll);
|
10047
|
+
useLockScroll(rootRef, () => props2.lockScroll || dragging.value);
|
10037
10048
|
use.useEventListener("touchmove", onTouchmove, {
|
10038
10049
|
target: rootRef
|
10039
10050
|
});
|
@@ -13259,12 +13270,16 @@ var stdin_default$r = vue.defineComponent({
|
|
13259
13270
|
const empty = document.createElement("canvas");
|
13260
13271
|
empty.width = canvas.width;
|
13261
13272
|
empty.height = canvas.height;
|
13273
|
+
if (props2.backgroundColor) {
|
13274
|
+
const emptyCtx = empty.getContext("2d");
|
13275
|
+
setCanvasBgColor(emptyCtx);
|
13276
|
+
}
|
13262
13277
|
return canvas.toDataURL() === empty.toDataURL();
|
13263
13278
|
};
|
13264
|
-
const setCanvasBgColor = () => {
|
13265
|
-
if (
|
13266
|
-
|
13267
|
-
|
13279
|
+
const setCanvasBgColor = (ctx) => {
|
13280
|
+
if (ctx && props2.backgroundColor) {
|
13281
|
+
ctx.fillStyle = props2.backgroundColor;
|
13282
|
+
ctx.fillRect(0, 0, state.width, state.height);
|
13268
13283
|
}
|
13269
13284
|
};
|
13270
13285
|
const submit = () => {
|
@@ -13287,7 +13302,7 @@ var stdin_default$r = vue.defineComponent({
|
|
13287
13302
|
if (state.ctx) {
|
13288
13303
|
state.ctx.clearRect(0, 0, state.width, state.height);
|
13289
13304
|
state.ctx.closePath();
|
13290
|
-
setCanvasBgColor();
|
13305
|
+
setCanvasBgColor(state.ctx);
|
13291
13306
|
}
|
13292
13307
|
emit("clear");
|
13293
13308
|
};
|
@@ -13298,7 +13313,7 @@ var stdin_default$r = vue.defineComponent({
|
|
13298
13313
|
state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
|
13299
13314
|
state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
|
13300
13315
|
vue.nextTick(() => {
|
13301
|
-
setCanvasBgColor();
|
13316
|
+
setCanvasBgColor(state.ctx);
|
13302
13317
|
});
|
13303
13318
|
}
|
13304
13319
|
});
|
@@ -14372,6 +14387,7 @@ var stdin_default$c = vue.defineComponent({
|
|
14372
14387
|
let opened;
|
14373
14388
|
let lockClick2;
|
14374
14389
|
let startOffset;
|
14390
|
+
let isInBeforeClosing;
|
14375
14391
|
const root = vue.ref();
|
14376
14392
|
const leftRef = vue.ref();
|
14377
14393
|
const rightRef = vue.ref();
|
@@ -14448,14 +14464,22 @@ var stdin_default$c = vue.defineComponent({
|
|
14448
14464
|
}
|
14449
14465
|
};
|
14450
14466
|
const onClick = (position = "outside") => {
|
14467
|
+
if (isInBeforeClosing)
|
14468
|
+
return;
|
14451
14469
|
emit("click", position);
|
14452
14470
|
if (opened && !lockClick2) {
|
14471
|
+
isInBeforeClosing = true;
|
14453
14472
|
callInterceptor(props2.beforeClose, {
|
14454
14473
|
args: [{
|
14455
14474
|
name: props2.name,
|
14456
14475
|
position
|
14457
14476
|
}],
|
14458
|
-
done: () =>
|
14477
|
+
done: () => {
|
14478
|
+
isInBeforeClosing = false;
|
14479
|
+
close(position);
|
14480
|
+
},
|
14481
|
+
canceled: () => isInBeforeClosing = false,
|
14482
|
+
error: () => isInBeforeClosing = false
|
14459
14483
|
});
|
14460
14484
|
}
|
14461
14485
|
};
|
@@ -16475,7 +16499,7 @@ const Lazyload = {
|
|
16475
16499
|
});
|
16476
16500
|
}
|
16477
16501
|
};
|
16478
|
-
const version = "4.
|
16502
|
+
const version = "4.7.0";
|
16479
16503
|
function install(app) {
|
16480
16504
|
const components = [
|
16481
16505
|
ActionBar,
|
package/lib/vant.es.js
CHANGED
@@ -378,7 +378,8 @@ const TAP_OFFSET = 5;
|
|
378
378
|
function callInterceptor(interceptor, {
|
379
379
|
args = [],
|
380
380
|
done,
|
381
|
-
canceled
|
381
|
+
canceled,
|
382
|
+
error
|
382
383
|
}) {
|
383
384
|
if (interceptor) {
|
384
385
|
const returnVal = interceptor.apply(null, args);
|
@@ -389,7 +390,7 @@ function callInterceptor(interceptor, {
|
|
389
390
|
} else if (canceled) {
|
390
391
|
canceled();
|
391
392
|
}
|
392
|
-
}).catch(noop);
|
393
|
+
}).catch(error || noop);
|
393
394
|
} else if (returnVal) {
|
394
395
|
done();
|
395
396
|
} else if (canceled) {
|
@@ -4990,7 +4991,7 @@ const addressEditProps = {
|
|
4990
4991
|
var stdin_default$1q = defineComponent({
|
4991
4992
|
name: name$1g,
|
4992
4993
|
props: addressEditProps,
|
4993
|
-
emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
4994
|
+
emits: ["save", "focus", "change", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
4994
4995
|
setup(props2, {
|
4995
4996
|
emit,
|
4996
4997
|
slots
|
@@ -5024,6 +5025,12 @@ var stdin_default$1q = defineComponent({
|
|
5024
5025
|
detailFocused.value = key === "addressDetail";
|
5025
5026
|
emit("focus", key);
|
5026
5027
|
};
|
5028
|
+
const onChange = (key, value) => {
|
5029
|
+
emit("change", {
|
5030
|
+
key,
|
5031
|
+
value
|
5032
|
+
});
|
5033
|
+
};
|
5027
5034
|
const rules = computed(() => {
|
5028
5035
|
const {
|
5029
5036
|
validator,
|
@@ -5135,7 +5142,7 @@ var stdin_default$1q = defineComponent({
|
|
5135
5142
|
"class": bem$1c("fields")
|
5136
5143
|
}, [createVNode(Field, {
|
5137
5144
|
"modelValue": data.name,
|
5138
|
-
"onUpdate:modelValue": ($event) => data.name = $event,
|
5145
|
+
"onUpdate:modelValue": [($event) => data.name = $event, (val) => onChange("name", val)],
|
5139
5146
|
"clearable": true,
|
5140
5147
|
"label": t$i("name"),
|
5141
5148
|
"rules": rules.value.name,
|
@@ -5143,7 +5150,7 @@ var stdin_default$1q = defineComponent({
|
|
5143
5150
|
"onFocus": () => onFocus("name")
|
5144
5151
|
}, null), createVNode(Field, {
|
5145
5152
|
"modelValue": data.tel,
|
5146
|
-
"onUpdate:modelValue": ($event) => data.tel = $event,
|
5153
|
+
"onUpdate:modelValue": [($event) => data.tel = $event, (val) => onChange("tel", val)],
|
5147
5154
|
"clearable": true,
|
5148
5155
|
"type": "tel",
|
5149
5156
|
"label": t$i("tel"),
|
@@ -6138,7 +6145,7 @@ var stdin_default$1h = defineComponent({
|
|
6138
6145
|
offset: makeNumberProp(0),
|
6139
6146
|
rowHeight: String
|
6140
6147
|
},
|
6141
|
-
emits: ["click"],
|
6148
|
+
emits: ["click", "clickDisabledDate"],
|
6142
6149
|
setup(props2, {
|
6143
6150
|
emit,
|
6144
6151
|
slots
|
@@ -6184,6 +6191,8 @@ var stdin_default$1h = defineComponent({
|
|
6184
6191
|
const onClick = () => {
|
6185
6192
|
if (props2.item.type !== "disabled") {
|
6186
6193
|
emit("click", props2.item);
|
6194
|
+
} else {
|
6195
|
+
emit("clickDisabledDate", props2.item);
|
6187
6196
|
}
|
6188
6197
|
};
|
6189
6198
|
const renderTopInfo = () => {
|
@@ -6270,7 +6279,7 @@ const calendarMonthProps = {
|
|
6270
6279
|
var stdin_default$1g = defineComponent({
|
6271
6280
|
name: name$16,
|
6272
6281
|
props: calendarMonthProps,
|
6273
|
-
emits: ["click"],
|
6282
|
+
emits: ["click", "clickDisabledDate"],
|
6274
6283
|
setup(props2, {
|
6275
6284
|
emit,
|
6276
6285
|
slots
|
@@ -6429,7 +6438,8 @@ var stdin_default$1g = defineComponent({
|
|
6429
6438
|
"color": props2.color,
|
6430
6439
|
"offset": offset.value,
|
6431
6440
|
"rowHeight": rowHeight.value,
|
6432
|
-
"onClick": (item2) => emit("click", item2)
|
6441
|
+
"onClick": (item2) => emit("click", item2),
|
6442
|
+
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
6433
6443
|
}, pick(slots, ["top-info", "bottom-info"]));
|
6434
6444
|
const renderDays = () => createVNode("div", {
|
6435
6445
|
"ref": daysRef,
|
@@ -6554,7 +6564,7 @@ const calendarProps = {
|
|
6554
6564
|
var stdin_default$1e = defineComponent({
|
6555
6565
|
name: name$18,
|
6556
6566
|
props: calendarProps,
|
6557
|
-
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
|
6567
|
+
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
|
6558
6568
|
setup(props2, {
|
6559
6569
|
emit,
|
6560
6570
|
slots
|
@@ -6822,7 +6832,8 @@ var stdin_default$1e = defineComponent({
|
|
6822
6832
|
"showMonthTitle": showMonthTitle,
|
6823
6833
|
"firstDayOfWeek": dayOffset.value
|
6824
6834
|
}, pick(props2, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
6825
|
-
"onClick": onClickDay
|
6835
|
+
"onClick": onClickDay,
|
6836
|
+
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
6826
6837
|
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
6827
6838
|
};
|
6828
6839
|
const renderFooterButton = () => {
|
@@ -9400,7 +9411,7 @@ function initInstance$2() {
|
|
9400
9411
|
}
|
9401
9412
|
function showDialog(options) {
|
9402
9413
|
if (!inBrowser) {
|
9403
|
-
return Promise.resolve();
|
9414
|
+
return Promise.resolve(void 0);
|
9404
9415
|
}
|
9405
9416
|
return new Promise((resolve, reject) => {
|
9406
9417
|
if (!instance$2) {
|
@@ -10031,7 +10042,7 @@ var stdin_default$Q = defineComponent({
|
|
10031
10042
|
}, {
|
10032
10043
|
immediate: true
|
10033
10044
|
});
|
10034
|
-
useLockScroll(rootRef, () => props2.lockScroll);
|
10045
|
+
useLockScroll(rootRef, () => props2.lockScroll || dragging.value);
|
10035
10046
|
useEventListener("touchmove", onTouchmove, {
|
10036
10047
|
target: rootRef
|
10037
10048
|
});
|
@@ -13257,12 +13268,16 @@ var stdin_default$r = defineComponent({
|
|
13257
13268
|
const empty = document.createElement("canvas");
|
13258
13269
|
empty.width = canvas.width;
|
13259
13270
|
empty.height = canvas.height;
|
13271
|
+
if (props2.backgroundColor) {
|
13272
|
+
const emptyCtx = empty.getContext("2d");
|
13273
|
+
setCanvasBgColor(emptyCtx);
|
13274
|
+
}
|
13260
13275
|
return canvas.toDataURL() === empty.toDataURL();
|
13261
13276
|
};
|
13262
|
-
const setCanvasBgColor = () => {
|
13263
|
-
if (
|
13264
|
-
|
13265
|
-
|
13277
|
+
const setCanvasBgColor = (ctx) => {
|
13278
|
+
if (ctx && props2.backgroundColor) {
|
13279
|
+
ctx.fillStyle = props2.backgroundColor;
|
13280
|
+
ctx.fillRect(0, 0, state.width, state.height);
|
13266
13281
|
}
|
13267
13282
|
};
|
13268
13283
|
const submit = () => {
|
@@ -13285,7 +13300,7 @@ var stdin_default$r = defineComponent({
|
|
13285
13300
|
if (state.ctx) {
|
13286
13301
|
state.ctx.clearRect(0, 0, state.width, state.height);
|
13287
13302
|
state.ctx.closePath();
|
13288
|
-
setCanvasBgColor();
|
13303
|
+
setCanvasBgColor(state.ctx);
|
13289
13304
|
}
|
13290
13305
|
emit("clear");
|
13291
13306
|
};
|
@@ -13296,7 +13311,7 @@ var stdin_default$r = defineComponent({
|
|
13296
13311
|
state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
|
13297
13312
|
state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
|
13298
13313
|
nextTick(() => {
|
13299
|
-
setCanvasBgColor();
|
13314
|
+
setCanvasBgColor(state.ctx);
|
13300
13315
|
});
|
13301
13316
|
}
|
13302
13317
|
});
|
@@ -14370,6 +14385,7 @@ var stdin_default$c = defineComponent({
|
|
14370
14385
|
let opened;
|
14371
14386
|
let lockClick2;
|
14372
14387
|
let startOffset;
|
14388
|
+
let isInBeforeClosing;
|
14373
14389
|
const root = ref();
|
14374
14390
|
const leftRef = ref();
|
14375
14391
|
const rightRef = ref();
|
@@ -14446,14 +14462,22 @@ var stdin_default$c = defineComponent({
|
|
14446
14462
|
}
|
14447
14463
|
};
|
14448
14464
|
const onClick = (position = "outside") => {
|
14465
|
+
if (isInBeforeClosing)
|
14466
|
+
return;
|
14449
14467
|
emit("click", position);
|
14450
14468
|
if (opened && !lockClick2) {
|
14469
|
+
isInBeforeClosing = true;
|
14451
14470
|
callInterceptor(props2.beforeClose, {
|
14452
14471
|
args: [{
|
14453
14472
|
name: props2.name,
|
14454
14473
|
position
|
14455
14474
|
}],
|
14456
|
-
done: () =>
|
14475
|
+
done: () => {
|
14476
|
+
isInBeforeClosing = false;
|
14477
|
+
close(position);
|
14478
|
+
},
|
14479
|
+
canceled: () => isInBeforeClosing = false,
|
14480
|
+
error: () => isInBeforeClosing = false
|
14457
14481
|
});
|
14458
14482
|
}
|
14459
14483
|
};
|
@@ -16473,7 +16497,7 @@ const Lazyload = {
|
|
16473
16497
|
});
|
16474
16498
|
}
|
16475
16499
|
};
|
16476
|
-
const version = "4.
|
16500
|
+
const version = "4.7.0";
|
16477
16501
|
function install(app) {
|
16478
16502
|
const components = [
|
16479
16503
|
ActionBar,
|