vant 4.6.4-beta.2 → 4.6.5

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 (56) hide show
  1. package/README.md +4 -1
  2. package/es/dropdown-menu/DropdownMenu.d.ts +3 -0
  3. package/es/dropdown-menu/DropdownMenu.mjs +7 -3
  4. package/es/dropdown-menu/index.css +1 -1
  5. package/es/dropdown-menu/index.d.ts +2 -0
  6. package/es/floating-bubble/FloatingBubble.mjs +6 -4
  7. package/es/floating-panel/FloatingPanel.d.ts +4 -0
  8. package/es/floating-panel/FloatingPanel.mjs +14 -8
  9. package/es/floating-panel/index.d.ts +3 -0
  10. package/es/image-preview/ImagePreview.d.ts +13 -0
  11. package/es/image-preview/ImagePreview.mjs +2 -0
  12. package/es/image-preview/ImagePreviewItem.d.ts +3 -0
  13. package/es/image-preview/ImagePreviewItem.mjs +8 -3
  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/list/List.d.ts +7 -4
  20. package/es/list/List.mjs +5 -3
  21. package/es/list/index.d.ts +2 -0
  22. package/es/locale/lang/sr-RS.d.ts +63 -0
  23. package/es/locale/lang/sr-RS.mjs +73 -0
  24. package/es/text-ellipsis/TextEllipsis.mjs +7 -7
  25. package/es/toast/index.d.ts +1 -1
  26. package/lib/dropdown-menu/DropdownMenu.d.ts +3 -0
  27. package/lib/dropdown-menu/DropdownMenu.js +7 -3
  28. package/lib/dropdown-menu/index.css +1 -1
  29. package/lib/dropdown-menu/index.d.ts +2 -0
  30. package/lib/floating-bubble/FloatingBubble.js +5 -3
  31. package/lib/floating-panel/FloatingPanel.d.ts +4 -0
  32. package/lib/floating-panel/FloatingPanel.js +12 -6
  33. package/lib/floating-panel/index.d.ts +3 -0
  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 +8 -3
  38. package/lib/image-preview/function-call.js +1 -0
  39. package/lib/image-preview/index.d.ts +9 -0
  40. package/lib/image-preview/types.d.ts +1 -0
  41. package/lib/index.css +1 -1
  42. package/lib/index.d.ts +1 -1
  43. package/lib/index.js +1 -1
  44. package/lib/list/List.d.ts +7 -4
  45. package/lib/list/List.js +4 -2
  46. package/lib/list/index.d.ts +2 -0
  47. package/lib/locale/lang/sr-RS.d.ts +63 -0
  48. package/lib/locale/lang/sr-RS.js +92 -0
  49. package/lib/text-ellipsis/TextEllipsis.js +7 -7
  50. package/lib/toast/index.d.ts +1 -1
  51. package/lib/vant.cjs.js +47 -25
  52. package/lib/vant.es.js +47 -25
  53. package/lib/vant.js +47 -25
  54. package/lib/vant.min.js +1 -1
  55. package/lib/web-types.json +1 -1
  56. package/package.json +3 -3
package/README.md CHANGED
@@ -53,7 +53,7 @@ npm i vant
53
53
  npm i vant@latest-v2
54
54
  ```
55
55
 
56
- Using `yarn` or `pnpm`:
56
+ Using `yarn`, `pnpm`, or `bun`:
57
57
 
58
58
  ```bash
59
59
  # with yarn
@@ -61,6 +61,9 @@ yarn add vant
61
61
 
62
62
  # with pnpm
63
63
  pnpm add vant
64
+
65
+ # with Bun
66
+ bun add vant
64
67
  ```
65
68
 
66
69
  ## Quickstart
@@ -23,6 +23,7 @@ export declare const dropdownMenuProps: {
23
23
  type: BooleanConstructor;
24
24
  default: true;
25
25
  };
26
+ swipeThreshold: (NumberConstructor | StringConstructor)[];
26
27
  };
27
28
  export type DropdownMenuProps = ExtractPropTypes<typeof dropdownMenuProps>;
28
29
  export declare const DROPDOWN_KEY: InjectionKey<DropdownMenuProvide>;
@@ -49,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
49
50
  type: BooleanConstructor;
50
51
  default: true;
51
52
  };
53
+ swipeThreshold: (NumberConstructor | StringConstructor)[];
52
54
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
53
55
  overlay: {
54
56
  type: BooleanConstructor;
@@ -72,6 +74,7 @@ declare const _default: import("vue").DefineComponent<{
72
74
  type: BooleanConstructor;
73
75
  default: true;
74
76
  };
77
+ swipeThreshold: (NumberConstructor | StringConstructor)[];
75
78
  }>>, {
76
79
  overlay: boolean;
77
80
  duration: string | number;
@@ -12,7 +12,8 @@ const dropdownMenuProps = {
12
12
  direction: makeStringProp("down"),
13
13
  activeColor: String,
14
14
  closeOnClickOutside: truthProp,
15
- closeOnClickOverlay: truthProp
15
+ closeOnClickOverlay: truthProp,
16
+ swipeThreshold: numericProp
16
17
  };
17
18
  const DROPDOWN_KEY = Symbol(name);
18
19
  var stdin_default = defineComponent({
@@ -31,6 +32,7 @@ var stdin_default = defineComponent({
31
32
  } = useChildren(DROPDOWN_KEY);
32
33
  const scrollParent = useScrollParent(root);
33
34
  const opened = computed(() => children.some((item) => item.state.showWrapper));
35
+ const scrollable = computed(() => props.swipeThreshold && children.length > +props.swipeThreshold);
34
36
  const barStyle = computed(() => {
35
37
  if (opened.value && isDef(props.zIndex)) {
36
38
  return {
@@ -87,7 +89,8 @@ var stdin_default = defineComponent({
87
89
  "role": "button",
88
90
  "tabindex": disabled ? void 0 : 0,
89
91
  "class": [bem("item", {
90
- disabled
92
+ disabled,
93
+ grow: scrollable.value
91
94
  }), {
92
95
  [HAPTICS_FEEDBACK]: !disabled
93
96
  }],
@@ -131,7 +134,8 @@ var stdin_default = defineComponent({
131
134
  "ref": barRef,
132
135
  "style": barStyle.value,
133
136
  "class": bem("bar", {
134
- opened: opened.value
137
+ opened: opened.value,
138
+ scrollable: scrollable.value
135
139
  })
136
140
  }, [children.map(renderTitle)]), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
137
141
  };
@@ -1 +1 @@
1
- :root{--van-dropdown-menu-height: 48px;--van-dropdown-menu-background: var(--van-background-2);--van-dropdown-menu-shadow: 0 2px 12px rgba(100, 101, 102, .12);--van-dropdown-menu-title-font-size: 15px;--van-dropdown-menu-title-text-color: var(--van-text-color);--van-dropdown-menu-title-active-text-color: var(--van-primary-color);--van-dropdown-menu-title-disabled-text-color: var(--van-text-color-2);--van-dropdown-menu-title-padding: 0 var(--van-padding-xs);--van-dropdown-menu-title-line-height: var(--van-line-height-lg);--van-dropdown-menu-option-active-color: var(--van-primary-color);--van-dropdown-menu-content-max-height: 80%}.van-dropdown-menu{-webkit-user-select:none;user-select:none}.van-dropdown-menu__bar{position:relative;display:flex;height:var(--van-dropdown-menu-height);background:var(--van-dropdown-menu-background);box-shadow:var(--van-dropdown-menu-shadow)}.van-dropdown-menu__bar--opened{z-index:calc(var(--van-dropdown-item-z-index) + 1)}.van-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;min-width:0}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--van-dropdown-menu-title-disabled-text-color)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:var(--van-dropdown-menu-title-padding);color:var(--van-dropdown-menu-title-text-color);font-size:var(--van-dropdown-menu-title-font-size);line-height:var(--van-dropdown-menu-title-line-height)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border:3px solid;border-color:transparent transparent var(--van-gray-4) var(--van-gray-4);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:var(--van-dropdown-menu-title-active-text-color)}.van-dropdown-menu__title--active:after{border-color:transparent transparent currentColor currentColor}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
1
+ :root{--van-dropdown-menu-height: 48px;--van-dropdown-menu-background: var(--van-background-2);--van-dropdown-menu-shadow: 0 2px 12px rgba(100, 101, 102, .12);--van-dropdown-menu-title-font-size: 15px;--van-dropdown-menu-title-text-color: var(--van-text-color);--van-dropdown-menu-title-active-text-color: var(--van-primary-color);--van-dropdown-menu-title-disabled-text-color: var(--van-text-color-2);--van-dropdown-menu-title-padding: 0 var(--van-padding-xs);--van-dropdown-menu-title-line-height: var(--van-line-height-lg);--van-dropdown-menu-option-active-color: var(--van-primary-color);--van-dropdown-menu-content-max-height: 80%}.van-dropdown-menu{-webkit-user-select:none;user-select:none}.van-dropdown-menu__bar{position:relative;display:flex;height:var(--van-dropdown-menu-height);background:var(--van-dropdown-menu-background);box-shadow:var(--van-dropdown-menu-shadow)}.van-dropdown-menu__bar--opened{z-index:calc(var(--van-dropdown-item-z-index) + 1)}.van-dropdown-menu__bar--scrollable{padding-left:var(--van-padding-base);padding-right:var(--van-padding-xs);overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-dropdown-menu__bar--scrollable::-webkit-scrollbar{display:none}.van-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;min-width:0}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--van-dropdown-menu-title-disabled-text-color)}.van-dropdown-menu__item--grow{flex:1 0 auto;padding-left:var(--van-padding-base);padding-right:var(--van-padding-sm)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:var(--van-dropdown-menu-title-padding);color:var(--van-dropdown-menu-title-text-color);font-size:var(--van-dropdown-menu-title-font-size);line-height:var(--van-dropdown-menu-title-line-height)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border:3px solid;border-color:transparent transparent var(--van-gray-4) var(--van-gray-4);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:var(--van-dropdown-menu-title-active-text-color)}.van-dropdown-menu__title--active:after{border-color:transparent transparent currentColor currentColor}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
@@ -22,6 +22,7 @@ export declare const DropdownMenu: import("../utils").WithInstall<import("vue").
22
22
  type: BooleanConstructor;
23
23
  default: true;
24
24
  };
25
+ swipeThreshold: (NumberConstructor | StringConstructor)[];
25
26
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
27
  overlay: {
27
28
  type: BooleanConstructor;
@@ -45,6 +46,7 @@ export declare const DropdownMenu: import("../utils").WithInstall<import("vue").
45
46
  type: BooleanConstructor;
46
47
  default: true;
47
48
  };
49
+ swipeThreshold: (NumberConstructor | StringConstructor)[];
48
50
  }>>, {
49
51
  overlay: boolean;
50
52
  duration: string | number;
@@ -1,4 +1,4 @@
1
- import { withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode } from "vue";
1
+ import { withDirectives as _withDirectives, mergeProps as _mergeProps, vShow as _vShow, createVNode as _createVNode } from "vue";
2
2
  import { Teleport, computed, defineComponent, nextTick, onMounted, ref, watch, onActivated, onDeactivated } from "vue";
3
3
  import { pick, addUnit, closest, createNamespace, makeNumberProp, makeStringProp, windowWidth, windowHeight } from "../utils/index.mjs";
4
4
  import { useRect, useEventListener } from "@vant/use";
@@ -24,11 +24,13 @@ const floatingBubbleProps = {
24
24
  const [name, bem] = createNamespace("floating-bubble");
25
25
  var stdin_default = defineComponent({
26
26
  name,
27
+ inheritAttrs: false,
27
28
  props: floatingBubbleProps,
28
29
  emits: ["click", "update:offset", "offsetChange"],
29
30
  setup(props, {
30
31
  slots,
31
- emit
32
+ emit,
33
+ attrs
32
34
  }) {
33
35
  const rootRef = ref();
34
36
  const state = ref({
@@ -149,7 +151,7 @@ var stdin_default = defineComponent({
149
151
  }
150
152
  });
151
153
  return () => {
152
- const Content = _withDirectives(_createVNode("div", {
154
+ const Content = _withDirectives(_createVNode("div", _mergeProps({
153
155
  "class": bem(),
154
156
  "ref": rootRef,
155
157
  "onTouchstartPassive": onTouchStart,
@@ -157,7 +159,7 @@ var stdin_default = defineComponent({
157
159
  "onTouchcancel": onTouchEnd,
158
160
  "onClick": onClick,
159
161
  "style": rootStyle.value
160
- }, [slots.default ? slots.default() : _createVNode(Icon, {
162
+ }, attrs), [slots.default ? slots.default() : _createVNode(Icon, {
161
163
  "name": props.icon,
162
164
  "class": bem("icon")
163
165
  }, null)]), [[_vShow, show.value]]);
@@ -16,6 +16,7 @@ export declare const floatingPanelProps: {
16
16
  type: BooleanConstructor;
17
17
  default: true;
18
18
  };
19
+ lockScroll: BooleanConstructor;
19
20
  safeAreaInsetBottom: {
20
21
  type: BooleanConstructor;
21
22
  default: true;
@@ -39,6 +40,7 @@ declare const _default: import("vue").DefineComponent<{
39
40
  type: BooleanConstructor;
40
41
  default: true;
41
42
  };
43
+ lockScroll: BooleanConstructor;
42
44
  safeAreaInsetBottom: {
43
45
  type: BooleanConstructor;
44
46
  default: true;
@@ -60,6 +62,7 @@ declare const _default: import("vue").DefineComponent<{
60
62
  type: BooleanConstructor;
61
63
  default: true;
62
64
  };
65
+ lockScroll: BooleanConstructor;
63
66
  safeAreaInsetBottom: {
64
67
  type: BooleanConstructor;
65
68
  default: true;
@@ -71,6 +74,7 @@ declare const _default: import("vue").DefineComponent<{
71
74
  height: string | number;
72
75
  safeAreaInsetBottom: boolean;
73
76
  duration: string | number;
77
+ lockScroll: boolean;
74
78
  anchors: number[];
75
79
  contentDraggable: boolean;
76
80
  }, {}>;
@@ -1,6 +1,6 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { computed, defineComponent, ref, watch } from "vue";
3
- import { addUnit, closest, createNamespace, makeArrayProp, makeNumericProp, truthProp, windowHeight } from "../utils/index.mjs";
2
+ import { ref, watch, computed, defineComponent } from "vue";
3
+ import { addUnit, closest, createNamespace, makeArrayProp, makeNumericProp, preventDefault, truthProp, windowHeight } from "../utils/index.mjs";
4
4
  import { useEventListener } from "@vant/use";
5
5
  import { useLockScroll } from "../composables/use-lock-scroll.mjs";
6
6
  import { useTouch } from "../composables/use-touch.mjs";
@@ -10,10 +10,10 @@ const floatingPanelProps = {
10
10
  anchors: makeArrayProp(),
11
11
  duration: makeNumericProp(0.2),
12
12
  contentDraggable: truthProp,
13
+ lockScroll: Boolean,
13
14
  safeAreaInsetBottom: truthProp
14
15
  };
15
16
  const [name, bem] = createNamespace("floating-panel");
16
- const DAMP = 0.2;
17
17
  var stdin_default = defineComponent({
18
18
  name,
19
19
  props: floatingPanelProps,
@@ -22,6 +22,7 @@ var stdin_default = defineComponent({
22
22
  emit,
23
23
  slots
24
24
  }) {
25
+ const DAMP = 0.2;
25
26
  const rootRef = ref();
26
27
  const contentRef = ref();
27
28
  const height = useSyncPropRef(() => +props.height, (value) => emit("update:height", value));
@@ -54,24 +55,28 @@ var stdin_default = defineComponent({
54
55
  return moveY;
55
56
  };
56
57
  let startY;
58
+ let maxScroll = -1;
57
59
  const touch = useTouch();
58
60
  const onTouchstart = (e) => {
59
61
  touch.start(e);
60
62
  dragging.value = true;
61
63
  startY = -height.value;
64
+ maxScroll = -1;
62
65
  };
63
66
  const onTouchmove = (e) => {
64
67
  var _a;
65
68
  touch.move(e);
66
69
  const target = e.target;
67
70
  if (contentRef.value === target || ((_a = contentRef.value) == null ? void 0 : _a.contains(target))) {
71
+ const {
72
+ scrollTop
73
+ } = contentRef.value;
74
+ maxScroll = Math.max(maxScroll, scrollTop);
68
75
  if (!props.contentDraggable)
69
76
  return;
70
77
  if (-startY < boundary.value.max) {
71
- if (e.cancelable)
72
- e.preventDefault();
73
- e.stopPropagation();
74
- } else if (!(contentRef.value.scrollTop <= 0 && touch.deltaY.value > 0)) {
78
+ preventDefault(e, true);
79
+ } else if (!(scrollTop <= 0 && touch.deltaY.value > 0) || maxScroll > 0) {
75
80
  return;
76
81
  }
77
82
  }
@@ -79,6 +84,7 @@ var stdin_default = defineComponent({
79
84
  height.value = -ease(moveY);
80
85
  };
81
86
  const onTouchend = () => {
87
+ maxScroll = -1;
82
88
  dragging.value = false;
83
89
  height.value = closest(anchors.value, height.value);
84
90
  if (height.value !== -startY) {
@@ -92,7 +98,7 @@ var stdin_default = defineComponent({
92
98
  }, {
93
99
  immediate: true
94
100
  });
95
- useLockScroll(rootRef, () => true);
101
+ useLockScroll(rootRef, () => props.lockScroll);
96
102
  useEventListener("touchmove", onTouchmove, {
97
103
  target: rootRef
98
104
  });
@@ -15,6 +15,7 @@ export declare const FloatingPanel: import("../utils").WithInstall<import("vue")
15
15
  type: BooleanConstructor;
16
16
  default: true;
17
17
  };
18
+ lockScroll: BooleanConstructor;
18
19
  safeAreaInsetBottom: {
19
20
  type: BooleanConstructor;
20
21
  default: true;
@@ -36,6 +37,7 @@ export declare const FloatingPanel: import("../utils").WithInstall<import("vue")
36
37
  type: BooleanConstructor;
37
38
  default: true;
38
39
  };
40
+ lockScroll: BooleanConstructor;
39
41
  safeAreaInsetBottom: {
40
42
  type: BooleanConstructor;
41
43
  default: true;
@@ -47,6 +49,7 @@ export declare const FloatingPanel: import("../utils").WithInstall<import("vue")
47
49
  height: string | number;
48
50
  safeAreaInsetBottom: boolean;
49
51
  duration: string | number;
52
+ lockScroll: boolean;
50
53
  anchors: number[];
51
54
  contentDraggable: boolean;
52
55
  }, {}>>;
@@ -50,6 +50,10 @@ export declare const imagePreviewProps: {
50
50
  type: BooleanConstructor;
51
51
  default: true;
52
52
  };
53
+ closeOnClickOverlay: {
54
+ type: BooleanConstructor;
55
+ default: true;
56
+ };
53
57
  closeIconPosition: {
54
58
  type: PropType<PopupCloseIconPosition>;
55
59
  default: PopupCloseIconPosition;
@@ -106,6 +110,10 @@ declare const _default: import("vue").DefineComponent<{
106
110
  type: BooleanConstructor;
107
111
  default: true;
108
112
  };
113
+ closeOnClickOverlay: {
114
+ type: BooleanConstructor;
115
+ default: true;
116
+ };
109
117
  closeIconPosition: {
110
118
  type: PropType<PopupCloseIconPosition>;
111
119
  default: PopupCloseIconPosition;
@@ -160,6 +168,10 @@ declare const _default: import("vue").DefineComponent<{
160
168
  type: BooleanConstructor;
161
169
  default: true;
162
170
  };
171
+ closeOnClickOverlay: {
172
+ type: BooleanConstructor;
173
+ default: true;
174
+ };
163
175
  closeIconPosition: {
164
176
  type: PropType<PopupCloseIconPosition>;
165
177
  default: PopupCloseIconPosition;
@@ -176,6 +188,7 @@ declare const _default: import("vue").DefineComponent<{
176
188
  loop: boolean;
177
189
  overlay: boolean;
178
190
  show: boolean;
191
+ closeOnClickOverlay: boolean;
179
192
  closeIcon: string;
180
193
  closeable: boolean;
181
194
  closeOnPopstate: boolean;
@@ -28,6 +28,7 @@ const imagePreviewProps = {
28
28
  startPosition: makeNumericProp(0),
29
29
  showIndicators: Boolean,
30
30
  closeOnPopstate: truthProp,
31
+ closeOnClickOverlay: truthProp,
31
32
  closeIconPosition: makeStringProp("top-right"),
32
33
  teleport: [String, Object]
33
34
  };
@@ -112,6 +113,7 @@ var stdin_default = defineComponent({
112
113
  "rootWidth": state.rootWidth,
113
114
  "rootHeight": state.rootHeight,
114
115
  "disableZoom": state.disableZoom,
116
+ "closeOnClickOverlay": props.closeOnClickOverlay,
115
117
  "onScale": emitScale,
116
118
  "onClose": emitClose,
117
119
  "onLongPress": () => emit("longPress", {
@@ -19,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{
19
19
  required: true;
20
20
  };
21
21
  disableZoom: BooleanConstructor;
22
+ closeOnClickOverlay: BooleanConstructor;
22
23
  }, () => 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<{
23
24
  src: StringConstructor;
24
25
  show: BooleanConstructor;
@@ -40,12 +41,14 @@ declare const _default: import("vue").DefineComponent<{
40
41
  required: true;
41
42
  };
42
43
  disableZoom: BooleanConstructor;
44
+ closeOnClickOverlay: BooleanConstructor;
43
45
  }>> & {
44
46
  onClose?: ((...args: any[]) => any) | undefined;
45
47
  onScale?: ((...args: any[]) => any) | undefined;
46
48
  onLongPress?: ((...args: any[]) => any) | undefined;
47
49
  }, {
48
50
  show: boolean;
51
+ closeOnClickOverlay: boolean;
49
52
  disableZoom: boolean;
50
53
  }, {}>;
51
54
  export default _default;
@@ -22,7 +22,8 @@ var stdin_default = defineComponent({
22
22
  maxZoom: makeRequiredProp(numericProp),
23
23
  rootWidth: makeRequiredProp(Number),
24
24
  rootHeight: makeRequiredProp(Number),
25
- disableZoom: Boolean
25
+ disableZoom: Boolean,
26
+ closeOnClickOverlay: Boolean
26
27
  },
27
28
  emits: ["scale", "close", "longPress"],
28
29
  setup(props, {
@@ -182,7 +183,8 @@ var stdin_default = defineComponent({
182
183
  }
183
184
  }
184
185
  };
185
- const checkTap = () => {
186
+ const checkTap = (event) => {
187
+ var _a;
186
188
  if (fingerNum > 1) {
187
189
  return;
188
190
  }
@@ -199,6 +201,9 @@ var stdin_default = defineComponent({
199
201
  doubleTapTimer = null;
200
202
  toggleScale();
201
203
  } else {
204
+ if (!props.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
205
+ return;
206
+ }
202
207
  doubleTapTimer = setTimeout(() => {
203
208
  emit("close");
204
209
  doubleTapTimer = null;
@@ -236,7 +241,7 @@ var stdin_default = defineComponent({
236
241
  }
237
242
  }
238
243
  preventDefault(event, stopPropagation);
239
- checkTap();
244
+ checkTap(event);
240
245
  touch.reset();
241
246
  };
242
247
  const resize = () => {
@@ -24,6 +24,7 @@ const defaultConfig = {
24
24
  swipeDuration: 300,
25
25
  showIndicators: false,
26
26
  closeOnPopstate: true,
27
+ closeOnClickOverlay: true,
27
28
  closeIconPosition: "top-right"
28
29
  };
29
30
  function initInstance() {
@@ -48,6 +48,10 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
48
48
  type: BooleanConstructor;
49
49
  default: true;
50
50
  };
51
+ closeOnClickOverlay: {
52
+ type: BooleanConstructor;
53
+ default: true;
54
+ };
51
55
  closeIconPosition: {
52
56
  type: import("vue").PropType<import("..").PopupCloseIconPosition>;
53
57
  default: import("..").PopupCloseIconPosition;
@@ -102,6 +106,10 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
102
106
  type: BooleanConstructor;
103
107
  default: true;
104
108
  };
109
+ closeOnClickOverlay: {
110
+ type: BooleanConstructor;
111
+ default: true;
112
+ };
105
113
  closeIconPosition: {
106
114
  type: import("vue").PropType<import("..").PopupCloseIconPosition>;
107
115
  default: import("..").PopupCloseIconPosition;
@@ -118,6 +126,7 @@ export declare const ImagePreview: import("../utils").WithInstall<import("vue").
118
126
  loop: boolean;
119
127
  overlay: boolean;
120
128
  show: boolean;
129
+ closeOnClickOverlay: boolean;
121
130
  closeIcon: string;
122
131
  closeable: boolean;
123
132
  closeOnPopstate: boolean;
@@ -22,6 +22,7 @@ export type ImagePreviewOptions = {
22
22
  showIndicators?: boolean;
23
23
  closeOnPopstate?: boolean;
24
24
  closeIconPosition?: PopupCloseIconPosition;
25
+ closeOnClickOverlay?: boolean;
25
26
  onClose?(): void;
26
27
  onScale?(args: {
27
28
  scale: number;
package/es/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.6.4-beta.2";
108
+ export const version: "4.6.5";
package/es/index.mjs CHANGED
@@ -98,7 +98,7 @@ import { Toast } from "./toast/index.mjs";
98
98
  import { TreeSelect } from "./tree-select/index.mjs";
99
99
  import { Uploader } from "./uploader/index.mjs";
100
100
  import { Watermark } from "./watermark/index.mjs";
101
- const version = "4.6.4-beta.2";
101
+ const version = "4.6.5";
102
102
  function install(app) {
103
103
  const components = [
104
104
  ActionBar,
package/es/list/List.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type ExtractPropTypes } from 'vue';
1
+ import { type PropType, type ExtractPropTypes } from 'vue';
2
2
  import type { ListDirection } from './types';
3
3
  export declare const listProps: {
4
4
  error: BooleanConstructor;
@@ -9,9 +9,10 @@ export declare const listProps: {
9
9
  loading: BooleanConstructor;
10
10
  disabled: BooleanConstructor;
11
11
  finished: BooleanConstructor;
12
+ scroller: PropType<Element>;
12
13
  errorText: StringConstructor;
13
14
  direction: {
14
- type: import("vue").PropType<ListDirection>;
15
+ type: PropType<ListDirection>;
15
16
  default: ListDirection;
16
17
  };
17
18
  loadingText: StringConstructor;
@@ -31,9 +32,10 @@ declare const _default: import("vue").DefineComponent<{
31
32
  loading: BooleanConstructor;
32
33
  disabled: BooleanConstructor;
33
34
  finished: BooleanConstructor;
35
+ scroller: PropType<Element>;
34
36
  errorText: StringConstructor;
35
37
  direction: {
36
- type: import("vue").PropType<ListDirection>;
38
+ type: PropType<ListDirection>;
37
39
  default: ListDirection;
38
40
  };
39
41
  loadingText: StringConstructor;
@@ -51,9 +53,10 @@ declare const _default: import("vue").DefineComponent<{
51
53
  loading: BooleanConstructor;
52
54
  disabled: BooleanConstructor;
53
55
  finished: BooleanConstructor;
56
+ scroller: PropType<Element>;
54
57
  errorText: StringConstructor;
55
58
  direction: {
56
- type: import("vue").PropType<ListDirection>;
59
+ type: PropType<ListDirection>;
57
60
  default: ListDirection;
58
61
  };
59
62
  loadingText: StringConstructor;
package/es/list/List.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { ref, watch, nextTick, onUpdated, onMounted, defineComponent } from "vue";
2
+ import { ref, watch, computed, nextTick, onUpdated, onMounted, defineComponent } from "vue";
3
3
  import { isHidden, truthProp, makeStringProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
4
4
  import { useRect, useScrollParent, useEventListener } from "@vant/use";
5
5
  import { useExpose } from "../composables/use-expose.mjs";
@@ -12,6 +12,7 @@ const listProps = {
12
12
  loading: Boolean,
13
13
  disabled: Boolean,
14
14
  finished: Boolean,
15
+ scroller: Object,
15
16
  errorText: String,
16
17
  direction: makeStringProp("down"),
17
18
  loadingText: String,
@@ -31,6 +32,7 @@ var stdin_default = defineComponent({
31
32
  const placeholder = ref();
32
33
  const tabStatus = useTabStatus();
33
34
  const scrollParent = useScrollParent(root);
35
+ const scroller = computed(() => props.scroller || scrollParent.value);
34
36
  const check = () => {
35
37
  nextTick(() => {
36
38
  if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
@@ -41,7 +43,7 @@ var stdin_default = defineComponent({
41
43
  direction
42
44
  } = props;
43
45
  const offset = +props.offset;
44
- const scrollParentRect = useRect(scrollParent);
46
+ const scrollParentRect = useRect(scroller);
45
47
  if (!scrollParentRect.height || isHidden(root)) {
46
48
  return;
47
49
  }
@@ -117,7 +119,7 @@ var stdin_default = defineComponent({
117
119
  check
118
120
  });
119
121
  useEventListener("scroll", check, {
120
- target: scrollParent,
122
+ target: scroller,
121
123
  passive: true
122
124
  });
123
125
  return () => {
@@ -8,6 +8,7 @@ export declare const List: import("../utils").WithInstall<import("vue").DefineCo
8
8
  loading: BooleanConstructor;
9
9
  disabled: BooleanConstructor;
10
10
  finished: BooleanConstructor;
11
+ scroller: import("vue").PropType<Element>;
11
12
  errorText: StringConstructor;
12
13
  direction: {
13
14
  type: import("vue").PropType<import("./types").ListDirection>;
@@ -28,6 +29,7 @@ export declare const List: import("../utils").WithInstall<import("vue").DefineCo
28
29
  loading: BooleanConstructor;
29
30
  disabled: BooleanConstructor;
30
31
  finished: BooleanConstructor;
32
+ scroller: import("vue").PropType<Element>;
31
33
  errorText: StringConstructor;
32
34
  direction: {
33
35
  type: import("vue").PropType<import("./types").ListDirection>;
@@ -0,0 +1,63 @@
1
+ declare const _default: {
2
+ name: string;
3
+ tel: string;
4
+ save: string;
5
+ clear: string;
6
+ cancel: string;
7
+ confirm: string;
8
+ delete: string;
9
+ loading: string;
10
+ noCoupon: string;
11
+ nameEmpty: string;
12
+ addContact: string;
13
+ telInvalid: string;
14
+ vanCalendar: {
15
+ end: string;
16
+ start: string;
17
+ title: string;
18
+ weekdays: string[];
19
+ monthTitle: (year: number, month: number) => string;
20
+ rangePrompt: (maxRange: number) => string;
21
+ };
22
+ vanCascader: {
23
+ select: string;
24
+ };
25
+ vanPagination: {
26
+ prev: string;
27
+ next: string;
28
+ };
29
+ vanPullRefresh: {
30
+ pulling: string;
31
+ loosing: string;
32
+ };
33
+ vanSubmitBar: {
34
+ label: string;
35
+ };
36
+ vanCoupon: {
37
+ unlimited: string;
38
+ discount: (discount: number) => string;
39
+ condition: (condition: number) => string;
40
+ };
41
+ vanCouponCell: {
42
+ title: string;
43
+ count: (count: number) => string;
44
+ };
45
+ vanCouponList: {
46
+ exchange: string;
47
+ close: string;
48
+ enable: string;
49
+ disabled: string;
50
+ placeholder: string;
51
+ };
52
+ vanAddressEdit: {
53
+ area: string;
54
+ areaEmpty: string;
55
+ addressEmpty: string;
56
+ addressDetail: string;
57
+ defaultAddress: string;
58
+ };
59
+ vanAddressList: {
60
+ add: string;
61
+ };
62
+ };
63
+ export default _default;