vant 4.7.0 → 4.7.2

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 (58) hide show
  1. package/README.md +4 -1
  2. package/es/cell-group/CellGroup.mjs +2 -1
  3. package/es/composables/use-scope-id.d.ts +3 -0
  4. package/es/composables/use-scope-id.mjs +9 -0
  5. package/es/dialog/function-call.d.ts +15 -0
  6. package/es/floating-panel/FloatingPanel.mjs +2 -2
  7. package/es/floating-panel/index.css +1 -1
  8. package/es/icon/index.css +1 -1
  9. package/es/image-preview/ImagePreview.d.ts +13 -0
  10. package/es/image-preview/ImagePreview.mjs +2 -0
  11. package/es/image-preview/ImagePreviewItem.d.ts +3 -0
  12. package/es/image-preview/ImagePreviewItem.mjs +16 -11
  13. package/es/image-preview/function-call.d.ts +3 -0
  14. package/es/image-preview/function-call.mjs +1 -0
  15. package/es/image-preview/index.d.ts +9 -0
  16. package/es/image-preview/types.d.ts +1 -0
  17. package/es/index.d.ts +1 -1
  18. package/es/index.mjs +1 -1
  19. package/es/notify/function-call.d.ts +12 -0
  20. package/es/popover/Popover.mjs +2 -1
  21. package/es/popup/Popup.mjs +7 -5
  22. package/es/signature/Signature.mjs +34 -36
  23. package/es/swipe/Swipe.mjs +1 -1
  24. package/es/swipe/index.css +1 -1
  25. package/es/toast/function-call.d.ts +26 -0
  26. package/es/uploader/Uploader.mjs +12 -3
  27. package/lib/cell-group/CellGroup.js +2 -1
  28. package/lib/composables/use-scope-id.d.ts +3 -0
  29. package/lib/composables/use-scope-id.js +28 -0
  30. package/lib/dialog/function-call.d.ts +15 -0
  31. package/lib/floating-panel/FloatingPanel.js +2 -2
  32. package/lib/floating-panel/index.css +1 -1
  33. package/lib/icon/index.css +1 -1
  34. package/lib/image-preview/ImagePreview.d.ts +13 -0
  35. package/lib/image-preview/ImagePreview.js +2 -0
  36. package/lib/image-preview/ImagePreviewItem.d.ts +3 -0
  37. package/lib/image-preview/ImagePreviewItem.js +16 -11
  38. package/lib/image-preview/function-call.d.ts +3 -0
  39. package/lib/image-preview/function-call.js +1 -0
  40. package/lib/image-preview/index.d.ts +9 -0
  41. package/lib/image-preview/types.d.ts +1 -0
  42. package/lib/index.css +1 -1
  43. package/lib/index.d.ts +1 -1
  44. package/lib/index.js +1 -1
  45. package/lib/notify/function-call.d.ts +12 -0
  46. package/lib/popover/Popover.js +2 -1
  47. package/lib/popup/Popup.js +6 -4
  48. package/lib/signature/Signature.js +33 -35
  49. package/lib/swipe/Swipe.js +1 -1
  50. package/lib/swipe/index.css +1 -1
  51. package/lib/toast/function-call.d.ts +26 -0
  52. package/lib/uploader/Uploader.js +11 -2
  53. package/lib/vant.cjs.js +79 -58
  54. package/lib/vant.es.js +79 -58
  55. package/lib/vant.js +79 -58
  56. package/lib/vant.min.js +1 -1
  57. package/lib/web-types.json +1 -1
  58. package/package.json +2 -2
package/lib/index.d.ts CHANGED
@@ -105,4 +105,4 @@ declare namespace _default {
105
105
  }
106
106
  export default _default;
107
107
  export function install(app: any): void;
108
- export const version: "4.7.0";
108
+ export const version: "4.7.2";
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.7.0";
227
+ const version = "4.7.2";
228
228
  function install(app) {
229
229
  const components = [
230
230
  import_action_bar.ActionBar,
@@ -1,6 +1,18 @@
1
1
  import { type ComponentInstance } from '../utils';
2
2
  import type { NotifyMessage, NotifyOptions } from './types';
3
+ /**
4
+ * Close the currently displayed Notify
5
+ */
3
6
  export declare const closeNotify: () => void;
7
+ /**
8
+ * Display Notify at the top of the page
9
+ */
4
10
  export declare function showNotify(options: NotifyMessage | NotifyOptions): ComponentInstance | undefined;
11
+ /**
12
+ * Modify the default configuration, affecting all `showNotify` calls
13
+ */
5
14
  export declare const setNotifyDefaultOptions: (options: NotifyOptions) => NotifyOptions;
15
+ /**
16
+ * Reset the default configuration, affecting all `showNotify` calls
17
+ */
6
18
  export declare const resetNotifyDefaultOptions: () => void;
@@ -26,6 +26,7 @@ var import_vue2 = require("vue");
26
26
  var import_popperjs = require("@vant/popperjs");
27
27
  var import_utils = require("../utils");
28
28
  var import_use = require("@vant/use");
29
+ var import_use_scope_id = require("../composables/use-scope-id");
29
30
  var import_use_sync_prop_ref = require("../composables/use-sync-prop-ref");
30
31
  var import_icon = require("../icon");
31
32
  var import_popup = require("../popup");
@@ -203,7 +204,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
203
204
  "transition": "van-popover-zoom",
204
205
  "lockScroll": false,
205
206
  "onUpdate:show": updateShow
206
- }, attrs, (0, import_utils.pick)(props, popupProps)), {
207
+ }, attrs, (0, import_use_scope_id.useScopeId)(), (0, import_utils.pick)(props, popupProps)), {
207
208
  default: () => [props.showArrow && (0, import_vue.createVNode)("div", {
208
209
  "class": bem("arrow")
209
210
  }, null), (0, import_vue.createVNode)("div", {
@@ -31,6 +31,7 @@ var import_use_lock_scroll = require("../composables/use-lock-scroll");
31
31
  var import_use_lazy_render = require("../composables/use-lazy-render");
32
32
  var import_on_popup_reopen = require("../composables/on-popup-reopen");
33
33
  var import_use_global_z_index = require("../composables/use-global-z-index");
34
+ var import_use_scope_id = require("../composables/use-scope-id");
34
35
  var import_icon = require("../icon");
35
36
  var import_overlay = require("../overlay");
36
37
  const popupProps = (0, import_utils.extend)({}, import_shared.popupSharedProps, {
@@ -97,16 +98,17 @@ var stdin_default = (0, import_vue2.defineComponent)({
97
98
  };
98
99
  const renderOverlay = () => {
99
100
  if (props.overlay) {
100
- return (0, import_vue.createVNode)(import_overlay.Overlay, {
101
+ return (0, import_vue.createVNode)(import_overlay.Overlay, (0, import_vue.mergeProps)({
101
102
  "show": props.show,
102
103
  "class": props.overlayClass,
103
104
  "zIndex": zIndex.value,
104
105
  "duration": props.duration,
105
106
  "customStyle": props.overlayStyle,
106
107
  "role": props.closeOnClickOverlay ? "button" : void 0,
107
- "tabindex": props.closeOnClickOverlay ? 0 : void 0,
108
+ "tabindex": props.closeOnClickOverlay ? 0 : void 0
109
+ }, (0, import_use_scope_id.useScopeId)(), {
108
110
  "onClick": onClickOverlay
109
- }, {
111
+ }), {
110
112
  default: slots["overlay-content"]
111
113
  });
112
114
  }
@@ -158,7 +160,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
158
160
  "van-safe-area-bottom": safeAreaInsetBottom
159
161
  }],
160
162
  "onKeydown": onKeydown
161
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[import_vue.vShow, props.show]]);
163
+ }, attrs, (0, import_use_scope_id.useScopeId)()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[import_vue.vShow, props.show]]);
162
164
  });
163
165
  const renderTransition = () => {
164
166
  const {
@@ -50,37 +50,37 @@ var stdin_default = (0, import_vue2.defineComponent)({
50
50
  }) {
51
51
  const canvasRef = (0, import_vue2.ref)();
52
52
  const wrapRef = (0, import_vue2.ref)();
53
- const state = (0, import_vue2.reactive)({
54
- width: 0,
55
- height: 0,
56
- ctx: null,
57
- ratio: import_utils.inBrowser ? window.devicePixelRatio : 1
53
+ const ctx = (0, import_vue2.computed)(() => {
54
+ if (!canvasRef.value)
55
+ return null;
56
+ return canvasRef.value.getContext("2d");
58
57
  });
59
- let canvasRect;
60
58
  const isRenderCanvas = import_utils.inBrowser ? hasCanvasSupport() : true;
59
+ let canvasWidth = 0;
60
+ let canvasHeight = 0;
61
+ let canvasRect;
61
62
  const touchStart = () => {
62
- if (!state.ctx) {
63
+ if (!ctx.value) {
63
64
  return false;
64
65
  }
65
- state.ctx.beginPath();
66
- state.ctx.lineWidth = props.lineWidth * state.ratio;
67
- state.ctx.strokeStyle = props.penColor;
66
+ ctx.value.beginPath();
67
+ ctx.value.lineWidth = props.lineWidth;
68
+ ctx.value.strokeStyle = props.penColor;
68
69
  canvasRect = (0, import_use.useRect)(canvasRef);
69
70
  emit("start");
70
71
  };
71
72
  const touchMove = (event) => {
72
- var _a, _b;
73
- if (!state.ctx) {
73
+ if (!ctx.value) {
74
74
  return false;
75
75
  }
76
76
  (0, import_utils.preventDefault)(event);
77
77
  const touch = event.touches[0];
78
- const mouseX = (touch.clientX - ((canvasRect == null ? void 0 : canvasRect.left) || 0)) * state.ratio;
79
- const mouseY = (touch.clientY - ((canvasRect == null ? void 0 : canvasRect.top) || 0)) * state.ratio;
80
- state.ctx.lineCap = "round";
81
- state.ctx.lineJoin = "round";
82
- (_a = state.ctx) == null ? void 0 : _a.lineTo(mouseX, mouseY);
83
- (_b = state.ctx) == null ? void 0 : _b.stroke();
78
+ const mouseX = touch.clientX - ((canvasRect == null ? void 0 : canvasRect.left) || 0);
79
+ const mouseY = touch.clientY - ((canvasRect == null ? void 0 : canvasRect.top) || 0);
80
+ ctx.value.lineCap = "round";
81
+ ctx.value.lineJoin = "round";
82
+ ctx.value.lineTo(mouseX, mouseY);
83
+ ctx.value.stroke();
84
84
  emit("signing", event);
85
85
  };
86
86
  const touchEnd = (event) => {
@@ -97,10 +97,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
97
97
  }
98
98
  return canvas.toDataURL() === empty.toDataURL();
99
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
+ const setCanvasBgColor = (ctx2) => {
101
+ if (ctx2 && props.backgroundColor) {
102
+ ctx2.fillStyle = props.backgroundColor;
103
+ ctx2.fillRect(0, 0, canvasWidth, canvasHeight);
104
104
  }
105
105
  };
106
106
  const submit = () => {
@@ -120,22 +120,22 @@ var stdin_default = (0, import_vue2.defineComponent)({
120
120
  });
121
121
  };
122
122
  const clear = () => {
123
- if (state.ctx) {
124
- state.ctx.clearRect(0, 0, state.width, state.height);
125
- state.ctx.closePath();
126
- setCanvasBgColor(state.ctx);
123
+ if (ctx.value) {
124
+ ctx.value.clearRect(0, 0, canvasWidth, canvasHeight);
125
+ ctx.value.closePath();
126
+ setCanvasBgColor(ctx.value);
127
127
  }
128
128
  emit("clear");
129
129
  };
130
130
  (0, import_vue2.onMounted)(() => {
131
131
  var _a, _b, _c;
132
- if (isRenderCanvas) {
133
- state.ctx = (_a = canvasRef.value) == null ? void 0 : _a.getContext("2d");
134
- state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
135
- state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
136
- (0, import_vue2.nextTick)(() => {
137
- setCanvasBgColor(state.ctx);
138
- });
132
+ if (isRenderCanvas && canvasRef.value) {
133
+ const canvas = canvasRef.value;
134
+ const dpr = import_utils.inBrowser ? window.devicePixelRatio : 1;
135
+ canvasWidth = canvas.width = (((_a = wrapRef.value) == null ? void 0 : _a.offsetWidth) || 0) * dpr;
136
+ canvasHeight = canvas.height = (((_b = wrapRef.value) == null ? void 0 : _b.offsetHeight) || 0) * dpr;
137
+ (_c = ctx.value) == null ? void 0 : _c.scale(dpr, dpr);
138
+ setCanvasBgColor(ctx.value);
139
139
  }
140
140
  });
141
141
  return () => (0, import_vue.createVNode)("div", {
@@ -145,8 +145,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
145
145
  "ref": wrapRef
146
146
  }, [isRenderCanvas ? (0, import_vue.createVNode)("canvas", {
147
147
  "ref": canvasRef,
148
- "width": state.width,
149
- "height": state.height,
150
148
  "onTouchstartPassive": touchStart,
151
149
  "onTouchmove": touchMove,
152
150
  "onTouchend": touchEnd
@@ -89,7 +89,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
89
89
  const trackStyle = (0, import_vue2.computed)(() => {
90
90
  const style = {
91
91
  transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
92
- transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
92
+ transform: `translate${props.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
93
93
  };
94
94
  if (size.value) {
95
95
  const mainAxis = props.vertical ? "height" : "width";
@@ -1 +1 @@
1
- :root{--van-swipe-indicator-size: 6px;--van-swipe-indicator-margin: var(--van-padding-sm);--van-swipe-indicator-active-opacity: 1;--van-swipe-indicator-inactive-opacity: .3;--van-swipe-indicator-active-background: var(--van-primary-color);--van-swipe-indicator-inactive-background: var(--van-border-color)}.van-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:flex;height:100%}.van-swipe__track--vertical{flex-direction:column}.van-swipe__indicators{position:absolute;bottom:var(--van-swipe-indicator-margin);left:50%;display:flex;transform:translate(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--van-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:var(--van-swipe-indicator-size)}.van-swipe__indicator{width:var(--van-swipe-indicator-size);height:var(--van-swipe-indicator-size);background-color:var(--van-swipe-indicator-inactive-background);border-radius:100%;opacity:var(--van-swipe-indicator-inactive-opacity);transition:opacity var(--van-duration-fast),background-color var(--van-duration-fast)}.van-swipe__indicator:not(:last-child){margin-right:var(--van-swipe-indicator-size)}.van-swipe__indicator--active{background-color:var(--van-swipe-indicator-active-background);opacity:var(--van-swipe-indicator-active-opacity)}
1
+ :root{--van-swipe-indicator-size: 6px;--van-swipe-indicator-margin: var(--van-padding-sm);--van-swipe-indicator-active-opacity: 1;--van-swipe-indicator-inactive-opacity: .3;--van-swipe-indicator-active-background: var(--van-primary-color);--van-swipe-indicator-inactive-background: var(--van-border-color)}.van-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:flex;height:100%;transition-property:transform}.van-swipe__track--vertical{flex-direction:column}.van-swipe__indicators{position:absolute;bottom:var(--van-swipe-indicator-margin);left:50%;display:flex;transform:translate(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--van-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:var(--van-swipe-indicator-size)}.van-swipe__indicator{width:var(--van-swipe-indicator-size);height:var(--van-swipe-indicator-size);background-color:var(--van-swipe-indicator-inactive-background);border-radius:100%;opacity:var(--van-swipe-indicator-inactive-opacity);transition:opacity var(--van-duration-fast),background-color var(--van-duration-fast)}.van-swipe__indicator:not(:last-child){margin-right:var(--van-swipe-indicator-size)}.van-swipe__indicator--active{background-color:var(--van-swipe-indicator-active-background);opacity:var(--van-swipe-indicator-active-opacity)}
@@ -1,10 +1,36 @@
1
1
  import type { ToastType, ToastOptions, ToastWrapperInstance } from './types';
2
+ /**
3
+ * Display a text toast
4
+ */
2
5
  export declare function showToast(options?: string | ToastOptions): ToastWrapperInstance;
6
+ /**
7
+ * Display a loading toast
8
+ */
3
9
  export declare const showLoadingToast: (options: string | ToastOptions) => ToastWrapperInstance;
10
+ /**
11
+ * Display a success toast
12
+ */
4
13
  export declare const showSuccessToast: (options: string | ToastOptions) => ToastWrapperInstance;
14
+ /**
15
+ * Display a fail toast
16
+ */
5
17
  export declare const showFailToast: (options: string | ToastOptions) => ToastWrapperInstance;
18
+ /**
19
+ * Close the currently displayed toast
20
+ */
6
21
  export declare const closeToast: (all?: boolean) => void;
22
+ /**
23
+ * Modify the default configuration that affects all `showToast` calls.
24
+ * Specify the `type` parameter to modify the default configuration of a specific type of toast
25
+ */
7
26
  export declare function setToastDefaultOptions(options: ToastOptions): void;
8
27
  export declare function setToastDefaultOptions(type: ToastType, options: ToastOptions): void;
28
+ /**
29
+ * Reset the default configuration that affects all `showToast` calls.
30
+ * Specify the `type` parameter to reset the default configuration of a specific type of toast
31
+ */
9
32
  export declare const resetToastDefaultOptions: (type?: ToastType) => void;
33
+ /**
34
+ * Allow multiple toasts to be displayed as the same time
35
+ */
10
36
  export declare const allowMultipleToast: (value?: boolean) => void;
@@ -80,6 +80,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
80
80
  const inputRef = (0, import_vue2.ref)();
81
81
  const urls = [];
82
82
  const reuploadIndex = (0, import_vue2.ref)(-1);
83
+ const isReuploading = (0, import_vue2.ref)(false);
83
84
  const getDetail = (index = props.modelValue.length) => ({
84
85
  name: props.name,
85
86
  index
@@ -216,8 +217,15 @@ var stdin_default = (0, import_vue2.defineComponent)({
216
217
  emit("delete", item, getDetail(index));
217
218
  };
218
219
  const reuploadImage = (index) => {
219
- chooseFile();
220
+ isReuploading.value = true;
220
221
  reuploadIndex.value = index;
222
+ (0, import_vue2.nextTick)(() => chooseFile());
223
+ };
224
+ const onInputClick = () => {
225
+ if (!isReuploading.value) {
226
+ reuploadIndex.value = -1;
227
+ }
228
+ isReuploading.value = false;
221
229
  };
222
230
  const renderPreviewItem = (item, index) => {
223
231
  const needPickData = ["imageFit", "deletable", "reupload", "previewSize", "beforeDelete"];
@@ -250,7 +258,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
250
258
  "capture": props.capture,
251
259
  "multiple": props.multiple && reuploadIndex.value === -1,
252
260
  "disabled": props.disabled,
253
- "onChange": onChange
261
+ "onChange": onChange,
262
+ "onClick": onInputClick
254
263
  }, null);
255
264
  if (slots.default) {
256
265
  return (0, import_vue.withDirectives)((0, import_vue.createVNode)("div", {
package/lib/vant.cjs.js CHANGED
@@ -1250,6 +1250,11 @@ function useLazyRender(show) {
1250
1250
  );
1251
1251
  return (render) => () => inited.value ? render() : null;
1252
1252
  }
1253
+ const useScopeId = () => {
1254
+ var _a;
1255
+ const { scopeId } = ((_a = vue.getCurrentInstance()) == null ? void 0 : _a.vnode) || {};
1256
+ return scopeId ? { [scopeId]: "" } : null;
1257
+ };
1253
1258
  const [name$1B, bem$1w] = createNamespace("overlay");
1254
1259
  const overlayProps = {
1255
1260
  show: Boolean,
@@ -1361,16 +1366,17 @@ var stdin_default$1J = vue.defineComponent({
1361
1366
  };
1362
1367
  const renderOverlay = () => {
1363
1368
  if (props2.overlay) {
1364
- return vue.createVNode(Overlay, {
1369
+ return vue.createVNode(Overlay, vue.mergeProps({
1365
1370
  "show": props2.show,
1366
1371
  "class": props2.overlayClass,
1367
1372
  "zIndex": zIndex.value,
1368
1373
  "duration": props2.duration,
1369
1374
  "customStyle": props2.overlayStyle,
1370
1375
  "role": props2.closeOnClickOverlay ? "button" : void 0,
1371
- "tabindex": props2.closeOnClickOverlay ? 0 : void 0,
1376
+ "tabindex": props2.closeOnClickOverlay ? 0 : void 0
1377
+ }, useScopeId(), {
1372
1378
  "onClick": onClickOverlay
1373
- }, {
1379
+ }), {
1374
1380
  default: slots["overlay-content"]
1375
1381
  });
1376
1382
  }
@@ -1422,7 +1428,7 @@ var stdin_default$1J = vue.defineComponent({
1422
1428
  "van-safe-area-bottom": safeAreaInsetBottom
1423
1429
  }],
1424
1430
  "onKeydown": onKeydown
1425
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props2.show]]);
1431
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[vue.vShow, props2.show]]);
1426
1432
  });
1427
1433
  const renderTransition = () => {
1428
1434
  const {
@@ -2222,7 +2228,7 @@ var stdin_default$1E = vue.defineComponent({
2222
2228
  const trackStyle = vue.computed(() => {
2223
2229
  const style = {
2224
2230
  transitionDuration: `${state.swiping ? 0 : props2.duration}ms`,
2225
- transform: `translate${props2.vertical ? "Y" : "X"}(${state.offset}px)`
2231
+ transform: `translate${props2.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
2226
2232
  };
2227
2233
  if (size.value) {
2228
2234
  const mainAxis = props2.vertical ? "height" : "width";
@@ -7453,7 +7459,7 @@ var stdin_default$1a = vue.defineComponent({
7453
7459
  }), {
7454
7460
  [BORDER_TOP_BOTTOM]: props2.border && !props2.inset
7455
7461
  }]
7456
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7462
+ }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7457
7463
  };
7458
7464
  const renderTitle = () => vue.createVNode("div", {
7459
7465
  "class": bem$10("title", {
@@ -9954,7 +9960,7 @@ const FloatingBubble = withInstall(stdin_default$R);
9954
9960
  const floatingPanelProps = {
9955
9961
  height: makeNumericProp(0),
9956
9962
  anchors: makeArrayProp(),
9957
- duration: makeNumericProp(0.2),
9963
+ duration: makeNumericProp(0.3),
9958
9964
  contentDraggable: truthProp,
9959
9965
  lockScroll: Boolean,
9960
9966
  safeAreaInsetBottom: truthProp
@@ -9984,7 +9990,7 @@ var stdin_default$Q = vue.defineComponent({
9984
9990
  const rootStyle = vue.computed(() => ({
9985
9991
  height: addUnit(boundary.value.max),
9986
9992
  transform: `translateY(calc(100% + ${addUnit(-height.value)}))`,
9987
- transition: !dragging.value ? `transform ${props2.duration}s` : "none"
9993
+ transition: !dragging.value ? `transform ${props2.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)` : "none"
9988
9994
  }));
9989
9995
  const ease = (moveY) => {
9990
9996
  const absDistance = Math.abs(moveY);
@@ -10262,6 +10268,7 @@ var stdin_default$N = vue.defineComponent({
10262
10268
  rootWidth: makeRequiredProp(Number),
10263
10269
  rootHeight: makeRequiredProp(Number),
10264
10270
  disableZoom: Boolean,
10271
+ doubleScale: Boolean,
10265
10272
  closeOnClickOverlay: Boolean
10266
10273
  },
10267
10274
  emits: ["scale", "close", "longPress"],
@@ -10435,18 +10442,22 @@ var stdin_default$N = vue.defineComponent({
10435
10442
  const TAP_TIME = 250;
10436
10443
  if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET) {
10437
10444
  if (deltaTime < TAP_TIME) {
10438
- if (doubleTapTimer) {
10439
- clearTimeout(doubleTapTimer);
10440
- doubleTapTimer = null;
10441
- toggleScale();
10442
- } else {
10443
- if (!props2.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
10444
- return;
10445
- }
10446
- doubleTapTimer = setTimeout(() => {
10447
- emit("close");
10445
+ if (props2.doubleScale) {
10446
+ if (doubleTapTimer) {
10447
+ clearTimeout(doubleTapTimer);
10448
10448
  doubleTapTimer = null;
10449
- }, TAP_TIME);
10449
+ toggleScale();
10450
+ } else {
10451
+ if (!props2.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
10452
+ return;
10453
+ }
10454
+ doubleTapTimer = setTimeout(() => {
10455
+ emit("close");
10456
+ doubleTapTimer = null;
10457
+ }, TAP_TIME);
10458
+ }
10459
+ } else {
10460
+ emit("close");
10450
10461
  }
10451
10462
  } else if (deltaTime > LONG_PRESS_START_TIME) {
10452
10463
  emit("longPress");
@@ -10571,6 +10582,7 @@ const imagePreviewProps = {
10571
10582
  closeIcon: makeStringProp("clear"),
10572
10583
  transition: String,
10573
10584
  beforeClose: Function,
10585
+ doubleScale: truthProp,
10574
10586
  overlayClass: unknownProp,
10575
10587
  overlayStyle: Object,
10576
10588
  swipeDuration: makeNumericProp(300),
@@ -10662,6 +10674,7 @@ var stdin_default$M = vue.defineComponent({
10662
10674
  "rootWidth": state.rootWidth,
10663
10675
  "rootHeight": state.rootHeight,
10664
10676
  "disableZoom": state.disableZoom,
10677
+ "doubleScale": props2.doubleScale,
10665
10678
  "closeOnClickOverlay": props2.closeOnClickOverlay,
10666
10679
  "onScale": emitScale,
10667
10680
  "onClose": emitClose,
@@ -10739,6 +10752,7 @@ const defaultConfig = {
10739
10752
  closeIcon: "clear",
10740
10753
  transition: void 0,
10741
10754
  beforeClose: void 0,
10755
+ doubleScale: true,
10742
10756
  overlayStyle: void 0,
10743
10757
  overlayClass: void 0,
10744
10758
  startPosition: 0,
@@ -12267,7 +12281,7 @@ var stdin_default$B = vue.defineComponent({
12267
12281
  "transition": "van-popover-zoom",
12268
12282
  "lockScroll": false,
12269
12283
  "onUpdate:show": updateShow
12270
- }, attrs, pick(props2, popupProps)), {
12284
+ }, attrs, useScopeId(), pick(props2, popupProps)), {
12271
12285
  default: () => [props2.showArrow && vue.createVNode("div", {
12272
12286
  "class": bem$s("arrow")
12273
12287
  }, null), vue.createVNode("div", {
@@ -13229,37 +13243,37 @@ var stdin_default$r = vue.defineComponent({
13229
13243
  }) {
13230
13244
  const canvasRef = vue.ref();
13231
13245
  const wrapRef = vue.ref();
13232
- const state = vue.reactive({
13233
- width: 0,
13234
- height: 0,
13235
- ctx: null,
13236
- ratio: inBrowser ? window.devicePixelRatio : 1
13246
+ const ctx = vue.computed(() => {
13247
+ if (!canvasRef.value)
13248
+ return null;
13249
+ return canvasRef.value.getContext("2d");
13237
13250
  });
13238
- let canvasRect;
13239
13251
  const isRenderCanvas = inBrowser ? hasCanvasSupport() : true;
13252
+ let canvasWidth = 0;
13253
+ let canvasHeight = 0;
13254
+ let canvasRect;
13240
13255
  const touchStart = () => {
13241
- if (!state.ctx) {
13256
+ if (!ctx.value) {
13242
13257
  return false;
13243
13258
  }
13244
- state.ctx.beginPath();
13245
- state.ctx.lineWidth = props2.lineWidth * state.ratio;
13246
- state.ctx.strokeStyle = props2.penColor;
13259
+ ctx.value.beginPath();
13260
+ ctx.value.lineWidth = props2.lineWidth;
13261
+ ctx.value.strokeStyle = props2.penColor;
13247
13262
  canvasRect = use.useRect(canvasRef);
13248
13263
  emit("start");
13249
13264
  };
13250
13265
  const touchMove = (event) => {
13251
- var _a, _b;
13252
- if (!state.ctx) {
13266
+ if (!ctx.value) {
13253
13267
  return false;
13254
13268
  }
13255
13269
  preventDefault(event);
13256
13270
  const touch = event.touches[0];
13257
- const mouseX = (touch.clientX - ((canvasRect == null ? void 0 : canvasRect.left) || 0)) * state.ratio;
13258
- const mouseY = (touch.clientY - ((canvasRect == null ? void 0 : canvasRect.top) || 0)) * state.ratio;
13259
- state.ctx.lineCap = "round";
13260
- state.ctx.lineJoin = "round";
13261
- (_a = state.ctx) == null ? void 0 : _a.lineTo(mouseX, mouseY);
13262
- (_b = state.ctx) == null ? void 0 : _b.stroke();
13271
+ const mouseX = touch.clientX - ((canvasRect == null ? void 0 : canvasRect.left) || 0);
13272
+ const mouseY = touch.clientY - ((canvasRect == null ? void 0 : canvasRect.top) || 0);
13273
+ ctx.value.lineCap = "round";
13274
+ ctx.value.lineJoin = "round";
13275
+ ctx.value.lineTo(mouseX, mouseY);
13276
+ ctx.value.stroke();
13263
13277
  emit("signing", event);
13264
13278
  };
13265
13279
  const touchEnd = (event) => {
@@ -13276,10 +13290,10 @@ var stdin_default$r = vue.defineComponent({
13276
13290
  }
13277
13291
  return canvas.toDataURL() === empty.toDataURL();
13278
13292
  };
13279
- const setCanvasBgColor = (ctx) => {
13280
- if (ctx && props2.backgroundColor) {
13281
- ctx.fillStyle = props2.backgroundColor;
13282
- ctx.fillRect(0, 0, state.width, state.height);
13293
+ const setCanvasBgColor = (ctx2) => {
13294
+ if (ctx2 && props2.backgroundColor) {
13295
+ ctx2.fillStyle = props2.backgroundColor;
13296
+ ctx2.fillRect(0, 0, canvasWidth, canvasHeight);
13283
13297
  }
13284
13298
  };
13285
13299
  const submit = () => {
@@ -13299,22 +13313,22 @@ var stdin_default$r = vue.defineComponent({
13299
13313
  });
13300
13314
  };
13301
13315
  const clear = () => {
13302
- if (state.ctx) {
13303
- state.ctx.clearRect(0, 0, state.width, state.height);
13304
- state.ctx.closePath();
13305
- setCanvasBgColor(state.ctx);
13316
+ if (ctx.value) {
13317
+ ctx.value.clearRect(0, 0, canvasWidth, canvasHeight);
13318
+ ctx.value.closePath();
13319
+ setCanvasBgColor(ctx.value);
13306
13320
  }
13307
13321
  emit("clear");
13308
13322
  };
13309
13323
  vue.onMounted(() => {
13310
13324
  var _a, _b, _c;
13311
- if (isRenderCanvas) {
13312
- state.ctx = (_a = canvasRef.value) == null ? void 0 : _a.getContext("2d");
13313
- state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
13314
- state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
13315
- vue.nextTick(() => {
13316
- setCanvasBgColor(state.ctx);
13317
- });
13325
+ if (isRenderCanvas && canvasRef.value) {
13326
+ const canvas = canvasRef.value;
13327
+ const dpr = inBrowser ? window.devicePixelRatio : 1;
13328
+ canvasWidth = canvas.width = (((_a = wrapRef.value) == null ? void 0 : _a.offsetWidth) || 0) * dpr;
13329
+ canvasHeight = canvas.height = (((_b = wrapRef.value) == null ? void 0 : _b.offsetHeight) || 0) * dpr;
13330
+ (_c = ctx.value) == null ? void 0 : _c.scale(dpr, dpr);
13331
+ setCanvasBgColor(ctx.value);
13318
13332
  }
13319
13333
  });
13320
13334
  return () => vue.createVNode("div", {
@@ -13324,8 +13338,6 @@ var stdin_default$r = vue.defineComponent({
13324
13338
  "ref": wrapRef
13325
13339
  }, [isRenderCanvas ? vue.createVNode("canvas", {
13326
13340
  "ref": canvasRef,
13327
- "width": state.width,
13328
- "height": state.height,
13329
13341
  "onTouchstartPassive": touchStart,
13330
13342
  "onTouchmove": touchMove,
13331
13343
  "onTouchend": touchEnd
@@ -15283,6 +15295,7 @@ var stdin_default$5 = vue.defineComponent({
15283
15295
  const inputRef = vue.ref();
15284
15296
  const urls = [];
15285
15297
  const reuploadIndex = vue.ref(-1);
15298
+ const isReuploading = vue.ref(false);
15286
15299
  const getDetail = (index = props2.modelValue.length) => ({
15287
15300
  name: props2.name,
15288
15301
  index
@@ -15419,8 +15432,15 @@ var stdin_default$5 = vue.defineComponent({
15419
15432
  emit("delete", item, getDetail(index));
15420
15433
  };
15421
15434
  const reuploadImage = (index) => {
15422
- chooseFile();
15435
+ isReuploading.value = true;
15423
15436
  reuploadIndex.value = index;
15437
+ vue.nextTick(() => chooseFile());
15438
+ };
15439
+ const onInputClick = () => {
15440
+ if (!isReuploading.value) {
15441
+ reuploadIndex.value = -1;
15442
+ }
15443
+ isReuploading.value = false;
15424
15444
  };
15425
15445
  const renderPreviewItem = (item, index) => {
15426
15446
  const needPickData = ["imageFit", "deletable", "reupload", "previewSize", "beforeDelete"];
@@ -15453,7 +15473,8 @@ var stdin_default$5 = vue.defineComponent({
15453
15473
  "capture": props2.capture,
15454
15474
  "multiple": props2.multiple && reuploadIndex.value === -1,
15455
15475
  "disabled": props2.disabled,
15456
- "onChange": onChange
15476
+ "onChange": onChange,
15477
+ "onClick": onInputClick
15457
15478
  }, null);
15458
15479
  if (slots.default) {
15459
15480
  return vue.withDirectives(vue.createVNode("div", {
@@ -16499,7 +16520,7 @@ const Lazyload = {
16499
16520
  });
16500
16521
  }
16501
16522
  };
16502
- const version = "4.7.0";
16523
+ const version = "4.7.2";
16503
16524
  function install(app) {
16504
16525
  const components = [
16505
16526
  ActionBar,