vant 4.9.17 → 4.9.19

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 (48) hide show
  1. package/README.md +2 -0
  2. package/es/button/index.css +1 -1
  3. package/es/dialog/Dialog.d.ts +4 -0
  4. package/es/dialog/Dialog.mjs +3 -2
  5. package/es/dialog/function-call.mjs +2 -1
  6. package/es/dialog/index.d.ts +3 -0
  7. package/es/dialog/types.d.ts +2 -0
  8. package/es/floating-bubble/FloatingBubble.d.ts +5 -5
  9. package/es/floating-bubble/FloatingBubble.mjs +14 -9
  10. package/es/floating-bubble/index.d.ts +3 -3
  11. package/es/floating-bubble/types.d.ts +4 -0
  12. package/es/index.d.ts +1 -1
  13. package/es/index.mjs +1 -1
  14. package/es/overlay/Overlay.mjs +5 -3
  15. package/es/picker/Picker.mjs +2 -1
  16. package/es/picker/utils.mjs +1 -1
  17. package/es/signature/Signature.mjs +3 -2
  18. package/es/swipe-cell/SwipeCell.mjs +4 -4
  19. package/es/tabbar-item/TabbarItem.mjs +1 -1
  20. package/es/tabs/Tabs.mjs +2 -3
  21. package/es/watermark/Watermark.mjs +15 -18
  22. package/lib/button/index.css +1 -1
  23. package/lib/dialog/Dialog.d.ts +4 -0
  24. package/lib/dialog/Dialog.js +3 -2
  25. package/lib/dialog/function-call.js +2 -1
  26. package/lib/dialog/index.d.ts +3 -0
  27. package/lib/dialog/types.d.ts +2 -0
  28. package/lib/floating-bubble/FloatingBubble.d.ts +5 -5
  29. package/lib/floating-bubble/FloatingBubble.js +13 -8
  30. package/lib/floating-bubble/index.d.ts +3 -3
  31. package/lib/floating-bubble/types.d.ts +4 -0
  32. package/lib/index.css +1 -1
  33. package/lib/index.d.ts +1 -1
  34. package/lib/index.js +1 -1
  35. package/lib/overlay/Overlay.js +4 -2
  36. package/lib/picker/Picker.js +2 -1
  37. package/lib/picker/utils.js +1 -1
  38. package/lib/signature/Signature.js +3 -2
  39. package/lib/swipe-cell/SwipeCell.js +4 -4
  40. package/lib/tabbar-item/TabbarItem.js +1 -1
  41. package/lib/tabs/Tabs.js +2 -3
  42. package/lib/vant.cjs.js +51 -44
  43. package/lib/vant.es.js +53 -46
  44. package/lib/vant.js +68 -62
  45. package/lib/vant.min.js +2 -2
  46. package/lib/watermark/Watermark.js +14 -17
  47. package/lib/web-types.json +1 -1
  48. package/package.json +9 -9
@@ -37,7 +37,10 @@ var import_use = require("@vant/use");
37
37
  var import_use_touch = require("../composables/use-touch");
38
38
  var import_icon = __toESM(require("../icon"));
39
39
  const floatingBubbleProps = {
40
- gap: (0, import_utils.makeNumberProp)(24),
40
+ gap: {
41
+ type: [Number, Object],
42
+ default: 24
43
+ },
41
44
  icon: String,
42
45
  axis: (0, import_utils.makeStringProp)("y"),
43
46
  magnetic: String,
@@ -71,11 +74,13 @@ var stdin_default = (0, import_vue.defineComponent)({
71
74
  width: 0,
72
75
  height: 0
73
76
  });
77
+ const gapX = (0, import_vue.computed)(() => (0, import_utils.isObject)(props.gap) ? props.gap.x : props.gap);
78
+ const gapY = (0, import_vue.computed)(() => (0, import_utils.isObject)(props.gap) ? props.gap.y : props.gap);
74
79
  const boundary = (0, import_vue.computed)(() => ({
75
- top: props.gap,
76
- right: import_utils.windowWidth.value - state.value.width - props.gap,
77
- bottom: import_utils.windowHeight.value - state.value.height - props.gap,
78
- left: props.gap
80
+ top: gapY.value,
81
+ right: import_utils.windowWidth.value - state.value.width - gapX.value,
82
+ bottom: import_utils.windowHeight.value - state.value.height - gapY.value,
83
+ left: gapX.value
79
84
  }));
80
85
  const dragging = (0, import_vue.ref)(false);
81
86
  let initialized = false;
@@ -99,8 +104,8 @@ var stdin_default = (0, import_vue.defineComponent)({
99
104
  offset
100
105
  } = props;
101
106
  state.value = {
102
- x: offset.x > -1 ? offset.x : import_utils.windowWidth.value - width - props.gap,
103
- y: offset.y > -1 ? offset.y : import_utils.windowHeight.value - height - props.gap,
107
+ x: offset.x > -1 ? offset.x : import_utils.windowWidth.value - width - gapX.value,
108
+ y: offset.y > -1 ? offset.y : import_utils.windowHeight.value - height - gapY.value,
104
109
  width,
105
110
  height
106
111
  };
@@ -168,7 +173,7 @@ var stdin_default = (0, import_vue.defineComponent)({
168
173
  initialized = true;
169
174
  });
170
175
  });
171
- (0, import_vue.watch)([import_utils.windowWidth, import_utils.windowHeight, () => props.gap, () => props.offset], updateState, {
176
+ (0, import_vue.watch)([import_utils.windowWidth, import_utils.windowHeight, gapX, gapY, () => props.offset], updateState, {
172
177
  deep: true
173
178
  });
174
179
  const show = (0, import_vue.ref)(true);
@@ -1,6 +1,6 @@
1
1
  export declare const FloatingBubble: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  gap: {
3
- type: NumberConstructor;
3
+ type: import("vue").PropType<import("./types").FloatingBubbleGap>;
4
4
  default: number;
5
5
  };
6
6
  icon: StringConstructor;
@@ -22,7 +22,7 @@ export declare const FloatingBubble: import("../utils").WithInstall<import("vue"
22
22
  };
23
23
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:offset" | "offsetChange")[], "click" | "update:offset" | "offsetChange", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
24
  gap: {
25
- type: NumberConstructor;
25
+ type: import("vue").PropType<import("./types").FloatingBubbleGap>;
26
26
  default: number;
27
27
  };
28
28
  icon: StringConstructor;
@@ -49,7 +49,7 @@ export declare const FloatingBubble: import("../utils").WithInstall<import("vue"
49
49
  }>, {
50
50
  offset: import("./types").FloatingBubbleOffset;
51
51
  teleport: string | import("vue").RendererElement | null | undefined;
52
- gap: number;
52
+ gap: import("./types").FloatingBubbleGap;
53
53
  axis: import("./types").FloatingBubbleAxis;
54
54
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
55
55
  export default FloatingBubble;
@@ -12,6 +12,10 @@ export type FloatingBubbleOffset = {
12
12
  x: number;
13
13
  y: number;
14
14
  };
15
+ export type FloatingBubbleGap = number | {
16
+ x: number;
17
+ y: number;
18
+ };
15
19
  export type FloatingBubbleBoundary = {
16
20
  top: number;
17
21
  right: number;