vant 4.6.7 → 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/cell/index.css +1 -1
- package/es/config-provider/ConfigProvider.mjs +5 -1
- package/es/config-provider/types.d.ts +61 -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/nav-bar/NavBar.d.ts +8 -0
- package/es/nav-bar/NavBar.mjs +18 -4
- package/es/nav-bar/index.css +1 -1
- package/es/nav-bar/index.d.ts +6 -0
- 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/cell/index.css +1 -1
- package/lib/config-provider/ConfigProvider.js +5 -1
- package/lib/config-provider/types.d.ts +61 -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/nav-bar/NavBar.d.ts +8 -0
- package/lib/nav-bar/NavBar.js +18 -4
- package/lib/nav-bar/index.css +1 -1
- package/lib/nav-bar/index.d.ts +6 -0
- 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 +67 -25
- package/lib/vant.es.js +67 -25
- package/lib/vant.js +67 -25
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +2 -2
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) {
|
@@ -630,10 +631,14 @@ const configProviderProps = {
|
|
630
631
|
themeVarsScope: makeStringProp("local"),
|
631
632
|
iconPrefix: String
|
632
633
|
};
|
634
|
+
function insertDash(str) {
|
635
|
+
return str.replace(/([a-zA-Z])(\d)/g, "$1-$2");
|
636
|
+
}
|
633
637
|
function mapThemeVarsToCSSVars(themeVars) {
|
634
638
|
const cssVars = {};
|
635
639
|
Object.keys(themeVars).forEach((key) => {
|
636
|
-
|
640
|
+
const formattedKey = insertDash(kebabCase(key));
|
641
|
+
cssVars[`--van-${formattedKey}`] = themeVars[key];
|
637
642
|
});
|
638
643
|
return cssVars;
|
639
644
|
}
|
@@ -4986,7 +4991,7 @@ const addressEditProps = {
|
|
4986
4991
|
var stdin_default$1q = defineComponent({
|
4987
4992
|
name: name$1g,
|
4988
4993
|
props: addressEditProps,
|
4989
|
-
emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
4994
|
+
emits: ["save", "focus", "change", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
4990
4995
|
setup(props2, {
|
4991
4996
|
emit,
|
4992
4997
|
slots
|
@@ -5020,6 +5025,12 @@ var stdin_default$1q = defineComponent({
|
|
5020
5025
|
detailFocused.value = key === "addressDetail";
|
5021
5026
|
emit("focus", key);
|
5022
5027
|
};
|
5028
|
+
const onChange = (key, value) => {
|
5029
|
+
emit("change", {
|
5030
|
+
key,
|
5031
|
+
value
|
5032
|
+
});
|
5033
|
+
};
|
5023
5034
|
const rules = computed(() => {
|
5024
5035
|
const {
|
5025
5036
|
validator,
|
@@ -5131,7 +5142,7 @@ var stdin_default$1q = defineComponent({
|
|
5131
5142
|
"class": bem$1c("fields")
|
5132
5143
|
}, [createVNode(Field, {
|
5133
5144
|
"modelValue": data.name,
|
5134
|
-
"onUpdate:modelValue": ($event) => data.name = $event,
|
5145
|
+
"onUpdate:modelValue": [($event) => data.name = $event, (val) => onChange("name", val)],
|
5135
5146
|
"clearable": true,
|
5136
5147
|
"label": t$i("name"),
|
5137
5148
|
"rules": rules.value.name,
|
@@ -5139,7 +5150,7 @@ var stdin_default$1q = defineComponent({
|
|
5139
5150
|
"onFocus": () => onFocus("name")
|
5140
5151
|
}, null), createVNode(Field, {
|
5141
5152
|
"modelValue": data.tel,
|
5142
|
-
"onUpdate:modelValue": ($event) => data.tel = $event,
|
5153
|
+
"onUpdate:modelValue": [($event) => data.tel = $event, (val) => onChange("tel", val)],
|
5143
5154
|
"clearable": true,
|
5144
5155
|
"type": "tel",
|
5145
5156
|
"label": t$i("tel"),
|
@@ -6134,7 +6145,7 @@ var stdin_default$1h = defineComponent({
|
|
6134
6145
|
offset: makeNumberProp(0),
|
6135
6146
|
rowHeight: String
|
6136
6147
|
},
|
6137
|
-
emits: ["click"],
|
6148
|
+
emits: ["click", "clickDisabledDate"],
|
6138
6149
|
setup(props2, {
|
6139
6150
|
emit,
|
6140
6151
|
slots
|
@@ -6180,6 +6191,8 @@ var stdin_default$1h = defineComponent({
|
|
6180
6191
|
const onClick = () => {
|
6181
6192
|
if (props2.item.type !== "disabled") {
|
6182
6193
|
emit("click", props2.item);
|
6194
|
+
} else {
|
6195
|
+
emit("clickDisabledDate", props2.item);
|
6183
6196
|
}
|
6184
6197
|
};
|
6185
6198
|
const renderTopInfo = () => {
|
@@ -6266,7 +6279,7 @@ const calendarMonthProps = {
|
|
6266
6279
|
var stdin_default$1g = defineComponent({
|
6267
6280
|
name: name$16,
|
6268
6281
|
props: calendarMonthProps,
|
6269
|
-
emits: ["click"],
|
6282
|
+
emits: ["click", "clickDisabledDate"],
|
6270
6283
|
setup(props2, {
|
6271
6284
|
emit,
|
6272
6285
|
slots
|
@@ -6425,7 +6438,8 @@ var stdin_default$1g = defineComponent({
|
|
6425
6438
|
"color": props2.color,
|
6426
6439
|
"offset": offset.value,
|
6427
6440
|
"rowHeight": rowHeight.value,
|
6428
|
-
"onClick": (item2) => emit("click", item2)
|
6441
|
+
"onClick": (item2) => emit("click", item2),
|
6442
|
+
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
6429
6443
|
}, pick(slots, ["top-info", "bottom-info"]));
|
6430
6444
|
const renderDays = () => createVNode("div", {
|
6431
6445
|
"ref": daysRef,
|
@@ -6550,7 +6564,7 @@ const calendarProps = {
|
|
6550
6564
|
var stdin_default$1e = defineComponent({
|
6551
6565
|
name: name$18,
|
6552
6566
|
props: calendarProps,
|
6553
|
-
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
|
6567
|
+
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
|
6554
6568
|
setup(props2, {
|
6555
6569
|
emit,
|
6556
6570
|
slots
|
@@ -6818,7 +6832,8 @@ var stdin_default$1e = defineComponent({
|
|
6818
6832
|
"showMonthTitle": showMonthTitle,
|
6819
6833
|
"firstDayOfWeek": dayOffset.value
|
6820
6834
|
}, pick(props2, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
6821
|
-
"onClick": onClickDay
|
6835
|
+
"onClick": onClickDay,
|
6836
|
+
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
6822
6837
|
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
6823
6838
|
};
|
6824
6839
|
const renderFooterButton = () => {
|
@@ -9396,7 +9411,7 @@ function initInstance$2() {
|
|
9396
9411
|
}
|
9397
9412
|
function showDialog(options) {
|
9398
9413
|
if (!inBrowser) {
|
9399
|
-
return Promise.resolve();
|
9414
|
+
return Promise.resolve(void 0);
|
9400
9415
|
}
|
9401
9416
|
return new Promise((resolve, reject) => {
|
9402
9417
|
if (!instance$2) {
|
@@ -10027,7 +10042,7 @@ var stdin_default$Q = defineComponent({
|
|
10027
10042
|
}, {
|
10028
10043
|
immediate: true
|
10029
10044
|
});
|
10030
|
-
useLockScroll(rootRef, () => props2.lockScroll);
|
10045
|
+
useLockScroll(rootRef, () => props2.lockScroll || dragging.value);
|
10031
10046
|
useEventListener("touchmove", onTouchmove, {
|
10032
10047
|
target: rootRef
|
10033
10048
|
});
|
@@ -11202,6 +11217,8 @@ const navBarProps = {
|
|
11202
11217
|
border: truthProp,
|
11203
11218
|
leftText: String,
|
11204
11219
|
rightText: String,
|
11220
|
+
leftDisabled: Boolean,
|
11221
|
+
rightDisabled: Boolean,
|
11205
11222
|
leftArrow: Boolean,
|
11206
11223
|
placeholder: Boolean,
|
11207
11224
|
safeAreaInsetTop: Boolean,
|
@@ -11217,8 +11234,16 @@ var stdin_default$I = defineComponent({
|
|
11217
11234
|
}) {
|
11218
11235
|
const navBarRef = ref();
|
11219
11236
|
const renderPlaceholder = usePlaceholder(navBarRef, bem$z);
|
11220
|
-
const onClickLeft = (event) =>
|
11221
|
-
|
11237
|
+
const onClickLeft = (event) => {
|
11238
|
+
if (!props2.leftDisabled) {
|
11239
|
+
emit("clickLeft", event);
|
11240
|
+
}
|
11241
|
+
};
|
11242
|
+
const onClickRight = (event) => {
|
11243
|
+
if (!props2.rightDisabled) {
|
11244
|
+
emit("clickRight", event);
|
11245
|
+
}
|
11246
|
+
};
|
11222
11247
|
const renderLeft = () => {
|
11223
11248
|
if (slots.left) {
|
11224
11249
|
return slots.left();
|
@@ -11260,12 +11285,16 @@ var stdin_default$I = defineComponent({
|
|
11260
11285
|
}, [createVNode("div", {
|
11261
11286
|
"class": bem$z("content")
|
11262
11287
|
}, [hasLeft && createVNode("div", {
|
11263
|
-
"class": [bem$z("left"
|
11288
|
+
"class": [bem$z("left", {
|
11289
|
+
disabled: props2.leftDisabled
|
11290
|
+
}), props2.clickable && !props2.leftDisabled ? HAPTICS_FEEDBACK : ""],
|
11264
11291
|
"onClick": onClickLeft
|
11265
11292
|
}, [renderLeft()]), createVNode("div", {
|
11266
11293
|
"class": [bem$z("title"), "van-ellipsis"]
|
11267
11294
|
}, [slots.title ? slots.title() : title]), hasRight && createVNode("div", {
|
11268
|
-
"class": [bem$z("right"
|
11295
|
+
"class": [bem$z("right", {
|
11296
|
+
disabled: props2.rightDisabled
|
11297
|
+
}), props2.clickable && !props2.rightDisabled ? HAPTICS_FEEDBACK : ""],
|
11269
11298
|
"onClick": onClickRight
|
11270
11299
|
}, [renderRight()])])]);
|
11271
11300
|
};
|
@@ -13239,12 +13268,16 @@ var stdin_default$r = defineComponent({
|
|
13239
13268
|
const empty = document.createElement("canvas");
|
13240
13269
|
empty.width = canvas.width;
|
13241
13270
|
empty.height = canvas.height;
|
13271
|
+
if (props2.backgroundColor) {
|
13272
|
+
const emptyCtx = empty.getContext("2d");
|
13273
|
+
setCanvasBgColor(emptyCtx);
|
13274
|
+
}
|
13242
13275
|
return canvas.toDataURL() === empty.toDataURL();
|
13243
13276
|
};
|
13244
|
-
const setCanvasBgColor = () => {
|
13245
|
-
if (
|
13246
|
-
|
13247
|
-
|
13277
|
+
const setCanvasBgColor = (ctx) => {
|
13278
|
+
if (ctx && props2.backgroundColor) {
|
13279
|
+
ctx.fillStyle = props2.backgroundColor;
|
13280
|
+
ctx.fillRect(0, 0, state.width, state.height);
|
13248
13281
|
}
|
13249
13282
|
};
|
13250
13283
|
const submit = () => {
|
@@ -13267,7 +13300,7 @@ var stdin_default$r = defineComponent({
|
|
13267
13300
|
if (state.ctx) {
|
13268
13301
|
state.ctx.clearRect(0, 0, state.width, state.height);
|
13269
13302
|
state.ctx.closePath();
|
13270
|
-
setCanvasBgColor();
|
13303
|
+
setCanvasBgColor(state.ctx);
|
13271
13304
|
}
|
13272
13305
|
emit("clear");
|
13273
13306
|
};
|
@@ -13278,7 +13311,7 @@ var stdin_default$r = defineComponent({
|
|
13278
13311
|
state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
|
13279
13312
|
state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
|
13280
13313
|
nextTick(() => {
|
13281
|
-
setCanvasBgColor();
|
13314
|
+
setCanvasBgColor(state.ctx);
|
13282
13315
|
});
|
13283
13316
|
}
|
13284
13317
|
});
|
@@ -14352,6 +14385,7 @@ var stdin_default$c = defineComponent({
|
|
14352
14385
|
let opened;
|
14353
14386
|
let lockClick2;
|
14354
14387
|
let startOffset;
|
14388
|
+
let isInBeforeClosing;
|
14355
14389
|
const root = ref();
|
14356
14390
|
const leftRef = ref();
|
14357
14391
|
const rightRef = ref();
|
@@ -14428,14 +14462,22 @@ var stdin_default$c = defineComponent({
|
|
14428
14462
|
}
|
14429
14463
|
};
|
14430
14464
|
const onClick = (position = "outside") => {
|
14465
|
+
if (isInBeforeClosing)
|
14466
|
+
return;
|
14431
14467
|
emit("click", position);
|
14432
14468
|
if (opened && !lockClick2) {
|
14469
|
+
isInBeforeClosing = true;
|
14433
14470
|
callInterceptor(props2.beforeClose, {
|
14434
14471
|
args: [{
|
14435
14472
|
name: props2.name,
|
14436
14473
|
position
|
14437
14474
|
}],
|
14438
|
-
done: () =>
|
14475
|
+
done: () => {
|
14476
|
+
isInBeforeClosing = false;
|
14477
|
+
close(position);
|
14478
|
+
},
|
14479
|
+
canceled: () => isInBeforeClosing = false,
|
14480
|
+
error: () => isInBeforeClosing = false
|
14439
14481
|
});
|
14440
14482
|
}
|
14441
14483
|
};
|
@@ -16455,7 +16497,7 @@ const Lazyload = {
|
|
16455
16497
|
});
|
16456
16498
|
}
|
16457
16499
|
};
|
16458
|
-
const version = "4.
|
16500
|
+
const version = "4.7.0";
|
16459
16501
|
function install(app) {
|
16460
16502
|
const components = [
|
16461
16503
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -768,7 +768,8 @@
|
|
768
768
|
function callInterceptor(interceptor, {
|
769
769
|
args = [],
|
770
770
|
done,
|
771
|
-
canceled
|
771
|
+
canceled,
|
772
|
+
error
|
772
773
|
}) {
|
773
774
|
if (interceptor) {
|
774
775
|
const returnVal = interceptor.apply(null, args);
|
@@ -779,7 +780,7 @@
|
|
779
780
|
} else if (canceled) {
|
780
781
|
canceled();
|
781
782
|
}
|
782
|
-
}).catch(noop);
|
783
|
+
}).catch(error || noop);
|
783
784
|
} else if (returnVal) {
|
784
785
|
done();
|
785
786
|
} else if (canceled) {
|
@@ -1020,10 +1021,14 @@
|
|
1020
1021
|
themeVarsScope: makeStringProp("local"),
|
1021
1022
|
iconPrefix: String
|
1022
1023
|
};
|
1024
|
+
function insertDash(str) {
|
1025
|
+
return str.replace(/([a-zA-Z])(\d)/g, "$1-$2");
|
1026
|
+
}
|
1023
1027
|
function mapThemeVarsToCSSVars(themeVars) {
|
1024
1028
|
const cssVars = {};
|
1025
1029
|
Object.keys(themeVars).forEach((key) => {
|
1026
|
-
|
1030
|
+
const formattedKey = insertDash(kebabCase(key));
|
1031
|
+
cssVars[`--van-${formattedKey}`] = themeVars[key];
|
1027
1032
|
});
|
1028
1033
|
return cssVars;
|
1029
1034
|
}
|
@@ -5447,7 +5452,7 @@
|
|
5447
5452
|
var stdin_default$1q = vue.defineComponent({
|
5448
5453
|
name: name$1g,
|
5449
5454
|
props: addressEditProps,
|
5450
|
-
emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
5455
|
+
emits: ["save", "focus", "change", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
5451
5456
|
setup(props2, {
|
5452
5457
|
emit,
|
5453
5458
|
slots
|
@@ -5481,6 +5486,12 @@
|
|
5481
5486
|
detailFocused.value = key === "addressDetail";
|
5482
5487
|
emit("focus", key);
|
5483
5488
|
};
|
5489
|
+
const onChange = (key, value) => {
|
5490
|
+
emit("change", {
|
5491
|
+
key,
|
5492
|
+
value
|
5493
|
+
});
|
5494
|
+
};
|
5484
5495
|
const rules = vue.computed(() => {
|
5485
5496
|
const {
|
5486
5497
|
validator,
|
@@ -5592,7 +5603,7 @@
|
|
5592
5603
|
"class": bem$1c("fields")
|
5593
5604
|
}, [vue.createVNode(Field, {
|
5594
5605
|
"modelValue": data.name,
|
5595
|
-
"onUpdate:modelValue": ($event) => data.name = $event,
|
5606
|
+
"onUpdate:modelValue": [($event) => data.name = $event, (val) => onChange("name", val)],
|
5596
5607
|
"clearable": true,
|
5597
5608
|
"label": t$i("name"),
|
5598
5609
|
"rules": rules.value.name,
|
@@ -5600,7 +5611,7 @@
|
|
5600
5611
|
"onFocus": () => onFocus("name")
|
5601
5612
|
}, null), vue.createVNode(Field, {
|
5602
5613
|
"modelValue": data.tel,
|
5603
|
-
"onUpdate:modelValue": ($event) => data.tel = $event,
|
5614
|
+
"onUpdate:modelValue": [($event) => data.tel = $event, (val) => onChange("tel", val)],
|
5604
5615
|
"clearable": true,
|
5605
5616
|
"type": "tel",
|
5606
5617
|
"label": t$i("tel"),
|
@@ -6592,7 +6603,7 @@
|
|
6592
6603
|
offset: makeNumberProp(0),
|
6593
6604
|
rowHeight: String
|
6594
6605
|
},
|
6595
|
-
emits: ["click"],
|
6606
|
+
emits: ["click", "clickDisabledDate"],
|
6596
6607
|
setup(props2, {
|
6597
6608
|
emit,
|
6598
6609
|
slots
|
@@ -6638,6 +6649,8 @@
|
|
6638
6649
|
const onClick = () => {
|
6639
6650
|
if (props2.item.type !== "disabled") {
|
6640
6651
|
emit("click", props2.item);
|
6652
|
+
} else {
|
6653
|
+
emit("clickDisabledDate", props2.item);
|
6641
6654
|
}
|
6642
6655
|
};
|
6643
6656
|
const renderTopInfo = () => {
|
@@ -6724,7 +6737,7 @@
|
|
6724
6737
|
var stdin_default$1g = vue.defineComponent({
|
6725
6738
|
name: name$16,
|
6726
6739
|
props: calendarMonthProps,
|
6727
|
-
emits: ["click"],
|
6740
|
+
emits: ["click", "clickDisabledDate"],
|
6728
6741
|
setup(props2, {
|
6729
6742
|
emit,
|
6730
6743
|
slots
|
@@ -6883,7 +6896,8 @@
|
|
6883
6896
|
"color": props2.color,
|
6884
6897
|
"offset": offset2.value,
|
6885
6898
|
"rowHeight": rowHeight.value,
|
6886
|
-
"onClick": (item2) => emit("click", item2)
|
6899
|
+
"onClick": (item2) => emit("click", item2),
|
6900
|
+
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
6887
6901
|
}, pick(slots, ["top-info", "bottom-info"]));
|
6888
6902
|
const renderDays = () => vue.createVNode("div", {
|
6889
6903
|
"ref": daysRef,
|
@@ -7008,7 +7022,7 @@
|
|
7008
7022
|
var stdin_default$1e = vue.defineComponent({
|
7009
7023
|
name: name$18,
|
7010
7024
|
props: calendarProps,
|
7011
|
-
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
|
7025
|
+
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
|
7012
7026
|
setup(props2, {
|
7013
7027
|
emit,
|
7014
7028
|
slots
|
@@ -7276,7 +7290,8 @@
|
|
7276
7290
|
"showMonthTitle": showMonthTitle,
|
7277
7291
|
"firstDayOfWeek": dayOffset.value
|
7278
7292
|
}, pick(props2, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
7279
|
-
"onClick": onClickDay
|
7293
|
+
"onClick": onClickDay,
|
7294
|
+
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
7280
7295
|
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
7281
7296
|
};
|
7282
7297
|
const renderFooterButton = () => {
|
@@ -9834,7 +9849,7 @@
|
|
9834
9849
|
}
|
9835
9850
|
function showDialog(options) {
|
9836
9851
|
if (!inBrowser$1) {
|
9837
|
-
return Promise.resolve();
|
9852
|
+
return Promise.resolve(void 0);
|
9838
9853
|
}
|
9839
9854
|
return new Promise((resolve, reject) => {
|
9840
9855
|
if (!instance$2) {
|
@@ -10462,7 +10477,7 @@
|
|
10462
10477
|
}, {
|
10463
10478
|
immediate: true
|
10464
10479
|
});
|
10465
|
-
useLockScroll(rootRef, () => props2.lockScroll);
|
10480
|
+
useLockScroll(rootRef, () => props2.lockScroll || dragging.value);
|
10466
10481
|
useEventListener("touchmove", onTouchmove, {
|
10467
10482
|
target: rootRef
|
10468
10483
|
});
|
@@ -11631,6 +11646,8 @@
|
|
11631
11646
|
border: truthProp,
|
11632
11647
|
leftText: String,
|
11633
11648
|
rightText: String,
|
11649
|
+
leftDisabled: Boolean,
|
11650
|
+
rightDisabled: Boolean,
|
11634
11651
|
leftArrow: Boolean,
|
11635
11652
|
placeholder: Boolean,
|
11636
11653
|
safeAreaInsetTop: Boolean,
|
@@ -11646,8 +11663,16 @@
|
|
11646
11663
|
}) {
|
11647
11664
|
const navBarRef = vue.ref();
|
11648
11665
|
const renderPlaceholder = usePlaceholder(navBarRef, bem$z);
|
11649
|
-
const onClickLeft = (event) =>
|
11650
|
-
|
11666
|
+
const onClickLeft = (event) => {
|
11667
|
+
if (!props2.leftDisabled) {
|
11668
|
+
emit("clickLeft", event);
|
11669
|
+
}
|
11670
|
+
};
|
11671
|
+
const onClickRight = (event) => {
|
11672
|
+
if (!props2.rightDisabled) {
|
11673
|
+
emit("clickRight", event);
|
11674
|
+
}
|
11675
|
+
};
|
11651
11676
|
const renderLeft = () => {
|
11652
11677
|
if (slots.left) {
|
11653
11678
|
return slots.left();
|
@@ -11689,12 +11714,16 @@
|
|
11689
11714
|
}, [vue.createVNode("div", {
|
11690
11715
|
"class": bem$z("content")
|
11691
11716
|
}, [hasLeft && vue.createVNode("div", {
|
11692
|
-
"class": [bem$z("left"
|
11717
|
+
"class": [bem$z("left", {
|
11718
|
+
disabled: props2.leftDisabled
|
11719
|
+
}), props2.clickable && !props2.leftDisabled ? HAPTICS_FEEDBACK : ""],
|
11693
11720
|
"onClick": onClickLeft
|
11694
11721
|
}, [renderLeft()]), vue.createVNode("div", {
|
11695
11722
|
"class": [bem$z("title"), "van-ellipsis"]
|
11696
11723
|
}, [slots.title ? slots.title() : title]), hasRight && vue.createVNode("div", {
|
11697
|
-
"class": [bem$z("right"
|
11724
|
+
"class": [bem$z("right", {
|
11725
|
+
disabled: props2.rightDisabled
|
11726
|
+
}), props2.clickable && !props2.rightDisabled ? HAPTICS_FEEDBACK : ""],
|
11698
11727
|
"onClick": onClickRight
|
11699
11728
|
}, [renderRight()])])]);
|
11700
11729
|
};
|
@@ -14477,12 +14506,16 @@
|
|
14477
14506
|
const empty = document.createElement("canvas");
|
14478
14507
|
empty.width = canvas.width;
|
14479
14508
|
empty.height = canvas.height;
|
14509
|
+
if (props2.backgroundColor) {
|
14510
|
+
const emptyCtx = empty.getContext("2d");
|
14511
|
+
setCanvasBgColor(emptyCtx);
|
14512
|
+
}
|
14480
14513
|
return canvas.toDataURL() === empty.toDataURL();
|
14481
14514
|
};
|
14482
|
-
const setCanvasBgColor = () => {
|
14483
|
-
if (
|
14484
|
-
|
14485
|
-
|
14515
|
+
const setCanvasBgColor = (ctx) => {
|
14516
|
+
if (ctx && props2.backgroundColor) {
|
14517
|
+
ctx.fillStyle = props2.backgroundColor;
|
14518
|
+
ctx.fillRect(0, 0, state.width, state.height);
|
14486
14519
|
}
|
14487
14520
|
};
|
14488
14521
|
const submit = () => {
|
@@ -14505,7 +14538,7 @@
|
|
14505
14538
|
if (state.ctx) {
|
14506
14539
|
state.ctx.clearRect(0, 0, state.width, state.height);
|
14507
14540
|
state.ctx.closePath();
|
14508
|
-
setCanvasBgColor();
|
14541
|
+
setCanvasBgColor(state.ctx);
|
14509
14542
|
}
|
14510
14543
|
emit("clear");
|
14511
14544
|
};
|
@@ -14516,7 +14549,7 @@
|
|
14516
14549
|
state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
|
14517
14550
|
state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
|
14518
14551
|
vue.nextTick(() => {
|
14519
|
-
setCanvasBgColor();
|
14552
|
+
setCanvasBgColor(state.ctx);
|
14520
14553
|
});
|
14521
14554
|
}
|
14522
14555
|
});
|
@@ -15587,6 +15620,7 @@
|
|
15587
15620
|
let opened;
|
15588
15621
|
let lockClick2;
|
15589
15622
|
let startOffset;
|
15623
|
+
let isInBeforeClosing;
|
15590
15624
|
const root = vue.ref();
|
15591
15625
|
const leftRef = vue.ref();
|
15592
15626
|
const rightRef = vue.ref();
|
@@ -15663,14 +15697,22 @@
|
|
15663
15697
|
}
|
15664
15698
|
};
|
15665
15699
|
const onClick = (position = "outside") => {
|
15700
|
+
if (isInBeforeClosing)
|
15701
|
+
return;
|
15666
15702
|
emit("click", position);
|
15667
15703
|
if (opened && !lockClick2) {
|
15704
|
+
isInBeforeClosing = true;
|
15668
15705
|
callInterceptor(props2.beforeClose, {
|
15669
15706
|
args: [{
|
15670
15707
|
name: props2.name,
|
15671
15708
|
position
|
15672
15709
|
}],
|
15673
|
-
done: () =>
|
15710
|
+
done: () => {
|
15711
|
+
isInBeforeClosing = false;
|
15712
|
+
close(position);
|
15713
|
+
},
|
15714
|
+
canceled: () => isInBeforeClosing = false,
|
15715
|
+
error: () => isInBeforeClosing = false
|
15674
15716
|
});
|
15675
15717
|
}
|
15676
15718
|
};
|
@@ -17667,7 +17709,7 @@
|
|
17667
17709
|
});
|
17668
17710
|
}
|
17669
17711
|
};
|
17670
|
-
const version = "4.
|
17712
|
+
const version = "4.7.0";
|
17671
17713
|
function install(app) {
|
17672
17714
|
const components = [
|
17673
17715
|
ActionBar,
|