@lynx-example/lynx-ui-swiper 0.0.4 → 0.0.6
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/Basic/index.tsx +3 -3
- package/Basic/styles.css +1 -1
- package/BasicDynamic/index.tsx +66 -74
- package/BasicUpdateSize/index.tsx +65 -75
- package/Bounces/index.tsx +71 -55
- package/Bounces/styles.css +36 -27
- package/CHANGELOG.md +18 -0
- package/Common/Demo/styles.css +113 -0
- package/Custom/index.tsx +43 -41
- package/CustomScale/index.tsx +44 -42
- package/CustomTinder/index.tsx +2 -2
- package/CustomTinder/styles.css +1 -1
- package/DifferentHeight/Button.tsx +1 -29
- package/DifferentHeight/index.tsx +4 -4
- package/DifferentHeight/styles.css +1 -1
- package/Direction/index.tsx +97 -105
- package/EmptyDataBug/index.tsx +14 -13
- package/EmptyDataBug/styles.css +19 -12
- package/Indicator/index.tsx +56 -50
- package/Lazy/index.tsx +69 -65
- package/Loop/index.tsx +45 -42
- package/RTL/Button.tsx +1 -29
- package/RTL/index.tsx +74 -83
- package/RTLCustom/index.tsx +45 -43
- package/RTLLoop/Button.tsx +1 -29
- package/RTLLoop/index.tsx +57 -66
- package/RTLLoopLynxRTL/Button.tsx +1 -29
- package/RTLLoopLynxRTL/index.tsx +57 -66
- package/WithGap/Button.tsx +1 -29
- package/WithGap/index.tsx +57 -68
- package/dist/SwiperBasic.lynx.bundle +0 -0
- package/dist/SwiperBasic.web.bundle +1 -1
- package/dist/SwiperBasicDynamic.lynx.bundle +0 -0
- package/dist/SwiperBasicDynamic.web.bundle +1 -1
- package/dist/SwiperBasicUpdateSize.lynx.bundle +0 -0
- package/dist/SwiperBasicUpdateSize.web.bundle +1 -1
- package/dist/SwiperBounces.lynx.bundle +0 -0
- package/dist/SwiperBounces.web.bundle +1 -1
- package/dist/SwiperCustom.lynx.bundle +0 -0
- package/dist/SwiperCustom.web.bundle +1 -1
- package/dist/SwiperCustomScale.lynx.bundle +0 -0
- package/dist/SwiperCustomScale.web.bundle +1 -1
- package/dist/SwiperCustomTinder.lynx.bundle +0 -0
- package/dist/SwiperCustomTinder.web.bundle +1 -1
- package/dist/SwiperDifferentHeight.lynx.bundle +0 -0
- package/dist/SwiperDifferentHeight.web.bundle +1 -1
- package/dist/SwiperEmptyDataBug.lynx.bundle +0 -0
- package/dist/SwiperEmptyDataBug.web.bundle +1 -1
- package/dist/SwiperIndicator.lynx.bundle +0 -0
- package/dist/SwiperIndicator.web.bundle +1 -1
- package/dist/SwiperLazy.lynx.bundle +0 -0
- package/dist/SwiperLazy.web.bundle +1 -1
- package/dist/SwiperLoop.lynx.bundle +0 -0
- package/dist/SwiperLoop.web.bundle +1 -1
- package/dist/SwiperRTL.lynx.bundle +0 -0
- package/dist/SwiperRTL.web.bundle +1 -1
- package/dist/SwiperRTLCustom.lynx.bundle +0 -0
- package/dist/SwiperRTLCustom.web.bundle +1 -1
- package/dist/SwiperRTLLoop.lynx.bundle +0 -0
- package/dist/SwiperRTLLoop.web.bundle +1 -1
- package/dist/SwiperRTLLynxRTL.lynx.bundle +0 -0
- package/dist/SwiperRTLLynxRTL.web.bundle +1 -1
- package/dist/SwiperWithGap.lynx.bundle +0 -0
- package/dist/SwiperWithGap.web.bundle +1 -1
- package/package.json +6 -6
- package/BasicDynamic/styles.css +0 -47
- package/BasicUpdateSize/styles.css +0 -47
- package/Custom/styles.css +0 -47
- package/CustomScale/styles.css +0 -41
- package/Direction/styles.css +0 -41
- package/Indicator/styles.css +0 -41
- package/Lazy/styles.css +0 -41
- package/Loop/styles.css +0 -41
- package/RTL/styles.css +0 -41
- package/RTLCustom/styles.css +0 -41
- package/RTLLoop/styles.css +0 -41
- package/RTLLoopLynxRTL/styles.css +0 -41
- package/WithGap/styles.css +0 -47
package/EmptyDataBug/index.tsx
CHANGED
|
@@ -22,6 +22,7 @@ import type { SwiperRef } from '@lynx-js/lynx-ui'
|
|
|
22
22
|
import { Button } from '../Common/Button'
|
|
23
23
|
import { Card } from '../Common/Card'
|
|
24
24
|
|
|
25
|
+
import '../Common/Demo/styles.css'
|
|
25
26
|
import './styles.css'
|
|
26
27
|
|
|
27
28
|
const DEFAULT_DATA: number[] = [1, 2, 3, 4, 5]
|
|
@@ -101,9 +102,9 @@ function EmptyDataWithAutoPlay(): JSX.Element {
|
|
|
101
102
|
autoPlayInterval={2000}
|
|
102
103
|
modeConfig={{ align: 'center' }}
|
|
103
104
|
>
|
|
104
|
-
{({ index
|
|
105
|
-
<SwiperItem
|
|
106
|
-
<Card index={
|
|
105
|
+
{({ index }) => (
|
|
106
|
+
<SwiperItem>
|
|
107
|
+
<Card index={index} style={{ height: '200px' }} />
|
|
107
108
|
</SwiperItem>
|
|
108
109
|
)}
|
|
109
110
|
</Swiper>
|
|
@@ -186,9 +187,9 @@ function EmptyDataWithManualSwipe(): JSX.Element {
|
|
|
186
187
|
onSwipeStart={handleSwipeStart}
|
|
187
188
|
onSwipeStop={handleSwipeStop}
|
|
188
189
|
>
|
|
189
|
-
{({ index
|
|
190
|
-
<SwiperItem
|
|
191
|
-
<Card index={
|
|
190
|
+
{({ index }) => (
|
|
191
|
+
<SwiperItem>
|
|
192
|
+
<Card index={index} style={{ height: '200px' }} />
|
|
192
193
|
</SwiperItem>
|
|
193
194
|
)}
|
|
194
195
|
</Swiper>
|
|
@@ -263,9 +264,9 @@ function DataBecomesEmpty(): JSX.Element {
|
|
|
263
264
|
autoPlayInterval={3000}
|
|
264
265
|
modeConfig={{ align: 'center' }}
|
|
265
266
|
>
|
|
266
|
-
{({ index
|
|
267
|
-
<SwiperItem
|
|
268
|
-
<Card index={
|
|
267
|
+
{({ index }) => (
|
|
268
|
+
<SwiperItem>
|
|
269
|
+
<Card index={index} style={{ height: '200px' }} />
|
|
269
270
|
</SwiperItem>
|
|
270
271
|
)}
|
|
271
272
|
</Swiper>
|
|
@@ -329,9 +330,9 @@ function ResetWithCorruptedIndex(): JSX.Element {
|
|
|
329
330
|
autoPlay={false}
|
|
330
331
|
modeConfig={{ align: 'center' }}
|
|
331
332
|
>
|
|
332
|
-
{({ index
|
|
333
|
-
<SwiperItem
|
|
334
|
-
<Card index={
|
|
333
|
+
{({ index }) => (
|
|
334
|
+
<SwiperItem>
|
|
335
|
+
<Card index={index} style={{ height: '200px' }} />
|
|
335
336
|
</SwiperItem>
|
|
336
337
|
)}
|
|
337
338
|
</Swiper>
|
|
@@ -352,7 +353,7 @@ function ResetWithCorruptedIndex(): JSX.Element {
|
|
|
352
353
|
|
|
353
354
|
function EmptyDataBugExample(): JSX.Element {
|
|
354
355
|
return (
|
|
355
|
-
<scroll-view class='container' scroll-orientation='vertical'>
|
|
356
|
+
<scroll-view class='container lunaris-dark' scroll-orientation='vertical'>
|
|
356
357
|
<text class='main-title'>Empty Data Bug Reproduction</text>
|
|
357
358
|
<text class='main-description'>
|
|
358
359
|
These examples demonstrate the "calcBounceOffset: invalid offset" error
|
package/EmptyDataBug/styles.css
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
@import "@lynx-js/luna-styles/index.css";
|
|
2
|
+
|
|
1
3
|
.container {
|
|
4
|
+
background-color: var(--canvas);
|
|
2
5
|
width: 100%;
|
|
3
6
|
height: 100%;
|
|
4
7
|
padding: 16px;
|
|
@@ -7,14 +10,14 @@
|
|
|
7
10
|
|
|
8
11
|
.main-title {
|
|
9
12
|
font-size: 24px;
|
|
10
|
-
font-weight:
|
|
13
|
+
font-weight: 600;
|
|
11
14
|
margin-bottom: 8px;
|
|
12
|
-
color:
|
|
15
|
+
color: var(--content);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.main-description {
|
|
16
19
|
font-size: 14px;
|
|
17
|
-
color:
|
|
20
|
+
color: var(--content-muted);
|
|
18
21
|
margin-bottom: 24px;
|
|
19
22
|
line-height: 1.5;
|
|
20
23
|
}
|
|
@@ -22,20 +25,22 @@
|
|
|
22
25
|
.section {
|
|
23
26
|
margin-bottom: 32px;
|
|
24
27
|
padding: 16px;
|
|
25
|
-
background-color:
|
|
28
|
+
background-color: var(--neutral-ambient);
|
|
26
29
|
border-radius: 8px;
|
|
30
|
+
border-width: 1px;
|
|
31
|
+
border-color: var(--line);
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
.title {
|
|
30
35
|
font-size: 16px;
|
|
31
|
-
font-weight:
|
|
36
|
+
font-weight: 600;
|
|
32
37
|
margin-bottom: 8px;
|
|
33
|
-
color:
|
|
38
|
+
color: var(--content);
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
.description {
|
|
37
42
|
font-size: 12px;
|
|
38
|
-
color:
|
|
43
|
+
color: var(--content-muted);
|
|
39
44
|
margin-bottom: 16px;
|
|
40
45
|
line-height: 1.4;
|
|
41
46
|
}
|
|
@@ -53,23 +58,25 @@
|
|
|
53
58
|
gap: 4px;
|
|
54
59
|
margin-top: 12px;
|
|
55
60
|
padding: 8px;
|
|
56
|
-
background-color:
|
|
61
|
+
background-color: var(--canvas);
|
|
57
62
|
border-radius: 4px;
|
|
63
|
+
border-width: 1px;
|
|
64
|
+
border-color: var(--line);
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
.info text {
|
|
61
68
|
font-size: 12px;
|
|
62
|
-
color:
|
|
69
|
+
color: var(--content-muted);
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
.log-title {
|
|
66
|
-
font-weight:
|
|
73
|
+
font-weight: 600;
|
|
67
74
|
margin-top: 8px;
|
|
68
|
-
color:
|
|
75
|
+
color: var(--content);
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
.log-item {
|
|
72
79
|
font-size: 11px;
|
|
73
|
-
color:
|
|
80
|
+
color: var(--content-subtle);
|
|
74
81
|
padding-left: 8px;
|
|
75
82
|
}
|
package/Indicator/index.tsx
CHANGED
|
@@ -2,63 +2,69 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
import { root } from '@lynx-js/react'
|
|
5
|
+
import { root, useState } from '@lynx-js/react'
|
|
6
6
|
|
|
7
7
|
import { Swiper, SwiperItem } from '@lynx-js/lynx-ui'
|
|
8
8
|
|
|
9
|
-
import '
|
|
9
|
+
import { Card } from '../Common/Card'
|
|
10
|
+
import { Indicator } from '../Common/Indicator'
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
import '../Common/Demo/styles.css'
|
|
13
|
+
|
|
14
|
+
const itemArr: number[] = [1, 2, 3, 4]
|
|
12
15
|
|
|
13
16
|
function SwiperEntry() {
|
|
17
|
+
const [currentIndex, setCurrentIndex] = useState(0)
|
|
18
|
+
|
|
14
19
|
return (
|
|
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
|
-
|
|
20
|
+
<view className='demo-container lunaris-dark'>
|
|
21
|
+
<view className='top-area' />
|
|
22
|
+
<view className='content-area'>
|
|
23
|
+
<Swiper
|
|
24
|
+
data={itemArr}
|
|
25
|
+
itemWidth={300}
|
|
26
|
+
itemHeight={250}
|
|
27
|
+
containerWidth={lynx.__globalProps.screenWidth - 32
|
|
28
|
+
|| SystemInfo.pixelWidth / SystemInfo.pixelRatio - 32}
|
|
29
|
+
loop={false}
|
|
30
|
+
duration={500}
|
|
31
|
+
initialIndex={0}
|
|
32
|
+
mode='normal'
|
|
33
|
+
modeConfig={{
|
|
34
|
+
align: 'center',
|
|
35
|
+
spaceBetween: 16,
|
|
36
|
+
}}
|
|
37
|
+
bounceConfig={{
|
|
38
|
+
enable: true,
|
|
39
|
+
startBounceItemWidth: 100,
|
|
40
|
+
startBounceItem: (
|
|
41
|
+
<view className='bounce-item'>
|
|
42
|
+
<text className='bounce-item-text'>Start</text>
|
|
43
|
+
</view>
|
|
44
|
+
),
|
|
45
|
+
}}
|
|
46
|
+
onChange={setCurrentIndex}
|
|
47
|
+
style={{
|
|
48
|
+
overflow: 'visible',
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{({ index }) => (
|
|
52
|
+
<SwiperItem>
|
|
53
|
+
<Card
|
|
54
|
+
index={index}
|
|
55
|
+
style={{
|
|
56
|
+
height: '250px',
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
</SwiperItem>
|
|
60
|
+
)}
|
|
61
|
+
</Swiper>
|
|
62
|
+
<Indicator
|
|
63
|
+
current={currentIndex}
|
|
64
|
+
count={itemArr.length}
|
|
65
|
+
/>
|
|
66
|
+
</view>
|
|
67
|
+
</view>
|
|
62
68
|
)
|
|
63
69
|
}
|
|
64
70
|
|
package/Lazy/index.tsx
CHANGED
|
@@ -2,79 +2,83 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
import { root } from '@lynx-js/react'
|
|
5
|
+
import { root, useState } from '@lynx-js/react'
|
|
6
6
|
|
|
7
7
|
import { LazyComponent, Swiper, SwiperItem } from '@lynx-js/lynx-ui'
|
|
8
8
|
|
|
9
|
-
import '
|
|
9
|
+
import { Card } from '../Common/Card'
|
|
10
|
+
import { Indicator } from '../Common/Indicator'
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'yellow',
|
|
15
|
-
'purple',
|
|
16
|
-
'lightblue',
|
|
17
|
-
'lightgreen',
|
|
18
|
-
'lightyellow',
|
|
19
|
-
]
|
|
12
|
+
import '../Common/Demo/styles.css'
|
|
13
|
+
|
|
14
|
+
const itemArr: number[] = [1, 2, 3, 4, 5, 6, 7]
|
|
20
15
|
|
|
21
16
|
function SwiperEntry() {
|
|
17
|
+
const [currentIndex, setCurrentIndex] = useState(0)
|
|
18
|
+
|
|
22
19
|
return (
|
|
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
|
-
{({ item, index, realIndex }) => (
|
|
48
|
-
<SwiperItem index={index} key={realIndex} realIndex={realIndex}>
|
|
49
|
-
<LazyComponent
|
|
50
|
-
scene='scene'
|
|
51
|
-
pid={`pid_${realIndex}`}
|
|
52
|
-
estimatedStyle={{ width: '100%', height: '100%' }}
|
|
53
|
-
>
|
|
54
|
-
<view
|
|
55
|
-
class='block-view'
|
|
56
|
-
style={{
|
|
57
|
-
width: '100%',
|
|
58
|
-
height: '100%',
|
|
59
|
-
backgroundColor: item,
|
|
60
|
-
display: 'flex',
|
|
61
|
-
justifyContent: 'center',
|
|
62
|
-
alignItems: 'center',
|
|
63
|
-
}}
|
|
64
|
-
>
|
|
65
|
-
<view
|
|
66
|
-
style={{
|
|
67
|
-
backgroundColor: 'white',
|
|
68
|
-
width: '4px',
|
|
69
|
-
height: '4px',
|
|
70
|
-
}}
|
|
71
|
-
>
|
|
20
|
+
<view className='demo-container lunaris-dark'>
|
|
21
|
+
<view className='top-area' />
|
|
22
|
+
<view className='content-area'>
|
|
23
|
+
<Swiper
|
|
24
|
+
data={itemArr}
|
|
25
|
+
itemWidth={250}
|
|
26
|
+
itemHeight={250}
|
|
27
|
+
containerWidth={lynx.__globalProps.screenWidth - 32
|
|
28
|
+
|| SystemInfo.pixelWidth / SystemInfo.pixelRatio - 32}
|
|
29
|
+
loop={false}
|
|
30
|
+
duration={500}
|
|
31
|
+
initialIndex={0}
|
|
32
|
+
mode='normal'
|
|
33
|
+
modeConfig={{
|
|
34
|
+
align: 'start',
|
|
35
|
+
spaceBetween: 16,
|
|
36
|
+
}}
|
|
37
|
+
bounceConfig={{
|
|
38
|
+
enable: true,
|
|
39
|
+
startBounceItemWidth: 0,
|
|
40
|
+
endBounceItem: (
|
|
41
|
+
<view className='bounce-item'>
|
|
42
|
+
<text className='bounce-item-text'>Show More</text>
|
|
72
43
|
</view>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
44
|
+
),
|
|
45
|
+
onEndBounceItemBounce: ({ type }) => {
|
|
46
|
+
console.log('onBounce result', type)
|
|
47
|
+
},
|
|
48
|
+
}}
|
|
49
|
+
onChange={setCurrentIndex}
|
|
50
|
+
style={{
|
|
51
|
+
overflow: 'visible',
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
{({ index }) => (
|
|
55
|
+
<SwiperItem>
|
|
56
|
+
<LazyComponent
|
|
57
|
+
scene='scene'
|
|
58
|
+
pid={`pid_${index}`}
|
|
59
|
+
estimatedStyle={{ width: '100%', height: '100%' }}
|
|
60
|
+
>
|
|
61
|
+
<Card
|
|
62
|
+
index={index}
|
|
63
|
+
style={{
|
|
64
|
+
height: '250px',
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
</LazyComponent>
|
|
68
|
+
</SwiperItem>
|
|
69
|
+
)}
|
|
70
|
+
</Swiper>
|
|
71
|
+
<Indicator
|
|
72
|
+
current={currentIndex}
|
|
73
|
+
count={itemArr.length}
|
|
74
|
+
/>
|
|
75
|
+
</view>
|
|
76
|
+
<view className='demo-status'>
|
|
77
|
+
<text className='demo-status-text'>
|
|
78
|
+
Each slide body is mounted through LazyComponent.
|
|
79
|
+
</text>
|
|
80
|
+
</view>
|
|
81
|
+
</view>
|
|
78
82
|
)
|
|
79
83
|
}
|
|
80
84
|
|
package/Loop/index.tsx
CHANGED
|
@@ -6,9 +6,12 @@ import { root, useState } from '@lynx-js/react'
|
|
|
6
6
|
|
|
7
7
|
import { Swiper, SwiperItem } from '@lynx-js/lynx-ui'
|
|
8
8
|
|
|
9
|
-
import '
|
|
9
|
+
import { Card } from '../Common/Card'
|
|
10
|
+
import { Indicator } from '../Common/Indicator'
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
import '../Common/Demo/styles.css'
|
|
13
|
+
|
|
14
|
+
const itemArr: number[] = [1, 2, 3, 4]
|
|
12
15
|
|
|
13
16
|
function SwiperEntry() {
|
|
14
17
|
const [currentIndex, setCurrentIndex] = useState(0)
|
|
@@ -25,48 +28,48 @@ function SwiperEntry() {
|
|
|
25
28
|
containWidth,
|
|
26
29
|
)
|
|
27
30
|
return (
|
|
28
|
-
<view>
|
|
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
|
-
<view
|
|
31
|
+
<view className='demo-container lunaris-dark'>
|
|
32
|
+
<view className='top-area' />
|
|
33
|
+
<view className='content-area'>
|
|
34
|
+
<Swiper
|
|
35
|
+
data={itemArr}
|
|
36
|
+
itemWidth={itemWidth + SwiperItemGap}
|
|
37
|
+
itemHeight={250}
|
|
38
|
+
containerWidth={containWidth}
|
|
39
|
+
loop={true}
|
|
40
|
+
duration={500}
|
|
41
|
+
initialIndex={0}
|
|
42
|
+
mode='normal'
|
|
43
|
+
modeConfig={{
|
|
44
|
+
spaceBetween: SwiperItemGap,
|
|
45
|
+
}}
|
|
46
|
+
autoPlay={true}
|
|
47
|
+
onChange={setCurrentIndex}
|
|
48
|
+
experimentalHorizontalSwipeOnly={true}
|
|
49
|
+
style={{
|
|
50
|
+
overflow: 'visible',
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
{({ index }) => (
|
|
54
|
+
<SwiperItem>
|
|
55
|
+
<Card
|
|
56
|
+
index={index}
|
|
56
57
|
style={{
|
|
57
|
-
|
|
58
|
-
width: '4px',
|
|
59
|
-
height: '4px',
|
|
58
|
+
height: '250px',
|
|
60
59
|
}}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
/>
|
|
61
|
+
</SwiperItem>
|
|
62
|
+
)}
|
|
63
|
+
</Swiper>
|
|
64
|
+
<Indicator
|
|
65
|
+
current={currentIndex}
|
|
66
|
+
count={itemArr.length}
|
|
67
|
+
/>
|
|
68
|
+
</view>
|
|
69
|
+
<view className='demo-status'>
|
|
70
|
+
<text className='demo-status-text'>
|
|
71
|
+
Loop mode keeps autoplay continuous across the boundary.
|
|
72
|
+
</text>
|
|
70
73
|
</view>
|
|
71
74
|
</view>
|
|
72
75
|
)
|
package/RTL/Button.tsx
CHANGED
|
@@ -2,32 +2,4 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { Button as ButtonInner } from '@lynx-js/lynx-ui'
|
|
7
|
-
|
|
8
|
-
const ButtonStyle = {
|
|
9
|
-
border: '1px solid',
|
|
10
|
-
'border-radius': '4px',
|
|
11
|
-
width: '150px',
|
|
12
|
-
'background-color': 'red',
|
|
13
|
-
margin: '4px 8px',
|
|
14
|
-
padding: '4px 8px',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const ButtonTextStyle = {
|
|
18
|
-
color: 'white',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function Button(props: {
|
|
22
|
-
onClick: () => void
|
|
23
|
-
text: string
|
|
24
|
-
}) {
|
|
25
|
-
return (
|
|
26
|
-
<ButtonInner
|
|
27
|
-
style={ButtonStyle}
|
|
28
|
-
onClick={props.onClick}
|
|
29
|
-
>
|
|
30
|
-
<text style={ButtonTextStyle}>{props.text}</text>
|
|
31
|
-
</ButtonInner>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
5
|
+
export { Button } from '../Common/Button'
|