@adactive/arc-carousel-asia
Advanced tools
Comparing version 2.2.5 to 2.3.0
{ | ||
"name": "@adactive/arc-carousel-asia", | ||
"version": "2.2.5", | ||
"version": "2.3.0", | ||
"description": "Adsum Carousel Component", | ||
"main": "index.js", | ||
"author": "Stanley Ong <stanley.ong@adactive.com>", | ||
"contributors": [ | ||
"Erlanda Zakaria <erlandazakaria@gmail.com>" | ||
], | ||
"license": "UNLISENCED", | ||
@@ -8,0 +11,0 @@ "readmeFilename": "README.md", |
@@ -56,3 +56,5 @@ # Carousel component | ||
adaptiveHeight: true, | ||
wrapAround: true | ||
wrapAround: true, | ||
autoSlide: false, | ||
autoSlideInterval: 10000, | ||
} | ||
@@ -75,3 +77,7 @@ }; | ||
**autoSlide** -> Slider Looping in Boolean | ||
**autoSlideInterval** -> Slider Looping Interval in ms | ||
## Copy component inside your project src folder | ||
@@ -78,0 +84,0 @@ |
@@ -53,2 +53,4 @@ // @flow | ||
ButtonModalForImage: null, | ||
autoSlide: false, | ||
autoSlideInterval: 10000, | ||
}; | ||
@@ -70,3 +72,5 @@ | ||
autoPlayInterval: 10000, | ||
setTimeoutSlide: null, | ||
}; | ||
} | ||
@@ -80,3 +84,2 @@ | ||
const { autoplay, autoPlayInterval } = this.state; | ||
if (this._videoPlayers[0]) { | ||
@@ -146,6 +149,20 @@ this.playVideo(0); | ||
slideDidChange(id: number | string) { | ||
const { isOpen } = this.props; | ||
const { isOpen, autoSlide, autoSlideInterval } = this.props; | ||
const { setTimeoutSlide } = this.state; | ||
console.log(this.carousel.currentSlide) | ||
if(autoSlide){ | ||
if(setTimeoutSlide!==null) {clearTimeout(setTimeoutSlide)}; | ||
if(id === (this.carousel.state.slideCount-1)){ | ||
this.setState({ | ||
setTimeoutSlide: setTimeout(() => { this.carousel.goToSlide(0); }, autoSlideInterval), | ||
}) | ||
} else { | ||
this.setState({ | ||
setTimeoutSlide: setTimeout(() => { this.carousel.goToSlide(id+1); }, autoSlideInterval), | ||
}) | ||
} | ||
} | ||
if (!isOpen) return; | ||
@@ -177,9 +194,2 @@ | ||
// goAuto() { | ||
// if(this.carousel.currentSlide < this.carousel.slideCount){ | ||
// setTimeout(function(){ this.carousel.goToNextSlide(); }, 3000); | ||
// } | ||
// } | ||
/** | ||
@@ -256,3 +266,2 @@ * Create carousel slides content images or videos | ||
const { autoplay, autoPlayInterval } = this.state; | ||
if (!isOpen) return null; | ||
@@ -274,3 +283,2 @@ | ||
{this.generateSlides()} | ||
{/* {this.goAuto()} */} | ||
</Carousel> | ||
@@ -277,0 +285,0 @@ </div> |
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
22107
526
88