@momo-kits/carousel 0.92.6-rc.9 → 0.92.8-beta.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/index.tsx +5 -8
- package/package.json +1 -1
- package/types.ts +2 -1
package/index.tsx
CHANGED
|
@@ -12,16 +12,13 @@ import {
|
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import {defaultScrollInterpolator} from './animation';
|
|
14
14
|
import {CarouselProps, CarouselRef, CarouselState, Position} from './types';
|
|
15
|
-
import {
|
|
15
|
+
import {scaleSize, Spacing} from '@momo-kits/foundation';
|
|
16
16
|
|
|
17
17
|
const IS_ANDROID = Platform.OS === 'android';
|
|
18
18
|
const IS_IOS = Platform.OS === 'ios';
|
|
19
19
|
const screenWidth = Dimensions.get('window').width;
|
|
20
20
|
|
|
21
|
-
class Carousel extends React.PureComponent<
|
|
22
|
-
CarouselProps,
|
|
23
|
-
CarouselState
|
|
24
|
-
> {
|
|
21
|
+
class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
|
|
25
22
|
static defaultProps = {
|
|
26
23
|
activeSlideAlignment: 'start',
|
|
27
24
|
activeSlideOffset: 20,
|
|
@@ -670,10 +667,8 @@ class Carousel extends React.PureComponent<
|
|
|
670
667
|
if (full) {
|
|
671
668
|
spacingStyle = {};
|
|
672
669
|
}
|
|
673
|
-
const accessibilityID = getAccessibilityID?.(`carousel_${index}`)
|
|
674
670
|
return (
|
|
675
671
|
<Component
|
|
676
|
-
{...accessibilityID}
|
|
677
672
|
style={[
|
|
678
673
|
mainDimension,
|
|
679
674
|
slideStyle,
|
|
@@ -765,6 +760,7 @@ class Carousel extends React.PureComponent<
|
|
|
765
760
|
style,
|
|
766
761
|
disableIntervalMomentum,
|
|
767
762
|
enableSnap,
|
|
763
|
+
contentContainerStyle,
|
|
768
764
|
} = this.props;
|
|
769
765
|
const {hideCarousel, containerWidth} = this.state;
|
|
770
766
|
|
|
@@ -805,6 +801,7 @@ class Carousel extends React.PureComponent<
|
|
|
805
801
|
]}
|
|
806
802
|
automaticallyAdjustContentInsets={false}
|
|
807
803
|
directionalLockEnabled
|
|
804
|
+
contentContainerStyle={contentContainerStyle}
|
|
808
805
|
disableScrollViewPanResponder={false}
|
|
809
806
|
pinchGestureEnabled={false}
|
|
810
807
|
scrollsToTop={false}
|
|
@@ -827,5 +824,5 @@ class Carousel extends React.PureComponent<
|
|
|
827
824
|
}
|
|
828
825
|
}
|
|
829
826
|
|
|
830
|
-
export {Carousel}
|
|
827
|
+
export {Carousel};
|
|
831
828
|
export type {CarouselProps, CarouselRef};
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {NativeScrollEvent, NativeSyntheticEvent, ViewStyle} from 'react-native';
|
|
1
|
+
import {NativeScrollEvent, NativeSyntheticEvent, StyleProp, ViewStyle} from 'react-native';
|
|
2
2
|
|
|
3
3
|
export type CarouselProps = {
|
|
4
4
|
activeSlideOffset?: number;
|
|
@@ -34,6 +34,7 @@ export type CarouselProps = {
|
|
|
34
34
|
) => {length: number; offset: number; index: number};
|
|
35
35
|
style?: ViewStyle;
|
|
36
36
|
visibleItem?: number;
|
|
37
|
+
contentContainerStyle?: StyleProp<ViewStyle>
|
|
37
38
|
full?: boolean;
|
|
38
39
|
};
|
|
39
40
|
|