@momo-kits/carousel 0.92.21-rc.5 → 0.92.34
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 +6 -6
- package/package.json +1 -1
- package/publish.sh +1 -2
package/index.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import {defaultAnimatedStyles, defaultScrollInterpolator} from './animation';
|
|
14
14
|
import {CarouselProps, CarouselRef, CarouselState, Position} from './types';
|
|
15
|
-
import {
|
|
15
|
+
import {Spacing} from '@momo-kits/foundation';
|
|
16
16
|
|
|
17
17
|
const IS_ANDROID = Platform.OS === 'android';
|
|
18
18
|
const IS_IOS = Platform.OS === 'ios';
|
|
@@ -574,9 +574,7 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
|
|
|
574
574
|
this.props.visibleItem === 1
|
|
575
575
|
? screenWidth - Spacing.M * 2
|
|
576
576
|
: Math.ceil(
|
|
577
|
-
|
|
578
|
-
(containerWidth * 0.9 - visibleItem * Spacing.S) / visibleItem
|
|
579
|
-
)
|
|
577
|
+
(containerWidth * 0.9 - visibleItem * Spacing.S) / visibleItem
|
|
580
578
|
);
|
|
581
579
|
if (this.props.itemWidth) {
|
|
582
580
|
itemWidth = this.props.itemWidth;
|
|
@@ -668,7 +666,7 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
|
|
|
668
666
|
if (full) {
|
|
669
667
|
spacingStyle = {};
|
|
670
668
|
}
|
|
671
|
-
const animatedStyle = defaultAnimatedStyles(animatedValue,this.props)
|
|
669
|
+
const animatedStyle = defaultAnimatedStyles(animatedValue, this.props);
|
|
672
670
|
return (
|
|
673
671
|
<Component
|
|
674
672
|
style={[
|
|
@@ -791,7 +789,9 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
|
|
|
791
789
|
{...specificProps}
|
|
792
790
|
ref={c => (this._carouselRef = c)}
|
|
793
791
|
overScrollMode={'never'}
|
|
794
|
-
snapToInterval={
|
|
792
|
+
snapToInterval={
|
|
793
|
+
this.props.snapToInterval ? this.props.snapToInterval : snapToInterval
|
|
794
|
+
}
|
|
795
795
|
disableIntervalMomentum={disableIntervalMomentum}
|
|
796
796
|
pointerEvents={hideCarousel ? 'none' : 'auto'}
|
|
797
797
|
decelerationRate={'fast'}
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
@@ -11,8 +11,7 @@ if [ "$1" == "stable" ]; then
|
|
|
11
11
|
npm version patch
|
|
12
12
|
npm publish --tag stable --access=public
|
|
13
13
|
elif [ "$1" == "latest" ]; then
|
|
14
|
-
npm version $(npm view @momo-kits/foundation@
|
|
15
|
-
npm version prerelease --preid=rc
|
|
14
|
+
npm version $(npm view @momo-kits/foundation@stable version)
|
|
16
15
|
npm publish --tag latest --access=public
|
|
17
16
|
else
|
|
18
17
|
npm version $(npm view @momo-kits/carousel@beta version)
|