vant 4.0.8 → 4.0.10

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 (51) hide show
  1. package/README.md +1 -1
  2. package/es/back-top/BackTop.d.ts +4 -0
  3. package/es/back-top/BackTop.mjs +2 -1
  4. package/es/back-top/index.d.ts +3 -0
  5. package/es/calendar/Calendar.mjs +1 -1
  6. package/es/calendar/CalendarMonth.mjs +4 -1
  7. package/es/image-preview/ImagePreview.mjs +13 -3
  8. package/es/image-preview/ImagePreviewItem.d.ts +3 -0
  9. package/es/image-preview/ImagePreviewItem.mjs +21 -9
  10. package/es/index.d.ts +1 -1
  11. package/es/index.mjs +1 -1
  12. package/es/locale/index.d.ts +1 -0
  13. package/es/locale/index.mjs +3 -1
  14. package/es/locale/lang/eo-EO.d.ts +62 -0
  15. package/es/locale/lang/eo-EO.mjs +64 -0
  16. package/es/locale/lang/it-IT.mjs +12 -12
  17. package/es/picker/Picker.mjs +5 -3
  18. package/es/slider/Slider.d.ts +2 -2
  19. package/es/slider/Slider.mjs +6 -4
  20. package/es/slider/index.d.ts +2 -2
  21. package/es/swipe/Swipe.d.ts +3 -1
  22. package/es/swipe/Swipe.mjs +10 -2
  23. package/es/swipe/index.d.ts +3 -1
  24. package/lib/back-top/BackTop.d.ts +4 -0
  25. package/lib/back-top/BackTop.js +2 -1
  26. package/lib/back-top/index.d.ts +3 -0
  27. package/lib/calendar/Calendar.js +1 -1
  28. package/lib/calendar/CalendarMonth.js +4 -1
  29. package/lib/image-preview/ImagePreview.js +13 -3
  30. package/lib/image-preview/ImagePreviewItem.d.ts +3 -0
  31. package/lib/image-preview/ImagePreviewItem.js +21 -9
  32. package/lib/index.d.ts +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/locale/index.d.ts +1 -0
  35. package/lib/locale/index.js +3 -1
  36. package/lib/locale/lang/eo-EO.d.ts +62 -0
  37. package/lib/locale/lang/eo-EO.js +83 -0
  38. package/lib/locale/lang/it-IT.js +12 -12
  39. package/lib/picker/Picker.js +5 -3
  40. package/lib/slider/Slider.d.ts +2 -2
  41. package/lib/slider/Slider.js +6 -4
  42. package/lib/slider/index.d.ts +2 -2
  43. package/lib/swipe/Swipe.d.ts +3 -1
  44. package/lib/swipe/Swipe.js +10 -2
  45. package/lib/swipe/index.d.ts +3 -1
  46. package/lib/vant.cjs.js +65 -25
  47. package/lib/vant.es.js +65 -25
  48. package/lib/vant.js +65 -25
  49. package/lib/vant.min.js +1 -1
  50. package/lib/web-types.json +1 -1
  51. package/package.json +1 -1
@@ -7,6 +7,7 @@ export declare const backTopProps: {
7
7
  type: (NumberConstructor | StringConstructor)[];
8
8
  default: number;
9
9
  };
10
+ immediate: BooleanConstructor;
10
11
  teleport: {
11
12
  type: PropType<string | import("vue").RendererElement | null | undefined>;
12
13
  default: string;
@@ -21,6 +22,7 @@ declare const _default: import("vue").DefineComponent<{
21
22
  type: (NumberConstructor | StringConstructor)[];
22
23
  default: number;
23
24
  };
25
+ immediate: BooleanConstructor;
24
26
  teleport: {
25
27
  type: PropType<string | import("vue").RendererElement | null | undefined>;
26
28
  default: string;
@@ -33,6 +35,7 @@ declare const _default: import("vue").DefineComponent<{
33
35
  type: (NumberConstructor | StringConstructor)[];
34
36
  default: number;
35
37
  };
38
+ immediate: BooleanConstructor;
36
39
  teleport: {
37
40
  type: PropType<string | import("vue").RendererElement | null | undefined>;
38
41
  default: string;
@@ -41,6 +44,7 @@ declare const _default: import("vue").DefineComponent<{
41
44
  onClick?: ((...args: any[]) => any) | undefined;
42
45
  }, {
43
46
  offset: string | number;
47
+ immediate: boolean;
44
48
  teleport: string | import("vue").RendererElement | null | undefined;
45
49
  }>;
46
50
  export default _default;
@@ -33,6 +33,7 @@ const backTopProps = {
33
33
  bottom: import_utils.numericProp,
34
34
  target: [String, Object],
35
35
  offset: (0, import_utils.makeNumericProp)(200),
36
+ immediate: Boolean,
36
37
  teleport: {
37
38
  type: [String, Object],
38
39
  default: "body"
@@ -60,7 +61,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
60
61
  emit("click", event);
61
62
  (_a = scrollParent.value) == null ? void 0 : _a.scrollTo({
62
63
  top: 0,
63
- behavior: "smooth"
64
+ behavior: props.immediate ? "auto" : "smooth"
64
65
  });
65
66
  };
66
67
  const scroll = () => {
@@ -6,6 +6,7 @@ export declare const BackTop: import("../utils").WithInstall<import("vue").Defin
6
6
  type: (NumberConstructor | StringConstructor)[];
7
7
  default: number;
8
8
  };
9
+ immediate: BooleanConstructor;
9
10
  teleport: {
10
11
  type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
11
12
  default: string;
@@ -18,6 +19,7 @@ export declare const BackTop: import("../utils").WithInstall<import("vue").Defin
18
19
  type: (NumberConstructor | StringConstructor)[];
19
20
  default: number;
20
21
  };
22
+ immediate: BooleanConstructor;
21
23
  teleport: {
22
24
  type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
23
25
  default: string;
@@ -26,6 +28,7 @@ export declare const BackTop: import("../utils").WithInstall<import("vue").Defin
26
28
  onClick?: ((...args: any[]) => any) | undefined;
27
29
  }, {
28
30
  offset: string | number;
31
+ immediate: boolean;
29
32
  teleport: string | import("vue").RendererElement | null | undefined;
30
33
  }>>;
31
34
  export default BackTop;
@@ -358,7 +358,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
358
358
  "firstDayOfWeek": dayOffset.value
359
359
  }, (0, import_utils.pick)(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
360
360
  "onClick": onClickDay
361
- }), (0, import_utils.pick)(slots, ["top-info", "bottom-info"]));
361
+ }), (0, import_utils.pick)(slots, ["top-info", "bottom-info", "month-title"]));
362
362
  };
363
363
  const renderFooterButton = () => {
364
364
  if (slots.footer) {
@@ -159,7 +159,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
159
159
  if (props.showMonthTitle) {
160
160
  return (0, import_vue.createVNode)("div", {
161
161
  "class": (0, import_utils3.bem)("month-title")
162
- }, [title.value]);
162
+ }, [slots["month-title"] ? slots["month-title"]({
163
+ date: props.date,
164
+ text: title.value
165
+ }) : title.value]);
163
166
  }
164
167
  };
165
168
  const renderMark = () => {
@@ -37,7 +37,7 @@ var import_swipe = require("../swipe");
37
37
  var import_popup = require("../popup");
38
38
  var import_ImagePreviewItem = __toESM(require("./ImagePreviewItem"));
39
39
  const [name, bem] = (0, import_utils.createNamespace)("image-preview");
40
- const popupProps = ["show", "transition", "overlayStyle", "closeOnPopstate", "teleport"];
40
+ const popupProps = ["show", "teleport", "transition", "overlayStyle", "closeOnPopstate"];
41
41
  const imagePreviewProps = {
42
42
  show: Boolean,
43
43
  loop: import_utils.truthProp,
@@ -72,7 +72,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
72
72
  const state = (0, import_vue2.reactive)({
73
73
  active: 0,
74
74
  rootWidth: 0,
75
- rootHeight: 0
75
+ rootHeight: 0,
76
+ disableZoom: false
76
77
  });
77
78
  const resize = () => {
78
79
  if (swipeRef.value) {
@@ -112,6 +113,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
112
113
  }, [slots.cover()]);
113
114
  }
114
115
  };
116
+ const onDragStart = () => {
117
+ state.disableZoom = true;
118
+ };
119
+ const onDragEnd = () => {
120
+ state.disableZoom = false;
121
+ };
115
122
  const renderImages = () => (0, import_vue.createVNode)(import_swipe.Swipe, {
116
123
  "ref": swipeRef,
117
124
  "lazyRender": true,
@@ -121,7 +128,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
121
128
  "initialSwipe": props.startPosition,
122
129
  "showIndicators": props.showIndicators,
123
130
  "indicatorColor": "white",
124
- "onChange": setActive
131
+ "onChange": setActive,
132
+ "onDragEnd": onDragEnd,
133
+ "onDragStart": onDragStart
125
134
  }, {
126
135
  default: () => [props.images.map((image, index) => (0, import_vue.createVNode)(import_ImagePreviewItem.default, {
127
136
  "src": image,
@@ -131,6 +140,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
131
140
  "minZoom": props.minZoom,
132
141
  "rootWidth": state.rootWidth,
133
142
  "rootHeight": state.rootHeight,
143
+ "disableZoom": state.disableZoom,
134
144
  "onScale": emitScale,
135
145
  "onClose": emitClose,
136
146
  "onLongPress": () => emit("longPress", {
@@ -18,6 +18,7 @@ declare const _default: import("vue").DefineComponent<{
18
18
  type: NumberConstructor;
19
19
  required: true;
20
20
  };
21
+ disableZoom: BooleanConstructor;
21
22
  }, () => 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<{
22
23
  src: StringConstructor;
23
24
  show: BooleanConstructor;
@@ -38,11 +39,13 @@ declare const _default: import("vue").DefineComponent<{
38
39
  type: NumberConstructor;
39
40
  required: true;
40
41
  };
42
+ disableZoom: BooleanConstructor;
41
43
  }>> & {
42
44
  onClose?: ((...args: any[]) => any) | undefined;
43
45
  onScale?: ((...args: any[]) => any) | undefined;
44
46
  onLongPress?: ((...args: any[]) => any) | undefined;
45
47
  }, {
46
48
  show: boolean;
49
+ disableZoom: boolean;
47
50
  }>;
48
51
  export default _default;
@@ -38,7 +38,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
38
38
  minZoom: (0, import_utils.makeRequiredProp)(import_utils.numericProp),
39
39
  maxZoom: (0, import_utils.makeRequiredProp)(import_utils.numericProp),
40
40
  rootWidth: (0, import_utils.makeRequiredProp)(Number),
41
- rootHeight: (0, import_utils.makeRequiredProp)(Number)
41
+ rootHeight: (0, import_utils.makeRequiredProp)(Number),
42
+ disableZoom: Boolean
42
43
  },
43
44
  emits: ["scale", "close", "longPress"],
44
45
  setup(props, {
@@ -133,18 +134,23 @@ var stdin_default = (0, import_vue2.defineComponent)({
133
134
  let startDistance;
134
135
  let doubleTapTimer;
135
136
  let touchStartTime;
137
+ let isImageMoved = false;
136
138
  const onTouchStart = (event) => {
137
139
  const {
138
140
  touches
139
141
  } = event;
142
+ fingerNum = touches.length;
143
+ if (fingerNum === 2 && props.disableZoom) {
144
+ return;
145
+ }
140
146
  const {
141
147
  offsetX
142
148
  } = touch;
143
149
  touch.start(event);
144
- fingerNum = touches.length;
145
150
  startMoveX = state.moveX;
146
151
  startMoveY = state.moveY;
147
152
  touchStartTime = Date.now();
153
+ isImageMoved = false;
148
154
  state.moving = fingerNum === 1 && state.scale !== 1;
149
155
  state.zooming = fingerNum === 2 && !offsetX.value;
150
156
  if (state.zooming) {
@@ -157,9 +163,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
157
163
  touches
158
164
  } = event;
159
165
  touch.move(event);
160
- if (state.moving || state.zooming) {
161
- (0, import_utils.preventDefault)(event, true);
162
- }
163
166
  if (state.moving) {
164
167
  const {
165
168
  deltaX,
@@ -167,13 +170,22 @@ var stdin_default = (0, import_vue2.defineComponent)({
167
170
  } = touch;
168
171
  const moveX = deltaX.value + startMoveX;
169
172
  const moveY = deltaY.value + startMoveY;
173
+ if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved) {
174
+ state.moving = false;
175
+ return;
176
+ }
177
+ isImageMoved = true;
178
+ (0, import_utils.preventDefault)(event, true);
170
179
  state.moveX = (0, import_utils.clamp)(moveX, -maxMoveX.value, maxMoveX.value);
171
180
  state.moveY = (0, import_utils.clamp)(moveY, -maxMoveY.value, maxMoveY.value);
172
181
  }
173
- if (state.zooming && touches.length === 2) {
174
- const distance = getDistance(touches);
175
- const scale = startScale * distance / startDistance;
176
- setScale(scale);
182
+ if (state.zooming) {
183
+ (0, import_utils.preventDefault)(event, true);
184
+ if (touches.length === 2) {
185
+ const distance = getDistance(touches);
186
+ const scale = startScale * distance / startDistance;
187
+ setScale(scale);
188
+ }
177
189
  }
178
190
  };
179
191
  const checkTap = () => {
package/lib/index.d.ts CHANGED
@@ -98,4 +98,4 @@ declare namespace _default {
98
98
  }
99
99
  export default _default;
100
100
  export function install(app: any): void;
101
- export const version: "4.0.8";
101
+ export const version: "4.0.10";
package/lib/index.js CHANGED
@@ -210,7 +210,7 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
210
210
  __reExport(stdin_exports, require("./toast"), module.exports);
211
211
  __reExport(stdin_exports, require("./tree-select"), module.exports);
212
212
  __reExport(stdin_exports, require("./uploader"), module.exports);
213
- const version = "4.0.8";
213
+ const version = "4.0.10";
214
214
  function install(app) {
215
215
  const components = [
216
216
  import_action_bar.ActionBar,
@@ -4,4 +4,5 @@ export declare const Locale: {
4
4
  use(newLang: string, newMessages?: Message): void;
5
5
  add(newMessages?: Message): void;
6
6
  };
7
+ export declare const useCurrentLang: () => import("vue").Ref<string>;
7
8
  export default Locale;
@@ -24,7 +24,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
24
24
  var stdin_exports = {};
25
25
  __export(stdin_exports, {
26
26
  Locale: () => Locale,
27
- default: () => stdin_default
27
+ default: () => stdin_default,
28
+ useCurrentLang: () => useCurrentLang
28
29
  });
29
30
  module.exports = __toCommonJS(stdin_exports);
30
31
  var import_vue = require("vue");
@@ -46,4 +47,5 @@ const Locale = {
46
47
  (0, import_deep_assign.deepAssign)(messages, newMessages);
47
48
  }
48
49
  };
50
+ const useCurrentLang = () => lang;
49
51
  var stdin_default = Locale;
@@ -0,0 +1,62 @@
1
+ declare const _default: {
2
+ name: string;
3
+ tel: string;
4
+ save: string;
5
+ confirm: string;
6
+ cancel: string;
7
+ delete: string;
8
+ loading: string;
9
+ noCoupon: string;
10
+ nameEmpty: string;
11
+ addContact: string;
12
+ telInvalid: string;
13
+ vanCalendar: {
14
+ end: string;
15
+ start: string;
16
+ title: string;
17
+ weekdays: string[];
18
+ monthTitle: (year: number, month: number) => string;
19
+ rangePrompt: (maxRange: number) => string;
20
+ };
21
+ vanCascader: {
22
+ select: string;
23
+ };
24
+ vanPagination: {
25
+ prev: string;
26
+ next: string;
27
+ };
28
+ vanPullRefresh: {
29
+ pulling: string;
30
+ loosing: string;
31
+ };
32
+ vanSubmitBar: {
33
+ label: string;
34
+ };
35
+ vanCoupon: {
36
+ unlimited: string;
37
+ discount: (discount: number) => string;
38
+ condition: (condition: number) => string;
39
+ };
40
+ vanCouponCell: {
41
+ title: string;
42
+ count: (count: number) => string;
43
+ };
44
+ vanCouponList: {
45
+ exchange: string;
46
+ close: string;
47
+ enable: string;
48
+ disabled: string;
49
+ placeholder: string;
50
+ };
51
+ vanAddressEdit: {
52
+ area: string;
53
+ areaEmpty: string;
54
+ addressEmpty: string;
55
+ addressDetail: string;
56
+ defaultAddress: string;
57
+ };
58
+ vanAddressList: {
59
+ add: string;
60
+ };
61
+ };
62
+ export default _default;
@@ -0,0 +1,83 @@
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: "Nomo",
25
+ tel: "Telefonnumero",
26
+ save: "Konservi",
27
+ confirm: "Konfirmi",
28
+ cancel: "Rezigni",
29
+ delete: "Forigi",
30
+ loading: "Bonvolu atendi...",
31
+ noCoupon: "Neniu kupono",
32
+ nameEmpty: "Plenigu la nomon",
33
+ addContact: "Aldoni kontakton",
34
+ telInvalid: "Nevalida telefonnumero",
35
+ vanCalendar: {
36
+ end: "Fino",
37
+ start: "Komenco",
38
+ title: "Kalendaro",
39
+ weekdays: ["Dim", "Lun", "Mar", "Mer", "\u0134a\u016D", "Ven", "Sab"],
40
+ monthTitle: (year, month) => `${year}/${month}`,
41
+ rangePrompt: (maxRange) => `Elektu maksimume ${maxRange} tagojn`
42
+ },
43
+ vanCascader: {
44
+ select: "Elekti"
45
+ },
46
+ vanPagination: {
47
+ prev: "Anta\u016Da",
48
+ next: "Sekva"
49
+ },
50
+ vanPullRefresh: {
51
+ pulling: "Tiri por refre\u015Digi...",
52
+ loosing: "Lasi por refre\u015Digi..."
53
+ },
54
+ vanSubmitBar: {
55
+ label: "Sumo:"
56
+ },
57
+ vanCoupon: {
58
+ unlimited: "Senlima",
59
+ discount: (discount) => `${discount * 10}%-a rabato`,
60
+ condition: (condition) => `Minimume ${condition}`
61
+ },
62
+ vanCouponCell: {
63
+ title: "Kupono",
64
+ count: (count) => `Vi havas ${count} kuponojn`
65
+ },
66
+ vanCouponList: {
67
+ exchange: "Inter\u015Dan\u011Di",
68
+ close: "Fermi",
69
+ enable: "Disponebla",
70
+ disabled: "Nedisponebla",
71
+ placeholder: "Kupon-kodo"
72
+ },
73
+ vanAddressEdit: {
74
+ area: "Areo",
75
+ areaEmpty: "Elektu ricevan areon",
76
+ addressEmpty: "La adreso ne povas esti malplena",
77
+ addressDetail: "Adreso",
78
+ defaultAddress: "Agordi kiel defa\u016Dltan adreson"
79
+ },
80
+ vanAddressList: {
81
+ add: "Aldoni novan adreson"
82
+ }
83
+ };
@@ -31,19 +31,19 @@ var stdin_default = {
31
31
  noCoupon: "Nessun coupon",
32
32
  nameEmpty: "Inserisci il nome",
33
33
  addContact: "Aggiungi contatto",
34
- telInvalid: "Numero di telefono errato",
34
+ telInvalid: "Numero di telefono non valido",
35
35
  vanCalendar: {
36
36
  end: "Fine",
37
37
  start: "Inizio",
38
38
  title: "Calendario",
39
39
  weekdays: [
40
- "domenica",
41
- "Lunedi",
42
- "Marted\xEC",
43
- "mercoled\xEC",
44
- "gioved\xEC",
45
- "venerd\xEC",
46
- "Sabato"
40
+ "dom",
41
+ "lun",
42
+ "mar",
43
+ "mer",
44
+ "gio",
45
+ "ven",
46
+ "sab"
47
47
  ],
48
48
  monthTitle: (year, month) => `${year}/${month}`,
49
49
  rangePrompt: (maxRange) => `Scegli non pi\xF9 di ${maxRange} giorni`
@@ -53,11 +53,11 @@ var stdin_default = {
53
53
  },
54
54
  vanPagination: {
55
55
  prev: "Precedente",
56
- next: "Avanti"
56
+ next: "Successivo"
57
57
  },
58
58
  vanPullRefresh: {
59
- pulling: "Tiri per aggiornare...",
60
- loosing: "Largo per rinfrescare..."
59
+ pulling: "Tira per aggiornare...",
60
+ loosing: "Rilascia per aggiornare..."
61
61
  },
62
62
  vanSubmitBar: {
63
63
  label: "Totale:"
@@ -68,7 +68,7 @@ var stdin_default = {
68
68
  condition: (condition) => `Almeno ${condition}`
69
69
  },
70
70
  vanCouponCell: {
71
- title: "Buono",
71
+ title: "Coupon",
72
72
  count: (count) => `Hai ${count} coupon`
73
73
  },
74
74
  vanCouponList: {
@@ -112,9 +112,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
112
112
  }
113
113
  });
114
114
  }
115
- emit("change", (0, import_utils.extend)({
116
- columnIndex
117
- }, getEventParams()));
115
+ (0, import_vue2.nextTick)(() => {
116
+ emit("change", (0, import_utils.extend)({
117
+ columnIndex
118
+ }, getEventParams()));
119
+ });
118
120
  };
119
121
  const onClickOption = (currentOption, columnIndex) => emit("clickOption", (0, import_utils.extend)({
120
122
  columnIndex,
@@ -55,7 +55,7 @@ declare const _default: import("vue").DefineComponent<{
55
55
  type: PropType<SliderValue>;
56
56
  default: number;
57
57
  };
58
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "dragEnd" | "dragStart")[], "update:modelValue" | "change" | "dragEnd" | "dragStart", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
58
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "dragStart" | "dragEnd")[], "update:modelValue" | "change" | "dragStart" | "dragEnd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
59
59
  min: {
60
60
  type: (NumberConstructor | StringConstructor)[];
61
61
  default: number;
@@ -84,8 +84,8 @@ declare const _default: import("vue").DefineComponent<{
84
84
  }>> & {
85
85
  onChange?: ((...args: any[]) => any) | undefined;
86
86
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
87
- onDragEnd?: ((...args: any[]) => any) | undefined;
88
87
  onDragStart?: ((...args: any[]) => any) | undefined;
88
+ onDragEnd?: ((...args: any[]) => any) | undefined;
89
89
  }, {
90
90
  range: boolean;
91
91
  max: string | number;
@@ -57,7 +57,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
57
57
  let current;
58
58
  let startValue;
59
59
  const root = (0, import_vue2.ref)();
60
- const slider = (0, import_vue2.ref)();
60
+ const slider = [(0, import_vue2.ref)(), (0, import_vue2.ref)()];
61
61
  const dragStatus = (0, import_vue2.ref)();
62
62
  const touch = (0, import_use_touch.useTouch)();
63
63
  const scope = (0, import_vue2.computed)(() => Number(props.max) - Number(props.min));
@@ -249,7 +249,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
249
249
  const renderButton = (index) => {
250
250
  const current2 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
251
251
  return (0, import_vue.createVNode)("div", {
252
- "ref": slider,
252
+ "ref": slider[index != null ? index : 0],
253
253
  "role": "slider",
254
254
  "class": getButtonClassName(index),
255
255
  "tabindex": props.disabled ? void 0 : 0,
@@ -272,8 +272,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
272
272
  };
273
273
  updateValue(props.modelValue);
274
274
  (0, import_use.useCustomFieldValue)(() => props.modelValue);
275
- (0, import_use.useEventListener)("touchmove", onTouchMove, {
276
- target: slider
275
+ slider.forEach((item) => {
276
+ (0, import_use.useEventListener)("touchmove", onTouchMove, {
277
+ target: item
278
+ });
277
279
  });
278
280
  return () => (0, import_vue.createVNode)("div", {
279
281
  "ref": root,
@@ -24,7 +24,7 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
24
24
  type: import("vue").PropType<number | [number, number]>;
25
25
  default: number;
26
26
  };
27
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "dragEnd" | "dragStart")[], "update:modelValue" | "change" | "dragEnd" | "dragStart", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "dragStart" | "dragEnd")[], "update:modelValue" | "change" | "dragStart" | "dragEnd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
28
  min: {
29
29
  type: (NumberConstructor | StringConstructor)[];
30
30
  default: number;
@@ -53,8 +53,8 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
53
53
  }>> & {
54
54
  onChange?: ((...args: any[]) => any) | undefined;
55
55
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
56
- onDragEnd?: ((...args: any[]) => any) | undefined;
57
56
  onDragStart?: ((...args: any[]) => any) | undefined;
57
+ onDragEnd?: ((...args: any[]) => any) | undefined;
58
58
  }, {
59
59
  range: boolean;
60
60
  max: string | number;
@@ -71,7 +71,7 @@ declare const _default: import("vue").DefineComponent<{
71
71
  type: BooleanConstructor;
72
72
  default: true;
73
73
  };
74
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
74
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "dragStart" | "dragEnd")[], "change" | "dragStart" | "dragEnd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
75
75
  loop: {
76
76
  type: BooleanConstructor;
77
77
  default: true;
@@ -107,6 +107,8 @@ declare const _default: import("vue").DefineComponent<{
107
107
  };
108
108
  }>> & {
109
109
  onChange?: ((...args: any[]) => any) | undefined;
110
+ onDragStart?: ((...args: any[]) => any) | undefined;
111
+ onDragEnd?: ((...args: any[]) => any) | undefined;
110
112
  }, {
111
113
  autoplay: string | number;
112
114
  loop: boolean;
@@ -48,7 +48,7 @@ const SWIPE_KEY = Symbol(name);
48
48
  var stdin_default = (0, import_vue2.defineComponent)({
49
49
  name,
50
50
  props: swipeProps,
51
- emits: ["change"],
51
+ emits: ["change", "dragStart", "dragEnd"],
52
52
  setup(props, {
53
53
  emit,
54
54
  slots
@@ -63,6 +63,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
63
63
  active: 0,
64
64
  swiping: false
65
65
  });
66
+ let dragging = false;
66
67
  const touch = (0, import_use_touch.useTouch)();
67
68
  const {
68
69
  children,
@@ -233,9 +234,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
233
234
  const resize = () => initialize(state.active);
234
235
  let touchStartTime;
235
236
  const onTouchStart = (event) => {
236
- if (!props.touchable)
237
+ if (!props.touchable || event.touches.length > 1)
237
238
  return;
238
239
  touch.start(event);
240
+ dragging = false;
239
241
  touchStartTime = Date.now();
240
242
  stopAutoplay();
241
243
  correctPosition();
@@ -250,6 +252,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
250
252
  move({
251
253
  offset: delta.value
252
254
  });
255
+ if (!dragging) {
256
+ emit("dragStart");
257
+ dragging = true;
258
+ }
253
259
  }
254
260
  }
255
261
  }
@@ -278,7 +284,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
278
284
  pace: 0
279
285
  });
280
286
  }
287
+ dragging = false;
281
288
  state.swiping = false;
289
+ emit("dragEnd");
282
290
  autoplay();
283
291
  };
284
292
  const swipeTo = (index, options = {}) => {
@@ -33,7 +33,7 @@ export declare const Swipe: import("../utils").WithInstall<import("vue").DefineC
33
33
  type: BooleanConstructor;
34
34
  default: true;
35
35
  };
36
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "dragStart" | "dragEnd")[], "change" | "dragStart" | "dragEnd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
37
  loop: {
38
38
  type: BooleanConstructor;
39
39
  default: true;
@@ -69,6 +69,8 @@ export declare const Swipe: import("../utils").WithInstall<import("vue").DefineC
69
69
  };
70
70
  }>> & {
71
71
  onChange?: ((...args: any[]) => any) | undefined;
72
+ onDragStart?: ((...args: any[]) => any) | undefined;
73
+ onDragEnd?: ((...args: any[]) => any) | undefined;
72
74
  }, {
73
75
  autoplay: string | number;
74
76
  loop: boolean;