react-multi-carousel
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -144,3 +144,3 @@ "use strict"; | ||
const { slidesToShow } = this.state; | ||
const { slidesToSlide } = this.props; | ||
const { slidesToSlide, infinite } = this.props; | ||
if (this.state.currentSlide + 1 + slidesToShow <= this.state.totalItems) { | ||
@@ -154,3 +154,5 @@ this.setState({ | ||
else { | ||
this.resetAllItems(); | ||
if (infinite) { | ||
this.resetAllItems(); | ||
} | ||
} | ||
@@ -160,3 +162,3 @@ } | ||
const { slidesToShow } = this.state; | ||
const { slidesToSlide } = this.props; | ||
const { slidesToSlide, infinite } = this.props; | ||
if (this.state.currentSlide - slidesToSlide >= 0) { | ||
@@ -170,7 +172,9 @@ this.setState({ | ||
else { | ||
this.setState({ | ||
transform: `translate3d(-${this.state.itemWidth * | ||
(this.state.totalItems - slidesToShow)}px,0,0)`, | ||
currentSlide: this.state.totalItems - slidesToShow | ||
}); | ||
if (infinite) { | ||
this.setState({ | ||
transform: `translate3d(-${this.state.itemWidth * | ||
(this.state.totalItems - slidesToShow)}px,0,0)`, | ||
currentSlide: this.state.totalItems - slidesToShow | ||
}); | ||
} | ||
} | ||
@@ -206,3 +210,3 @@ } | ||
return React.cloneElement(customLeftArrow, { | ||
onClick: disableLeftArrow ? () => { } : () => this.previous() | ||
onClick: () => this.previous() | ||
}); | ||
@@ -213,3 +217,3 @@ } | ||
// @ts-ignore | ||
style: style_1.leftArrowStyle, onClick: disableLeftArrow ? () => { } : () => this.previous() })); | ||
style: style_1.leftArrowStyle, onClick: () => this.previous() })); | ||
} | ||
@@ -220,3 +224,3 @@ }; | ||
return React.cloneElement(customRightArrow, { | ||
onClick: disableRightArrow ? () => { } : () => this.next() | ||
onClick: () => this.next() | ||
}); | ||
@@ -227,7 +231,7 @@ } | ||
// @ts-ignore | ||
style: style_1.rightArrowStyle, onClick: disableRightArrow ? () => { } : () => this.next() })); | ||
style: style_1.rightArrowStyle, onClick: () => this.next() })); | ||
} | ||
}; | ||
return (React.createElement("div", { className: containerClassName, style: style_1.containerStyle }, | ||
shouldShowArrows && React.createElement(LeftArrow, null), | ||
shouldShowArrows && !disableLeftArrow && React.createElement(LeftArrow, null), | ||
React.createElement("div", { className: contentClassName, style: style_1.contentStyle }, React.Children.toArray(children).map((child, index) => (React.createElement("div", { key: index, ref: this.itemRef, onMouseMove: this.handleMouseMove, onMouseDown: this.handleMouseDown, onMouseUp: this.handleMouseUp, onTouchStart: this.handleTouchStart, onTouchMove: this.handleTouchMove, onTouchEnd: this.handleTouchEnd, style: { | ||
@@ -238,3 +242,3 @@ transition: transition || "all 0.2s", | ||
}, className: itemClassName }, child)))), | ||
shouldShowArrows && React.createElement(RightArrow, null))); | ||
shouldShowArrows && !disableRightArrow && React.createElement(RightArrow, null))); | ||
} | ||
@@ -241,0 +245,0 @@ } |
{ | ||
"name": "react-multi-carousel", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
409
28597