vant 4.9.18 → 4.9.20

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 (73) hide show
  1. package/README.md +1 -0
  2. package/es/action-sheet/ActionSheet.d.ts +3 -0
  3. package/es/action-sheet/index.d.ts +2 -0
  4. package/es/barrage/Barrage.mjs +1 -1
  5. package/es/dialog/Dialog.d.ts +3 -0
  6. package/es/dialog/index.d.ts +2 -0
  7. package/es/dialog/types.d.ts +2 -0
  8. package/es/dropdown-item/DropdownItem.mjs +3 -0
  9. package/es/dropdown-menu/DropdownMenu.mjs +3 -1
  10. package/es/dropdown-menu/types.d.ts +2 -0
  11. package/es/floating-bubble/FloatingBubble.d.ts +5 -5
  12. package/es/floating-bubble/FloatingBubble.mjs +14 -9
  13. package/es/floating-bubble/index.d.ts +3 -3
  14. package/es/floating-bubble/types.d.ts +4 -0
  15. package/es/image/Image.d.ts +3 -0
  16. package/es/image/Image.mjs +3 -1
  17. package/es/image/index.d.ts +2 -0
  18. package/es/index.d.ts +1 -1
  19. package/es/index.mjs +1 -1
  20. package/es/notify/Notify.d.ts +3 -0
  21. package/es/notify/index.d.ts +2 -0
  22. package/es/overlay/Overlay.mjs +5 -3
  23. package/es/picker/Picker.mjs +8 -3
  24. package/es/picker/utils.mjs +1 -1
  25. package/es/popup/Popup.d.ts +3 -0
  26. package/es/popup/Popup.mjs +10 -9
  27. package/es/popup/index.d.ts +2 -0
  28. package/es/popup/shared.d.ts +2 -0
  29. package/es/popup/shared.mjs +2 -0
  30. package/es/share-sheet/ShareSheet.d.ts +3 -0
  31. package/es/share-sheet/index.d.ts +2 -0
  32. package/es/tabbar-item/TabbarItem.mjs +1 -1
  33. package/es/tabs/Tabs.mjs +2 -3
  34. package/es/watermark/Watermark.mjs +17 -17
  35. package/lib/action-sheet/ActionSheet.d.ts +3 -0
  36. package/lib/action-sheet/index.d.ts +2 -0
  37. package/lib/barrage/Barrage.js +1 -1
  38. package/lib/dialog/Dialog.d.ts +3 -0
  39. package/lib/dialog/index.d.ts +2 -0
  40. package/lib/dialog/types.d.ts +2 -0
  41. package/lib/dropdown-item/DropdownItem.js +3 -0
  42. package/lib/dropdown-menu/DropdownMenu.js +3 -1
  43. package/lib/dropdown-menu/types.d.ts +2 -0
  44. package/lib/floating-bubble/FloatingBubble.d.ts +5 -5
  45. package/lib/floating-bubble/FloatingBubble.js +13 -8
  46. package/lib/floating-bubble/index.d.ts +3 -3
  47. package/lib/floating-bubble/types.d.ts +4 -0
  48. package/lib/image/Image.d.ts +3 -0
  49. package/lib/image/Image.js +3 -1
  50. package/lib/image/index.d.ts +2 -0
  51. package/lib/index.d.ts +1 -1
  52. package/lib/index.js +1 -1
  53. package/lib/notify/Notify.d.ts +3 -0
  54. package/lib/notify/index.d.ts +2 -0
  55. package/lib/overlay/Overlay.js +4 -2
  56. package/lib/picker/Picker.js +8 -3
  57. package/lib/picker/utils.js +1 -1
  58. package/lib/popup/Popup.d.ts +3 -0
  59. package/lib/popup/Popup.js +10 -9
  60. package/lib/popup/index.d.ts +2 -0
  61. package/lib/popup/shared.d.ts +2 -0
  62. package/lib/popup/shared.js +2 -0
  63. package/lib/share-sheet/ShareSheet.d.ts +3 -0
  64. package/lib/share-sheet/index.d.ts +2 -0
  65. package/lib/tabbar-item/TabbarItem.js +1 -1
  66. package/lib/tabs/Tabs.js +2 -3
  67. package/lib/vant.cjs.js +69 -48
  68. package/lib/vant.es.js +71 -50
  69. package/lib/vant.js +1333 -1330
  70. package/lib/vant.min.js +3 -3
  71. package/lib/watermark/Watermark.js +16 -16
  72. package/lib/web-types.json +1 -1
  73. package/package.json +13 -13
@@ -111,28 +111,28 @@ var stdin_default = (0, import_vue.defineComponent)({
111
111
  });
112
112
  return URL.createObjectURL(svgBlob);
113
113
  };
114
+ const revokeWatermarkUrl = () => {
115
+ if (watermarkUrl.value) {
116
+ URL.revokeObjectURL(watermarkUrl.value);
117
+ }
118
+ };
119
+ const generateWatermarkUrl = () => {
120
+ if (svgElRef.value) {
121
+ revokeWatermarkUrl();
122
+ watermarkUrl.value = makeSvgToBlobUrl(svgElRef.value.innerHTML);
123
+ }
124
+ };
114
125
  (0, import_vue.watchEffect)(() => {
115
126
  if (props.image) {
116
127
  makeImageToBase64(props.image);
117
128
  }
118
129
  });
119
- (0, import_vue.watch)(() => [imageBase64.value, props.content, props.textColor, props.height, props.width, props.rotate, props.gapX, props.gapY], () => {
120
- (0, import_vue.nextTick)(() => {
121
- if (svgElRef.value) {
122
- if (watermarkUrl.value) {
123
- URL.revokeObjectURL(watermarkUrl.value);
124
- }
125
- watermarkUrl.value = makeSvgToBlobUrl(svgElRef.value.innerHTML);
126
- }
127
- });
128
- }, {
129
- immediate: true
130
- });
131
- (0, import_vue.onUnmounted)(() => {
132
- if (watermarkUrl.value) {
133
- URL.revokeObjectURL(watermarkUrl.value);
134
- }
130
+ (0, import_vue.watch)(() => [props.content, props.textColor, props.height, props.width, props.rotate, props.gapX, props.gapY], generateWatermarkUrl);
131
+ (0, import_vue.watch)(imageBase64, () => {
132
+ (0, import_vue.nextTick)(generateWatermarkUrl);
135
133
  });
134
+ (0, import_vue.onMounted)(generateWatermarkUrl);
135
+ (0, import_vue.onUnmounted)(revokeWatermarkUrl);
136
136
  return () => {
137
137
  const style = (0, import_utils.extend)({
138
138
  backgroundImage: `url(${watermarkUrl.value})`