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
@@ -19,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{
19
19
  required: true;
20
20
  };
21
21
  disableZoom: BooleanConstructor;
22
+ doubleScale: BooleanConstructor;
22
23
  closeOnClickOverlay: BooleanConstructor;
23
24
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "scale" | "longPress")[], "close" | "scale" | "longPress", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
24
25
  src: StringConstructor;
@@ -41,6 +42,7 @@ declare const _default: import("vue").DefineComponent<{
41
42
  required: true;
42
43
  };
43
44
  disableZoom: BooleanConstructor;
45
+ doubleScale: BooleanConstructor;
44
46
  closeOnClickOverlay: BooleanConstructor;
45
47
  }>> & {
46
48
  onClose?: ((...args: any[]) => any) | undefined;
@@ -50,5 +52,6 @@ declare const _default: import("vue").DefineComponent<{
50
52
  show: boolean;
51
53
  closeOnClickOverlay: boolean;
52
54
  disableZoom: boolean;
55
+ doubleScale: boolean;
53
56
  }, {}>;
54
57
  export default _default;
@@ -45,6 +45,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
45
45
  rootWidth: (0, import_utils.makeRequiredProp)(Number),
46
46
  rootHeight: (0, import_utils.makeRequiredProp)(Number),
47
47
  disableZoom: Boolean,
48
+ doubleScale: Boolean,
48
49
  closeOnClickOverlay: Boolean
49
50
  },
50
51
  emits: ["scale", "close", "longPress"],
@@ -218,18 +219,22 @@ var stdin_default = (0, import_vue2.defineComponent)({
218
219
  const TAP_TIME = 250;
219
220
  if (offsetX.value < import_utils.TAP_OFFSET && offsetY.value < import_utils.TAP_OFFSET) {
220
221
  if (deltaTime < TAP_TIME) {
221
- if (doubleTapTimer) {
222
- clearTimeout(doubleTapTimer);
223
- doubleTapTimer = null;
224
- toggleScale();
225
- } else {
226
- if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
227
- return;
228
- }
229
- doubleTapTimer = setTimeout(() => {
230
- emit("close");
222
+ if (props.doubleScale) {
223
+ if (doubleTapTimer) {
224
+ clearTimeout(doubleTapTimer);
231
225
  doubleTapTimer = null;
232
- }, TAP_TIME);
226
+ toggleScale();
227
+ } else {
228
+ if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
229
+ return;
230
+ }
231
+ doubleTapTimer = setTimeout(() => {
232
+ emit("close");
233
+ doubleTapTimer = null;
234
+ }, TAP_TIME);
235
+ }
236
+ } else {
237
+ emit("close");
233
238
  }
234
239
  } else if (deltaTime > import_utils.LONG_PRESS_START_TIME) {
235
240
  emit("longPress");
@@ -1,3 +1,6 @@
1
1
  import { ComponentInstance } from '../utils';
2
2
  import type { ImagePreviewOptions } from './types';
3
+ /**
4
+ * Display a full-screen image preview component
5
+ */
3
6
  export declare const showImagePreview: (options: string[] | ImagePreviewOptions, startPosition?: number) => ComponentInstance | undefined;
@@ -50,6 +50,7 @@ const defaultConfig = {
50
50
  closeIcon: "clear",
51
51
  transition: void 0,
52
52
  beforeClose: void 0,
53
+ doubleScale: true,
53
54
  overlayStyle: void 0,
54
55
  overlayClass: void 0,
55
56
  startPosition: 0,
@@ -33,6 +33,10 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
33
33
  };
34
34
  transition: StringConstructor;
35
35
  beforeClose: import("vue").PropType<import("../utils").Interceptor>;
36
+ doubleScale: {
37
+ type: BooleanConstructor;
38
+ default: true;
39
+ };
36
40
  overlayClass: import("vue").PropType<unknown>;
37
41
  overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
38
42
  swipeDuration: {
@@ -91,6 +95,10 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
91
95
  };
92
96
  transition: StringConstructor;
93
97
  beforeClose: import("vue").PropType<import("../utils").Interceptor>;
98
+ doubleScale: {
99
+ type: BooleanConstructor;
100
+ default: true;
101
+ };
94
102
  overlayClass: import("vue").PropType<unknown>;
95
103
  overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
96
104
  swipeDuration: {
@@ -136,6 +144,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
136
144
  startPosition: string | number;
137
145
  minZoom: string | number;
138
146
  maxZoom: string | number;
147
+ doubleScale: boolean;
139
148
  images: string[];
140
149
  showIndex: boolean;
141
150
  }, {}>>;
@@ -15,6 +15,7 @@ export type ImagePreviewOptions = {
15
15
  closeIcon?: string;
16
16
  transition?: string;
17
17
  beforeClose?: Interceptor;
18
+ doubleScale?: boolean;
18
19
  overlayStyle?: CSSProperties;
19
20
  overlayClass?: unknown;
20
21
  swipeDuration?: number;