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/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.6.4-beta.2";
108
+ export const version: "4.6.5";
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.6.4-beta.2";
227
+ const version = "4.6.5";
228
228
  function install(app) {
229
229
  const components = [
230
230
  import_action_bar.ActionBar,
@@ -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/lib/list/List.js CHANGED
@@ -35,6 +35,7 @@ const listProps = {
35
35
  loading: Boolean,
36
36
  disabled: Boolean,
37
37
  finished: Boolean,
38
+ scroller: Object,
38
39
  errorText: String,
39
40
  direction: (0, import_utils.makeStringProp)("down"),
40
41
  loadingText: String,
@@ -54,6 +55,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
54
55
  const placeholder = (0, import_vue2.ref)();
55
56
  const tabStatus = (0, import_use_tab_status.useTabStatus)();
56
57
  const scrollParent = (0, import_use.useScrollParent)(root);
58
+ const scroller = (0, import_vue2.computed)(() => props.scroller || scrollParent.value);
57
59
  const check = () => {
58
60
  (0, import_vue2.nextTick)(() => {
59
61
  if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
@@ -64,7 +66,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
64
66
  direction
65
67
  } = props;
66
68
  const offset = +props.offset;
67
- const scrollParentRect = (0, import_use.useRect)(scrollParent);
69
+ const scrollParentRect = (0, import_use.useRect)(scroller);
68
70
  if (!scrollParentRect.height || (0, import_utils.isHidden)(root)) {
69
71
  return;
70
72
  }
@@ -140,7 +142,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
140
142
  check
141
143
  });
142
144
  (0, import_use.useEventListener)("scroll", check, {
143
- target: scrollParent,
145
+ target: scroller,
144
146
  passive: true
145
147
  });
146
148
  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;
@@ -0,0 +1,92 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ default: () => stdin_default
21
+ });
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ var stdin_default = {
24
+ name: "Ime i prezime",
25
+ tel: "Broj telefona",
26
+ save: "Sa\u010Duvaj",
27
+ clear: "Prazno",
28
+ cancel: "Otka\u017Ei",
29
+ confirm: "Potvrdi",
30
+ delete: "Brisanje",
31
+ loading: "U\u010Ditavanje...",
32
+ noCoupon: "Jo\u0161 nema kupona",
33
+ nameEmpty: "Molimo unesite ime",
34
+ addContact: "Dodaj kontakte",
35
+ telInvalid: "Molimo unesite broj telefona",
36
+ vanCalendar: {
37
+ end: "Zavr\u0161etak",
38
+ start: "Po\u010Detak",
39
+ title: "Izaberite Datum",
40
+ weekdays: [
41
+ "Nedelja",
42
+ "Ponedeljak",
43
+ "Utorak",
44
+ "Sreda",
45
+ "\u010Cetvrtak",
46
+ "Petak",
47
+ "Subota"
48
+ ],
49
+ monthTitle: (year, month) => `${year}/${month}`,
50
+ rangePrompt: (maxRange) => `Izaberite do ${maxRange} dana`
51
+ },
52
+ vanCascader: {
53
+ select: "Molimo izaberite "
54
+ },
55
+ vanPagination: {
56
+ prev: "Prethodna strana",
57
+ next: "Sledec\u0301a strana"
58
+ },
59
+ vanPullRefresh: {
60
+ pulling: "Prevucite nadole da osve\u017Eite...",
61
+ loosing: "Otpustite da osve\u017Eite..."
62
+ },
63
+ vanSubmitBar: {
64
+ label: "Ukupno:"
65
+ },
66
+ vanCoupon: {
67
+ unlimited: "No threshold",
68
+ discount: (discount) => `${discount} puta`,
69
+ condition: (condition) => `Dostupno za preko ${condition} juana`
70
+ },
71
+ vanCouponCell: {
72
+ title: "Kupon",
73
+ count: (count) => `Dostupan ${count}`
74
+ },
75
+ vanCouponList: {
76
+ exchange: "Razmeni",
77
+ close: "Ne koristi",
78
+ enable: "Iskoristi",
79
+ disabled: "Nedostupno",
80
+ placeholder: "Unesite promo kod"
81
+ },
82
+ vanAddressEdit: {
83
+ area: "Region",
84
+ areaEmpty: "Molimo odaberite region",
85
+ addressEmpty: "Molimo upi\u0161ite adresu",
86
+ addressDetail: "Adresa",
87
+ defaultAddress: "Postavi kao podrazumevanu adresu za isporuku"
88
+ },
89
+ vanAddressList: {
90
+ add: "Dodaj adresu"
91
+ }
92
+ };
@@ -45,7 +45,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
45
45
  const expanded = (0, import_vue2.ref)(false);
46
46
  const hasAction = (0, import_vue2.ref)(false);
47
47
  const root = (0, import_vue2.ref)();
48
- const actionText = (0, import_vue2.computed)(() => expanded.value ? props.expandText : props.collapseText);
48
+ const actionText = (0, import_vue2.computed)(() => expanded.value ? props.collapseText : props.expandText);
49
49
  const pxToNum = (value) => {
50
50
  if (!value)
51
51
  return 0;
@@ -87,7 +87,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
87
87
  }
88
88
  return dots + content.slice(right, end);
89
89
  }
90
- const middle2 = Math.round(left + right >> 1);
90
+ const middle2 = Math.round((left + right) / 2);
91
91
  if (position === "end") {
92
92
  container2.innerText = content.slice(0, middle2) + dots + actionText.value;
93
93
  } else {
@@ -108,11 +108,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
108
108
  };
109
109
  const middleTail = (leftPart, rightPart) => {
110
110
  if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
111
- return content.slice(0, leftPart[1]) + dots + content.slice(rightPart[1], end);
111
+ return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
112
112
  }
113
- const leftMiddle = Math.floor(leftPart[0] + leftPart[1] >> 1);
114
- const rightMiddle = Math.ceil(rightPart[0] + rightPart[1] >> 1);
115
- container2.innerText = props.content.slice(0, leftMiddle) + props.dots + actionText.value + props.dots + props.content.slice(rightMiddle, end);
113
+ const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
114
+ const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
115
+ container2.innerText = props.content.slice(0, leftMiddle) + props.dots + props.content.slice(rightMiddle, end) + props.expandText;
116
116
  if (container2.offsetHeight >= maxHeight2) {
117
117
  return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
118
118
  }
@@ -147,7 +147,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
147
147
  const renderAction = () => (0, import_vue.createVNode)("span", {
148
148
  "class": bem("action"),
149
149
  "onClick": onClickAction
150
- }, [expanded.value ? props.collapseText : props.expandText]);
150
+ }, [actionText.value]);
151
151
  (0, import_vue2.onMounted)(calcEllipsised);
152
152
  (0, import_vue2.watch)(() => [props.content, props.rows, props.position], calcEllipsised);
153
153
  (0, import_use.useEventListener)("resize", calcEllipsised);
@@ -79,7 +79,7 @@ export default Toast;
79
79
  export { toastProps } from './Toast';
80
80
  export { showToast, closeToast, showFailToast, showLoadingToast, showSuccessToast, allowMultipleToast, setToastDefaultOptions, resetToastDefaultOptions, } from './function-call';
81
81
  export type { ToastProps } from './Toast';
82
- export type { ToastType, ToastOptions, ToastPosition, ToastThemeVars, ToastWordBreak, } from './types';
82
+ export type { ToastType, ToastOptions, ToastPosition, ToastThemeVars, ToastWordBreak, ToastWrapperInstance, } from './types';
83
83
  declare module 'vue' {
84
84
  interface GlobalComponents {
85
85
  VanToast: typeof Toast;
package/lib/vant.cjs.js CHANGED
@@ -9418,7 +9418,8 @@ const dropdownMenuProps = {
9418
9418
  direction: makeStringProp("down"),
9419
9419
  activeColor: String,
9420
9420
  closeOnClickOutside: truthProp,
9421
- closeOnClickOverlay: truthProp
9421
+ closeOnClickOverlay: truthProp,
9422
+ swipeThreshold: numericProp
9422
9423
  };
9423
9424
  const DROPDOWN_KEY = Symbol(name$K);
9424
9425
  var stdin_default$T = vue.defineComponent({
@@ -9437,6 +9438,7 @@ var stdin_default$T = vue.defineComponent({
9437
9438
  } = use.useChildren(DROPDOWN_KEY);
9438
9439
  const scrollParent = use.useScrollParent(root);
9439
9440
  const opened = vue.computed(() => children.some((item) => item.state.showWrapper));
9441
+ const scrollable = vue.computed(() => props2.swipeThreshold && children.length > +props2.swipeThreshold);
9440
9442
  const barStyle = vue.computed(() => {
9441
9443
  if (opened.value && isDef(props2.zIndex)) {
9442
9444
  return {
@@ -9493,7 +9495,8 @@ var stdin_default$T = vue.defineComponent({
9493
9495
  "role": "button",
9494
9496
  "tabindex": disabled ? void 0 : 0,
9495
9497
  "class": [bem$K("item", {
9496
- disabled
9498
+ disabled,
9499
+ grow: scrollable.value
9497
9500
  }), {
9498
9501
  [HAPTICS_FEEDBACK]: !disabled
9499
9502
  }],
@@ -9537,7 +9540,8 @@ var stdin_default$T = vue.defineComponent({
9537
9540
  "ref": barRef,
9538
9541
  "style": barStyle.value,
9539
9542
  "class": bem$K("bar", {
9540
- opened: opened.value
9543
+ opened: opened.value,
9544
+ scrollable: scrollable.value
9541
9545
  })
9542
9546
  }, [children.map(renderTitle)]), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
9543
9547
  };
@@ -9736,11 +9740,13 @@ const floatingBubbleProps = {
9736
9740
  const [name$I, bem$I] = createNamespace("floating-bubble");
9737
9741
  var stdin_default$R = vue.defineComponent({
9738
9742
  name: name$I,
9743
+ inheritAttrs: false,
9739
9744
  props: floatingBubbleProps,
9740
9745
  emits: ["click", "update:offset", "offsetChange"],
9741
9746
  setup(props2, {
9742
9747
  slots,
9743
- emit
9748
+ emit,
9749
+ attrs
9744
9750
  }) {
9745
9751
  const rootRef = vue.ref();
9746
9752
  const state = vue.ref({
@@ -9861,7 +9867,7 @@ var stdin_default$R = vue.defineComponent({
9861
9867
  }
9862
9868
  });
9863
9869
  return () => {
9864
- const Content = vue.withDirectives(vue.createVNode("div", {
9870
+ const Content = vue.withDirectives(vue.createVNode("div", vue.mergeProps({
9865
9871
  "class": bem$I(),
9866
9872
  "ref": rootRef,
9867
9873
  "onTouchstartPassive": onTouchStart,
@@ -9869,7 +9875,7 @@ var stdin_default$R = vue.defineComponent({
9869
9875
  "onTouchcancel": onTouchEnd,
9870
9876
  "onClick": onClick,
9871
9877
  "style": rootStyle.value
9872
- }, [slots.default ? slots.default() : vue.createVNode(stdin_default$1P, {
9878
+ }, attrs), [slots.default ? slots.default() : vue.createVNode(stdin_default$1P, {
9873
9879
  "name": props2.icon,
9874
9880
  "class": bem$I("icon")
9875
9881
  }, null)]), [[vue.vShow, show.value]]);
@@ -9887,10 +9893,10 @@ const floatingPanelProps = {
9887
9893
  anchors: makeArrayProp(),
9888
9894
  duration: makeNumericProp(0.2),
9889
9895
  contentDraggable: truthProp,
9896
+ lockScroll: Boolean,
9890
9897
  safeAreaInsetBottom: truthProp
9891
9898
  };
9892
9899
  const [name$H, bem$H] = createNamespace("floating-panel");
9893
- const DAMP = 0.2;
9894
9900
  var stdin_default$Q = vue.defineComponent({
9895
9901
  name: name$H,
9896
9902
  props: floatingPanelProps,
@@ -9899,6 +9905,7 @@ var stdin_default$Q = vue.defineComponent({
9899
9905
  emit,
9900
9906
  slots
9901
9907
  }) {
9908
+ const DAMP = 0.2;
9902
9909
  const rootRef = vue.ref();
9903
9910
  const contentRef = vue.ref();
9904
9911
  const height = useSyncPropRef(() => +props2.height, (value) => emit("update:height", value));
@@ -9931,24 +9938,28 @@ var stdin_default$Q = vue.defineComponent({
9931
9938
  return moveY;
9932
9939
  };
9933
9940
  let startY;
9941
+ let maxScroll = -1;
9934
9942
  const touch = useTouch();
9935
9943
  const onTouchstart = (e) => {
9936
9944
  touch.start(e);
9937
9945
  dragging.value = true;
9938
9946
  startY = -height.value;
9947
+ maxScroll = -1;
9939
9948
  };
9940
9949
  const onTouchmove = (e) => {
9941
9950
  var _a;
9942
9951
  touch.move(e);
9943
9952
  const target = e.target;
9944
9953
  if (contentRef.value === target || ((_a = contentRef.value) == null ? void 0 : _a.contains(target))) {
9954
+ const {
9955
+ scrollTop
9956
+ } = contentRef.value;
9957
+ maxScroll = Math.max(maxScroll, scrollTop);
9945
9958
  if (!props2.contentDraggable)
9946
9959
  return;
9947
9960
  if (-startY < boundary.value.max) {
9948
- if (e.cancelable)
9949
- e.preventDefault();
9950
- e.stopPropagation();
9951
- } else if (!(contentRef.value.scrollTop <= 0 && touch.deltaY.value > 0)) {
9961
+ preventDefault(e, true);
9962
+ } else if (!(scrollTop <= 0 && touch.deltaY.value > 0) || maxScroll > 0) {
9952
9963
  return;
9953
9964
  }
9954
9965
  }
@@ -9956,6 +9967,7 @@ var stdin_default$Q = vue.defineComponent({
9956
9967
  height.value = -ease(moveY);
9957
9968
  };
9958
9969
  const onTouchend = () => {
9970
+ maxScroll = -1;
9959
9971
  dragging.value = false;
9960
9972
  height.value = closest(anchors.value, height.value);
9961
9973
  if (height.value !== -startY) {
@@ -9969,7 +9981,7 @@ var stdin_default$Q = vue.defineComponent({
9969
9981
  }, {
9970
9982
  immediate: true
9971
9983
  });
9972
- useLockScroll(rootRef, () => true);
9984
+ useLockScroll(rootRef, () => props2.lockScroll);
9973
9985
  use.useEventListener("touchmove", onTouchmove, {
9974
9986
  target: rootRef
9975
9987
  });
@@ -10186,7 +10198,8 @@ var stdin_default$N = vue.defineComponent({
10186
10198
  maxZoom: makeRequiredProp(numericProp),
10187
10199
  rootWidth: makeRequiredProp(Number),
10188
10200
  rootHeight: makeRequiredProp(Number),
10189
- disableZoom: Boolean
10201
+ disableZoom: Boolean,
10202
+ closeOnClickOverlay: Boolean
10190
10203
  },
10191
10204
  emits: ["scale", "close", "longPress"],
10192
10205
  setup(props2, {
@@ -10346,7 +10359,8 @@ var stdin_default$N = vue.defineComponent({
10346
10359
  }
10347
10360
  }
10348
10361
  };
10349
- const checkTap = () => {
10362
+ const checkTap = (event) => {
10363
+ var _a;
10350
10364
  if (fingerNum > 1) {
10351
10365
  return;
10352
10366
  }
@@ -10363,6 +10377,9 @@ var stdin_default$N = vue.defineComponent({
10363
10377
  doubleTapTimer = null;
10364
10378
  toggleScale();
10365
10379
  } else {
10380
+ if (!props2.closeOnClickOverlay && event.target === ((_a = swipeItem.value) == null ? void 0 : _a.$el)) {
10381
+ return;
10382
+ }
10366
10383
  doubleTapTimer = setTimeout(() => {
10367
10384
  emit("close");
10368
10385
  doubleTapTimer = null;
@@ -10400,7 +10417,7 @@ var stdin_default$N = vue.defineComponent({
10400
10417
  }
10401
10418
  }
10402
10419
  preventDefault(event, stopPropagation2);
10403
- checkTap();
10420
+ checkTap(event);
10404
10421
  touch.reset();
10405
10422
  };
10406
10423
  const resize = () => {
@@ -10497,6 +10514,7 @@ const imagePreviewProps = {
10497
10514
  startPosition: makeNumericProp(0),
10498
10515
  showIndicators: Boolean,
10499
10516
  closeOnPopstate: truthProp,
10517
+ closeOnClickOverlay: truthProp,
10500
10518
  closeIconPosition: makeStringProp("top-right"),
10501
10519
  teleport: [String, Object]
10502
10520
  };
@@ -10581,6 +10599,7 @@ var stdin_default$M = vue.defineComponent({
10581
10599
  "rootWidth": state.rootWidth,
10582
10600
  "rootHeight": state.rootHeight,
10583
10601
  "disableZoom": state.disableZoom,
10602
+ "closeOnClickOverlay": props2.closeOnClickOverlay,
10584
10603
  "onScale": emitScale,
10585
10604
  "onClose": emitClose,
10586
10605
  "onLongPress": () => emit("longPress", {
@@ -10663,6 +10682,7 @@ const defaultConfig = {
10663
10682
  swipeDuration: 300,
10664
10683
  showIndicators: false,
10665
10684
  closeOnPopstate: true,
10685
+ closeOnClickOverlay: true,
10666
10686
  closeIconPosition: "top-right"
10667
10687
  };
10668
10688
  function initInstance$1() {
@@ -11001,6 +11021,7 @@ const listProps = {
11001
11021
  loading: Boolean,
11002
11022
  disabled: Boolean,
11003
11023
  finished: Boolean,
11024
+ scroller: Object,
11004
11025
  errorText: String,
11005
11026
  direction: makeStringProp("down"),
11006
11027
  loadingText: String,
@@ -11020,6 +11041,7 @@ var stdin_default$J = vue.defineComponent({
11020
11041
  const placeholder = vue.ref();
11021
11042
  const tabStatus = useTabStatus();
11022
11043
  const scrollParent = use.useScrollParent(root);
11044
+ const scroller = vue.computed(() => props2.scroller || scrollParent.value);
11023
11045
  const check = () => {
11024
11046
  vue.nextTick(() => {
11025
11047
  if (loading.value || props2.finished || props2.disabled || props2.error || // skip check when inside an inactive tab
@@ -11030,7 +11052,7 @@ var stdin_default$J = vue.defineComponent({
11030
11052
  direction
11031
11053
  } = props2;
11032
11054
  const offset = +props2.offset;
11033
- const scrollParentRect = use.useRect(scrollParent);
11055
+ const scrollParentRect = use.useRect(scroller);
11034
11056
  if (!scrollParentRect.height || isHidden(root)) {
11035
11057
  return;
11036
11058
  }
@@ -11106,7 +11128,7 @@ var stdin_default$J = vue.defineComponent({
11106
11128
  check
11107
11129
  });
11108
11130
  use.useEventListener("scroll", check, {
11109
- target: scrollParent,
11131
+ target: scroller,
11110
11132
  passive: true
11111
11133
  });
11112
11134
  return () => {
@@ -14624,7 +14646,7 @@ var stdin_default$9 = vue.defineComponent({
14624
14646
  const expanded = vue.ref(false);
14625
14647
  const hasAction = vue.ref(false);
14626
14648
  const root = vue.ref();
14627
- const actionText = vue.computed(() => expanded.value ? props2.expandText : props2.collapseText);
14649
+ const actionText = vue.computed(() => expanded.value ? props2.collapseText : props2.expandText);
14628
14650
  const pxToNum = (value) => {
14629
14651
  if (!value)
14630
14652
  return 0;
@@ -14666,7 +14688,7 @@ var stdin_default$9 = vue.defineComponent({
14666
14688
  }
14667
14689
  return dots + content.slice(right, end);
14668
14690
  }
14669
- const middle2 = Math.round(left + right >> 1);
14691
+ const middle2 = Math.round((left + right) / 2);
14670
14692
  if (position === "end") {
14671
14693
  container2.innerText = content.slice(0, middle2) + dots + actionText.value;
14672
14694
  } else {
@@ -14687,11 +14709,11 @@ var stdin_default$9 = vue.defineComponent({
14687
14709
  };
14688
14710
  const middleTail = (leftPart, rightPart) => {
14689
14711
  if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
14690
- return content.slice(0, leftPart[1]) + dots + content.slice(rightPart[1], end);
14712
+ return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
14691
14713
  }
14692
- const leftMiddle = Math.floor(leftPart[0] + leftPart[1] >> 1);
14693
- const rightMiddle = Math.ceil(rightPart[0] + rightPart[1] >> 1);
14694
- container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + actionText.value + props2.dots + props2.content.slice(rightMiddle, end);
14714
+ const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
14715
+ const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
14716
+ container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end) + props2.expandText;
14695
14717
  if (container2.offsetHeight >= maxHeight2) {
14696
14718
  return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
14697
14719
  }
@@ -14726,7 +14748,7 @@ var stdin_default$9 = vue.defineComponent({
14726
14748
  const renderAction = () => vue.createVNode("span", {
14727
14749
  "class": bem$3("action"),
14728
14750
  "onClick": onClickAction
14729
- }, [expanded.value ? props2.collapseText : props2.expandText]);
14751
+ }, [actionText.value]);
14730
14752
  vue.onMounted(calcEllipsised);
14731
14753
  vue.watch(() => [props2.content, props2.rows, props2.position], calcEllipsised);
14732
14754
  use.useEventListener("resize", calcEllipsised);
@@ -16387,7 +16409,7 @@ const Lazyload = {
16387
16409
  });
16388
16410
  }
16389
16411
  };
16390
- const version = "4.6.4-beta.2";
16412
+ const version = "4.6.5";
16391
16413
  function install(app) {
16392
16414
  const components = [
16393
16415
  ActionBar,