react-responsive-carousel
Advanced tools
Comparing version 3.0.22 to 3.0.23
@@ -5,3 +5,3 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
@@ -39,3 +39,4 @@ var React = require('react'); | ||
swipeScrollTolerance: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]), | ||
dynamicHeight: React.PropTypes.bool | ||
dynamicHeight: React.PropTypes.bool, | ||
emulateTouch: React.PropTypes.bool | ||
}, | ||
@@ -57,3 +58,4 @@ | ||
swipeScrollTolerance: 5, | ||
dynamicHeight: false | ||
dynamicHeight: false, | ||
emulateTouch: false | ||
}; | ||
@@ -185,2 +187,10 @@ }, | ||
handleClickItem: function handleClickItem(index, item) { | ||
if (this.state.cancelClick) { | ||
this.selectItem({ | ||
cancelClick: false | ||
}); | ||
return; | ||
} | ||
var handler = this.props.onClickItem; | ||
@@ -223,3 +233,4 @@ | ||
this.setState({ | ||
swiping: false | ||
swiping: false, | ||
cancelClick: true | ||
}); | ||
@@ -251,3 +262,3 @@ }, | ||
var position = currentPosition + 100 / (this.state.wrapperSize / handledDelta) + '%'; | ||
var position = currentPosition + 100 / (this.state.itemSize / handledDelta) + '%'; | ||
@@ -465,3 +476,3 @@ ['WebkitTransform', 'MozTransform', 'MsTransform', 'OTransform', 'transform', 'msTransform'].forEach(function (prop) { | ||
Swipe, | ||
_extends({ tagName: 'ul' }, swiperProps), | ||
_extends({ tagName: 'ul' }, swiperProps, { allowMouseEvents: this.props.emulateTouch }), | ||
this.renderItems() | ||
@@ -468,0 +479,0 @@ ) |
{ | ||
"name": "react-responsive-carousel", | ||
"version": "3.0.22", | ||
"version": "3.0.23", | ||
"description": "React Responsive Carousel", | ||
@@ -88,4 +88,4 @@ "author": { | ||
"classnames": "^2.2.5", | ||
"react-easy-swipe": "0.0.5" | ||
"react-easy-swipe": "0.0.8" | ||
} | ||
} |
@@ -25,3 +25,3 @@ # React Responsive Carousel | ||
return ( | ||
<Carousel axis="horizontal|vertical" showThumbs={true|false} showArrows={true|false} onChange={onChange} onClickItem={onClickItem} onClickThumb={onClickThumb}> | ||
<Carousel axis="horizontal|vertical" showThumbs={true|false} showArrows={true|false} onChange={onChange} onClickItem={onClickItem} onClickThumb={onClickThumb} dynamicHeight emulateTouch> | ||
<div> | ||
@@ -68,3 +68,4 @@ <img src="assets/1.jpeg" /> | ||
| swipeScrollTolerance | `number` | `5` | Allows scroll when the swipe movement occurs in a different direction than the carousel axis and within the tolerance - Increase for loose - Decrease for strict | | ||
| dynamicHeight | `boolean` | false | Adjusts the carousel height if required. -- Do not work with vertical axis -- | ||
| dynamicHeight | `boolean` | false | Adjusts the carousel height if required. -- Do not work with vertical axis -- | | ||
| emulateTouch | `boolean` | false | Allows mouse to simulate swipe | | ||
@@ -71,0 +72,0 @@ |
@@ -35,2 +35,7 @@ import React from 'react'; | ||
)) | ||
.add('emulate touch', () => ( | ||
<Carousel emulateTouch> | ||
{ baseChildren.props.children } | ||
</Carousel> | ||
)) | ||
.add('no arrows', () => ( | ||
@@ -37,0 +42,0 @@ <Carousel showArrows={false}> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
908347
1344
113
+ Addedreact-easy-swipe@0.0.8(transitive)
- Removedreact-easy-swipe@0.0.5(transitive)
Updatedreact-easy-swipe@0.0.8