Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-multi-carousel

Package Overview
Dependencies
Maintainers
1
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-multi-carousel - npm Package Compare versions

Comparing version 1.4.5 to 1.4.6

44

CHANGELOG.md

@@ -7,2 +7,24 @@ ### Changelog

#### [v1.4.5](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.4.4...v1.4.5)
> 19 June 2019
- Reduce one extra re-rendering [`617d200`](https://github.com/YIZHUANG/react-multi-carousel/commit/617d200c643e841ef74fb9d7b4341a7678660514)
#### [v1.4.4](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.4.3...v1.4.4)
> 18 June 2019
- Fix CustomDot component's react key warning [`#26`](https://github.com/YIZHUANG/react-multi-carousel/pull/26)
- Fixed test [`1f96f7e`](https://github.com/YIZHUANG/react-multi-carousel/commit/1f96f7e9ba0773014ec28cd42498f2eb51941c05)
- Change slideIndex to index [`49a4de6`](https://github.com/YIZHUANG/react-multi-carousel/commit/49a4de661afd413c5252c136d9b1821aa9e87012)
#### [v1.4.3](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.4.2...v1.4.3)
> 9 June 2019
- Clean up codes [`0291122`](https://github.com/YIZHUANG/react-multi-carousel/commit/0291122cf5a7ea3e021c587aa60295fdb4c1fbd7)
- Update changelog [`f604fef`](https://github.com/YIZHUANG/react-multi-carousel/commit/f604fef3fb57648e47a7f58407f1a817c9ae4331)
- Prevent rendering carousel items on client side before dom is ready [`dbb24d1`](https://github.com/YIZHUANG/react-multi-carousel/commit/dbb24d18a57edba8ed729289073ea57f0c53d162)
#### [v1.4.2](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.4.1...v1.4.2)

@@ -27,14 +49,14 @@

#### [v1.4.0](https://github.com/YIZHUANG/react-multi-carousel/compare/1.3.21...v1.4.0)
#### [1.4.0](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.4.0...1.4.0)
> 11 May 2019
- Minify the codes [`408d4d9`](https://github.com/YIZHUANG/react-multi-carousel/commit/408d4d91651fa27f3fc8bc63bc0762992004a7db)
- Change naming of lastPosition to lastX [`fc0d144`](https://github.com/YIZHUANG/react-multi-carousel/commit/fc0d14499384e66251c94422839b91938ea1c9ff)
- Put uglify-js back in dev dependency [`da3363d`](https://github.com/YIZHUANG/react-multi-carousel/commit/da3363d8f75f1b53d254f27e46d3c06dc4fa6c75)
#### [1.4.0](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.4.0...1.4.0)
#### [v1.4.0](https://github.com/YIZHUANG/react-multi-carousel/compare/1.3.21...v1.4.0)
> 11 May 2019
- Put uglify-js back in dev dependency [`da3363d`](https://github.com/YIZHUANG/react-multi-carousel/commit/da3363d8f75f1b53d254f27e46d3c06dc4fa6c75)
- Minify the codes [`408d4d9`](https://github.com/YIZHUANG/react-multi-carousel/commit/408d4d91651fa27f3fc8bc63bc0762992004a7db)
- Change naming of lastPosition to lastX [`fc0d144`](https://github.com/YIZHUANG/react-multi-carousel/commit/fc0d14499384e66251c94422839b91938ea1c9ff)

@@ -257,2 +279,8 @@ #### [1.3.21](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.3.21...1.3.21)

#### [1.2.4](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.2.4...1.2.4)
> 26 March 2019
- Update storybook [`a103f68`](https://github.com/YIZHUANG/react-multi-carousel/commit/a103f68fa1854e286cbbfa7d5fdbe24d303b0d7b)
#### [v1.2.4](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.2.3...v1.2.4)

@@ -266,8 +294,2 @@

#### [1.2.4](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.2.4...1.2.4)
> 26 March 2019
- Update storybook [`a103f68`](https://github.com/YIZHUANG/react-multi-carousel/commit/a103f68fa1854e286cbbfa7d5fdbe24d303b0d7b)
#### [v1.2.3](https://github.com/YIZHUANG/react-multi-carousel/compare/v1.2.2...v1.2.3)

@@ -274,0 +296,0 @@

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),LeftArrow=function(_a){var customLeftArrow=_a.customLeftArrow,getState=_a.getState,previous=_a.previous;return customLeftArrow?React.cloneElement(customLeftArrow,{onClick:function(){return previous()},carouselState:getState()}):React.createElement("button",{className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--left",onClick:function(){return previous()}})};exports.LeftArrow=LeftArrow;var RightArrow=function(_a){var customRightArrow=_a.customRightArrow,next=_a.next,getState=_a.getState;return customRightArrow?React.cloneElement(customRightArrow,{onClick:function(){return next()},carouselState:getState()}):React.createElement("button",{className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--right",onClick:function(){return next()}})};exports.RightArrow=RightArrow;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),LeftArrow=function(e){var t=e.customLeftArrow,r=e.getState,o=e.previous;return t?React.cloneElement(t,{onClick:function(){return o()},carouselState:r()}):React.createElement("button",{className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--left",onClick:function(){return o()}})};exports.LeftArrow=LeftArrow;var RightArrow=function(e){var t=e.customRightArrow,r=e.next,o=e.getState;return t?React.cloneElement(t,{onClick:function(){return r()},carouselState:o()}):React.createElement("button",{className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--right",onClick:function(){return r()}})};exports.RightArrow=RightArrow;

@@ -1,1 +0,1 @@

"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)};return function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),utils_1=require("./utils"),Dots_1=require("./Dots"),Arrows_1=require("./Arrows"),CarouselItems_1=require("./CarouselItems"),defaultTransitionDuration=400,defaultTransition="transform 400ms ease-in-out",Carousel=function(_super){function Carousel(props){var _this=_super.call(this,props)||this;return _this.containerRef=React.createRef(),_this.state={itemWidth:0,slidesToShow:0,currentSlide:0,clones:React.Children.toArray(props.children),totalItems:React.Children.count(props.children),deviceType:"",domLoaded:!1,transform:0,containerWidth:0},_this.onResize=_this.onResize.bind(_this),_this.handleDown=_this.handleDown.bind(_this),_this.handleMove=_this.handleMove.bind(_this),_this.handleOut=_this.handleOut.bind(_this),_this.onKeyUp=_this.onKeyUp.bind(_this),_this.handleEnter=_this.handleEnter.bind(_this),_this.setIsInThrottle=_this.setIsInThrottle.bind(_this),_this.next=utils_1.throttle(_this.next.bind(_this),props.transitionDuration||defaultTransitionDuration,_this.setIsInThrottle),_this.previous=utils_1.throttle(_this.previous.bind(_this),props.transitionDuration||defaultTransitionDuration,_this.setIsInThrottle),_this.goToSlide=utils_1.throttle(_this.goToSlide.bind(_this),props.transitionDuration||defaultTransitionDuration,_this.setIsInThrottle),_this.onMove=!1,_this.initialX=0,_this.lastX=0,_this.isAnimationAllowed=!1,_this.direction="",_this.initialY=0,_this.isInThrottle=!1,_this}return __extends(Carousel,_super),Carousel.prototype.setIsInThrottle=function(isInThrottle){void 0===isInThrottle&&(isInThrottle=!1),this.isInThrottle=isInThrottle},Carousel.prototype.componentDidMount=function(){this.setState({domLoaded:!0}),this.setItemsToShow(),window.addEventListener("resize",this.onResize),this.onResize(!0),this.props.keyBoardControl&&window.addEventListener("keyup",this.onKeyUp),this.props.autoPlay&&this.props.autoPlaySpeed&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed))},Carousel.prototype.setClones=function(slidesToShow,itemWidth,forResizing){var _this=this;this.isAnimationAllowed=!1;var childrenArr=React.Children.toArray(this.props.children),_a=utils_1.getClones(this.state.slidesToShow,childrenArr),clones=_a.clones,initialSlide=_a.initialSlide;utils_1.notEnoughChildren(this.state,this.props,slidesToShow)||this.setState({clones:clones,totalItems:clones.length,currentSlide:forResizing?this.state.currentSlide:initialSlide},function(){_this.correctItemsPosition(itemWidth||_this.state.itemWidth)})},Carousel.prototype.setItemsToShow=function(shouldCorrectItemPosition){var _this=this,responsive=this.props.responsive;Object.keys(responsive).forEach(function(item){var _a=responsive[item],breakpoint=_a.breakpoint,items=_a.items,max=breakpoint.max,min=breakpoint.min;window.innerWidth>=min&&window.innerWidth<=max&&(_this.setState({slidesToShow:items,deviceType:item}),_this.setContainerAndItemWidth(items,shouldCorrectItemPosition))})},Carousel.prototype.setContainerAndItemWidth=function(slidesToShow,shouldCorrectItemPosition){var _this=this;if(this.containerRef&&this.containerRef.current){var containerWidth=this.containerRef.current.offsetWidth,itemWidth_1=utils_1.getItemClientSideWidth(this.props,slidesToShow,containerWidth);this.setState({containerWidth:containerWidth,itemWidth:itemWidth_1},function(){_this.props.infinite&&_this.setClones(slidesToShow,itemWidth_1,shouldCorrectItemPosition)}),shouldCorrectItemPosition&&this.correctItemsPosition(itemWidth_1)}},Carousel.prototype.correctItemsPosition=function(itemWidth,isAnimationAllowed){isAnimationAllowed&&(this.isAnimationAllowed=!0),!isAnimationAllowed&&this.isAnimationAllowed&&(this.isAnimationAllowed=!1),this.setState({transform:-itemWidth*this.state.currentSlide})},Carousel.prototype.onResize=function(value){var shouldCorrectItemPosition;shouldCorrectItemPosition=!!this.props.infinite&&("boolean"!=typeof value||!value),this.setItemsToShow(shouldCorrectItemPosition)},Carousel.prototype.componentDidUpdate=function(_a,_b){var _this=this,keyBoardControl=_a.keyBoardControl,autoPlay=_a.autoPlay,containerWidth=_b.containerWidth,domLoaded=_b.domLoaded;this.containerRef&&this.containerRef.current&&this.containerRef.current.offsetWidth!==containerWidth&&setTimeout(function(){_this.setItemsToShow(!0)},this.props.transitionDuration||defaultTransitionDuration),keyBoardControl&&!this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),autoPlay&&!this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),autoPlay||!this.props.autoPlay||this.autoPlay||(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed)),this.props.infinite&&this.correctClonesPosition({domLoaded:domLoaded})},Carousel.prototype.correctClonesPosition=function(_a){var _this=this,domLoaded=_a.domLoaded,childrenArr=React.Children.toArray(this.props.children),_b=utils_1.checkClonesPosition(this.state,childrenArr,this.props),isReachingTheEnd=_b.isReachingTheEnd,isReachingTheStart=_b.isReachingTheStart,nextSlide=_b.nextSlide,nextPosition=_b.nextPosition;this.state.domLoaded&&domLoaded&&(isReachingTheEnd||isReachingTheStart)&&(this.isAnimationAllowed=!1,setTimeout(function(){_this.setState({transform:nextPosition,currentSlide:nextSlide})},this.props.transitionDuration||defaultTransitionDuration))},Carousel.prototype.next=function(slidesHavePassed){var _this=this;void 0===slidesHavePassed&&(slidesHavePassed=0);var _a=this.props,afterChange=_a.afterChange,beforeChange=_a.beforeChange;if(!utils_1.notEnoughChildren(this.state,this.props)){var _b=utils_1.populateNextSlides(this.state,this.props,slidesHavePassed),nextSlides=_b.nextSlides,nextPosition=_b.nextPosition,previousSlide=this.state.currentSlide;void 0!==nextSlides&&void 0!==nextPosition&&("function"==typeof beforeChange&&beforeChange(nextSlides,this.getState()),this.isAnimationAllowed=!0,this.setState({transform:nextPosition,currentSlide:nextSlides},function(){"function"==typeof afterChange&&setTimeout(function(){afterChange(previousSlide,_this.getState())},_this.props.transitionDuration||defaultTransitionDuration)}))}},Carousel.prototype.previous=function(slidesHavePassed){var _this=this;void 0===slidesHavePassed&&(slidesHavePassed=0);var _a=this.props,afterChange=_a.afterChange,beforeChange=_a.beforeChange;if(!utils_1.notEnoughChildren(this.state,this.props)){var _b=utils_1.populatePreviousSlides(this.state,this.props,slidesHavePassed),nextSlides=_b.nextSlides,nextPosition=_b.nextPosition;if(void 0!==nextSlides&&void 0!==nextPosition){var previousSlide=this.state.currentSlide;"function"==typeof beforeChange&&beforeChange(nextSlides,this.getState()),this.isAnimationAllowed=!0,this.setState({transform:nextPosition,currentSlide:nextSlides},function(){"function"==typeof afterChange&&setTimeout(function(){afterChange(previousSlide,_this.getState())},_this.props.transitionDuration||defaultTransitionDuration)})}}},Carousel.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.onResize),this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},Carousel.prototype.resetMoveStatus=function(){this.onMove=!1,this.initialX=0,this.lastX=0,this.direction="",this.initialY=0},Carousel.prototype.handleDown=function(e){if(!(e.touches&&!this.props.swipeable||!e.touches&&!this.props.draggable||this.isInThrottle)){var _a=e.touches?e.touches[0]:e,clientX=_a.clientX,clientY=_a.clientY;this.onMove=!0,this.initialX=clientX,this.initialY=clientY,this.lastX=clientX,this.isAnimationAllowed=!1}},Carousel.prototype.handleMove=function(e){if(!(e.touches&&!this.props.swipeable||e&&!e.touches&&!this.props.draggable||utils_1.notEnoughChildren(this.state,this.props))){var _a=e.touches?e.touches[0]:e,clientX=_a.clientX,clientY=_a.clientY,diffX=this.initialX-clientX,diffY=this.initialY-clientY;if(e.touches&&this.autoPlay&&this.props.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),this.onMove){if(!(Math.abs(diffX)>Math.abs(diffY)))return;var _b=utils_1.populateSlidesOnMouseTouchMove(this.state,this.props,this.initialX,this.lastX,clientX),direction=_b.direction,nextPosition=_b.nextPosition,canContinue=_b.canContinue;direction&&(this.direction=direction,canContinue&&void 0!==nextPosition&&this.setState({transform:nextPosition})),this.lastX=clientX}}},Carousel.prototype.handleOut=function(e){this.props.autoPlay&&!this.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed));var shouldDisableOnMobile="touchend"===e.type&&!this.props.swipeable,shouldDisableOnDesktop=("mouseleave"===e.type||"mouseup"===e.type)&&!this.props.draggable;if(!shouldDisableOnMobile&&!shouldDisableOnDesktop&&this.onMove){if("right"===this.direction)if(this.initialX-this.lastX>=this.props.minimumTouchDrag){var slidesHavePassed=Math.round((this.initialX-this.lastX)/this.state.itemWidth);this.next(slidesHavePassed)}else this.correctItemsPosition(this.state.itemWidth,!0);if("left"===this.direction)if(this.lastX-this.initialX>this.props.minimumTouchDrag){slidesHavePassed=Math.round((this.lastX-this.initialX)/this.state.itemWidth);this.previous(slidesHavePassed)}else this.correctItemsPosition(this.state.itemWidth,!0);this.resetMoveStatus()}},Carousel.prototype.onKeyUp=function(e){switch(e.keyCode){case 37:return this.previous();case 39:return this.next()}},Carousel.prototype.handleEnter=function(){this.autoPlay&&this.props.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},Carousel.prototype.goToSlide=function(slide){var _this=this;if(!this.isInThrottle){var itemWidth=this.state.itemWidth,_a=this.props,afterChange=_a.afterChange,beforeChange=_a.beforeChange,previousSlide=this.state.currentSlide;"function"==typeof beforeChange&&beforeChange(slide,this.getState()),this.isAnimationAllowed=!0,this.setState({currentSlide:slide,transform:-itemWidth*slide},function(){_this.props.infinite&&_this.correctClonesPosition({domLoaded:!0}),"function"==typeof afterChange&&setTimeout(function(){afterChange(previousSlide,_this.getState())},_this.props.transitionDuration||defaultTransitionDuration)})}},Carousel.prototype.getState=function(){return __assign({},this.state,{onMove:this.onMove,direction:this.direction})},Carousel.prototype.renderLeftArrow=function(){var _this=this,customLeftArrow=this.props.customLeftArrow;return React.createElement(Arrows_1.LeftArrow,{customLeftArrow:customLeftArrow,getState:function(){return _this.getState()},previous:this.previous})},Carousel.prototype.renderRightArrow=function(){var _this=this,customRightArrow=this.props.customRightArrow;return React.createElement(Arrows_1.RightArrow,{customRightArrow:customRightArrow,getState:function(){return _this.getState()},next:this.next})},Carousel.prototype.renderButtonGroups=function(){var _this=this,customButtonGroup=this.props.customButtonGroup;return customButtonGroup?React.cloneElement(customButtonGroup,{previous:function(){return _this.previous()},next:function(){return _this.next()},goToSlide:function(slideIndex){return _this.goToSlide(slideIndex)},carouselState:this.getState()}):null},Carousel.prototype.renderDotsList=function(){var _this=this;return React.createElement(Dots_1.default,{state:this.state,props:this.props,goToSlide:this.goToSlide,getState:function(){return _this.getState()}})},Carousel.prototype.renderCarouselItems=function(){return React.createElement(CarouselItems_1.default,{goToSlide:this.goToSlide,state:this.state,props:this.props})},Carousel.prototype.render=function(){var _a=this.props,deviceType=_a.deviceType,arrows=_a.arrows,removeArrowOnDeviceType=_a.removeArrowOnDeviceType,infinite=_a.infinite,containerClass=_a.containerClass,sliderClass=_a.sliderClass,customTransition=_a.customTransition,partialVisbile=_a.partialVisbile,centerMode=_a.centerMode,additionalTransfrom=_a.additionalTransfrom;utils_1.throwError(this.state,this.props);var _b=utils_1.getInitialState(this.state,this.props),shouldRenderOnSSR=_b.shouldRenderOnSSR,paritialVisibilityGutter=_b.paritialVisibilityGutter,shouldRenderAtAll=_b.shouldRenderAtAll,isLeftEndReach=utils_1.isInLeftEnd(this.state),isRightEndReach=utils_1.isInRightEnd(this.state),shouldShowArrows=arrows&&!(removeArrowOnDeviceType&&(deviceType&&-1<removeArrowOnDeviceType.indexOf(deviceType)||this.state.deviceType&&-1<removeArrowOnDeviceType.indexOf(this.state.deviceType)))&&!utils_1.notEnoughChildren(this.state,this.props)&&shouldRenderAtAll,disableLeftArrow=!infinite&&isLeftEndReach,disableRightArrow=!infinite&&isRightEndReach,currentTransform=partialVisbile?utils_1.getTransformForPartialVsibile(this.state,paritialVisibilityGutter,this.props):centerMode?utils_1.getTransformForCenterMode(this.state,this.props):this.state.transform;return React.createElement("div",{className:"react-multi-carousel-list "+containerClass,ref:this.containerRef},React.createElement("ul",{className:"react-multi-carousel-track "+sliderClass,style:{transition:this.isAnimationAllowed?customTransition||defaultTransition:"none",overflow:shouldRenderOnSSR?"hidden":"unset",transform:"translate3d("+(currentTransform+additionalTransfrom)+"px,0,0)"},onMouseMove:this.handleMove,onMouseDown:this.handleDown,onMouseUp:this.handleOut,onMouseEnter:this.handleEnter,onMouseLeave:this.handleOut,onTouchStart:this.handleDown,onTouchMove:this.handleMove,onTouchEnd:this.handleOut},this.renderCarouselItems()),shouldShowArrows&&!disableLeftArrow&&this.renderLeftArrow(),shouldShowArrows&&!disableRightArrow&&this.renderRightArrow(),shouldRenderAtAll&&this.renderButtonGroups(),shouldRenderAtAll&&this.renderDotsList())},Carousel.defaultProps={slidesToSlide:1,infinite:!1,draggable:!0,swipeable:!0,arrows:!0,containerClass:"",sliderClass:"",itemClass:"",keyBoardControl:!0,autoPlaySpeed:3e3,showDots:!1,minimumTouchDrag:80,dotListClass:"",focusOnSelect:!1,centerMode:!1,additionalTransfrom:0},Carousel}(React.Component);exports.default=Carousel;
"use strict";var __extends=this&&this.__extends||function(){var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};return function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),utils_1=require("./utils"),Dots_1=require("./Dots"),Arrows_1=require("./Arrows"),CarouselItems_1=require("./CarouselItems"),defaultTransitionDuration=400,defaultTransition="transform 400ms ease-in-out",Carousel=function(i){function t(t){var e=i.call(this,t)||this;return e.containerRef=React.createRef(),e.state={itemWidth:0,slidesToShow:0,currentSlide:0,clones:React.Children.toArray(t.children),totalItems:React.Children.count(t.children),deviceType:"",domLoaded:!1,transform:0,containerWidth:0},e.onResize=e.onResize.bind(e),e.handleDown=e.handleDown.bind(e),e.handleMove=e.handleMove.bind(e),e.handleOut=e.handleOut.bind(e),e.onKeyUp=e.onKeyUp.bind(e),e.handleEnter=e.handleEnter.bind(e),e.setIsInThrottle=e.setIsInThrottle.bind(e),e.next=utils_1.throttle(e.next.bind(e),t.transitionDuration||defaultTransitionDuration,e.setIsInThrottle),e.previous=utils_1.throttle(e.previous.bind(e),t.transitionDuration||defaultTransitionDuration,e.setIsInThrottle),e.goToSlide=utils_1.throttle(e.goToSlide.bind(e),t.transitionDuration||defaultTransitionDuration,e.setIsInThrottle),e.onMove=!1,e.initialX=0,e.lastX=0,e.isAnimationAllowed=!1,e.direction="",e.initialY=0,e.isInThrottle=!1,e}return __extends(t,i),t.prototype.setIsInThrottle=function(t){void 0===t&&(t=!1),this.isInThrottle=t},t.prototype.componentDidMount=function(){this.setState({domLoaded:!0}),this.setItemsToShow(),window.addEventListener("resize",this.onResize),this.onResize(!0),this.props.keyBoardControl&&window.addEventListener("keyup",this.onKeyUp),this.props.autoPlay&&this.props.autoPlaySpeed&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed))},t.prototype.setClones=function(t,e,i){var o=this;this.isAnimationAllowed=!1;var s=React.Children.toArray(this.props.children),n=utils_1.getClones(this.state.slidesToShow,s),r=n.clones,a=n.initialSlide;utils_1.notEnoughChildren(this.state,this.props,t)||this.setState({clones:r,totalItems:r.length,currentSlide:i?this.state.currentSlide:a},function(){o.correctItemsPosition(e||o.state.itemWidth)})},t.prototype.setItemsToShow=function(r){var a=this,h=this.props.responsive;Object.keys(h).forEach(function(t){var e=h[t],i=e.breakpoint,o=e.items,s=i.max,n=i.min;window.innerWidth>=n&&window.innerWidth<=s&&(a.setState({slidesToShow:o,deviceType:t}),a.setContainerAndItemWidth(o,r))})},t.prototype.setContainerAndItemWidth=function(t,e){var i=this;if(this.containerRef&&this.containerRef.current){var o=this.containerRef.current.offsetWidth,s=utils_1.getItemClientSideWidth(this.props,t,o);this.setState({containerWidth:o,itemWidth:s},function(){i.props.infinite&&i.setClones(t,s,e)}),e&&this.correctItemsPosition(s)}},t.prototype.correctItemsPosition=function(t,e){e&&(this.isAnimationAllowed=!0),!e&&this.isAnimationAllowed&&(this.isAnimationAllowed=!1),this.setState({transform:-t*this.state.currentSlide})},t.prototype.onResize=function(t){var e;e=!!this.props.infinite&&("boolean"!=typeof t||!t),this.setItemsToShow(e)},t.prototype.componentDidUpdate=function(t,e){var i=this,o=t.keyBoardControl,s=t.autoPlay,n=e.containerWidth,r=e.domLoaded;this.containerRef&&this.containerRef.current&&this.containerRef.current.offsetWidth!==n&&setTimeout(function(){i.setItemsToShow(!0)},this.props.transitionDuration||defaultTransitionDuration),o&&!this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),s&&!this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),s||!this.props.autoPlay||this.autoPlay||(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed)),this.props.infinite&&this.correctClonesPosition({domLoaded:r})},t.prototype.correctClonesPosition=function(t){var e=this,i=t.domLoaded,o=React.Children.toArray(this.props.children),s=utils_1.checkClonesPosition(this.state,o,this.props),n=s.isReachingTheEnd,r=s.isReachingTheStart,a=s.nextSlide,h=s.nextPosition;this.state.domLoaded&&i&&(n||r)&&(this.isAnimationAllowed=!1,setTimeout(function(){e.setState({transform:h,currentSlide:a})},this.props.transitionDuration||defaultTransitionDuration))},t.prototype.next=function(t){var e=this;void 0===t&&(t=0);var i=this.props,o=i.afterChange,s=i.beforeChange;if(!utils_1.notEnoughChildren(this.state,this.props)){var n=utils_1.populateNextSlides(this.state,this.props,t),r=n.nextSlides,a=n.nextPosition,h=this.state.currentSlide;void 0!==r&&void 0!==a&&("function"==typeof s&&s(r,this.getState()),this.isAnimationAllowed=!0,this.setState({transform:a,currentSlide:r},function(){"function"==typeof o&&setTimeout(function(){o(h,e.getState())},e.props.transitionDuration||defaultTransitionDuration)}))}},t.prototype.previous=function(t){var e=this;void 0===t&&(t=0);var i=this.props,o=i.afterChange,s=i.beforeChange;if(!utils_1.notEnoughChildren(this.state,this.props)){var n=utils_1.populatePreviousSlides(this.state,this.props,t),r=n.nextSlides,a=n.nextPosition;if(void 0!==r&&void 0!==a){var h=this.state.currentSlide;"function"==typeof s&&s(r,this.getState()),this.isAnimationAllowed=!0,this.setState({transform:a,currentSlide:r},function(){"function"==typeof o&&setTimeout(function(){o(h,e.getState())},e.props.transitionDuration||defaultTransitionDuration)})}}},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.onResize),this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},t.prototype.resetMoveStatus=function(){this.onMove=!1,this.initialX=0,this.lastX=0,this.direction="",this.initialY=0},t.prototype.handleDown=function(t){if(!(t.touches&&!this.props.swipeable||!t.touches&&!this.props.draggable||this.isInThrottle)){var e=t.touches?t.touches[0]:t,i=e.clientX,o=e.clientY;this.onMove=!0,this.initialX=i,this.initialY=o,this.lastX=i,this.isAnimationAllowed=!1}},t.prototype.handleMove=function(t){if(!(t.touches&&!this.props.swipeable||t&&!t.touches&&!this.props.draggable||utils_1.notEnoughChildren(this.state,this.props))){var e=t.touches?t.touches[0]:t,i=e.clientX,o=e.clientY,s=this.initialX-i,n=this.initialY-o;if(t.touches&&this.autoPlay&&this.props.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),this.onMove){if(!(Math.abs(s)>Math.abs(n)))return;var r=utils_1.populateSlidesOnMouseTouchMove(this.state,this.props,this.initialX,this.lastX,i),a=r.direction,h=r.nextPosition,l=r.canContinue;a&&(this.direction=a,l&&void 0!==h&&this.setState({transform:h})),this.lastX=i}}},t.prototype.handleOut=function(t){this.props.autoPlay&&!this.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed));var e="touchend"===t.type&&!this.props.swipeable,i=("mouseleave"===t.type||"mouseup"===t.type)&&!this.props.draggable;if(!e&&!i&&this.onMove){if("right"===this.direction)if(this.initialX-this.lastX>=this.props.minimumTouchDrag){var o=Math.round((this.initialX-this.lastX)/this.state.itemWidth);this.next(o)}else this.correctItemsPosition(this.state.itemWidth,!0);if("left"===this.direction)if(this.lastX-this.initialX>this.props.minimumTouchDrag){o=Math.round((this.lastX-this.initialX)/this.state.itemWidth);this.previous(o)}else this.correctItemsPosition(this.state.itemWidth,!0);this.resetMoveStatus()}},t.prototype.onKeyUp=function(t){switch(t.keyCode){case 37:return this.previous();case 39:return this.next()}},t.prototype.handleEnter=function(){this.autoPlay&&this.props.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},t.prototype.goToSlide=function(t){var e=this;if(!this.isInThrottle){var i=this.state.itemWidth,o=this.props,s=o.afterChange,n=o.beforeChange,r=this.state.currentSlide;"function"==typeof n&&n(t,this.getState()),this.isAnimationAllowed=!0,this.setState({currentSlide:t,transform:-i*t},function(){e.props.infinite&&e.correctClonesPosition({domLoaded:!0}),"function"==typeof s&&setTimeout(function(){s(r,e.getState())},e.props.transitionDuration||defaultTransitionDuration)})}},t.prototype.getState=function(){return __assign({},this.state,{onMove:this.onMove,direction:this.direction})},t.prototype.renderLeftArrow=function(){var t=this,e=this.props.customLeftArrow;return React.createElement(Arrows_1.LeftArrow,{customLeftArrow:e,getState:function(){return t.getState()},previous:this.previous})},t.prototype.renderRightArrow=function(){var t=this,e=this.props.customRightArrow;return React.createElement(Arrows_1.RightArrow,{customRightArrow:e,getState:function(){return t.getState()},next:this.next})},t.prototype.renderButtonGroups=function(){var e=this,t=this.props.customButtonGroup;return t?React.cloneElement(t,{previous:function(){return e.previous()},next:function(){return e.next()},goToSlide:function(t){return e.goToSlide(t)},carouselState:this.getState()}):null},t.prototype.renderDotsList=function(){var t=this;return React.createElement(Dots_1.default,{state:this.state,props:this.props,goToSlide:this.goToSlide,getState:function(){return t.getState()}})},t.prototype.renderCarouselItems=function(){return React.createElement(CarouselItems_1.default,{goToSlide:this.goToSlide,state:this.state,props:this.props})},t.prototype.render=function(){var t=this.props,e=t.deviceType,i=t.arrows,o=t.removeArrowOnDeviceType,s=t.infinite,n=t.containerClass,r=t.sliderClass,a=t.customTransition,h=t.partialVisbile,l=t.centerMode,u=t.additionalTransfrom;utils_1.throwError(this.state,this.props);var p=utils_1.getInitialState(this.state,this.props),d=p.shouldRenderOnSSR,c=p.paritialVisibilityGutter,f=p.shouldRenderAtAll,m=utils_1.isInLeftEnd(this.state),v=utils_1.isInRightEnd(this.state),y=i&&!(o&&(e&&-1<o.indexOf(e)||this.state.deviceType&&-1<o.indexOf(this.state.deviceType)))&&!utils_1.notEnoughChildren(this.state,this.props)&&f,S=!s&&m,g=!s&&v,w=h?utils_1.getTransformForPartialVsibile(this.state,c,this.props):l?utils_1.getTransformForCenterMode(this.state,this.props):this.state.transform;return React.createElement("div",{className:"react-multi-carousel-list "+n,ref:this.containerRef},React.createElement("ul",{className:"react-multi-carousel-track "+r,style:{transition:this.isAnimationAllowed?a||defaultTransition:"none",overflow:d?"hidden":"unset",transform:"translate3d("+(w+u)+"px,0,0)"},onMouseMove:this.handleMove,onMouseDown:this.handleDown,onMouseUp:this.handleOut,onMouseEnter:this.handleEnter,onMouseLeave:this.handleOut,onTouchStart:this.handleDown,onTouchMove:this.handleMove,onTouchEnd:this.handleOut},this.renderCarouselItems()),y&&!S&&this.renderLeftArrow(),y&&!g&&this.renderRightArrow(),f&&this.renderButtonGroups(),f&&this.renderDotsList())},t.defaultProps={slidesToSlide:1,infinite:!1,draggable:!0,swipeable:!0,arrows:!0,containerClass:"",sliderClass:"",itemClass:"",keyBoardControl:!0,autoPlaySpeed:3e3,showDots:!1,minimumTouchDrag:80,dotListClass:"",focusOnSelect:!1,centerMode:!1,additionalTransfrom:0},t}(React.Component);exports.default=Carousel;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),utils_1=require("./utils"),CarouselItems=function(_a){var props=_a.props,state=_a.state,goToSlide=_a.goToSlide,itemWidth=state.itemWidth,clones=state.clones,children=props.children,infinite=props.infinite,itemClass=props.itemClass,partialVisbile=props.partialVisbile,_b=utils_1.getInitialState(state,props),flexBisis=_b.flexBisis,shouldRenderOnSSR=_b.shouldRenderOnSSR,domFullyLoaded=_b.domFullyLoaded,paritialVisibilityGutter=_b.paritialVisibilityGutter;return _b.shouldRenderAtAll?infinite?clones.map(function(child,index){return React.createElement("li",{key:index,onClick:function(){props.focusOnSelect&&goToSlide(index)},"aria-hidden":utils_1.getIfSlideIsVisbile(index,state)?"false":"true","data-index":index,style:{flex:shouldRenderOnSSR?"1 0 "+flexBisis+"%":"auto",position:"relative",width:domFullyLoaded?(partialVisbile&&paritialVisibilityGutter?itemWidth-paritialVisibilityGutter:itemWidth)+"px":"auto"},className:"react-multi-carousel-item "+(utils_1.getIfSlideIsVisbile(index,state)?"react-multi-carousel-item--active":"")+" "+itemClass},child)}):React.Children.toArray(children).map(function(child,index){return React.createElement("li",{key:index,"data-index":index,onClick:function(){props.focusOnSelect&&goToSlide(index)},"aria-hidden":utils_1.getIfSlideIsVisbile(index,state)?"false":"true",style:{flex:shouldRenderOnSSR?"1 0 "+flexBisis+"%":"auto",position:"relative",width:domFullyLoaded?(partialVisbile&&paritialVisibilityGutter?itemWidth-paritialVisibilityGutter:itemWidth)+"px":"auto"},className:"react-multi-carousel-item "+(utils_1.getIfSlideIsVisbile(index,state)?"react-multi-carousel-item--active":"")+" "+itemClass},child)}):null};exports.default=CarouselItems;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),utils_1=require("./utils"),CarouselItems=function(e){var i=e.props,l=e.state,a=e.goToSlide,s=l.itemWidth,t=l.clones,r=i.children,u=i.infinite,n=i.itemClass,o=i.partialVisbile,c=utils_1.getInitialState(l,i),d=c.flexBisis,f=c.shouldRenderOnSSR,m=c.domFullyLoaded,p=c.paritialVisibilityGutter;return c.shouldRenderAtAll?u?t.map(function(e,t){return React.createElement("li",{key:t,onClick:function(){i.focusOnSelect&&a(t)},"aria-hidden":utils_1.getIfSlideIsVisbile(t,l)?"false":"true","data-index":t,style:{flex:f?"1 0 "+d+"%":"auto",position:"relative",width:m?(o&&p?s-p:s)+"px":"auto"},className:"react-multi-carousel-item "+(utils_1.getIfSlideIsVisbile(t,l)?"react-multi-carousel-item--active":"")+" "+n},e)}):React.Children.toArray(r).map(function(e,t){return React.createElement("li",{key:t,"data-index":t,onClick:function(){i.focusOnSelect&&a(t)},"aria-hidden":utils_1.getIfSlideIsVisbile(t,l)?"false":"true",style:{flex:f?"1 0 "+d+"%":"auto",position:"relative",width:m?(o&&p?s-p:s)+"px":"auto"},className:"react-multi-carousel-item "+(utils_1.getIfSlideIsVisbile(t,l)?"react-multi-carousel-item--active":"")+" "+n},e)}):null};exports.default=CarouselItems;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),utils_1=require("./utils"),Dots=function(_a){var props=_a.props,state=_a.state,goToSlide=_a.goToSlide,getState=_a.getState,showDots=props.showDots,customDot=props.customDot,dotListClass=props.dotListClass,infinite=props.infinite,children=props.children;if(!showDots)return null;var currentSlide=state.currentSlide,childrenArr=React.Children.toArray(children);return React.createElement("ul",{className:"react-multi-carousel-dot-list "+dotListClass},Array(childrenArr.length).fill(0).map(function(item,index){var isActive,slideIndex=infinite?utils_1.getOriginalCounterPart(index,state,childrenArr):index,cloneIndex=infinite?utils_1.getCloneCounterPart(index,state,childrenArr):null;return isActive=void 0!==cloneIndex&&currentSlide===cloneIndex||currentSlide===slideIndex,customDot?React.cloneElement(customDot,{index:index,active:isActive,key:index,onClick:function(){return goToSlide(slideIndex)},carouselState:getState()}):React.createElement("li",{"data-index":index,key:index,className:"react-multi-carousel-dot "+(isActive?"react-multi-carousel-dot--active":"")},React.createElement("button",{onClick:function(){return goToSlide(slideIndex)}}))}))};exports.default=Dots;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),utils_1=require("./utils"),Dots=function(e){var t=e.props,i=e.state,n=e.goToSlide,o=e.getState,r=t.showDots,u=t.customDot,a=t.dotListClass,c=t.infinite,l=t.children;if(!r)return null;var s=i.currentSlide,d=React.Children.toArray(l);return React.createElement("ul",{className:"react-multi-carousel-dot-list "+a},Array(d.length).fill(0).map(function(e,t){var r,a=c?utils_1.getOriginalCounterPart(t,i,d):t,l=c?utils_1.getCloneCounterPart(t,i,d):null;return r=void 0!==l&&s===l||s===a,u?React.cloneElement(u,{index:t,active:r,key:t,onClick:function(){return n(a)},carouselState:o()}):React.createElement("li",{"data-index":t,key:t,className:"react-multi-carousel-dot "+(r?"react-multi-carousel-dot--active":"")},React.createElement("button",{onClick:function(){return n(a)}}))}))};exports.default=Dots;

@@ -1,1 +0,1 @@

"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)};return function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),Carousel=function(_super){function Carousel(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(Carousel,_super),Carousel}(React.PureComponent);exports.default=Carousel;
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};return function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),Carousel=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(React.PureComponent);exports.default=Carousel;

@@ -1,1 +0,1 @@

"use strict";function getOriginalCounterPart(index,_a,childrenArr){var slidesToShow=_a.slidesToShow,currentSlide=_a.currentSlide;return childrenArr.length>2*slidesToShow?index+2*slidesToShow:currentSlide>=childrenArr.length?childrenArr.length+index:index}function getCloneCounterPart(index,_a,childrenArr){var slidesToShow=_a.slidesToShow;return childrenArr.length>2*slidesToShow?0===index?childrenArr.length+2*slidesToShow:index-(childrenArr.length-2*slidesToShow):0===index?2*childrenArr.length:void 0}function getClones(slidesToShow,childrenArr){var initialSlide,clones;return initialSlide=childrenArr.length>2*slidesToShow?(clones=childrenArr.slice(childrenArr.length-2*slidesToShow,childrenArr.length).concat(childrenArr,childrenArr.slice(0,2*slidesToShow)),2*slidesToShow):(clones=childrenArr.concat(childrenArr,childrenArr),childrenArr.length),{clones:clones,initialSlide:initialSlide}}function checkClonesPosition(_a,childrenArr,props){var isReachingTheEnd,currentSlide=_a.currentSlide,slidesToShow=_a.slidesToShow,itemWidth=_a.itemWidth,totalItems=_a.totalItems,nextSlide=0,nextPosition=0,isReachingTheStart=0===currentSlide,originalFirstSlide=childrenArr.length-(childrenArr.length-2*slidesToShow);return childrenArr.length>2*slidesToShow?((isReachingTheEnd=currentSlide>=originalFirstSlide+childrenArr.length)&&(nextPosition=-itemWidth*(nextSlide=currentSlide-childrenArr.length)),isReachingTheStart&&(nextPosition=-itemWidth*(nextSlide=originalFirstSlide+(childrenArr.length-2*slidesToShow)))):((isReachingTheEnd=currentSlide>=2*childrenArr.length)&&(nextPosition=-itemWidth*(nextSlide=currentSlide-childrenArr.length)),isReachingTheStart&&(nextPosition=props.showDots?-itemWidth*(nextSlide=childrenArr.length):-itemWidth*(nextSlide=totalItems-2*slidesToShow))),{isReachingTheEnd:isReachingTheEnd,isReachingTheStart:isReachingTheStart,nextSlide:nextSlide,nextPosition:nextPosition}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOriginalCounterPart=getOriginalCounterPart,exports.getCloneCounterPart=getCloneCounterPart,exports.getClones=getClones,exports.checkClonesPosition=checkClonesPosition;
"use strict";function getOriginalCounterPart(e,t,n){var o=t.slidesToShow,l=t.currentSlide;return n.length>2*o?e+2*o:l>=n.length?n.length+e:e}function getCloneCounterPart(e,t,n){var o=t.slidesToShow;return n.length>2*o?0===e?n.length+2*o:e-(n.length-2*o):0===e?2*n.length:void 0}function getClones(e,t){var n,o;return n=t.length>2*e?(o=t.slice(t.length-2*e,t.length).concat(t,t.slice(0,2*e)),2*e):(o=t.concat(t,t),t.length),{clones:o,initialSlide:n}}function checkClonesPosition(e,t,n){var o,l=e.currentSlide,r=e.slidesToShow,i=e.itemWidth,g=e.totalItems,h=0,s=0,c=0===l,a=t.length-(t.length-2*r);return t.length>2*r?((o=l>=a+t.length)&&(s=-i*(h=l-t.length)),c&&(s=-i*(h=a+(t.length-2*r)))):((o=l>=2*t.length)&&(s=-i*(h=l-t.length)),c&&(s=n.showDots?-i*(h=t.length):-i*(h=g-2*r))),{isReachingTheEnd:o,isReachingTheStart:c,nextSlide:h,nextPosition:s}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOriginalCounterPart=getOriginalCounterPart,exports.getCloneCounterPart=getCloneCounterPart,exports.getClones=getClones,exports.checkClonesPosition=checkClonesPosition;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),elementWidth_1=require("./elementWidth");function getInitialState(state,props){var flexBisis,domLoaded=state.domLoaded,slidesToShow=state.slidesToShow,containerWidth=state.containerWidth,itemWidth=state.itemWidth,deviceType=props.deviceType,responsive=props.responsive,ssr=props.ssr,partialVisbile=props.partialVisbile,domFullyLoaded=Boolean(domLoaded&&slidesToShow&&containerWidth&&itemWidth);ssr&&deviceType&&!domFullyLoaded&&(flexBisis=elementWidth_1.getWidthFromDeviceType(deviceType,responsive));var shouldRenderOnSSR=Boolean(ssr&&deviceType&&!domFullyLoaded&&flexBisis);return{shouldRenderOnSSR:shouldRenderOnSSR,flexBisis:flexBisis,domFullyLoaded:domFullyLoaded,paritialVisibilityGutter:elementWidth_1.getParitialVisibilityGutter(responsive,partialVisbile,deviceType,state.deviceType),shouldRenderAtAll:shouldRenderOnSSR||domFullyLoaded}}function getIfSlideIsVisbile(index,state){var currentSlide=state.currentSlide,slidesToShow=state.slidesToShow;return currentSlide<=index&&index<currentSlide+slidesToShow}function getTransformForCenterMode(state,props){return 0!==state.currentSlide||props.infinite?state.transform+state.itemWidth/2:state.transform}function getTransformForPartialVsibile(state,paritialVisibilityGutter,props){void 0===paritialVisibilityGutter&&(paritialVisibilityGutter=0);var currentSlide=state.currentSlide,slidesToShow=state.slidesToShow,isRightEndReach=isInRightEnd(state),shouldRemoveRightGutter=!props.infinite&&isRightEndReach,transform=state.transform+currentSlide*paritialVisibilityGutter;return shouldRemoveRightGutter?transform+(state.containerWidth-(state.itemWidth-paritialVisibilityGutter)*slidesToShow):transform}function isInLeftEnd(_a){return!(0<_a.currentSlide)}function isInRightEnd(_a){var currentSlide=_a.currentSlide,totalItems=_a.totalItems;return!(currentSlide+_a.slidesToShow<totalItems)}function notEnoughChildren(state,props,items){var childrenArr=React.Children.toArray(props.children),slidesToShow=state.slidesToShow;return items?childrenArr.length<items:childrenArr.length<slidesToShow}exports.getInitialState=getInitialState,exports.getIfSlideIsVisbile=getIfSlideIsVisbile,exports.getTransformForCenterMode=getTransformForCenterMode,exports.getTransformForPartialVsibile=getTransformForPartialVsibile,exports.isInLeftEnd=isInLeftEnd,exports.isInRightEnd=isInRightEnd,exports.notEnoughChildren=notEnoughChildren;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),elementWidth_1=require("./elementWidth");function getInitialState(e,t){var i,r=e.domLoaded,n=e.slidesToShow,o=e.containerWidth,s=e.itemWidth,l=t.deviceType,d=t.responsive,a=t.ssr,u=t.partialVisbile,h=Boolean(r&&n&&o&&s);a&&l&&!h&&(i=elementWidth_1.getWidthFromDeviceType(l,d));var f=Boolean(a&&l&&!h&&i);return{shouldRenderOnSSR:f,flexBisis:i,domFullyLoaded:h,paritialVisibilityGutter:elementWidth_1.getParitialVisibilityGutter(d,u,l,e.deviceType),shouldRenderAtAll:f||h}}function getIfSlideIsVisbile(e,t){var i=t.currentSlide,r=t.slidesToShow;return i<=e&&e<i+r}function getTransformForCenterMode(e,t){return 0!==e.currentSlide||t.infinite?e.transform+e.itemWidth/2:e.transform}function getTransformForPartialVsibile(e,t,i){void 0===t&&(t=0);var r=e.currentSlide,n=e.slidesToShow,o=isInRightEnd(e),s=!i.infinite&&o,l=e.transform+r*t;return s?l+(e.containerWidth-(e.itemWidth-t)*n):l}function isInLeftEnd(e){return!(0<e.currentSlide)}function isInRightEnd(e){var t=e.currentSlide,i=e.totalItems;return!(t+e.slidesToShow<i)}function notEnoughChildren(e,t,i){var r=React.Children.toArray(t.children),n=e.slidesToShow;return i?r.length<i:r.length<n}exports.getInitialState=getInitialState,exports.getIfSlideIsVisbile=getIfSlideIsVisbile,exports.getTransformForCenterMode=getTransformForCenterMode,exports.getTransformForPartialVsibile=getTransformForPartialVsibile,exports.isInLeftEnd=isInLeftEnd,exports.isInRightEnd=isInRightEnd,exports.notEnoughChildren=notEnoughChildren;

@@ -1,1 +0,1 @@

"use strict";function getParitialVisibilityGutter(responsive,partialVisbile,serverSideDeviceType,clientSideDeviceType){var gutter=0,deviceType=clientSideDeviceType||serverSideDeviceType;return partialVisbile&&deviceType&&(gutter=responsive[deviceType].paritialVisibilityGutter),gutter}function getWidthFromDeviceType(deviceType,responsive){var itemWidth;responsive[deviceType]&&(itemWidth=(100/responsive[deviceType].items).toFixed(1));return itemWidth}function getItemClientSideWidth(props,slidesToShow,containerWidth){return Math.round(containerWidth/(slidesToShow+(props.centerMode?1:0)))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getParitialVisibilityGutter=getParitialVisibilityGutter,exports.getWidthFromDeviceType=getWidthFromDeviceType,exports.getItemClientSideWidth=getItemClientSideWidth;
"use strict";function getParitialVisibilityGutter(t,e,i,r){var n=0,o=r||i;return e&&o&&(n=t[o].paritialVisibilityGutter),n}function getWidthFromDeviceType(t,e){var i;e[t]&&(i=(100/e[t].items).toFixed(1));return i}function getItemClientSideWidth(t,e,i){return Math.round(i/(e+(t.centerMode?1:0)))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getParitialVisibilityGutter=getParitialVisibilityGutter,exports.getWidthFromDeviceType=getWidthFromDeviceType,exports.getItemClientSideWidth=getItemClientSideWidth;

@@ -1,1 +0,1 @@

"use strict";function populateSlidesOnMouseTouchMove(state,props,initialX,lastX,clientX){var direction,nextPosition,itemWidth=state.itemWidth,slidesToShow=state.slidesToShow,totalItems=state.totalItems,transform=state.transform,currentSlide=state.currentSlide,infinite=props.infinite,canContinue=!1,slidesHavePassedRight=Math.round((initialX-lastX)/itemWidth),slidesHavePassedLeft=Math.round((lastX-initialX)/itemWidth),isMovingLeft=initialX<clientX;if(clientX<initialX&&!!(slidesHavePassedRight<=slidesToShow)){direction="right";var translateXLimit=Math.abs(-itemWidth*(totalItems-slidesToShow)),nextTranslate=transform-(lastX-clientX),isLastSlide=currentSlide===totalItems-slidesToShow;(Math.abs(nextTranslate)<=translateXLimit||isLastSlide&&infinite)&&(nextPosition=nextTranslate,canContinue=!0)}isMovingLeft&&slidesHavePassedLeft<=slidesToShow&&(direction="left",((nextTranslate=transform+(clientX-lastX))<=0||0===currentSlide&&infinite)&&(canContinue=!0,nextPosition=nextTranslate));return{direction:direction,nextPosition:nextPosition,canContinue:canContinue}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.populateSlidesOnMouseTouchMove=populateSlidesOnMouseTouchMove;
"use strict";function populateSlidesOnMouseTouchMove(e,t,o,i,n){var s,u,r=e.itemWidth,a=e.slidesToShow,l=e.totalItems,d=e.transform,M=e.currentSlide,h=t.infinite,c=!1,p=Math.round((o-i)/r),f=Math.round((i-o)/r),v=o<n;if(n<o&&!!(p<=a)){s="right";var S=Math.abs(-r*(l-a)),O=d-(i-n),T=M===l-a;(Math.abs(O)<=S||T&&h)&&(u=O,c=!0)}v&&f<=a&&(s="left",((O=d+(n-i))<=0||0===M&&h)&&(c=!0,u=O));return{direction:s,nextPosition:u,canContinue:c}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.populateSlidesOnMouseTouchMove=populateSlidesOnMouseTouchMove;

@@ -1,1 +0,1 @@

"use strict";function populateNextSlides(state,props,slidesHavePassed){void 0===slidesHavePassed&&(slidesHavePassed=0);var nextSlides,nextPosition,slidesToShow=state.slidesToShow,currentSlide=state.currentSlide,itemWidth=state.itemWidth,totalItems=state.totalItems,slidesToSlide=props.slidesToSlide,nextMaximumSlides=currentSlide+1+slidesHavePassed+slidesToShow+(0<slidesHavePassed?0:slidesToSlide);return nextPosition=nextMaximumSlides<=totalItems?-itemWidth*(nextSlides=currentSlide+slidesHavePassed+(0<slidesHavePassed?0:slidesToSlide)):totalItems<nextMaximumSlides&&currentSlide!==totalItems-slidesToShow?-itemWidth*(nextSlides=totalItems-slidesToShow):nextSlides=void 0,{nextSlides:nextSlides,nextPosition:nextPosition}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.populateNextSlides=populateNextSlides;
"use strict";function populateNextSlides(e,t,i){void 0===i&&(i=0);var o,s,l=e.slidesToShow,d=e.currentSlide,r=e.itemWidth,p=e.totalItems,u=t.slidesToSlide,n=d+1+i+l+(0<i?0:u);return s=n<=p?-r*(o=d+i+(0<i?0:u)):p<n&&d!==p-l?-r*(o=p-l):o=void 0,{nextSlides:o,nextPosition:s}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.populateNextSlides=populateNextSlides;

@@ -1,1 +0,1 @@

"use strict";function populatePreviousSlides(state,props,slidesHavePassed){void 0===slidesHavePassed&&(slidesHavePassed=0);var nextSlides,nextPosition,currentSlide=state.currentSlide,itemWidth=state.itemWidth,slidesToSlide=props.slidesToSlide,nextMaximumSlides=currentSlide-slidesHavePassed-(0<slidesHavePassed?0:slidesToSlide);return nextPosition=0<=nextMaximumSlides?-itemWidth*(nextSlides=nextMaximumSlides):nextSlides=nextMaximumSlides<0&&0!==currentSlide?0:void 0,{nextSlides:nextSlides,nextPosition:nextPosition}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.populatePreviousSlides=populatePreviousSlides;
"use strict";function populatePreviousSlides(e,i,t){void 0===t&&(t=0);var o,s,r=e.currentSlide,d=e.itemWidth,l=i.slidesToSlide,u=r-t-(0<t?0:l);return s=0<=u?-d*(o=u):o=u<0&&0!==r?0:void 0,{nextSlides:o,nextPosition:s}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.populatePreviousSlides=populatePreviousSlides;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var throttle=function(func,limit,setIsInThrottle){var inThrottle;return function(){var args=arguments;inThrottle||(func.apply(this,args),inThrottle=!0,"function"==typeof setIsInThrottle&&setIsInThrottle(!0),setTimeout(function(){inThrottle=!1,"function"==typeof setIsInThrottle&&setIsInThrottle(!1)},limit))}};exports.default=throttle;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var throttle=function(e,o,n){var r;return function(){var t=arguments;r||(e.apply(this,t),r=!0,"function"==typeof n&&n(!0),setTimeout(function(){r=!1,"function"==typeof n&&n(!1)},o))}};exports.default=throttle;

@@ -1,1 +0,1 @@

"use strict";function throwError(state,props){var partialVisbile=props.partialVisbile,centerMode=props.centerMode,ssr=props.ssr,responsive=props.responsive;props.infinite;if(partialVisbile&&centerMode)throw new Error("center mode can not be used at the same time with partialVisbile");if(!responsive)throw ssr?new Error("ssr mode need to be used in conjunction with responsive prop"):new Error("Responsive prop is needed for deciding the amount of items to show on the screen");if(responsive&&"object"!=typeof responsive)throw new Error("responsive prop must be an object")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=throwError;
"use strict";function throwError(e,r){var o=r.partialVisbile,t=r.centerMode,i=r.ssr,n=r.responsive;r.infinite;if(o&&t)throw new Error("center mode can not be used at the same time with partialVisbile");if(!n)throw i?new Error("ssr mode need to be used in conjunction with responsive prop"):new Error("Responsive prop is needed for deciding the amount of items to show on the screen");if(n&&"object"!=typeof n)throw new Error("responsive prop must be an object")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=throwError;

@@ -12,3 +12,3 @@ const UglifyJS = require("uglify-js");

{ [fileName]: fs.readFileSync(fileName, "utf8") },
{ mangle: false }
{ mangle: true }
).code,

@@ -15,0 +15,0 @@ "utf8"

{
"name": "react-multi-carousel",
"private": false,
"version": "1.4.5",
"version": "1.4.6",
"description": "Production-ready, lightweight fully customizable React carousel component that rocks supports multiple items and SSR(Server-side rendering) with typescript.",

@@ -6,0 +6,0 @@ "main": "index.js",

@@ -1,2 +0,2 @@

# react-multi-carousel
# react-multi-carousel 👋

@@ -7,4 +7,14 @@ Production-ready, lightweight fully customizable React carousel component that rocks supports multiple items and SSR(Server-side rendering) with typescript.

[![Package Quality](https://npm.packagequality.com/shield/react-multi-carousel.svg)](https://packagequality.com/#?package=react-multi-carousel)
[![npm version](https://badge.fury.io/js/react-multi-carousel.svg)](https://www.npmjs.com/package/react-multi-carousel)
[![Build Status](https://api.travis-ci.org/YIZHUANG/react-multi-carousel.svg?branch=master)](https://travis-ci.org/YIZHUANG/react-multi-carousel)
<a href="https://w3js.com/react-multi-carousel">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" target="_blank" />
</a>
<a href="https://github.com/YIZHUANG/react-multi-carousel/graphs/commit-activity">
<img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" target="_blank" />
</a>
<a href="https://github.com/YIZHUANG/react-multi-carousel/blob/master/LICENSE">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" target="_blank" />
</a>
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FYIZHUANG%2Freact-multi-carousel.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FYIZHUANG%2Freact-multi-carousel?ref=badge_shield)

@@ -40,2 +50,3 @@ [![David Dependancy Status](https://david-dm.org/YIZHUANG/react-multi-carousel.svg)](https://david-dm.org/YIZHUANG/react-multi-carousel)

### Shoutouts 🙏
<img src="/browserstack-logo-600x315.png" height="80" title="BrowserStack Logo" alt="BrowserStack Logo" />

@@ -47,2 +58,6 @@

## Show your support
Give a ⭐️ if this project helped you!
## Other important links.

@@ -109,12 +124,12 @@

breakpoint: { max: 3000, min: 1024 },
items: 3
items: 3,
},
tablet: {
breakpoint: { max: 1024, min: 464 },
items: 2
items: 2,
},
mobile: {
breakpoint: { max: 464, min: 0 },
items: 1
}
items: 1,
},
};

@@ -161,3 +176,3 @@ <Carousel

onMove,
state: { currentSlide, deviceType }
state: { currentSlide, deviceType },
} = rest;

@@ -404,4 +419,10 @@ // onMove means if dragging or swiping in progress.

## Contribute
## Author
👤 **Yi Zhuang**
- Github: [@YIZHUANG](https://github.com/YIZHUANG)
## 🤝 Contribute
Please read https://github.com/YIZHUANG/react-multi-carousel/blob/master/contributing.md

@@ -423,4 +444,4 @@

## License
## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FYIZHUANG%2Freact-multi-carousel.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FYIZHUANG%2Freact-multi-carousel?ref=badge_large)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc