@momo-kits/carousel 0.80.1-beta.2 → 0.80.4-beta.2
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/animation.ts +18 -6
- package/index.tsx +154 -301
- package/package.json +1 -1
- package/types.ts +19 -34
- package/newCarousel.tsx +0 -1041
package/types.ts
CHANGED
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
import {NativeScrollEvent, NativeSyntheticEvent, ViewStyle} from 'react-native';
|
|
2
2
|
|
|
3
3
|
export type CarouselProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
inactiveSlideShift: number;
|
|
19
|
-
layout: 'default' | 'stack' | 'tinder'; // Assuming these are the only valid values
|
|
20
|
-
loop: boolean;
|
|
21
|
-
loopClonesPerSide: number;
|
|
22
|
-
scrollEnabled: boolean;
|
|
23
|
-
slideStyle: object;
|
|
24
|
-
shouldOptimizeUpdates: boolean;
|
|
25
|
-
useScrollView: boolean;
|
|
26
|
-
vertical: boolean;
|
|
27
|
-
isCustomScrollWidth: boolean;
|
|
28
|
-
disableIntervalMomentum: boolean;
|
|
29
|
-
useExperimentalSnap: boolean;
|
|
4
|
+
activeSlideOffset?: number;
|
|
5
|
+
apparitionDelay?: number;
|
|
6
|
+
autoplay?: boolean;
|
|
7
|
+
autoplayDelay?: number;
|
|
8
|
+
autoplayInterval?: number;
|
|
9
|
+
enableSnap?: boolean;
|
|
10
|
+
firstItem?: number;
|
|
11
|
+
inactiveSlideOpacity?: number;
|
|
12
|
+
inactiveSlideScale?: number;
|
|
13
|
+
loop?: boolean;
|
|
14
|
+
loopClonesPerSide?: number;
|
|
15
|
+
scrollEnabled?: boolean;
|
|
16
|
+
slideStyle?: object;
|
|
17
|
+
disableIntervalMomentum?: boolean;
|
|
30
18
|
itemWidth?: number;
|
|
31
|
-
itemHeight?: number;
|
|
32
|
-
sliderWidth?: number;
|
|
33
|
-
sliderHeight?: number;
|
|
34
19
|
data: any[];
|
|
35
20
|
renderItem: (info: {item: any; index: number}) => React.ReactNode;
|
|
36
21
|
onScroll?: any;
|
|
@@ -43,16 +28,12 @@ export type CarouselProps = {
|
|
|
43
28
|
) => void;
|
|
44
29
|
onLayout?: (event: any) => void;
|
|
45
30
|
keyExtractor?: (item: any, index: number) => string;
|
|
46
|
-
CellRendererComponent?: React.ComponentType<any>;
|
|
47
31
|
getItemLayout?: (
|
|
48
32
|
data: any,
|
|
49
33
|
index: number,
|
|
50
34
|
) => {length: number; offset: number; index: number};
|
|
51
|
-
scrollInterpolator: any;
|
|
52
|
-
slideInterpolatedStyle: any;
|
|
53
|
-
layoutCardOffset?: number;
|
|
54
35
|
style?: ViewStyle;
|
|
55
|
-
visibleItem
|
|
36
|
+
visibleItem?: number;
|
|
56
37
|
};
|
|
57
38
|
|
|
58
39
|
export type CarouselRef = {
|
|
@@ -63,12 +44,16 @@ export type CarouselRef = {
|
|
|
63
44
|
) => void;
|
|
64
45
|
snapToNext: (animated?: boolean, fireCallback?: boolean) => void;
|
|
65
46
|
snapToPrev: (animated?: boolean, fireCallback?: boolean) => void;
|
|
47
|
+
startAutoplay: () => void;
|
|
48
|
+
pauseAutoplay: () => void;
|
|
49
|
+
stopAutoplay: () => void;
|
|
66
50
|
};
|
|
67
51
|
|
|
68
52
|
export type CarouselState = {
|
|
69
53
|
hideCarousel: boolean;
|
|
70
54
|
interpolators: any;
|
|
71
55
|
containerWidth: number;
|
|
56
|
+
itemWidth: number;
|
|
72
57
|
};
|
|
73
58
|
|
|
74
59
|
export type Position = {
|