Comparing version 1.0.2 to 1.1.0
@@ -43,2 +43,4 @@ 'use strict'; | ||
var noop = function noop() {}; | ||
var Zarousel = function (_ref) { | ||
@@ -116,4 +118,6 @@ _inherits(Zarousel, _ref); | ||
var _this$props2 = _this.props, | ||
onChange = _this$props2.onChange, | ||
children = _this$props2.children, | ||
transitionDuration = _this$props2.transitionDuration; | ||
var indexActive = _this.state.indexActive; | ||
@@ -124,2 +128,3 @@ var len = children.length; | ||
} | ||
onChange(indexActive, _this.calcRealIndex(index)); | ||
_this.isSwiping = true; | ||
@@ -279,2 +284,3 @@ if (index < 0 || index > len - 1) { | ||
Zarousel.propTypes = { | ||
onChange: _propTypes2.default.func, | ||
autoPlay: _propTypes2.default.bool, | ||
@@ -289,2 +295,3 @@ autoPlayInterval: _propTypes2.default.number, | ||
Zarousel.defaultProps = { | ||
onChange: noop, | ||
autoPlay: false, | ||
@@ -291,0 +298,0 @@ autoPlayInterval: 3000, |
{ | ||
"name": "zarousel", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "A react component of carousel.", | ||
@@ -5,0 +5,0 @@ "main": "lib/Zarousel.js", |
@@ -19,3 +19,3 @@ # Zarousel | ||
import React from 'react'; | ||
import Zarousel from 'Zarousel'; | ||
import Zarousel from 'zarousel'; | ||
import 'zarousel/lib/zarousel.css'; | ||
@@ -58,1 +58,5 @@ | ||
sizeDot|object|{width: 10, height: 10}|size of dot | ||
swipeTo|function(index)|--|control zarousel by index of slide that is 0 based | ||
goPrev|function|--|swipe to previous slide of zarousel | ||
goNext|function|--|swipe to next slide of zarousel | ||
onChange|function(previousIndex, currentIndex)|noop|callback when zarousel is changed |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
18117
386
61
0