vant 4.6.8 → 4.7.1

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.
Files changed (72) hide show
  1. package/README.md +4 -1
  2. package/es/address-edit/AddressEdit.d.ts +2 -1
  3. package/es/address-edit/AddressEdit.mjs +9 -3
  4. package/es/address-edit/index.d.ts +2 -1
  5. package/es/calendar/Calendar.d.ts +2 -1
  6. package/es/calendar/Calendar.mjs +3 -2
  7. package/es/calendar/CalendarDay.d.ts +2 -1
  8. package/es/calendar/CalendarDay.mjs +3 -1
  9. package/es/calendar/CalendarMonth.d.ts +2 -1
  10. package/es/calendar/CalendarMonth.mjs +3 -2
  11. package/es/calendar/index.d.ts +2 -1
  12. package/es/cell-group/CellGroup.mjs +2 -1
  13. package/es/composables/use-scope-id.d.ts +3 -0
  14. package/es/composables/use-scope-id.mjs +9 -0
  15. package/es/dialog/function-call.d.ts +18 -3
  16. package/es/dialog/function-call.mjs +1 -1
  17. package/es/floating-panel/FloatingPanel.mjs +3 -3
  18. package/es/floating-panel/index.css +1 -1
  19. package/es/icon/index.css +1 -1
  20. package/es/image-preview/function-call.d.ts +3 -0
  21. package/es/index.d.ts +1 -1
  22. package/es/index.mjs +1 -1
  23. package/es/notify/function-call.d.ts +12 -0
  24. package/es/popover/Popover.mjs +2 -1
  25. package/es/popup/Popup.mjs +7 -5
  26. package/es/signature/Signature.mjs +10 -6
  27. package/es/swipe/Swipe.mjs +1 -1
  28. package/es/swipe/index.css +1 -1
  29. package/es/swipe-cell/SwipeCell.mjs +10 -1
  30. package/es/toast/function-call.d.ts +26 -0
  31. package/es/uploader/index.css +1 -1
  32. package/es/utils/interceptor.d.ts +2 -1
  33. package/es/utils/interceptor.mjs +3 -2
  34. package/lib/address-edit/AddressEdit.d.ts +2 -1
  35. package/lib/address-edit/AddressEdit.js +9 -3
  36. package/lib/address-edit/index.d.ts +2 -1
  37. package/lib/calendar/Calendar.d.ts +2 -1
  38. package/lib/calendar/Calendar.js +3 -2
  39. package/lib/calendar/CalendarDay.d.ts +2 -1
  40. package/lib/calendar/CalendarDay.js +3 -1
  41. package/lib/calendar/CalendarMonth.d.ts +2 -1
  42. package/lib/calendar/CalendarMonth.js +3 -2
  43. package/lib/calendar/index.d.ts +2 -1
  44. package/lib/cell-group/CellGroup.js +2 -1
  45. package/lib/composables/use-scope-id.d.ts +3 -0
  46. package/lib/composables/use-scope-id.js +28 -0
  47. package/lib/dialog/function-call.d.ts +18 -3
  48. package/lib/dialog/function-call.js +1 -1
  49. package/lib/floating-panel/FloatingPanel.js +3 -3
  50. package/lib/floating-panel/index.css +1 -1
  51. package/lib/icon/index.css +1 -1
  52. package/lib/image-preview/function-call.d.ts +3 -0
  53. package/lib/index.css +1 -1
  54. package/lib/index.d.ts +1 -1
  55. package/lib/index.js +1 -1
  56. package/lib/notify/function-call.d.ts +12 -0
  57. package/lib/popover/Popover.js +2 -1
  58. package/lib/popup/Popup.js +6 -4
  59. package/lib/signature/Signature.js +10 -6
  60. package/lib/swipe/Swipe.js +1 -1
  61. package/lib/swipe/index.css +1 -1
  62. package/lib/swipe-cell/SwipeCell.js +10 -1
  63. package/lib/toast/function-call.d.ts +26 -0
  64. package/lib/uploader/index.css +1 -1
  65. package/lib/utils/interceptor.d.ts +2 -1
  66. package/lib/utils/interceptor.js +3 -2
  67. package/lib/vant.cjs.js +59 -29
  68. package/lib/vant.es.js +59 -29
  69. package/lib/vant.js +59 -29
  70. package/lib/vant.min.js +1 -1
  71. package/lib/web-types.json +1 -1
  72. package/package.json +4 -4
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) {
@@ -1247,6 +1248,11 @@ function useLazyRender(show) {
1247
1248
  );
1248
1249
  return (render) => () => inited.value ? render() : null;
1249
1250
  }
1251
+ const useScopeId = () => {
1252
+ var _a;
1253
+ const { scopeId } = ((_a = getCurrentInstance()) == null ? void 0 : _a.vnode) || {};
1254
+ return scopeId ? { [scopeId]: "" } : null;
1255
+ };
1250
1256
  const [name$1B, bem$1w] = createNamespace("overlay");
1251
1257
  const overlayProps = {
1252
1258
  show: Boolean,
@@ -1358,16 +1364,17 @@ var stdin_default$1J = defineComponent({
1358
1364
  };
1359
1365
  const renderOverlay = () => {
1360
1366
  if (props2.overlay) {
1361
- return createVNode(Overlay, {
1367
+ return createVNode(Overlay, mergeProps({
1362
1368
  "show": props2.show,
1363
1369
  "class": props2.overlayClass,
1364
1370
  "zIndex": zIndex.value,
1365
1371
  "duration": props2.duration,
1366
1372
  "customStyle": props2.overlayStyle,
1367
1373
  "role": props2.closeOnClickOverlay ? "button" : void 0,
1368
- "tabindex": props2.closeOnClickOverlay ? 0 : void 0,
1374
+ "tabindex": props2.closeOnClickOverlay ? 0 : void 0
1375
+ }, useScopeId(), {
1369
1376
  "onClick": onClickOverlay
1370
- }, {
1377
+ }), {
1371
1378
  default: slots["overlay-content"]
1372
1379
  });
1373
1380
  }
@@ -1419,7 +1426,7 @@ var stdin_default$1J = defineComponent({
1419
1426
  "van-safe-area-bottom": safeAreaInsetBottom
1420
1427
  }],
1421
1428
  "onKeydown": onKeydown
1422
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vShow, props2.show]]);
1429
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vShow, props2.show]]);
1423
1430
  });
1424
1431
  const renderTransition = () => {
1425
1432
  const {
@@ -2219,7 +2226,7 @@ var stdin_default$1E = defineComponent({
2219
2226
  const trackStyle = computed(() => {
2220
2227
  const style = {
2221
2228
  transitionDuration: `${state.swiping ? 0 : props2.duration}ms`,
2222
- transform: `translate${props2.vertical ? "Y" : "X"}(${state.offset}px)`
2229
+ transform: `translate${props2.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
2223
2230
  };
2224
2231
  if (size.value) {
2225
2232
  const mainAxis = props2.vertical ? "height" : "width";
@@ -4990,7 +4997,7 @@ const addressEditProps = {
4990
4997
  var stdin_default$1q = defineComponent({
4991
4998
  name: name$1g,
4992
4999
  props: addressEditProps,
4993
- emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
5000
+ emits: ["save", "focus", "change", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
4994
5001
  setup(props2, {
4995
5002
  emit,
4996
5003
  slots
@@ -5024,6 +5031,12 @@ var stdin_default$1q = defineComponent({
5024
5031
  detailFocused.value = key === "addressDetail";
5025
5032
  emit("focus", key);
5026
5033
  };
5034
+ const onChange = (key, value) => {
5035
+ emit("change", {
5036
+ key,
5037
+ value
5038
+ });
5039
+ };
5027
5040
  const rules = computed(() => {
5028
5041
  const {
5029
5042
  validator,
@@ -5135,7 +5148,7 @@ var stdin_default$1q = defineComponent({
5135
5148
  "class": bem$1c("fields")
5136
5149
  }, [createVNode(Field, {
5137
5150
  "modelValue": data.name,
5138
- "onUpdate:modelValue": ($event) => data.name = $event,
5151
+ "onUpdate:modelValue": [($event) => data.name = $event, (val) => onChange("name", val)],
5139
5152
  "clearable": true,
5140
5153
  "label": t$i("name"),
5141
5154
  "rules": rules.value.name,
@@ -5143,7 +5156,7 @@ var stdin_default$1q = defineComponent({
5143
5156
  "onFocus": () => onFocus("name")
5144
5157
  }, null), createVNode(Field, {
5145
5158
  "modelValue": data.tel,
5146
- "onUpdate:modelValue": ($event) => data.tel = $event,
5159
+ "onUpdate:modelValue": [($event) => data.tel = $event, (val) => onChange("tel", val)],
5147
5160
  "clearable": true,
5148
5161
  "type": "tel",
5149
5162
  "label": t$i("tel"),
@@ -6138,7 +6151,7 @@ var stdin_default$1h = defineComponent({
6138
6151
  offset: makeNumberProp(0),
6139
6152
  rowHeight: String
6140
6153
  },
6141
- emits: ["click"],
6154
+ emits: ["click", "clickDisabledDate"],
6142
6155
  setup(props2, {
6143
6156
  emit,
6144
6157
  slots
@@ -6184,6 +6197,8 @@ var stdin_default$1h = defineComponent({
6184
6197
  const onClick = () => {
6185
6198
  if (props2.item.type !== "disabled") {
6186
6199
  emit("click", props2.item);
6200
+ } else {
6201
+ emit("clickDisabledDate", props2.item);
6187
6202
  }
6188
6203
  };
6189
6204
  const renderTopInfo = () => {
@@ -6270,7 +6285,7 @@ const calendarMonthProps = {
6270
6285
  var stdin_default$1g = defineComponent({
6271
6286
  name: name$16,
6272
6287
  props: calendarMonthProps,
6273
- emits: ["click"],
6288
+ emits: ["click", "clickDisabledDate"],
6274
6289
  setup(props2, {
6275
6290
  emit,
6276
6291
  slots
@@ -6429,7 +6444,8 @@ var stdin_default$1g = defineComponent({
6429
6444
  "color": props2.color,
6430
6445
  "offset": offset.value,
6431
6446
  "rowHeight": rowHeight.value,
6432
- "onClick": (item2) => emit("click", item2)
6447
+ "onClick": (item2) => emit("click", item2),
6448
+ "onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
6433
6449
  }, pick(slots, ["top-info", "bottom-info"]));
6434
6450
  const renderDays = () => createVNode("div", {
6435
6451
  "ref": daysRef,
@@ -6554,7 +6570,7 @@ const calendarProps = {
6554
6570
  var stdin_default$1e = defineComponent({
6555
6571
  name: name$18,
6556
6572
  props: calendarProps,
6557
- emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
6573
+ emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
6558
6574
  setup(props2, {
6559
6575
  emit,
6560
6576
  slots
@@ -6822,7 +6838,8 @@ var stdin_default$1e = defineComponent({
6822
6838
  "showMonthTitle": showMonthTitle,
6823
6839
  "firstDayOfWeek": dayOffset.value
6824
6840
  }, pick(props2, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
6825
- "onClick": onClickDay
6841
+ "onClick": onClickDay,
6842
+ "onClickDisabledDate": (item) => emit("clickDisabledDate", item)
6826
6843
  }), pick(slots, ["top-info", "bottom-info", "month-title"]));
6827
6844
  };
6828
6845
  const renderFooterButton = () => {
@@ -7440,7 +7457,7 @@ var stdin_default$1a = defineComponent({
7440
7457
  }), {
7441
7458
  [BORDER_TOP_BOTTOM]: props2.border && !props2.inset
7442
7459
  }]
7443
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7460
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7444
7461
  };
7445
7462
  const renderTitle = () => createVNode("div", {
7446
7463
  "class": bem$10("title", {
@@ -9400,7 +9417,7 @@ function initInstance$2() {
9400
9417
  }
9401
9418
  function showDialog(options) {
9402
9419
  if (!inBrowser) {
9403
- return Promise.resolve();
9420
+ return Promise.resolve(void 0);
9404
9421
  }
9405
9422
  return new Promise((resolve, reject) => {
9406
9423
  if (!instance$2) {
@@ -9941,7 +9958,7 @@ const FloatingBubble = withInstall(stdin_default$R);
9941
9958
  const floatingPanelProps = {
9942
9959
  height: makeNumericProp(0),
9943
9960
  anchors: makeArrayProp(),
9944
- duration: makeNumericProp(0.2),
9961
+ duration: makeNumericProp(0.3),
9945
9962
  contentDraggable: truthProp,
9946
9963
  lockScroll: Boolean,
9947
9964
  safeAreaInsetBottom: truthProp
@@ -9971,7 +9988,7 @@ var stdin_default$Q = defineComponent({
9971
9988
  const rootStyle = computed(() => ({
9972
9989
  height: addUnit(boundary.value.max),
9973
9990
  transform: `translateY(calc(100% + ${addUnit(-height.value)}))`,
9974
- transition: !dragging.value ? `transform ${props2.duration}s` : "none"
9991
+ transition: !dragging.value ? `transform ${props2.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)` : "none"
9975
9992
  }));
9976
9993
  const ease = (moveY) => {
9977
9994
  const absDistance = Math.abs(moveY);
@@ -10031,7 +10048,7 @@ var stdin_default$Q = defineComponent({
10031
10048
  }, {
10032
10049
  immediate: true
10033
10050
  });
10034
- useLockScroll(rootRef, () => props2.lockScroll);
10051
+ useLockScroll(rootRef, () => props2.lockScroll || dragging.value);
10035
10052
  useEventListener("touchmove", onTouchmove, {
10036
10053
  target: rootRef
10037
10054
  });
@@ -12254,7 +12271,7 @@ var stdin_default$B = defineComponent({
12254
12271
  "transition": "van-popover-zoom",
12255
12272
  "lockScroll": false,
12256
12273
  "onUpdate:show": updateShow
12257
- }, attrs, pick(props2, popupProps)), {
12274
+ }, attrs, useScopeId(), pick(props2, popupProps)), {
12258
12275
  default: () => [props2.showArrow && createVNode("div", {
12259
12276
  "class": bem$s("arrow")
12260
12277
  }, null), createVNode("div", {
@@ -13257,12 +13274,16 @@ var stdin_default$r = defineComponent({
13257
13274
  const empty = document.createElement("canvas");
13258
13275
  empty.width = canvas.width;
13259
13276
  empty.height = canvas.height;
13277
+ if (props2.backgroundColor) {
13278
+ const emptyCtx = empty.getContext("2d");
13279
+ setCanvasBgColor(emptyCtx);
13280
+ }
13260
13281
  return canvas.toDataURL() === empty.toDataURL();
13261
13282
  };
13262
- const setCanvasBgColor = () => {
13263
- if (state.ctx && props2.backgroundColor) {
13264
- state.ctx.fillStyle = props2.backgroundColor;
13265
- state.ctx.fillRect(0, 0, state.width, state.height);
13283
+ const setCanvasBgColor = (ctx) => {
13284
+ if (ctx && props2.backgroundColor) {
13285
+ ctx.fillStyle = props2.backgroundColor;
13286
+ ctx.fillRect(0, 0, state.width, state.height);
13266
13287
  }
13267
13288
  };
13268
13289
  const submit = () => {
@@ -13285,7 +13306,7 @@ var stdin_default$r = defineComponent({
13285
13306
  if (state.ctx) {
13286
13307
  state.ctx.clearRect(0, 0, state.width, state.height);
13287
13308
  state.ctx.closePath();
13288
- setCanvasBgColor();
13309
+ setCanvasBgColor(state.ctx);
13289
13310
  }
13290
13311
  emit("clear");
13291
13312
  };
@@ -13296,7 +13317,7 @@ var stdin_default$r = defineComponent({
13296
13317
  state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
13297
13318
  state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
13298
13319
  nextTick(() => {
13299
- setCanvasBgColor();
13320
+ setCanvasBgColor(state.ctx);
13300
13321
  });
13301
13322
  }
13302
13323
  });
@@ -14370,6 +14391,7 @@ var stdin_default$c = defineComponent({
14370
14391
  let opened;
14371
14392
  let lockClick2;
14372
14393
  let startOffset;
14394
+ let isInBeforeClosing;
14373
14395
  const root = ref();
14374
14396
  const leftRef = ref();
14375
14397
  const rightRef = ref();
@@ -14446,14 +14468,22 @@ var stdin_default$c = defineComponent({
14446
14468
  }
14447
14469
  };
14448
14470
  const onClick = (position = "outside") => {
14471
+ if (isInBeforeClosing)
14472
+ return;
14449
14473
  emit("click", position);
14450
14474
  if (opened && !lockClick2) {
14475
+ isInBeforeClosing = true;
14451
14476
  callInterceptor(props2.beforeClose, {
14452
14477
  args: [{
14453
14478
  name: props2.name,
14454
14479
  position
14455
14480
  }],
14456
- done: () => close(position)
14481
+ done: () => {
14482
+ isInBeforeClosing = false;
14483
+ close(position);
14484
+ },
14485
+ canceled: () => isInBeforeClosing = false,
14486
+ error: () => isInBeforeClosing = false
14457
14487
  });
14458
14488
  }
14459
14489
  };
@@ -16473,7 +16503,7 @@ const Lazyload = {
16473
16503
  });
16474
16504
  }
16475
16505
  };
16476
- const version = "4.6.8";
16506
+ const version = "4.7.1";
16477
16507
  function install(app) {
16478
16508
  const components = [
16479
16509
  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) {
@@ -1637,6 +1638,11 @@
1637
1638
  );
1638
1639
  return (render) => () => inited.value ? render() : null;
1639
1640
  }
1641
+ const useScopeId = () => {
1642
+ var _a;
1643
+ const { scopeId } = ((_a = vue.getCurrentInstance()) == null ? void 0 : _a.vnode) || {};
1644
+ return scopeId ? { [scopeId]: "" } : null;
1645
+ };
1640
1646
  const [name$1B, bem$1w] = createNamespace("overlay");
1641
1647
  const overlayProps = {
1642
1648
  show: Boolean,
@@ -1748,16 +1754,17 @@
1748
1754
  };
1749
1755
  const renderOverlay = () => {
1750
1756
  if (props2.overlay) {
1751
- return vue.createVNode(Overlay, {
1757
+ return vue.createVNode(Overlay, vue.mergeProps({
1752
1758
  "show": props2.show,
1753
1759
  "class": props2.overlayClass,
1754
1760
  "zIndex": zIndex.value,
1755
1761
  "duration": props2.duration,
1756
1762
  "customStyle": props2.overlayStyle,
1757
1763
  "role": props2.closeOnClickOverlay ? "button" : void 0,
1758
- "tabindex": props2.closeOnClickOverlay ? 0 : void 0,
1764
+ "tabindex": props2.closeOnClickOverlay ? 0 : void 0
1765
+ }, useScopeId(), {
1759
1766
  "onClick": onClickOverlay
1760
- }, {
1767
+ }), {
1761
1768
  default: slots["overlay-content"]
1762
1769
  });
1763
1770
  }
@@ -1809,7 +1816,7 @@
1809
1816
  "van-safe-area-bottom": safeAreaInsetBottom
1810
1817
  }],
1811
1818
  "onKeydown": onKeydown
1812
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props2.show]]);
1819
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props2.show]]);
1813
1820
  });
1814
1821
  const renderTransition = () => {
1815
1822
  const {
@@ -2686,7 +2693,7 @@
2686
2693
  const trackStyle = vue.computed(() => {
2687
2694
  const style = {
2688
2695
  transitionDuration: `${state.swiping ? 0 : props2.duration}ms`,
2689
- transform: `translate${props2.vertical ? "Y" : "X"}(${state.offset}px)`
2696
+ transform: `translate${props2.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
2690
2697
  };
2691
2698
  if (size.value) {
2692
2699
  const mainAxis = props2.vertical ? "height" : "width";
@@ -5451,7 +5458,7 @@
5451
5458
  var stdin_default$1q = vue.defineComponent({
5452
5459
  name: name$1g,
5453
5460
  props: addressEditProps,
5454
- emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
5461
+ emits: ["save", "focus", "change", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
5455
5462
  setup(props2, {
5456
5463
  emit,
5457
5464
  slots
@@ -5485,6 +5492,12 @@
5485
5492
  detailFocused.value = key === "addressDetail";
5486
5493
  emit("focus", key);
5487
5494
  };
5495
+ const onChange = (key, value) => {
5496
+ emit("change", {
5497
+ key,
5498
+ value
5499
+ });
5500
+ };
5488
5501
  const rules = vue.computed(() => {
5489
5502
  const {
5490
5503
  validator,
@@ -5596,7 +5609,7 @@
5596
5609
  "class": bem$1c("fields")
5597
5610
  }, [vue.createVNode(Field, {
5598
5611
  "modelValue": data.name,
5599
- "onUpdate:modelValue": ($event) => data.name = $event,
5612
+ "onUpdate:modelValue": [($event) => data.name = $event, (val) => onChange("name", val)],
5600
5613
  "clearable": true,
5601
5614
  "label": t$i("name"),
5602
5615
  "rules": rules.value.name,
@@ -5604,7 +5617,7 @@
5604
5617
  "onFocus": () => onFocus("name")
5605
5618
  }, null), vue.createVNode(Field, {
5606
5619
  "modelValue": data.tel,
5607
- "onUpdate:modelValue": ($event) => data.tel = $event,
5620
+ "onUpdate:modelValue": [($event) => data.tel = $event, (val) => onChange("tel", val)],
5608
5621
  "clearable": true,
5609
5622
  "type": "tel",
5610
5623
  "label": t$i("tel"),
@@ -6596,7 +6609,7 @@
6596
6609
  offset: makeNumberProp(0),
6597
6610
  rowHeight: String
6598
6611
  },
6599
- emits: ["click"],
6612
+ emits: ["click", "clickDisabledDate"],
6600
6613
  setup(props2, {
6601
6614
  emit,
6602
6615
  slots
@@ -6642,6 +6655,8 @@
6642
6655
  const onClick = () => {
6643
6656
  if (props2.item.type !== "disabled") {
6644
6657
  emit("click", props2.item);
6658
+ } else {
6659
+ emit("clickDisabledDate", props2.item);
6645
6660
  }
6646
6661
  };
6647
6662
  const renderTopInfo = () => {
@@ -6728,7 +6743,7 @@
6728
6743
  var stdin_default$1g = vue.defineComponent({
6729
6744
  name: name$16,
6730
6745
  props: calendarMonthProps,
6731
- emits: ["click"],
6746
+ emits: ["click", "clickDisabledDate"],
6732
6747
  setup(props2, {
6733
6748
  emit,
6734
6749
  slots
@@ -6887,7 +6902,8 @@
6887
6902
  "color": props2.color,
6888
6903
  "offset": offset2.value,
6889
6904
  "rowHeight": rowHeight.value,
6890
- "onClick": (item2) => emit("click", item2)
6905
+ "onClick": (item2) => emit("click", item2),
6906
+ "onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
6891
6907
  }, pick(slots, ["top-info", "bottom-info"]));
6892
6908
  const renderDays = () => vue.createVNode("div", {
6893
6909
  "ref": daysRef,
@@ -7012,7 +7028,7 @@
7012
7028
  var stdin_default$1e = vue.defineComponent({
7013
7029
  name: name$18,
7014
7030
  props: calendarProps,
7015
- emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
7031
+ emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
7016
7032
  setup(props2, {
7017
7033
  emit,
7018
7034
  slots
@@ -7280,7 +7296,8 @@
7280
7296
  "showMonthTitle": showMonthTitle,
7281
7297
  "firstDayOfWeek": dayOffset.value
7282
7298
  }, pick(props2, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
7283
- "onClick": onClickDay
7299
+ "onClick": onClickDay,
7300
+ "onClickDisabledDate": (item) => emit("clickDisabledDate", item)
7284
7301
  }), pick(slots, ["top-info", "bottom-info", "month-title"]));
7285
7302
  };
7286
7303
  const renderFooterButton = () => {
@@ -7898,7 +7915,7 @@
7898
7915
  }), {
7899
7916
  [BORDER_TOP_BOTTOM]: props2.border && !props2.inset
7900
7917
  }]
7901
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7918
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7902
7919
  };
7903
7920
  const renderTitle = () => vue.createVNode("div", {
7904
7921
  "class": bem$10("title", {
@@ -9838,7 +9855,7 @@
9838
9855
  }
9839
9856
  function showDialog(options) {
9840
9857
  if (!inBrowser$1) {
9841
- return Promise.resolve();
9858
+ return Promise.resolve(void 0);
9842
9859
  }
9843
9860
  return new Promise((resolve, reject) => {
9844
9861
  if (!instance$2) {
@@ -10376,7 +10393,7 @@
10376
10393
  const floatingPanelProps = {
10377
10394
  height: makeNumericProp(0),
10378
10395
  anchors: makeArrayProp(),
10379
- duration: makeNumericProp(0.2),
10396
+ duration: makeNumericProp(0.3),
10380
10397
  contentDraggable: truthProp,
10381
10398
  lockScroll: Boolean,
10382
10399
  safeAreaInsetBottom: truthProp
@@ -10406,7 +10423,7 @@
10406
10423
  const rootStyle = vue.computed(() => ({
10407
10424
  height: addUnit(boundary.value.max),
10408
10425
  transform: `translateY(calc(100% + ${addUnit(-height2.value)}))`,
10409
- transition: !dragging.value ? `transform ${props2.duration}s` : "none"
10426
+ transition: !dragging.value ? `transform ${props2.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)` : "none"
10410
10427
  }));
10411
10428
  const ease = (moveY) => {
10412
10429
  const absDistance = Math.abs(moveY);
@@ -10466,7 +10483,7 @@
10466
10483
  }, {
10467
10484
  immediate: true
10468
10485
  });
10469
- useLockScroll(rootRef, () => props2.lockScroll);
10486
+ useLockScroll(rootRef, () => props2.lockScroll || dragging.value);
10470
10487
  useEventListener("touchmove", onTouchmove, {
10471
10488
  target: rootRef
10472
10489
  });
@@ -13495,7 +13512,7 @@
13495
13512
  "transition": "van-popover-zoom",
13496
13513
  "lockScroll": false,
13497
13514
  "onUpdate:show": updateShow
13498
- }, attrs, pick(props2, popupProps)), {
13515
+ }, attrs, useScopeId(), pick(props2, popupProps)), {
13499
13516
  default: () => [props2.showArrow && vue.createVNode("div", {
13500
13517
  "class": bem$s("arrow")
13501
13518
  }, null), vue.createVNode("div", {
@@ -14495,12 +14512,16 @@
14495
14512
  const empty = document.createElement("canvas");
14496
14513
  empty.width = canvas.width;
14497
14514
  empty.height = canvas.height;
14515
+ if (props2.backgroundColor) {
14516
+ const emptyCtx = empty.getContext("2d");
14517
+ setCanvasBgColor(emptyCtx);
14518
+ }
14498
14519
  return canvas.toDataURL() === empty.toDataURL();
14499
14520
  };
14500
- const setCanvasBgColor = () => {
14501
- if (state.ctx && props2.backgroundColor) {
14502
- state.ctx.fillStyle = props2.backgroundColor;
14503
- state.ctx.fillRect(0, 0, state.width, state.height);
14521
+ const setCanvasBgColor = (ctx) => {
14522
+ if (ctx && props2.backgroundColor) {
14523
+ ctx.fillStyle = props2.backgroundColor;
14524
+ ctx.fillRect(0, 0, state.width, state.height);
14504
14525
  }
14505
14526
  };
14506
14527
  const submit = () => {
@@ -14523,7 +14544,7 @@
14523
14544
  if (state.ctx) {
14524
14545
  state.ctx.clearRect(0, 0, state.width, state.height);
14525
14546
  state.ctx.closePath();
14526
- setCanvasBgColor();
14547
+ setCanvasBgColor(state.ctx);
14527
14548
  }
14528
14549
  emit("clear");
14529
14550
  };
@@ -14534,7 +14555,7 @@
14534
14555
  state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
14535
14556
  state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
14536
14557
  vue.nextTick(() => {
14537
- setCanvasBgColor();
14558
+ setCanvasBgColor(state.ctx);
14538
14559
  });
14539
14560
  }
14540
14561
  });
@@ -15605,6 +15626,7 @@
15605
15626
  let opened;
15606
15627
  let lockClick2;
15607
15628
  let startOffset;
15629
+ let isInBeforeClosing;
15608
15630
  const root = vue.ref();
15609
15631
  const leftRef = vue.ref();
15610
15632
  const rightRef = vue.ref();
@@ -15681,14 +15703,22 @@
15681
15703
  }
15682
15704
  };
15683
15705
  const onClick = (position = "outside") => {
15706
+ if (isInBeforeClosing)
15707
+ return;
15684
15708
  emit("click", position);
15685
15709
  if (opened && !lockClick2) {
15710
+ isInBeforeClosing = true;
15686
15711
  callInterceptor(props2.beforeClose, {
15687
15712
  args: [{
15688
15713
  name: props2.name,
15689
15714
  position
15690
15715
  }],
15691
- done: () => close(position)
15716
+ done: () => {
15717
+ isInBeforeClosing = false;
15718
+ close(position);
15719
+ },
15720
+ canceled: () => isInBeforeClosing = false,
15721
+ error: () => isInBeforeClosing = false
15692
15722
  });
15693
15723
  }
15694
15724
  };
@@ -17685,7 +17715,7 @@
17685
17715
  });
17686
17716
  }
17687
17717
  };
17688
- const version = "4.6.8";
17718
+ const version = "4.7.1";
17689
17719
  function install(app) {
17690
17720
  const components = [
17691
17721
  ActionBar,