-
Notifications
You must be signed in to change notification settings - Fork 389
Expand file tree
/
Copy pathswiper.js
More file actions
111 lines (109 loc) · 3.77 KB
/
swiper.js
File metadata and controls
111 lines (109 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
const TAG_NAME = 'swiper'
module.exports = function ({ print }) {
const aliPropLog = print({ platform: 'ali', tag: TAG_NAME, isError: false })
const baiduPropLog = print({ platform: 'baidu', tag: TAG_NAME, isError: false })
const baiduEventLog = print({ platform: 'baidu', tag: TAG_NAME, isError: false, type: 'event' })
const qqPropLog = print({ platform: 'qq', tag: TAG_NAME, isError: false })
const ttPropLog = print({ platform: 'bytedance', tag: TAG_NAME, isError: false })
const webPropLog = print({ platform: 'web', tag: TAG_NAME, isError: false })
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
const jdEventLog = print({ platform: 'jd', tag: TAG_NAME, isError: false, type: 'event' })
const jdPropLog = print({ platform: 'jd', tag: TAG_NAME, isError: false })
const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
const iosEventLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'event' })
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
return {
test: TAG_NAME,
web (tag, { el }) {
el.isBuiltIn = true
return 'mpx-swiper'
},
ios (tag, { el }) {
el.isBuiltIn = true
return 'mpx-swiper'
},
android (tag, { el }) {
el.isBuiltIn = true
return 'mpx-swiper'
},
harmony (tag, { el }) {
el.isBuiltIn = true
return 'mpx-swiper'
},
props: [
{
test: /^(display-multiple-items|skip-hidden-item-layout)$/,
ali: aliPropLog
},
{
test: /^(skip-hidden-item-layout|easing-function|snap-to-edge)$/,
swan: baiduPropLog
},
{
test: /^(easing-function)$/,
jd: jdPropLog
},
{
test: /^(easing-function|snap-to-edge)$/,
qq: qqPropLog
},
{
test: /^(skip-hidden-item-layout|easing-function)$/,
tt: ttPropLog
},
{
test: /^(previous-margin|next-margin|display-multiple-items|skip-hidden-item-layout)$/,
web: webPropLog
},
{
test: /^(snap-to-edge|easing-function)$/,
qa: qaPropLog
},
{
test: /^(snap-to-edge|easing-function)$/,
ios: iosPropLog,
android: androidPropLog,
harmony: harmonyPropLog
},
{
test: /^(snap-to-edge|previous-margin|next-margin|display-multiple-items|direction|layout-type|transformer-type|indicator-type|indicator-margin|indicator-spacing|indicator-radius|indicator-width|indicator-height|indicator-alignment|indicator-offset|scroll-with-animation|cache-extent)$/,
ks: ksPropLog
}
],
event: [
{
test: /^(change|animationfinish)$/,
ali (eventName) {
const eventMap = {
change: 'change',
animationfinish: 'animationEnd'
}
return eventMap[eventName]
}
},
{
test: /^(transition)$/,
swan: baiduEventLog,
jd: jdEventLog,
ios: iosEventLog,
android: androidEventLog,
harmony: harmonyEventLog
},
{
test: /^(animationfinish)$/,
ios: iosEventLog,
android: androidEventLog,
harmony: harmonyEventLog
},
{
test: /^(onscrollstart|onscrollupdate|onscrollend)$/,
ks: ksEventLog
}
]
}
}