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.
- package/README.md +1 -1
- package/es/back-top/BackTop.d.ts +4 -0
- package/es/back-top/BackTop.mjs +2 -1
- package/es/back-top/index.d.ts +3 -0
- package/es/calendar/Calendar.mjs +1 -1
- package/es/calendar/CalendarMonth.mjs +4 -1
- package/es/image-preview/ImagePreview.mjs +13 -3
- package/es/image-preview/ImagePreviewItem.d.ts +3 -0
- package/es/image-preview/ImagePreviewItem.mjs +21 -9
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/index.d.ts +1 -0
- package/es/locale/index.mjs +3 -1
- package/es/locale/lang/eo-EO.d.ts +62 -0
- package/es/locale/lang/eo-EO.mjs +64 -0
- package/es/locale/lang/it-IT.mjs +12 -12
- package/es/picker/Picker.mjs +5 -3
- package/es/slider/Slider.d.ts +2 -2
- package/es/slider/Slider.mjs +6 -4
- package/es/slider/index.d.ts +2 -2
- package/es/swipe/Swipe.d.ts +3 -1
- package/es/swipe/Swipe.mjs +10 -2
- package/es/swipe/index.d.ts +3 -1
- package/lib/back-top/BackTop.d.ts +4 -0
- package/lib/back-top/BackTop.js +2 -1
- package/lib/back-top/index.d.ts +3 -0
- package/lib/calendar/Calendar.js +1 -1
- package/lib/calendar/CalendarMonth.js +4 -1
- package/lib/image-preview/ImagePreview.js +13 -3
- package/lib/image-preview/ImagePreviewItem.d.ts +3 -0
- package/lib/image-preview/ImagePreviewItem.js +21 -9
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/index.d.ts +1 -0
- package/lib/locale/index.js +3 -1
- package/lib/locale/lang/eo-EO.d.ts +62 -0
- package/lib/locale/lang/eo-EO.js +83 -0
- package/lib/locale/lang/it-IT.js +12 -12
- package/lib/picker/Picker.js +5 -3
- package/lib/slider/Slider.d.ts +2 -2
- package/lib/slider/Slider.js +6 -4
- package/lib/slider/index.d.ts +2 -2
- package/lib/swipe/Swipe.d.ts +3 -1
- package/lib/swipe/Swipe.js +10 -2
- package/lib/swipe/index.d.ts +3 -1
- package/lib/vant.cjs.js +65 -25
- package/lib/vant.es.js +65 -25
- package/lib/vant.js +65 -25
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/es/back-top/BackTop.d.ts
CHANGED
@@ -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;
|
package/es/back-top/BackTop.mjs
CHANGED
@@ -10,6 +10,7 @@ const backTopProps = {
|
|
10
10
|
bottom: numericProp,
|
11
11
|
target: [String, Object],
|
12
12
|
offset: makeNumericProp(200),
|
13
|
+
immediate: Boolean,
|
13
14
|
teleport: {
|
14
15
|
type: [String, Object],
|
15
16
|
default: "body"
|
@@ -37,7 +38,7 @@ var stdin_default = defineComponent({
|
|
37
38
|
emit("click", event);
|
38
39
|
(_a = scrollParent.value) == null ? void 0 : _a.scrollTo({
|
39
40
|
top: 0,
|
40
|
-
behavior: "smooth"
|
41
|
+
behavior: props.immediate ? "auto" : "smooth"
|
41
42
|
});
|
42
43
|
};
|
43
44
|
const scroll = () => {
|
package/es/back-top/index.d.ts
CHANGED
@@ -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;
|
package/es/calendar/Calendar.mjs
CHANGED
@@ -329,7 +329,7 @@ var stdin_default = defineComponent({
|
|
329
329
|
"firstDayOfWeek": dayOffset.value
|
330
330
|
}, pick(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
331
331
|
"onClick": onClickDay
|
332
|
-
}), pick(slots, ["top-info", "bottom-info"]));
|
332
|
+
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
333
333
|
};
|
334
334
|
const renderFooterButton = () => {
|
335
335
|
if (slots.footer) {
|
@@ -131,7 +131,10 @@ var stdin_default = defineComponent({
|
|
131
131
|
if (props.showMonthTitle) {
|
132
132
|
return _createVNode("div", {
|
133
133
|
"class": bem("month-title")
|
134
|
-
}, [title
|
134
|
+
}, [slots["month-title"] ? slots["month-title"]({
|
135
|
+
date: props.date,
|
136
|
+
text: title.value
|
137
|
+
}) : title.value]);
|
135
138
|
}
|
136
139
|
};
|
137
140
|
const renderMark = () => {
|
@@ -8,7 +8,7 @@ import { Swipe } from "../swipe/index.mjs";
|
|
8
8
|
import { Popup } from "../popup/index.mjs";
|
9
9
|
import ImagePreviewItem from "./ImagePreviewItem.mjs";
|
10
10
|
const [name, bem] = createNamespace("image-preview");
|
11
|
-
const popupProps = ["show", "
|
11
|
+
const popupProps = ["show", "teleport", "transition", "overlayStyle", "closeOnPopstate"];
|
12
12
|
const imagePreviewProps = {
|
13
13
|
show: Boolean,
|
14
14
|
loop: truthProp,
|
@@ -43,7 +43,8 @@ var stdin_default = defineComponent({
|
|
43
43
|
const state = reactive({
|
44
44
|
active: 0,
|
45
45
|
rootWidth: 0,
|
46
|
-
rootHeight: 0
|
46
|
+
rootHeight: 0,
|
47
|
+
disableZoom: false
|
47
48
|
});
|
48
49
|
const resize = () => {
|
49
50
|
if (swipeRef.value) {
|
@@ -83,6 +84,12 @@ var stdin_default = defineComponent({
|
|
83
84
|
}, [slots.cover()]);
|
84
85
|
}
|
85
86
|
};
|
87
|
+
const onDragStart = () => {
|
88
|
+
state.disableZoom = true;
|
89
|
+
};
|
90
|
+
const onDragEnd = () => {
|
91
|
+
state.disableZoom = false;
|
92
|
+
};
|
86
93
|
const renderImages = () => _createVNode(Swipe, {
|
87
94
|
"ref": swipeRef,
|
88
95
|
"lazyRender": true,
|
@@ -92,7 +99,9 @@ var stdin_default = defineComponent({
|
|
92
99
|
"initialSwipe": props.startPosition,
|
93
100
|
"showIndicators": props.showIndicators,
|
94
101
|
"indicatorColor": "white",
|
95
|
-
"onChange": setActive
|
102
|
+
"onChange": setActive,
|
103
|
+
"onDragEnd": onDragEnd,
|
104
|
+
"onDragStart": onDragStart
|
96
105
|
}, {
|
97
106
|
default: () => [props.images.map((image, index) => _createVNode(ImagePreviewItem, {
|
98
107
|
"src": image,
|
@@ -102,6 +111,7 @@ var stdin_default = defineComponent({
|
|
102
111
|
"minZoom": props.minZoom,
|
103
112
|
"rootWidth": state.rootWidth,
|
104
113
|
"rootHeight": state.rootHeight,
|
114
|
+
"disableZoom": state.disableZoom,
|
105
115
|
"onScale": emitScale,
|
106
116
|
"onClose": emitClose,
|
107
117
|
"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;
|
@@ -16,7 +16,8 @@ var stdin_default = defineComponent({
|
|
16
16
|
minZoom: makeRequiredProp(numericProp),
|
17
17
|
maxZoom: makeRequiredProp(numericProp),
|
18
18
|
rootWidth: makeRequiredProp(Number),
|
19
|
-
rootHeight: makeRequiredProp(Number)
|
19
|
+
rootHeight: makeRequiredProp(Number),
|
20
|
+
disableZoom: Boolean
|
20
21
|
},
|
21
22
|
emits: ["scale", "close", "longPress"],
|
22
23
|
setup(props, {
|
@@ -111,18 +112,23 @@ var stdin_default = defineComponent({
|
|
111
112
|
let startDistance;
|
112
113
|
let doubleTapTimer;
|
113
114
|
let touchStartTime;
|
115
|
+
let isImageMoved = false;
|
114
116
|
const onTouchStart = (event) => {
|
115
117
|
const {
|
116
118
|
touches
|
117
119
|
} = event;
|
120
|
+
fingerNum = touches.length;
|
121
|
+
if (fingerNum === 2 && props.disableZoom) {
|
122
|
+
return;
|
123
|
+
}
|
118
124
|
const {
|
119
125
|
offsetX
|
120
126
|
} = touch;
|
121
127
|
touch.start(event);
|
122
|
-
fingerNum = touches.length;
|
123
128
|
startMoveX = state.moveX;
|
124
129
|
startMoveY = state.moveY;
|
125
130
|
touchStartTime = Date.now();
|
131
|
+
isImageMoved = false;
|
126
132
|
state.moving = fingerNum === 1 && state.scale !== 1;
|
127
133
|
state.zooming = fingerNum === 2 && !offsetX.value;
|
128
134
|
if (state.zooming) {
|
@@ -135,9 +141,6 @@ var stdin_default = defineComponent({
|
|
135
141
|
touches
|
136
142
|
} = event;
|
137
143
|
touch.move(event);
|
138
|
-
if (state.moving || state.zooming) {
|
139
|
-
preventDefault(event, true);
|
140
|
-
}
|
141
144
|
if (state.moving) {
|
142
145
|
const {
|
143
146
|
deltaX,
|
@@ -145,13 +148,22 @@ var stdin_default = defineComponent({
|
|
145
148
|
} = touch;
|
146
149
|
const moveX = deltaX.value + startMoveX;
|
147
150
|
const moveY = deltaY.value + startMoveY;
|
151
|
+
if ((moveX > maxMoveX.value || moveX < -maxMoveX.value) && !isImageMoved) {
|
152
|
+
state.moving = false;
|
153
|
+
return;
|
154
|
+
}
|
155
|
+
isImageMoved = true;
|
156
|
+
preventDefault(event, true);
|
148
157
|
state.moveX = clamp(moveX, -maxMoveX.value, maxMoveX.value);
|
149
158
|
state.moveY = clamp(moveY, -maxMoveY.value, maxMoveY.value);
|
150
159
|
}
|
151
|
-
if (state.zooming
|
152
|
-
|
153
|
-
|
154
|
-
|
160
|
+
if (state.zooming) {
|
161
|
+
preventDefault(event, true);
|
162
|
+
if (touches.length === 2) {
|
163
|
+
const distance = getDistance(touches);
|
164
|
+
const scale = startScale * distance / startDistance;
|
165
|
+
setScale(scale);
|
166
|
+
}
|
155
167
|
}
|
156
168
|
};
|
157
169
|
const checkTap = () => {
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
@@ -91,7 +91,7 @@ import { TimePicker } from "./time-picker/index.mjs";
|
|
91
91
|
import { Toast } from "./toast/index.mjs";
|
92
92
|
import { TreeSelect } from "./tree-select/index.mjs";
|
93
93
|
import { Uploader } from "./uploader/index.mjs";
|
94
|
-
const version = "4.0.
|
94
|
+
const version = "4.0.10";
|
95
95
|
function install(app) {
|
96
96
|
const components = [
|
97
97
|
ActionBar,
|
package/es/locale/index.d.ts
CHANGED
package/es/locale/index.mjs
CHANGED
@@ -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,64 @@
|
|
1
|
+
var stdin_default = {
|
2
|
+
name: "Nomo",
|
3
|
+
tel: "Telefonnumero",
|
4
|
+
save: "Konservi",
|
5
|
+
confirm: "Konfirmi",
|
6
|
+
cancel: "Rezigni",
|
7
|
+
delete: "Forigi",
|
8
|
+
loading: "Bonvolu atendi...",
|
9
|
+
noCoupon: "Neniu kupono",
|
10
|
+
nameEmpty: "Plenigu la nomon",
|
11
|
+
addContact: "Aldoni kontakton",
|
12
|
+
telInvalid: "Nevalida telefonnumero",
|
13
|
+
vanCalendar: {
|
14
|
+
end: "Fino",
|
15
|
+
start: "Komenco",
|
16
|
+
title: "Kalendaro",
|
17
|
+
weekdays: ["Dim", "Lun", "Mar", "Mer", "\u0134a\u016D", "Ven", "Sab"],
|
18
|
+
monthTitle: (year, month) => `${year}/${month}`,
|
19
|
+
rangePrompt: (maxRange) => `Elektu maksimume ${maxRange} tagojn`
|
20
|
+
},
|
21
|
+
vanCascader: {
|
22
|
+
select: "Elekti"
|
23
|
+
},
|
24
|
+
vanPagination: {
|
25
|
+
prev: "Anta\u016Da",
|
26
|
+
next: "Sekva"
|
27
|
+
},
|
28
|
+
vanPullRefresh: {
|
29
|
+
pulling: "Tiri por refre\u015Digi...",
|
30
|
+
loosing: "Lasi por refre\u015Digi..."
|
31
|
+
},
|
32
|
+
vanSubmitBar: {
|
33
|
+
label: "Sumo:"
|
34
|
+
},
|
35
|
+
vanCoupon: {
|
36
|
+
unlimited: "Senlima",
|
37
|
+
discount: (discount) => `${discount * 10}%-a rabato`,
|
38
|
+
condition: (condition) => `Minimume ${condition}`
|
39
|
+
},
|
40
|
+
vanCouponCell: {
|
41
|
+
title: "Kupono",
|
42
|
+
count: (count) => `Vi havas ${count} kuponojn`
|
43
|
+
},
|
44
|
+
vanCouponList: {
|
45
|
+
exchange: "Inter\u015Dan\u011Di",
|
46
|
+
close: "Fermi",
|
47
|
+
enable: "Disponebla",
|
48
|
+
disabled: "Nedisponebla",
|
49
|
+
placeholder: "Kupon-kodo"
|
50
|
+
},
|
51
|
+
vanAddressEdit: {
|
52
|
+
area: "Areo",
|
53
|
+
areaEmpty: "Elektu ricevan areon",
|
54
|
+
addressEmpty: "La adreso ne povas esti malplena",
|
55
|
+
addressDetail: "Adreso",
|
56
|
+
defaultAddress: "Agordi kiel defa\u016Dltan adreson"
|
57
|
+
},
|
58
|
+
vanAddressList: {
|
59
|
+
add: "Aldoni novan adreson"
|
60
|
+
}
|
61
|
+
};
|
62
|
+
export {
|
63
|
+
stdin_default as default
|
64
|
+
};
|
package/es/locale/lang/it-IT.mjs
CHANGED
@@ -9,19 +9,19 @@ var stdin_default = {
|
|
9
9
|
noCoupon: "Nessun coupon",
|
10
10
|
nameEmpty: "Inserisci il nome",
|
11
11
|
addContact: "Aggiungi contatto",
|
12
|
-
telInvalid: "Numero di telefono
|
12
|
+
telInvalid: "Numero di telefono non valido",
|
13
13
|
vanCalendar: {
|
14
14
|
end: "Fine",
|
15
15
|
start: "Inizio",
|
16
16
|
title: "Calendario",
|
17
17
|
weekdays: [
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
18
|
+
"dom",
|
19
|
+
"lun",
|
20
|
+
"mar",
|
21
|
+
"mer",
|
22
|
+
"gio",
|
23
|
+
"ven",
|
24
|
+
"sab"
|
25
25
|
],
|
26
26
|
monthTitle: (year, month) => `${year}/${month}`,
|
27
27
|
rangePrompt: (maxRange) => `Scegli non pi\xF9 di ${maxRange} giorni`
|
@@ -31,11 +31,11 @@ var stdin_default = {
|
|
31
31
|
},
|
32
32
|
vanPagination: {
|
33
33
|
prev: "Precedente",
|
34
|
-
next: "
|
34
|
+
next: "Successivo"
|
35
35
|
},
|
36
36
|
vanPullRefresh: {
|
37
|
-
pulling: "
|
38
|
-
loosing: "
|
37
|
+
pulling: "Tira per aggiornare...",
|
38
|
+
loosing: "Rilascia per aggiornare..."
|
39
39
|
},
|
40
40
|
vanSubmitBar: {
|
41
41
|
label: "Totale:"
|
@@ -46,7 +46,7 @@ var stdin_default = {
|
|
46
46
|
condition: (condition) => `Almeno ${condition}`
|
47
47
|
},
|
48
48
|
vanCouponCell: {
|
49
|
-
title: "
|
49
|
+
title: "Coupon",
|
50
50
|
count: (count) => `Hai ${count} coupon`
|
51
51
|
},
|
52
52
|
vanCouponList: {
|
package/es/picker/Picker.mjs
CHANGED
@@ -82,9 +82,11 @@ var stdin_default = defineComponent({
|
|
82
82
|
}
|
83
83
|
});
|
84
84
|
}
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
nextTick(() => {
|
86
|
+
emit("change", extend({
|
87
|
+
columnIndex
|
88
|
+
}, getEventParams()));
|
89
|
+
});
|
88
90
|
};
|
89
91
|
const onClickOption = (currentOption, columnIndex) => emit("clickOption", extend({
|
90
92
|
columnIndex,
|
package/es/slider/Slider.d.ts
CHANGED
@@ -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" | "
|
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;
|
package/es/slider/Slider.mjs
CHANGED
@@ -34,7 +34,7 @@ var stdin_default = defineComponent({
|
|
34
34
|
let current;
|
35
35
|
let startValue;
|
36
36
|
const root = ref();
|
37
|
-
const slider = ref();
|
37
|
+
const slider = [ref(), ref()];
|
38
38
|
const dragStatus = ref();
|
39
39
|
const touch = useTouch();
|
40
40
|
const scope = computed(() => Number(props.max) - Number(props.min));
|
@@ -226,7 +226,7 @@ var stdin_default = defineComponent({
|
|
226
226
|
const renderButton = (index) => {
|
227
227
|
const current2 = typeof index === "number" ? props.modelValue[index] : props.modelValue;
|
228
228
|
return _createVNode("div", {
|
229
|
-
"ref": slider,
|
229
|
+
"ref": slider[index != null ? index : 0],
|
230
230
|
"role": "slider",
|
231
231
|
"class": getButtonClassName(index),
|
232
232
|
"tabindex": props.disabled ? void 0 : 0,
|
@@ -249,8 +249,10 @@ var stdin_default = defineComponent({
|
|
249
249
|
};
|
250
250
|
updateValue(props.modelValue);
|
251
251
|
useCustomFieldValue(() => props.modelValue);
|
252
|
-
|
253
|
-
|
252
|
+
slider.forEach((item) => {
|
253
|
+
useEventListener("touchmove", onTouchMove, {
|
254
|
+
target: item
|
255
|
+
});
|
254
256
|
});
|
255
257
|
return () => _createVNode("div", {
|
256
258
|
"ref": root,
|
package/es/slider/index.d.ts
CHANGED
@@ -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" | "
|
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;
|
package/es/swipe/Swipe.d.ts
CHANGED
@@ -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;
|
package/es/swipe/Swipe.mjs
CHANGED
@@ -24,7 +24,7 @@ const SWIPE_KEY = Symbol(name);
|
|
24
24
|
var stdin_default = defineComponent({
|
25
25
|
name,
|
26
26
|
props: swipeProps,
|
27
|
-
emits: ["change"],
|
27
|
+
emits: ["change", "dragStart", "dragEnd"],
|
28
28
|
setup(props, {
|
29
29
|
emit,
|
30
30
|
slots
|
@@ -39,6 +39,7 @@ var stdin_default = defineComponent({
|
|
39
39
|
active: 0,
|
40
40
|
swiping: false
|
41
41
|
});
|
42
|
+
let dragging = false;
|
42
43
|
const touch = useTouch();
|
43
44
|
const {
|
44
45
|
children,
|
@@ -209,9 +210,10 @@ var stdin_default = defineComponent({
|
|
209
210
|
const resize = () => initialize(state.active);
|
210
211
|
let touchStartTime;
|
211
212
|
const onTouchStart = (event) => {
|
212
|
-
if (!props.touchable)
|
213
|
+
if (!props.touchable || event.touches.length > 1)
|
213
214
|
return;
|
214
215
|
touch.start(event);
|
216
|
+
dragging = false;
|
215
217
|
touchStartTime = Date.now();
|
216
218
|
stopAutoplay();
|
217
219
|
correctPosition();
|
@@ -226,6 +228,10 @@ var stdin_default = defineComponent({
|
|
226
228
|
move({
|
227
229
|
offset: delta.value
|
228
230
|
});
|
231
|
+
if (!dragging) {
|
232
|
+
emit("dragStart");
|
233
|
+
dragging = true;
|
234
|
+
}
|
229
235
|
}
|
230
236
|
}
|
231
237
|
}
|
@@ -254,7 +260,9 @@ var stdin_default = defineComponent({
|
|
254
260
|
pace: 0
|
255
261
|
});
|
256
262
|
}
|
263
|
+
dragging = false;
|
257
264
|
state.swiping = false;
|
265
|
+
emit("dragEnd");
|
258
266
|
autoplay();
|
259
267
|
};
|
260
268
|
const swipeTo = (index, options = {}) => {
|
package/es/swipe/index.d.ts
CHANGED
@@ -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;
|