react-slick
Advanced tools
Comparing version 0.6.6 to 0.6.7
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.Slider=e(require("react")):t.Slider=e(t.React)}(this,function(t){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";t.exports=i(1)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}var n=i(4),r=s(n),o=i(5),a=i(8),l=s(a),d=i(2),u=s(d),c=i(29),h=s(c),p=i(13),f=s(p),v=r["default"].createClass({displayName:"Slider",mixins:[h["default"]],getInitialState:function(){return{breakpoint:null}},componentDidMount:function(){var t=this;if(this.props.responsive){var e=this.props.responsive.map(function(t){return t.breakpoint});e.sort(function(t,e){return t-e}),e.forEach(function(i,s){var n;n=0===s?u["default"]({minWidth:0,maxWidth:i}):u["default"]({minWidth:e[s-1],maxWidth:i}),t.media(n,function(){t.setState({breakpoint:i})})});var i=u["default"]({minWidth:e.slice(-1)[0]});this.media(i,function(){t.setState({breakpoint:null})})}},render:function(){var t,e,i=this;return this.state.breakpoint?(e=this.props.responsive.filter(function(t){return t.breakpoint===i.state.breakpoint}),t="unslick"===e[0].settings?"unslick":l["default"]({},this.props,e[0].settings)):t=l["default"]({},f["default"],this.props),"unslick"===t?r["default"].createElement("div",null,this.props.children):r["default"].createElement(o.InnerSlider,t,this.props.children)}});t.exports=v},function(t,e,i){var s=i(3),n=function(t){var e=/[height|width]$/;return e.test(t)},r=function(t){var e="",i=Object.keys(t);return i.forEach(function(r,o){var a=t[r];r=s(r),n(r)&&"number"==typeof a&&(a+="px"),e+=a===!0?r:a===!1?"not "+r:"("+r+": "+a+")",o<i.length-1&&(e+=" and ")}),e},o=function(t){var e="";return"string"==typeof t?t:t instanceof Array?(t.forEach(function(i,s){e+=r(i),s<t.length-1&&(e+=", ")}),e):r(t)};t.exports=o},function(t,e,i){var s=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}).toLowerCase()};t.exports=s},function(e,i,s){e.exports=t},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},r=i(4),o=s(r),a=i(6),l=s(a),d=i(9),u=s(d),c=i(12),h=s(c),p=i(13),f=s(p),v=i(14),g=s(v),w=i(15),m=i(27),y=i(28),S=o["default"].createClass({displayName:"InnerSlider",mixins:[u["default"],l["default"]],getInitialState:function(){return h["default"]},getDefaultProps:function(){return f["default"]},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var t=[],e=0;e<this.props.children.length;e++)e>=this.state.currentSlide&&e<this.state.currentSlide+this.props.slidesToShow&&t.push(e);this.props.lazyLoad&&0===this.state.lazyLoadedList.length&&this.setState({lazyLoadedList:t})},componentDidMount:function(){this.initialize(this.props),this.adaptHeight(),window.addEventListener("resize",this.onWindowResized)},componentWillUnmount:function(){window.removeEventListener("resize",this.onWindowResized)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.initialize(this.props)},render:function(){var t,e=g["default"]("slick-initialized","slick-slider",this.props.className),i={fade:this.props.fade,cssEase:this.props.cssEase,speed:this.props.speed,infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,lazyLoad:this.props.lazyLoad,lazyLoadedList:this.state.lazyLoadedList,rtl:this.props.rtl,slideWidth:this.state.slideWidth,slidesToShow:this.props.slidesToShow,slideCount:this.state.slideCount,trackStyle:this.state.trackStyle,variableWidth:this.props.variableWidth};if(this.props.dots===!0&&this.state.slideCount>this.props.slidesToShow){var s={dotsClass:this.props.dotsClass,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,currentSlide:this.state.currentSlide,slidesToScroll:this.props.slidesToScroll,clickHandler:this.changeSlide};t=o["default"].createElement(m.Dots,s)}var r,a,l={infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,prevArrow:this.props.prevArrow,nextArrow:this.props.nextArrow,clickHandler:this.changeSlide};return this.props.arrows&&(r=o["default"].createElement(y.PrevArrow,l),a=o["default"].createElement(y.NextArrow,l)),o["default"].createElement("div",{className:e},o["default"].createElement("div",{ref:"list",className:"slick-list",onMouseDown:this.swipeStart,onMouseMove:this.state.dragging?this.swipeMove:null,onMouseUp:this.swipeEnd,onMouseLeave:this.state.dragging?this.swipeEnd:null,onTouchStart:this.swipeStart,onTouchMove:this.state.dragging?this.swipeMove:null,onTouchEnd:this.swipeEnd,onTouchCancel:this.state.dragging?this.swipeEnd:null},o["default"].createElement(w.Track,n({ref:"track"},i),this.props.children)),r,a,t)}});e.InnerSlider=S},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(7),r=i(8),o=s(r),a={changeSlide:function(t){var e,i,s,n;if(s=this.state.slideCount%this.props.slidesToScroll!==0,e=s?0:(this.state.slideCount-this.state.currentSlide)%this.props.slidesToScroll,"previous"===t.message)i=0===e?this.props.slidesToScroll:this.props.slidesToShow-e,n=this.state.currentSlide-i;else if("next"===t.message)i=0===e?this.props.slidesToScroll:e,n=this.state.currentSlide+i;else if("dots"===t.message&&(n=t.index*t.slidesToScroll,n===t.currentSlide))return;this.slideHandler(n)},keyHandler:function(t){},selectHandler:function(t){},swipeStart:function(t){var e,i;this.props.swipe===!1||"ontouchend"in document&&this.props.swipe===!1||(this.props.draggable!==!1||-1===t.type.indexOf("mouse"))&&(e=void 0!==t.touches?t.touches[0].pageX:t.clientX,i=void 0!==t.touches?t.touches[0].pageY:t.clientY,this.setState({dragging:!0,touchObject:{startX:e,startY:i,curX:e,curY:i}}))},swipeMove:function(t){if(this.state.dragging&&!this.state.animating){var e,i,s,r=this.state.touchObject;i=n.getTrackLeft(o["default"]({slideIndex:this.state.currentSlide,trackRef:this.refs.track},this.props,this.state)),r.curX=t.touches?t.touches[0].pageX:t.clientX,r.curY=t.touches?t.touches[0].pageY:t.clientY,r.swipeLength=Math.round(Math.sqrt(Math.pow(r.curX-r.startX,2))),s=(this.props.rtl===!1?1:-1)*(r.curX>r.startX?1:-1);var a=this.state.currentSlide,l=Math.ceil(this.state.slideCount/this.props.slidesToScroll),d=this.swipeDirection(this.state.touchObject),u=r.swipeLength;this.props.infinite===!1&&(0===a&&"right"===d||a+1>=l&&"left"===d)&&(u=r.swipeLength*this.props.edgeFriction,this.state.edgeDragged===!1&&this.props.edgeEvent&&(this.props.edgeEvent(d),this.setState({edgeDragged:!0}))),this.state.swiped===!1&&this.props.swipeEvent&&(this.props.swipeEvent(d),this.setState({swiped:!0})),e=i+u*s,this.setState({touchObject:r,swipeLeft:e,trackStyle:n.getTrackCSS(o["default"]({left:e},this.props,this.state))}),Math.abs(r.curX-r.startX)<.8*Math.abs(r.curY-r.startY)||r.swipeLength>4&&t.preventDefault()}},swipeEnd:function(t){if(this.state.dragging){var e=this.state.touchObject,i=this.state.listWidth/this.props.touchThreshold,s=this.swipeDirection(e);if(this.setState({dragging:!1,edgeDragged:!1,swiped:!1,swipeLeft:null,touchObject:{}}),e.swipeLength)if(e.swipeLength>i)t.preventDefault(),"left"===s?this.slideHandler(this.state.currentSlide+this.props.slidesToScroll):"right"===s?this.slideHandler(this.state.currentSlide-this.props.slidesToScroll):this.slideHandler(this.state.currentSlide);else{var r=n.getTrackLeft(o["default"]({slideIndex:this.state.currentSlide,trackRef:this.refs.track},this.props,this.state));this.setState({trackStyle:n.getTrackAnimateCSS(o["default"]({left:r},this.props,this.state))})}}}};e["default"]=a,t.exports=e["default"]},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(t,e){return e.reduce(function(e,i){return e&&t.hasOwnProperty(i)},!0)?null:console.error("Keys Missing",t)},n=function(t){s(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var e;e=t.variableWidth?(t.slideCount+2*t.slidesToShow)*t.slideWidth:t.centerMode?(t.slideCount+2*(t.slidesToShow+1))*t.slideWidth:(t.slideCount+2*t.slidesToShow)*t.slideWidth;var i={opacity:1,width:e,WebkitTransform:"translate3d("+t.left+"px, 0px, 0px)",transform:"translate3d("+t.left+"px, 0px, 0px)",transition:"",WebkitTransition:"",msTransform:"translateX("+t.left+"px)"};return i};e.getTrackCSS=n;var r=function(t){s(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var e=n(t);return e.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,e.transition="transform "+t.speed+"ms "+t.cssEase,e};e.getTrackAnimateCSS=r;var o=function(t){s(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth"]);var e,i,n=0;if(t.fade)return 0;if(t.infinite&&(t.slideCount>t.slidesToShow&&(n=t.slideWidth*t.slidesToShow*-1),t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow&&(n=t.slideIndex>t.slideCount?(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideWidth*-1:t.slideCount%t.slidesToScroll*t.slideWidth*-1)),t.centerMode&&(t.infinite?n+=t.slideWidth*Math.floor(t.slidesToShow/2):n=t.slideWidth*Math.floor(t.slidesToShow/2)),e=t.slideIndex*t.slideWidth*-1+n,t.variableWidth===!0){var r;t.slideCount<=t.slidesToShow||t.infinite===!1?i=t.trackRef.getDOMNode().childNodes[t.slideIndex]:(r=t.slideIndex+t.slidesToShow,i=t.trackRef.getDOMNode().childNodes[r]),e=i?-1*i.offsetLeft:0,t.centerMode===!0&&(i=t.infinite===!1?t.trackRef.getDOMNode().children[t.slideIndex]:t.trackRef.getDOMNode().children[t.slideIndex+t.slidesToShow+1],e=i?-1*i.offsetLeft:0,e+=(t.listWidth-i.offsetWidth)/2)}return e};e.getTrackLeft=o},function(t,e,i){"use strict";function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=Object.assign||function(t,e){for(var i,n,r=s(t),o=1;o<arguments.length;o++){i=arguments[o],n=Object.keys(Object(i));for(var a=0;a<n.length;a++)r[n[a]]=i[n[a]]}return r}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(4),r=s(n),o=i(10),a=s(o),l=i(7),d=i(8),u=s(d),c={initialize:function(t){var e=r["default"].Children.count(t.children),i=this.refs.list.getDOMNode().getBoundingClientRect().width,s=this.refs.track.getDOMNode().getBoundingClientRect().width,n=this.getDOMNode().getBoundingClientRect().width/t.slidesToShow,o=t.rtl?e-1-t.initialSlide:t.initialSlide;this.setState({slideCount:e,slideWidth:n,listWidth:i,trackWidth:s,currentSlide:o},function(){var e=l.getTrackLeft(u["default"]({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=l.getTrackCSS(u["default"]({left:e},t,this.state));this.setState({trackStyle:i}),this.autoPlay()})},adaptHeight:function(){if(this.props.adaptiveHeight){var t='[data-index="'+this.state.currentSlide+'"]';if(this.refs.list){var e=this.refs.list.getDOMNode();e.style.height=e.querySelector(t).offsetHeight+"px"}}},slideHandler:function(t){var e,i,s,n,r,o=this;if(this.state.animating!==!0&&this.state.currentSlide!==t){if(this.props.fade)return i=this.state.currentSlide,this.props.beforeChange&&this.props.beforeChange(i),e=0>t?t+this.state.slideCount:t>=this.state.slideCount?t-this.state.slideCount:t,this.props.lazyLoad&&this.state.lazyLoadedList.indexOf(e)<0&&this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(e)}),r=function(){o.setState({animating:!1}),o.props.afterChange&&o.props.afterChange(i),a["default"].removeEndEventListener(o.refs.track.getDOMNode().children[i],r)},this.setState({animating:!0,currentSlide:e},function(){a["default"].addEndEventListener(this.refs.track.getDOMNode().children[i],r)}),void this.autoPlay();if(e=t,i=0>e?this.props.infinite===!1?0:this.state.slideCount%this.props.slidesToScroll!==0?this.state.slideCount-this.state.slideCount%this.props.slidesToScroll:this.state.slideCount+e:e>=this.state.slideCount?this.props.infinite===!1?this.state.slideCount-this.props.slidesToShow:this.state.slideCount%this.props.slidesToScroll!==0?0:e-this.state.slideCount:e,s=l.getTrackLeft(u["default"]({slideIndex:e,trackRef:this.refs.track},this.props,this.state)),n=l.getTrackLeft(u["default"]({slideIndex:i,trackRef:this.refs.track},this.props,this.state)),this.props.infinite===!1&&(s=n),this.props.beforeChange&&this.props.beforeChange(i),this.props.lazyLoad){for(var d=!0,c=[],h=e;h<e+this.props.slidesToShow;h++)d=d&&this.state.lazyLoadedList.indexOf(h)>=0,d||c.push(h);d||this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(c)})}if(this.props.useCSS===!1)this.setState({currentSlide:i,trackStyle:l.getTrackCSS(u["default"]({left:n},this.props,this.state))},function(){this.props.afterChange&&this.props.afterChange(i)});else{var p={animating:!1,currentSlide:i,trackStyle:l.getTrackCSS(u["default"]({left:n},this.props,this.state)),swipeLeft:null};r=function(){o.setState(p),o.props.afterChange&&o.props.afterChange(i),a["default"].removeEndEventListener(o.refs.track.getDOMNode(),r)},this.setState({animating:!0,currentSlide:e,trackStyle:l.getTrackAnimateCSS(u["default"]({left:s},this.props,this.state))},function(){a["default"].addEndEventListener(this.refs.track.getDOMNode(),r)})}this.autoPlay()}},swipeDirection:function(t){var e,i,s,n;return e=t.startX-t.curX,i=t.startY-t.curY,s=Math.atan2(i,e),n=Math.round(180*s/Math.PI),0>n&&(n=360-Math.abs(n)),45>=n&&n>=0||360>=n&&n>=315?this.props.rtl===!1?"left":"right":n>=135&&225>=n?this.props.rtl===!1?"right":"left":"vertical"},autoPlay:function(){var t=this,e=function(){t.state.mounted&&t.slideHandler(t.state.currentSlide+t.props.slidesToScroll)};this.props.autoplay&&(window.clearTimeout(this.state.autoPlayTimer),this.setState({autoPlayTimer:window.setTimeout(e,this.props.autoplaySpeed)}))}};e["default"]=c,t.exports=e["default"]},function(t,e,i){"use strict";function s(){var t=document.createElement("div"),e=t.style;"AnimationEvent"in window||delete a.animationend.animation,"TransitionEvent"in window||delete a.transitionend.transition;for(var i in a){var s=a[i];for(var n in s)if(n in e){l.push(s[n]);break}}}function n(t,e,i){t.addEventListener(e,i,!1)}function r(t,e,i){t.removeEventListener(e,i,!1)}var o=i(11),a={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},l=[];o.canUseDOM&&s();var d={addEndEventListener:function(t,e){return 0===l.length?void window.setTimeout(e,0):void l.forEach(function(i){n(t,i,e)})},removeEndEventListener:function(t,e){0!==l.length&&l.forEach(function(i){r(t,i,e)})}};t.exports=d},function(t,e,i){"use strict";var s=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:s,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:s&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:s&&!!window.screen,isInWorker:!s};t.exports=n},function(t,e,i){"use strict";var s={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,slideCount:null,slideWidth:null,swipeLeft:null,touchObject:{startX:0,startY:0,curX:0,curY:0},lazyLoadedList:[],initialized:!1,edgeDragged:!1,swiped:!1,trackStyle:{},trackWidth:0};t.exports=s},function(t,e,i){"use strict";var s={className:"",adaptiveHeight:!1,arrows:!0,autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:!1,responsive:null,rtl:!1,slide:"div",slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,afterChange:null,beforeChange:null,edgeEvent:null,init:null,swipeEvent:null,nextArrow:null,prevArrow:null};t.exports=s},function(t,e,i){/*! | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.Slider=e(require("react")):t.Slider=e(t.React)}(this,function(t){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";t.exports=i(1)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}var n=i(4),r=s(n),o=i(5),a=i(8),l=s(a),d=i(2),u=s(d),c=i(29),h=s(c),p=i(13),f=s(p),v=r["default"].createClass({displayName:"Slider",mixins:[h["default"]],getInitialState:function(){return{breakpoint:null}},componentDidMount:function(){var t=this;if(this.props.responsive){var e=this.props.responsive.map(function(t){return t.breakpoint});e.sort(function(t,e){return t-e}),e.forEach(function(i,s){var n;n=0===s?u["default"]({minWidth:0,maxWidth:i}):u["default"]({minWidth:e[s-1],maxWidth:i}),t.media(n,function(){t.setState({breakpoint:i})})});var i=u["default"]({minWidth:e.slice(-1)[0]});this.media(i,function(){t.setState({breakpoint:null})})}},render:function(){var t,e,i=this;return this.state.breakpoint?(e=this.props.responsive.filter(function(t){return t.breakpoint===i.state.breakpoint}),t="unslick"===e[0].settings?"unslick":l["default"]({},this.props,e[0].settings)):t=l["default"]({},f["default"],this.props),"unslick"===t?r["default"].createElement("div",null,this.props.children):r["default"].createElement(o.InnerSlider,t,this.props.children)}});t.exports=v},function(t,e,i){var s=i(3),n=function(t){var e=/[height|width]$/;return e.test(t)},r=function(t){var e="",i=Object.keys(t);return i.forEach(function(r,o){var a=t[r];r=s(r),n(r)&&"number"==typeof a&&(a+="px"),e+=a===!0?r:a===!1?"not "+r:"("+r+": "+a+")",o<i.length-1&&(e+=" and ")}),e},o=function(t){var e="";return"string"==typeof t?t:t instanceof Array?(t.forEach(function(i,s){e+=r(i),s<t.length-1&&(e+=", ")}),e):r(t)};t.exports=o},function(t,e,i){var s=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}).toLowerCase()};t.exports=s},function(e,i,s){e.exports=t},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},r=i(4),o=s(r),a=i(6),l=s(a),d=i(9),u=s(d),c=i(12),h=s(c),p=i(13),f=s(p),v=i(14),g=s(v),w=i(15),m=i(27),y=i(28),S=o["default"].createClass({displayName:"InnerSlider",mixins:[u["default"],l["default"]],getInitialState:function(){return h["default"]},getDefaultProps:function(){return f["default"]},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var t=[],e=0;e<this.props.children.length;e++)e>=this.state.currentSlide&&e<this.state.currentSlide+this.props.slidesToShow&&t.push(e);this.props.lazyLoad&&0===this.state.lazyLoadedList.length&&this.setState({lazyLoadedList:t})},componentDidMount:function(){this.initialize(this.props),this.adaptHeight(),window.addEventListener("resize",this.onWindowResized)},componentWillUnmount:function(){window.removeEventListener("resize",this.onWindowResized),this.state.autoPlayTimer&&window.clearTimeout(this.state.autoPlayTimer)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.initialize(this.props)},render:function(){var t,e=g["default"]("slick-initialized","slick-slider",this.props.className),i={fade:this.props.fade,cssEase:this.props.cssEase,speed:this.props.speed,infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,lazyLoad:this.props.lazyLoad,lazyLoadedList:this.state.lazyLoadedList,rtl:this.props.rtl,slideWidth:this.state.slideWidth,slidesToShow:this.props.slidesToShow,slideCount:this.state.slideCount,trackStyle:this.state.trackStyle,variableWidth:this.props.variableWidth};if(this.props.dots===!0&&this.state.slideCount>this.props.slidesToShow){var s={dotsClass:this.props.dotsClass,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,currentSlide:this.state.currentSlide,slidesToScroll:this.props.slidesToScroll,clickHandler:this.changeSlide};t=o["default"].createElement(m.Dots,s)}var r,a,l={infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,prevArrow:this.props.prevArrow,nextArrow:this.props.nextArrow,clickHandler:this.changeSlide};return this.props.arrows&&(r=o["default"].createElement(y.PrevArrow,l),a=o["default"].createElement(y.NextArrow,l)),o["default"].createElement("div",{className:e},o["default"].createElement("div",{ref:"list",className:"slick-list",onMouseDown:this.swipeStart,onMouseMove:this.state.dragging?this.swipeMove:null,onMouseUp:this.swipeEnd,onMouseLeave:this.state.dragging?this.swipeEnd:null,onTouchStart:this.swipeStart,onTouchMove:this.state.dragging?this.swipeMove:null,onTouchEnd:this.swipeEnd,onTouchCancel:this.state.dragging?this.swipeEnd:null},o["default"].createElement(w.Track,n({ref:"track"},i),this.props.children)),r,a,t)}});e.InnerSlider=S},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(7),r=i(8),o=s(r),a={changeSlide:function(t){var e,i,s,n;if(s=this.state.slideCount%this.props.slidesToScroll!==0,e=s?0:(this.state.slideCount-this.state.currentSlide)%this.props.slidesToScroll,"previous"===t.message)i=0===e?this.props.slidesToScroll:this.props.slidesToShow-e,n=this.state.currentSlide-i;else if("next"===t.message)i=0===e?this.props.slidesToScroll:e,n=this.state.currentSlide+i;else if("dots"===t.message&&(n=t.index*t.slidesToScroll,n===t.currentSlide))return;this.slideHandler(n)},keyHandler:function(t){},selectHandler:function(t){},swipeStart:function(t){var e,i;this.props.swipe===!1||"ontouchend"in document&&this.props.swipe===!1||(this.props.draggable!==!1||-1===t.type.indexOf("mouse"))&&(e=void 0!==t.touches?t.touches[0].pageX:t.clientX,i=void 0!==t.touches?t.touches[0].pageY:t.clientY,this.setState({dragging:!0,touchObject:{startX:e,startY:i,curX:e,curY:i}}))},swipeMove:function(t){if(this.state.dragging&&!this.state.animating){var e,i,s,r=this.state.touchObject;i=n.getTrackLeft(o["default"]({slideIndex:this.state.currentSlide,trackRef:this.refs.track},this.props,this.state)),r.curX=t.touches?t.touches[0].pageX:t.clientX,r.curY=t.touches?t.touches[0].pageY:t.clientY,r.swipeLength=Math.round(Math.sqrt(Math.pow(r.curX-r.startX,2))),s=(this.props.rtl===!1?1:-1)*(r.curX>r.startX?1:-1);var a=this.state.currentSlide,l=Math.ceil(this.state.slideCount/this.props.slidesToScroll),d=this.swipeDirection(this.state.touchObject),u=r.swipeLength;this.props.infinite===!1&&(0===a&&"right"===d||a+1>=l&&"left"===d)&&(u=r.swipeLength*this.props.edgeFriction,this.state.edgeDragged===!1&&this.props.edgeEvent&&(this.props.edgeEvent(d),this.setState({edgeDragged:!0}))),this.state.swiped===!1&&this.props.swipeEvent&&(this.props.swipeEvent(d),this.setState({swiped:!0})),e=i+u*s,this.setState({touchObject:r,swipeLeft:e,trackStyle:n.getTrackCSS(o["default"]({left:e},this.props,this.state))}),Math.abs(r.curX-r.startX)<.8*Math.abs(r.curY-r.startY)||r.swipeLength>4&&t.preventDefault()}},swipeEnd:function(t){if(this.state.dragging){var e=this.state.touchObject,i=this.state.listWidth/this.props.touchThreshold,s=this.swipeDirection(e);if(this.setState({dragging:!1,edgeDragged:!1,swiped:!1,swipeLeft:null,touchObject:{}}),e.swipeLength)if(e.swipeLength>i)t.preventDefault(),"left"===s?this.slideHandler(this.state.currentSlide+this.props.slidesToScroll):"right"===s?this.slideHandler(this.state.currentSlide-this.props.slidesToScroll):this.slideHandler(this.state.currentSlide);else{var r=n.getTrackLeft(o["default"]({slideIndex:this.state.currentSlide,trackRef:this.refs.track},this.props,this.state));this.setState({trackStyle:n.getTrackAnimateCSS(o["default"]({left:r},this.props,this.state))})}}}};e["default"]=a,t.exports=e["default"]},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(t,e){return e.reduce(function(e,i){return e&&t.hasOwnProperty(i)},!0)?null:console.error("Keys Missing",t)},n=function(t){s(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var e;e=t.variableWidth?(t.slideCount+2*t.slidesToShow)*t.slideWidth:t.centerMode?(t.slideCount+2*(t.slidesToShow+1))*t.slideWidth:(t.slideCount+2*t.slidesToShow)*t.slideWidth;var i={opacity:1,width:e,WebkitTransform:"translate3d("+t.left+"px, 0px, 0px)",transform:"translate3d("+t.left+"px, 0px, 0px)",transition:"",WebkitTransition:"",msTransform:"translateX("+t.left+"px)"};return i};e.getTrackCSS=n;var r=function(t){s(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var e=n(t);return e.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,e.transition="transform "+t.speed+"ms "+t.cssEase,e};e.getTrackAnimateCSS=r;var o=function(t){s(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth"]);var e,i,n=0;if(t.fade)return 0;if(t.infinite&&(t.slideCount>t.slidesToShow&&(n=t.slideWidth*t.slidesToShow*-1),t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow&&(n=t.slideIndex>t.slideCount?(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideWidth*-1:t.slideCount%t.slidesToScroll*t.slideWidth*-1)),t.centerMode&&(t.infinite?n+=t.slideWidth*Math.floor(t.slidesToShow/2):n=t.slideWidth*Math.floor(t.slidesToShow/2)),e=t.slideIndex*t.slideWidth*-1+n,t.variableWidth===!0){var r;t.slideCount<=t.slidesToShow||t.infinite===!1?i=t.trackRef.getDOMNode().childNodes[t.slideIndex]:(r=t.slideIndex+t.slidesToShow,i=t.trackRef.getDOMNode().childNodes[r]),e=i?-1*i.offsetLeft:0,t.centerMode===!0&&(i=t.infinite===!1?t.trackRef.getDOMNode().children[t.slideIndex]:t.trackRef.getDOMNode().children[t.slideIndex+t.slidesToShow+1],e=i?-1*i.offsetLeft:0,e+=(t.listWidth-i.offsetWidth)/2)}return e};e.getTrackLeft=o},function(t,e,i){"use strict";function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=Object.assign||function(t,e){for(var i,n,r=s(t),o=1;o<arguments.length;o++){i=arguments[o],n=Object.keys(Object(i));for(var a=0;a<n.length;a++)r[n[a]]=i[n[a]]}return r}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(4),r=s(n),o=i(10),a=s(o),l=i(7),d=i(8),u=s(d),c={initialize:function(t){var e=r["default"].Children.count(t.children),i=this.refs.list.getDOMNode().getBoundingClientRect().width,s=this.refs.track.getDOMNode().getBoundingClientRect().width,n=this.getDOMNode().getBoundingClientRect().width/t.slidesToShow,o=t.rtl?e-1-t.initialSlide:t.initialSlide;this.setState({slideCount:e,slideWidth:n,listWidth:i,trackWidth:s,currentSlide:o},function(){var e=l.getTrackLeft(u["default"]({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=l.getTrackCSS(u["default"]({left:e},t,this.state));this.setState({trackStyle:i}),this.autoPlay()})},adaptHeight:function(){if(this.props.adaptiveHeight){var t='[data-index="'+this.state.currentSlide+'"]';if(this.refs.list){var e=this.refs.list.getDOMNode();e.style.height=e.querySelector(t).offsetHeight+"px"}}},slideHandler:function(t){var e,i,s,n,r,o=this;if(this.state.animating!==!0&&this.state.currentSlide!==t){if(this.props.fade)return i=this.state.currentSlide,this.props.beforeChange&&this.props.beforeChange(i),e=0>t?t+this.state.slideCount:t>=this.state.slideCount?t-this.state.slideCount:t,this.props.lazyLoad&&this.state.lazyLoadedList.indexOf(e)<0&&this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(e)}),r=function(){o.setState({animating:!1}),o.props.afterChange&&o.props.afterChange(i),a["default"].removeEndEventListener(o.refs.track.getDOMNode().children[i],r)},this.setState({animating:!0,currentSlide:e},function(){a["default"].addEndEventListener(this.refs.track.getDOMNode().children[i],r)}),void this.autoPlay();if(e=t,i=0>e?this.props.infinite===!1?0:this.state.slideCount%this.props.slidesToScroll!==0?this.state.slideCount-this.state.slideCount%this.props.slidesToScroll:this.state.slideCount+e:e>=this.state.slideCount?this.props.infinite===!1?this.state.slideCount-this.props.slidesToShow:this.state.slideCount%this.props.slidesToScroll!==0?0:e-this.state.slideCount:e,s=l.getTrackLeft(u["default"]({slideIndex:e,trackRef:this.refs.track},this.props,this.state)),n=l.getTrackLeft(u["default"]({slideIndex:i,trackRef:this.refs.track},this.props,this.state)),this.props.infinite===!1&&(s=n),this.props.beforeChange&&this.props.beforeChange(i),this.props.lazyLoad){for(var d=!0,c=[],h=e;h<e+this.props.slidesToShow;h++)d=d&&this.state.lazyLoadedList.indexOf(h)>=0,d||c.push(h);d||this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(c)})}if(this.props.useCSS===!1)this.setState({currentSlide:i,trackStyle:l.getTrackCSS(u["default"]({left:n},this.props,this.state))},function(){this.props.afterChange&&this.props.afterChange(i)});else{var p={animating:!1,currentSlide:i,trackStyle:l.getTrackCSS(u["default"]({left:n},this.props,this.state)),swipeLeft:null};r=function(){o.setState(p),o.props.afterChange&&o.props.afterChange(i),a["default"].removeEndEventListener(o.refs.track.getDOMNode(),r)},this.setState({animating:!0,currentSlide:e,trackStyle:l.getTrackAnimateCSS(u["default"]({left:s},this.props,this.state))},function(){a["default"].addEndEventListener(this.refs.track.getDOMNode(),r)})}this.autoPlay()}},swipeDirection:function(t){var e,i,s,n;return e=t.startX-t.curX,i=t.startY-t.curY,s=Math.atan2(i,e),n=Math.round(180*s/Math.PI),0>n&&(n=360-Math.abs(n)),45>=n&&n>=0||360>=n&&n>=315?this.props.rtl===!1?"left":"right":n>=135&&225>=n?this.props.rtl===!1?"right":"left":"vertical"},autoPlay:function(){var t=this,e=function(){t.state.mounted&&t.slideHandler(t.state.currentSlide+t.props.slidesToScroll)};this.props.autoplay&&(window.clearTimeout(this.state.autoPlayTimer),this.setState({autoPlayTimer:window.setTimeout(e,this.props.autoplaySpeed)}))}};e["default"]=c,t.exports=e["default"]},function(t,e,i){"use strict";function s(){var t=document.createElement("div"),e=t.style;"AnimationEvent"in window||delete a.animationend.animation,"TransitionEvent"in window||delete a.transitionend.transition;for(var i in a){var s=a[i];for(var n in s)if(n in e){l.push(s[n]);break}}}function n(t,e,i){t.addEventListener(e,i,!1)}function r(t,e,i){t.removeEventListener(e,i,!1)}var o=i(11),a={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},l=[];o.canUseDOM&&s();var d={addEndEventListener:function(t,e){return 0===l.length?void window.setTimeout(e,0):void l.forEach(function(i){n(t,i,e)})},removeEndEventListener:function(t,e){0!==l.length&&l.forEach(function(i){r(t,i,e)})}};t.exports=d},function(t,e,i){"use strict";var s=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:s,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:s&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:s&&!!window.screen,isInWorker:!s};t.exports=n},function(t,e,i){"use strict";var s={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,slideCount:null,slideWidth:null,swipeLeft:null,touchObject:{startX:0,startY:0,curX:0,curY:0},lazyLoadedList:[],initialized:!1,edgeDragged:!1,swiped:!1,trackStyle:{},trackWidth:0};t.exports=s},function(t,e,i){"use strict";var s={className:"",adaptiveHeight:!1,arrows:!0,autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:!1,responsive:null,rtl:!1,slide:"div",slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,afterChange:null,beforeChange:null,edgeEvent:null,init:null,swipeEvent:null,nextArrow:null,prevArrow:null};t.exports=s},function(t,e,i){/*! | ||
Copyright (c) 2015 Jed Watson. | ||
@@ -3,0 +3,0 @@ Licensed under the MIT License (MIT), see |
@@ -79,2 +79,5 @@ 'use strict'; | ||
window.removeEventListener('resize', this.onWindowResized); | ||
if (this.state.autoPlayTimer) { | ||
window.clearTimeout(this.state.autoPlayTimer); | ||
} | ||
}, | ||
@@ -81,0 +84,0 @@ componentDidUpdate: function componentDidUpdate() { |
{ | ||
"name": "react-slick", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"description": " React port of slick carousel", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
246308
31
3836