react-slick
Advanced tools
Comparing version 0.13.6 to 0.14.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.Slider=e(require("react"),require("react-dom")):t.Slider=e(t.React,t.ReactDOM)}(this,function(t,e){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=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(2),o=s(r),a=i(3),l=i(8),d=s(l),c=i(15),u=s(c),h=i(17),p=s(h),f=i(10),S=s(f),v=o["default"].createClass({displayName:"Slider",mixins:[p["default"]],innerSlider:null,innerSliderRefHandler:function(t){this.innerSlider=t},getInitialState:function(){return{breakpoint:null}},componentWillMount: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?(0,u["default"])({minWidth:0,maxWidth:i}):(0,u["default"])({minWidth:e[s-1],maxWidth:i}),t.media(n,function(){t.setState({breakpoint:i})})});var i=(0,u["default"])({minWidth:e.slice(-1)[0]});this.media(i,function(){t.setState({breakpoint:null})})}},slickPrev:function(){this.innerSlider.slickPrev()},slickNext:function(){this.innerSlider.slickNext()},slickGoTo:function(t){this.innerSlider.slickGoTo(t)},render:function(){var t,e,i=this;this.state.breakpoint?(e=this.props.responsive.filter(function(t){return t.breakpoint===i.state.breakpoint}),t="unslick"===e[0].settings?"unslick":(0,d["default"])({},this.props,e[0].settings)):t=(0,d["default"])({},S["default"],this.props);var s=this.props.children;return Array.isArray(s)||(s=[s]),s=s.filter(function(t){return!!t}),"unslick"===t?o["default"].createElement("div",null,s):o["default"].createElement(a.InnerSlider,n({ref:this.innerSliderRefHandler},t),s)}});t.exports=v},function(e,i){e.exports=t},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.InnerSlider=void 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(2),o=s(r),a=i(4),l=s(a),d=i(7),c=s(d),u=i(9),h=s(u),p=i(10),f=s(p),S=i(11),v=s(S),g=i(12),m=i(13),w=i(14);e.InnerSlider=o["default"].createClass({displayName:"InnerSlider",mixins:[c["default"],l["default"]],list:null,track:null,listRefHandler:function(t){this.list=t},trackRefHandler:function(t){this.track=t},getInitialState:function(){return n({},h["default"],{currentSlide:this.props.initialSlide})},getDefaultProps:function(){return f["default"]},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var t=[],e=0;e<o["default"].Children.count(this.props.children);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?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized)},componentWillUnmount:function(){this.animationEndCallback&&clearTimeout(this.animationEndCallback),window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized),this.state.autoPlayTimer&&window.clearInterval(this.state.autoPlayTimer)},componentWillReceiveProps:function(t){this.props.slickGoTo!=t.slickGoTo?(console.warn("react-slick deprecation warning: slickGoTo prop is deprecated and it will be removed in next release. Use slickGoTo method instead"),this.changeSlide({message:"index",index:t.slickGoTo,currentSlide:this.state.currentSlide})):this.state.currentSlide>=t.children.length?(this.update(t),this.changeSlide({message:"index",index:t.children.length-t.slidesToShow,currentSlide:this.state.currentSlide})):this.update(t)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.update(this.props),this.setState({animating:!1})},slickPrev:function(){this.changeSlide({message:"previous"})},slickNext:function(){this.changeSlide({message:"next"})},slickGoTo:function(t){"number"==typeof t&&this.changeSlide({message:"index",index:t,currentSlide:this.state.currentSlide})},render:function(){var t,e=(0,v["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,focusOnSelect:this.props.focusOnSelect?this.selectHandler:new Function,currentSlide:this.state.currentSlide,lazyLoad:this.props.lazyLoad,lazyLoadedList:this.state.lazyLoadedList,rtl:this.props.rtl,slideWidth:this.state.slideWidth,slidesToShow:this.props.slidesToShow,slidesToScroll:this.props.slidesToScroll,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};this.props.arrows&&(r=o["default"].createElement(w.PrevArrow,l),a=o["default"].createElement(w.NextArrow,l));var d=null;return this.props.vertical===!1?this.props.centerMode===!0&&(d={padding:"0px "+this.props.centerPadding}):this.props.centerMode===!0&&(d={padding:this.props.centerPadding+" 0px"}),o["default"].createElement("div",{className:e,onMouseEnter:this.onInnerSliderEnter,onMouseLeave:this.onInnerSliderLeave},r,o["default"].createElement("div",{ref:this.listRefHandler,className:"slick-list",style:d,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,onKeyDown:this.props.accessibility?this.keyHandler:null},o["default"].createElement(g.Track,n({ref:this.trackRefHandler},i),this.props.children)),a,t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=i(5),r=i(7),o=(s(r),i(8)),a=s(o),l={changeSlide:function(t){var e,i,s,n,r,o=this.props,a=o.slidesToScroll,l=o.slidesToShow,d=this.state,c=d.slideCount,u=d.currentSlide;if(n=c%a!==0,e=n?0:(c-u)%a,"previous"===t.message)s=0===e?a:l-e,r=u-s,this.props.lazyLoad&&(i=u-s,r=-1===i?c-1:i);else if("next"===t.message)s=0===e?a:e,r=u+s,this.props.lazyLoad&&(r=(u+a)%c+e);else if("dots"===t.message||"children"===t.message){if(r=t.index*t.slidesToScroll,r===t.currentSlide)return}else if("index"===t.message&&(r=parseInt(t.index),r===t.currentSlide))return;this.slideHandler(r)},keyHandler:function(t){t.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===t.keyCode&&this.props.accessibility===!0?this.changeSlide({message:this.props.rtl===!0?"next":"previous"}):39===t.keyCode&&this.props.accessibility===!0&&this.changeSlide({message:this.props.rtl===!0?"previous":"next"}))},selectHandler:function(t){this.changeSlide(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)return void t.preventDefault();if(!this.state.animating){var e,i,s,r=this.state.touchObject;i=(0,n.getTrackLeft)((0,a["default"])({slideIndex:this.state.currentSlide,trackRef:this.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 o=this.state.currentSlide,l=Math.ceil(this.state.slideCount/this.props.slidesToScroll),d=this.swipeDirection(this.state.touchObject),c=r.swipeLength;this.props.infinite===!1&&(0===o&&"right"===d||o+1>=l&&"left"===d)&&(c=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+c*s,this.setState({touchObject:r,swipeLeft:e,trackStyle:(0,n.getTrackCSS)((0,a["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)return void t.preventDefault();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=(0,n.getTrackLeft)((0,a["default"])({slideIndex:this.state.currentSlide,trackRef:this.track},this.props,this.state));this.setState({trackStyle:(0,n.getTrackAnimateCSS)((0,a["default"])({left:r},this.props,this.state))})}},onInnerSliderEnter:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.pause()},onInnerSliderLeave:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.autoPlay()}};e["default"]=l},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.getTrackLeft=e.getTrackAnimateCSS=e.getTrackCSS=void 0;var n=i(6),r=s(n),o=function(t,e){return e.reduce(function(e,i){return e&&t.hasOwnProperty(i)},!0)?null:console.error("Keys Missing",t)},a=e.getTrackCSS=function(t){o(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!window.addEventListener&&window.attachEvent&&(i.marginLeft=t.left+"px"),i};e.getTrackAnimateCSS=function(t){o(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var e=a(t);return e.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,e.transition="transform "+t.speed+"ms "+t.cssEase,e},e.getTrackLeft=function(t){o(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth"]);var e,i,s=0;if(t.fade)return 0;if(t.infinite)t.slideCount>t.slidesToShow&&(s=t.slideWidth*t.slidesToShow*-1),t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow&&(s=t.slideIndex>t.slideCount?(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideWidth*-1:t.slideCount%t.slidesToScroll*t.slideWidth*-1);else if(t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow){var n=t.slidesToShow-t.slideCount%t.slidesToScroll;s=n*t.slideWidth}if(t.centerMode&&(t.infinite?s+=t.slideWidth*Math.floor(t.slidesToShow/2):s=t.slideWidth*Math.floor(t.slidesToShow/2)),e=t.slideIndex*t.slideWidth*-1+s,t.variableWidth===!0){var a;t.slideCount<=t.slidesToShow||t.infinite===!1?i=r["default"].findDOMNode(t.trackRef).childNodes[t.slideIndex]:(a=t.slideIndex+t.slidesToShow,i=r["default"].findDOMNode(t.trackRef).childNodes[a]),e=i?-1*i.offsetLeft:0,t.centerMode===!0&&(i=t.infinite===!1?r["default"].findDOMNode(t.trackRef).children[t.slideIndex]:r["default"].findDOMNode(t.trackRef).children[t.slideIndex+t.slidesToShow+1],e=i?-1*i.offsetLeft:0,e+=(t.listWidth-i.offsetWidth)/2)}return e}},function(t,i){t.exports=e},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=i(2),r=s(n),o=i(6),a=s(o),l=i(5),d=i(8),c=s(d),u={initialize:function(t){var e=r["default"].Children.count(t.children),i=this.getWidth(a["default"].findDOMNode(this.list)),s=this.getWidth(a["default"].findDOMNode(this.track)),n=s/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=(0,l.getTrackLeft)((0,c["default"])({slideIndex:this.state.currentSlide,trackRef:this.track},t,this.state)),i=(0,l.getTrackCSS)((0,c["default"])({left:e},t,this.state));this.setState({trackStyle:i}),this.autoPlay()})},update:function(t){var e=r["default"].Children.count(t.children),i=this.getWidth(a["default"].findDOMNode(this.list)),s=this.getWidth(a["default"].findDOMNode(this.track)),n=this.getWidth(a["default"].findDOMNode(this))/t.slidesToShow;t.autoplay||this.pause(),this.setState({slideCount:e,slideWidth:n,listWidth:i,trackWidth:s},function(){var e=(0,l.getTrackLeft)((0,c["default"])({slideIndex:this.state.currentSlide,trackRef:this.track},t,this.state)),i=(0,l.getTrackCSS)((0,c["default"])({left:e},t,this.state));this.setState({trackStyle:i})})},getWidth:function(t){return t.getBoundingClientRect().width||t.offsetWidth},adaptHeight:function(){if(this.props.adaptiveHeight){var t='[data-index="'+this.state.currentSlide+'"]';if(this.list){var e=a["default"].findDOMNode(this.list);e.style.height=e.querySelector(t).offsetHeight+"px"}}},slideHandler:function(t){var e,i,s,n,r,o=this;if(!this.props.waitForAnimate||!this.state.animating){if(this.props.fade){if(i=this.state.currentSlide,this.props.infinite===!1&&(0>t||t>=this.state.slideCount))return;return 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(e),delete o.animationEndCallback},this.setState({animating:!0,currentSlide:e},function(){this.animationEndCallback=setTimeout(r,this.props.speed)}),this.props.beforeChange&&this.props.beforeChange(this.state.currentSlide,e),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=(0,l.getTrackLeft)((0,c["default"])({slideIndex:e,trackRef:this.track},this.props,this.state)),n=(0,l.getTrackLeft)((0,c["default"])({slideIndex:i,trackRef:this.track},this.props,this.state)),this.props.infinite===!1&&(s=n),this.props.beforeChange&&this.props.beforeChange(this.state.currentSlide,i),this.props.lazyLoad){for(var a=!0,d=[],u=e;u<e+this.props.slidesToShow;u++)a=a&&this.state.lazyLoadedList.indexOf(u)>=0,a||d.push(u);a||this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(d)})}if(this.props.useCSS===!1)this.setState({currentSlide:i,trackStyle:(0,l.getTrackCSS)((0,c["default"])({left:n},this.props,this.state))},function(){this.props.afterChange&&this.props.afterChange(i)});else{var h={animating:!1,currentSlide:i,trackStyle:(0,l.getTrackCSS)((0,c["default"])({left:n},this.props,this.state)),swipeLeft:null};r=function(){o.setState(h),o.props.afterChange&&o.props.afterChange(i),delete o.animationEndCallback},this.setState({animating:!0,currentSlide:i,trackStyle:(0,l.getTrackAnimateCSS)((0,c["default"])({left:s},this.props,this.state))},function(){this.animationEndCallback=setTimeout(r,this.props.speed)})}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;if(!this.state.autoPlayTimer){var e=function(){if(t.state.mounted){var e=t.props.rtl?t.state.currentSlide-t.props.slidesToScroll:t.state.currentSlide+t.props.slidesToScroll;t.slideHandler(e)}};this.props.autoplay&&this.setState({autoPlayTimer:window.setInterval(e,this.props.autoplaySpeed)})}},pause:function(){this.state.autoPlayTimer&&(window.clearInterval(this.state.autoPlayTimer),this.setState({autoPlayTimer:null}))}};e["default"]=u},function(t,e){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;10>i;i++)e["_"+String.fromCharCode(i)]=i;var s=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==s.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(r){return!1}}var n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=s()?Object.assign:function(t,e){for(var s,o,a=i(t),l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var d in s)n.call(s,d)&&(a[d]=s[d]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(s);for(var c=0;c<o.length;c++)r.call(s,o[c])&&(a[o[c]]=s[o[c]])}}return a}},function(t,e){"use strict";var i={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=i},function(t,e){"use strict";var i={className:"",accessibility:!0,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,pauseOnHover:!0,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,waitForAnimate:!0,afterChange:null,beforeChange:null,edgeEvent:null,init:null,swipeEvent:null,nextArrow:null,prevArrow:null};t.exports=i},function(t,e,i){var s,n;/*! | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.Slider=e(require("react"),require("react-dom")):t.Slider=e(t.React,t.ReactDOM)}(this,function(t,e){return function(t){function e(s){if(i[s])return i[s].exports;var r=i[s]={exports:{},id:s,loaded:!1};return t[s].call(r.exports,r,r.exports,e),r.loaded=!0,r.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 r=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},n=i(2),o=s(n),l=i(3),a=i(7),d=s(a),c=i(15),h=s(c),u=i(17),p=s(u),f=i(10),S=s(f),v=o["default"].createClass({displayName:"Slider",mixins:[p["default"]],innerSlider:null,innerSliderRefHandler:function(t){this.innerSlider=t},getInitialState:function(){return{breakpoint:null}},componentWillMount: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 r;r=0===s?(0,h["default"])({minWidth:0,maxWidth:i}):(0,h["default"])({minWidth:e[s-1],maxWidth:i}),t.media(r,function(){t.setState({breakpoint:i})})});var i=(0,h["default"])({minWidth:e.slice(-1)[0]});this.media(i,function(){t.setState({breakpoint:null})})}},slickPrev:function(){this.innerSlider.slickPrev()},slickNext:function(){this.innerSlider.slickNext()},slickGoTo:function(t){this.innerSlider.slickGoTo(t)},render:function(){var t,e,i=this;this.state.breakpoint?(e=this.props.responsive.filter(function(t){return t.breakpoint===i.state.breakpoint}),t="unslick"===e[0].settings?"unslick":(0,d["default"])({},this.props,e[0].settings)):t=(0,d["default"])({},S["default"],this.props);var s=this.props.children;return Array.isArray(s)||(s=[s]),s=s.filter(function(t){return!!t}),"unslick"===t?o["default"].createElement("div",null,s):o["default"].createElement(l.InnerSlider,r({ref:this.innerSliderRefHandler},t),s)}});t.exports=v},function(e,i){e.exports=t},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.InnerSlider=void 0;var r=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},n=i(2),o=s(n),l=i(4),a=s(l),d=i(8),c=s(d),h=i(9),u=s(h),p=i(10),f=s(p),S=i(11),v=s(S),g=i(7),w=s(g),m=i(12),y=i(13),k=i(14);e.InnerSlider=o["default"].createClass({displayName:"InnerSlider",mixins:[c["default"],a["default"]],list:null,track:null,listRefHandler:function(t){this.list=t},trackRefHandler:function(t){this.track=t},getInitialState:function(){return r({},u["default"],{currentSlide:this.props.initialSlide})},getDefaultProps:function(){return f["default"]},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var t=[],e=0;e<o["default"].Children.count(this.props.children);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&&(window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized))},componentWillUnmount:function(){this.animationEndCallback&&clearTimeout(this.animationEndCallback),window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized),this.state.autoPlayTimer&&clearInterval(this.state.autoPlayTimer)},componentWillReceiveProps:function(t){this.props.slickGoTo!=t.slickGoTo?(console.warn("react-slick deprecation warning: slickGoTo prop is deprecated and it will be removed in next release. Use slickGoTo method instead"),this.changeSlide({message:"index",index:t.slickGoTo,currentSlide:this.state.currentSlide})):this.state.currentSlide>=t.children.length?(this.update(t),this.changeSlide({message:"index",index:t.children.length-t.slidesToShow,currentSlide:this.state.currentSlide})):this.update(t)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.update(this.props),this.setState({animating:!1})},slickPrev:function(){this.changeSlide({message:"previous"})},slickNext:function(){this.changeSlide({message:"next"})},slickGoTo:function(t){"number"==typeof t&&this.changeSlide({message:"index",index:t,currentSlide:this.state.currentSlide})},render:function(){var t,e=(0,v["default"])("slick-initialized","slick-slider",this.props.className,{"slick-vertical":this.props.vertical}),i={fade:this.props.fade,cssEase:this.props.cssEase,speed:this.props.speed,infinite:this.props.infinite,centerMode:this.props.centerMode,focusOnSelect:this.props.focusOnSelect?this.selectHandler:null,currentSlide:this.state.currentSlide,lazyLoad:this.props.lazyLoad,lazyLoadedList:this.state.lazyLoadedList,rtl:this.props.rtl,slideWidth:this.state.slideWidth,slidesToShow:this.props.slidesToShow,slidesToScroll:this.props.slidesToScroll,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(y.Dots,s)}var n,l,a={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};this.props.arrows&&(n=o["default"].createElement(k.PrevArrow,a),l=o["default"].createElement(k.NextArrow,a));var d=null;this.props.vertical&&(d={height:this.state.listHeight});var c=null;this.props.vertical===!1?this.props.centerMode===!0&&(c={padding:"0px "+this.props.centerPadding}):this.props.centerMode===!0&&(c={padding:this.props.centerPadding+" 0px"});var h=(0,w["default"])({},d,c);return o["default"].createElement("div",{className:e,onMouseEnter:this.onInnerSliderEnter,onMouseLeave:this.onInnerSliderLeave},n,o["default"].createElement("div",{ref:this.listRefHandler,className:"slick-list",style:h,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,onKeyDown:this.props.accessibility?this.keyHandler:null},o["default"].createElement(m.Track,r({ref:this.trackRefHandler},i),this.props.children)),l,t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var r=i(5),n=i(8),o=(s(n),i(7)),l=s(o),a={changeSlide:function(t){var e,i,s,r,n,o=this.props,l=o.slidesToScroll,a=o.slidesToShow,d=this.state,c=d.slideCount,h=d.currentSlide;if(r=c%l!==0,e=r?0:(c-h)%l,"previous"===t.message)s=0===e?l:a-e,n=h-s,this.props.lazyLoad&&(i=h-s,n=-1===i?c-1:i);else if("next"===t.message)s=0===e?l:e,n=h+s,this.props.lazyLoad&&(n=(h+l)%c+e);else if("dots"===t.message||"children"===t.message){if(n=t.index*t.slidesToScroll,n===t.currentSlide)return}else if("index"===t.message&&(n=parseInt(t.index),n===t.currentSlide))return;this.slideHandler(n)},keyHandler:function(t){t.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===t.keyCode&&this.props.accessibility===!0?this.changeSlide({message:this.props.rtl===!0?"next":"previous"}):39===t.keyCode&&this.props.accessibility===!0&&this.changeSlide({message:this.props.rtl===!0?"previous":"next"}))},selectHandler:function(t){this.changeSlide(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)return void t.preventDefault();if(!this.state.animating){var e,i,s,n=this.state.touchObject;i=(0,r.getTrackLeft)((0,l["default"])({slideIndex:this.state.currentSlide,trackRef:this.track},this.props,this.state)),n.curX=t.touches?t.touches[0].pageX:t.clientX,n.curY=t.touches?t.touches[0].pageY:t.clientY,n.swipeLength=Math.round(Math.sqrt(Math.pow(n.curX-n.startX,2))),this.props.verticalSwiping&&(n.swipeLength=Math.round(Math.sqrt(Math.pow(n.curY-n.startY,2)))),s=(this.props.rtl===!1?1:-1)*(n.curX>n.startX?1:-1),this.props.verticalSwiping&&(s=n.curY>n.startY?1:-1);var o=this.state.currentSlide,a=Math.ceil(this.state.slideCount/this.props.slidesToScroll),d=this.swipeDirection(this.state.touchObject),c=n.swipeLength;this.props.infinite===!1&&(0===o&&"right"===d||o+1>=a&&"left"===d)&&(c=n.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=this.props.vertical?i+c*(this.state.listHeight/this.state.listWidth)*s:i+c*s,this.props.verticalSwiping&&(e=i+c*s),this.setState({touchObject:n,swipeLeft:e,trackStyle:(0,r.getTrackCSS)((0,l["default"])({left:e},this.props,this.state))}),Math.abs(n.curX-n.startX)<.8*Math.abs(n.curY-n.startY)||n.swipeLength>4&&t.preventDefault()}},swipeEnd:function(t){if(!this.state.dragging)return void t.preventDefault();var e=this.state.touchObject,i=this.state.listWidth/this.props.touchThreshold,s=this.swipeDirection(e);if(this.props.verticalSwiping&&(i=this.state.listHeight/this.props.touchThreshold),this.setState({dragging:!1,edgeDragged:!1,swiped:!1,swipeLeft:null,touchObject:{}}),e.swipeLength)if(e.swipeLength>i)switch(t.preventDefault(),s){case"left":case"down":this.slideHandler(this.state.currentSlide+this.props.slidesToScroll);break;case"right":case"up":this.slideHandler(this.state.currentSlide-this.props.slidesToScroll)}else{var n=(0,r.getTrackLeft)((0,l["default"])({slideIndex:this.state.currentSlide,trackRef:this.track},this.props,this.state));this.setState({trackStyle:(0,r.getTrackAnimateCSS)((0,l["default"])({left:n},this.props,this.state))})}},onInnerSliderEnter:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.pause()},onInnerSliderLeave:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.autoPlay()}};e["default"]=a},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.getTrackLeft=e.getTrackAnimateCSS=e.getTrackCSS=void 0;var r=i(6),n=s(r),o=i(7),l=s(o),a=function(t,e){return e.reduce(function(e,i){return e&&t.hasOwnProperty(i)},!0)?null:console.error("Keys Missing",t)},d=e.getTrackCSS=function(t){a(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var e,i,s=t.slideCount+2*t.slidesToShow;t.vertical?i=s*t.slideHeight: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 r={opacity:1,WebkitTransform:t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",transform:t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",transition:"",WebkitTransition:"",msTransform:t.vertical?"translateY("+t.left+"px)":"translateX("+t.left+"px)"};return e&&(0,l["default"])(r,{width:e}),i&&(0,l["default"])(r,{height:i}),window&&!window.addEventListener&&window.attachEvent&&(t.vertical?r.marginTop=t.left+"px":r.marginLeft=t.left+"px"),r};e.getTrackAnimateCSS=function(t){a(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var e=d(t);return e.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,e.transition="transform "+t.speed+"ms "+t.cssEase,e},e.getTrackLeft=function(t){a(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var e,i,s=0,r=0;if(t.fade)return 0;if(t.infinite)t.slideCount>=t.slidesToShow&&(s=t.slideWidth*t.slidesToShow*-1,r=t.slideHeight*t.slidesToShow*-1),t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow&&(t.slideIndex>t.slideCount?(s=(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideWidth*-1,r=(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideHeight*-1):(s=t.slideCount%t.slidesToScroll*t.slideWidth*-1,r=t.slideCount%t.slidesToScroll*t.slideHeight*-1));else if(t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow){var o=t.slidesToShow-t.slideCount%t.slidesToScroll;s=o*t.slideWidth}if(t.centerMode&&(t.infinite?s+=t.slideWidth*Math.floor(t.slidesToShow/2):s=t.slideWidth*Math.floor(t.slidesToShow/2)),e=t.vertical?t.slideIndex*t.slideHeight*-1+r:t.slideIndex*t.slideWidth*-1+s,t.variableWidth===!0){var l;t.slideCount<=t.slidesToShow||t.infinite===!1?i=n["default"].findDOMNode(t.trackRef).childNodes[t.slideIndex]:(l=t.slideIndex+t.slidesToShow,i=n["default"].findDOMNode(t.trackRef).childNodes[l]),e=i?-1*i.offsetLeft:0,t.centerMode===!0&&(i=t.infinite===!1?n["default"].findDOMNode(t.trackRef).children[t.slideIndex]:n["default"].findDOMNode(t.trackRef).children[t.slideIndex+t.slidesToShow+1],e=i?-1*i.offsetLeft:0,e+=(t.listWidth-i.offsetWidth)/2)}return e}},function(t,i){t.exports=e},function(t,e){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;10>i;i++)e["_"+String.fromCharCode(i)]=i;var s=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==s.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(n){return!1}}var r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=s()?Object.assign:function(t,e){for(var s,o,l=i(t),a=1;a<arguments.length;a++){s=Object(arguments[a]);for(var d in s)r.call(s,d)&&(l[d]=s[d]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(s);for(var c=0;c<o.length;c++)n.call(s,o[c])&&(l[o[c]]=s[o[c]])}}return l}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var r=i(2),n=s(r),o=i(6),l=s(o),a=i(5),d=i(7),c=s(d),h={initialize:function(t){var e,i=l["default"].findDOMNode(this.list),s=n["default"].Children.count(t.children),r=this.getWidth(i),o=this.getWidth(l["default"].findDOMNode(this.track));e=t.vertical?o:o/t.slidesToShow;var d=this.getHeight(i.querySelector('[data-index="0"]')),h=d*t.slidesToShow,u=t.rtl?s-1-t.initialSlide:t.initialSlide;this.setState({slideCount:s,slideWidth:e,listWidth:r,trackWidth:o,currentSlide:u,slideHeight:d,listHeight:h},function(){var e=(0,a.getTrackLeft)((0,c["default"])({slideIndex:this.state.currentSlide,trackRef:this.track},t,this.state)),i=(0,a.getTrackCSS)((0,c["default"])({left:e},t,this.state));this.setState({trackStyle:i}),this.autoPlay()})},update:function(t){var e,i=l["default"].findDOMNode(this.list),s=n["default"].Children.count(t.children),r=this.getWidth(i),o=this.getWidth(l["default"].findDOMNode(this.track));e=t.vertical?o:o/t.slidesToShow;var d=this.getHeight(i.querySelector('[data-index="0"]')),h=d*t.slidesToShow;t.autoplay||this.pause(),this.setState({slideCount:s,slideWidth:e,listWidth:r,trackWidth:o,slideHeight:d,listHeight:h},function(){var e=(0,a.getTrackLeft)((0,c["default"])({slideIndex:this.state.currentSlide,trackRef:this.track},t,this.state)),i=(0,a.getTrackCSS)((0,c["default"])({left:e},t,this.state));this.setState({trackStyle:i})})},getWidth:function(t){return t.getBoundingClientRect().width||t.offsetWidth},getHeight:function(t){return t.getBoundingClientRect().height||t.offsetHeight},adaptHeight:function(){if(this.props.adaptiveHeight){var t='[data-index="'+this.state.currentSlide+'"]';if(this.list){var e=l["default"].findDOMNode(this.list);e.style.height=e.querySelector(t).offsetHeight+"px"}}},slideHandler:function(t){var e,i,s,r,n,o=this;if(!this.props.waitForAnimate||!this.state.animating){if(this.props.fade){if(i=this.state.currentSlide,this.props.infinite===!1&&(0>t||t>=this.state.slideCount))return;return 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)}),n=function(){o.setState({animating:!1}),o.props.afterChange&&o.props.afterChange(e),delete o.animationEndCallback},this.setState({animating:!0,currentSlide:e},function(){this.animationEndCallback=setTimeout(n,this.props.speed)}),this.props.beforeChange&&this.props.beforeChange(this.state.currentSlide,e),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=(0,a.getTrackLeft)((0,c["default"])({slideIndex:e,trackRef:this.track},this.props,this.state)),r=(0,a.getTrackLeft)((0,c["default"])({slideIndex:i,trackRef:this.track},this.props,this.state)),this.props.infinite===!1&&(s=r),this.props.beforeChange&&this.props.beforeChange(this.state.currentSlide,i),this.props.lazyLoad){for(var l=!0,d=[],h=e;h<e+this.props.slidesToShow;h++)l=l&&this.state.lazyLoadedList.indexOf(h)>=0,l||d.push(h);l||this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(d)})}if(this.props.useCSS===!1)this.setState({currentSlide:i,trackStyle:(0,a.getTrackCSS)((0,c["default"])({left:r},this.props,this.state))},function(){this.props.afterChange&&this.props.afterChange(i)});else{var u={animating:!1,currentSlide:i,trackStyle:(0,a.getTrackCSS)((0,c["default"])({left:r},this.props,this.state)),swipeLeft:null};n=function(){o.setState(u),o.props.afterChange&&o.props.afterChange(i),delete o.animationEndCallback},this.setState({animating:!0,currentSlide:i,trackStyle:(0,a.getTrackAnimateCSS)((0,c["default"])({left:s},this.props,this.state))},function(){this.animationEndCallback=setTimeout(n,this.props.speed)})}this.autoPlay()}},swipeDirection:function(t){var e,i,s,r;return e=t.startX-t.curX,i=t.startY-t.curY,s=Math.atan2(i,e),r=Math.round(180*s/Math.PI),0>r&&(r=360-Math.abs(r)),45>=r&&r>=0||360>=r&&r>=315?this.props.rtl===!1?"left":"right":r>=135&&225>=r?this.props.rtl===!1?"right":"left":this.props.verticalSwiping===!0?r>=35&&135>=r?"down":"up":"vertical"},autoPlay:function(){var t=this;if(!this.state.autoPlayTimer){var e=function(){if(t.state.mounted){var e=t.props.rtl?t.state.currentSlide-t.props.slidesToScroll:t.state.currentSlide+t.props.slidesToScroll;t.slideHandler(e)}};this.props.autoplay&&this.setState({autoPlayTimer:setInterval(e,this.props.autoplaySpeed)})}},pause:function(){this.state.autoPlayTimer&&(clearInterval(this.state.autoPlayTimer),this.setState({autoPlayTimer:null}))}};e["default"]=h},function(t,e){"use strict";var i={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,listWidth:null,listHeight:null,slideCount:null,slideWidth:null,slideHeight:null,swipeLeft:null,touchObject:{startX:0,startY:0,curX:0,curY:0},lazyLoadedList:[],initialized:!1,edgeDragged:!1,swiped:!1,trackStyle:{},trackWidth:0};t.exports=i},function(t,e){"use strict";var i={className:"",accessibility:!0,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,pauseOnHover:!0,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,waitForAnimate:!0,afterChange:null,beforeChange:null,edgeEvent:null,init:null,swipeEvent:null,nextArrow:null,prevArrow:null};t.exports=i},function(t,e,i){var s,r;/*! | ||
Copyright (c) 2016 Jed Watson. | ||
@@ -6,2 +6,2 @@ Licensed under the MIT License (MIT), see | ||
*/ | ||
!function(){"use strict";function i(){for(var t=[],e=0;e<arguments.length;e++){var s=arguments[e];if(s){var n=typeof s;if("string"===n||"number"===n)t.push(s);else if(Array.isArray(s))t.push(i.apply(null,s));else if("object"===n)for(var o in s)r.call(s,o)&&s[o]&&t.push(o)}}return t.join(" ")}var r={}.hasOwnProperty;"undefined"!=typeof t&&t.exports?t.exports=i:(s=[],n=function(){return i}.apply(e,s),!(void 0!==n&&(t.exports=n)))}()},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.Track=void 0;var n=i(2),r=s(n),o=i(8),a=s(o),l=i(11),d=s(l),c=function(t){var e,i,s,n,r;return r=t.rtl?t.slideCount-1-t.index:t.index,s=0>r||r>=t.slideCount,t.centerMode?(n=Math.floor(t.slidesToShow/2),i=(r-t.currentSlide)%t.slideCount===0,r>t.currentSlide-n-1&&r<=t.currentSlide+n&&(e=!0)):e=t.currentSlide<=r&&r<t.currentSlide+t.slidesToShow,(0,d["default"])({"slick-slide":!0,"slick-active":e,"slick-center":i,"slick-cloned":s})},u=function(t){var e={};return void 0!==t.variableWidth&&t.variableWidth!==!1||(e.width=t.slideWidth),t.fade&&(e.position="relative",e.left=-t.index*t.slideWidth,e.opacity=t.currentSlide===t.index?1:0,e.transition="opacity "+t.speed+"ms "+t.cssEase,e.WebkitTransition="opacity "+t.speed+"ms "+t.cssEase),e},h=function(t,e){return null===t.key||void 0===t.key?e:t.key},p=function(t){var e,i=[],s=[],n=[],o=r["default"].Children.count(t.children);return r["default"].Children.forEach(t.children,function(l,p){var f=void 0,S={message:"children",index:p,slidesToScroll:t.slidesToScroll,currentSlide:t.currentSlide};f=!t.lazyLoad|(t.lazyLoad&&t.lazyLoadedList.indexOf(p)>=0)?l:r["default"].createElement("div",null);var v,g=u((0,a["default"])({},t,{index:p})),m=c((0,a["default"])({index:p},t));v=f.props.className?(0,d["default"])(m,f.props.className):m;var w=function(e){f.props&&f.props.onClick&&f.props.onClick(e),t.focusOnSelect(S)};if(i.push(r["default"].cloneElement(f,{key:"original"+h(f,p),"data-index":p,className:v,tabIndex:"-1",style:(0,a["default"])({outline:"none"},f.props.style||{},g),onClick:w})),t.infinite&&t.fade===!1){var y=t.variableWidth?t.slidesToShow+1:t.slidesToShow;p>=o-y&&(e=-(o-p),s.push(r["default"].cloneElement(f,{key:"precloned"+h(f,e),"data-index":e,className:v,style:(0,a["default"])({},f.props.style||{},g),onClick:w}))),y>p&&(e=o+p,n.push(r["default"].cloneElement(f,{key:"postcloned"+h(f,e),"data-index":e,className:v,style:(0,a["default"])({},f.props.style||{},g),onClick:w})))}}),t.rtl?s.concat(i,n).reverse():s.concat(i,n)};e.Track=r["default"].createClass({displayName:"Track",render:function(){var t=p.call(this,this.props);return r["default"].createElement("div",{className:"slick-track",style:this.props.trackStyle},t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.Dots=void 0;var n=i(2),r=s(n),o=i(11),a=s(o),l=function(t){var e;return e=Math.ceil(t.slideCount/t.slidesToScroll)};e.Dots=r["default"].createClass({displayName:"Dots",clickHandler:function(t,e){e.preventDefault(),this.props.clickHandler(t)},render:function(){var t=this,e=l({slideCount:this.props.slideCount,slidesToScroll:this.props.slidesToScroll}),i=Array.apply(null,Array(e+1).join("0").split("")).map(function(e,i){var s=i*t.props.slidesToScroll,n=i*t.props.slidesToScroll+(t.props.slidesToScroll-1),o=(0,a["default"])({"slick-active":t.props.currentSlide>=s&&t.props.currentSlide<=n}),l={message:"dots",index:i,slidesToScroll:t.props.slidesToScroll,currentSlide:t.props.currentSlide};return r["default"].createElement("li",{key:i,className:o},r["default"].createElement("button",{onClick:t.clickHandler.bind(t,l)},i+1))});return r["default"].createElement("ul",{className:this.props.dotsClass,style:{display:"block"}},i)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.NextArrow=e.PrevArrow=void 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(2),o=s(r),a=i(11),l=s(a);e.PrevArrow=o["default"].createClass({displayName:"PrevArrow",clickHandler:function(t,e){e&&e.preventDefault(),this.props.clickHandler(t,e)},render:function(){var t={"slick-arrow":!0,"slick-prev":!0},e=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(0===this.props.currentSlide||this.props.slideCount<=this.props.slidesToShow)&&(t["slick-disabled"]=!0,e=null);var i,s={key:"0","data-role":"none",className:(0,l["default"])(t),style:{display:"block"},onClick:e};return i=this.props.prevArrow?o["default"].cloneElement(this.props.prevArrow,s):o["default"].createElement("button",n({key:"0",type:"button"},s)," Previous")}}),e.NextArrow=o["default"].createClass({displayName:"NextArrow",clickHandler:function(t,e){e&&e.preventDefault(),this.props.clickHandler(t,e)},render:function(){var t={"slick-arrow":!0,"slick-next":!0},e=this.clickHandler.bind(this,{message:"next"});this.props.infinite||(this.props.centerMode&&this.props.currentSlide>=this.props.slideCount-1?(t["slick-disabled"]=!0,e=null):this.props.currentSlide>=this.props.slideCount-this.props.slidesToShow&&(t["slick-disabled"]=!0,e=null),this.props.slideCount<=this.props.slidesToShow&&(t["slick-disabled"]=!0,e=null));var i,s={key:"1","data-role":"none",className:(0,l["default"])(t),style:{display:"block"},onClick:e};return i=this.props.nextArrow?o["default"].cloneElement(this.props.nextArrow,s):o["default"].createElement("button",n({key:"1",type:"button"},s)," Next")}})},function(t,e,i){var s=i(16),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){var i=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}).toLowerCase()};t.exports=i},function(t,e,i){var s=i(18),n=s&&i(19),r=i(15),o={media:function(t,e){t=r(t),"function"==typeof e&&(e={match:e}),s&&n.register(t,e),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:t,handler:e})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(t){s&&n.unregister(t.query,t.handler)})}};t.exports=o},function(t,e){var i=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=i},function(t,e,i){var s;!function(n,r,o){var a=window.matchMedia;"undefined"!=typeof t&&t.exports?t.exports=o(a):(s=function(){return r[n]=o(a)}.call(e,i,e,t),!(void 0!==s&&(t.exports=s)))}("enquire",this,function(t){"use strict";function e(t,e){var i,s=0,n=t.length;for(s;n>s&&(i=e(t[s],s),i!==!1);s++);}function i(t){return"[object Array]"===Object.prototype.toString.apply(t)}function s(t){return"function"==typeof t}function n(t){this.options=t,!t.deferSetup&&this.setup()}function r(e,i){this.query=e,this.isUnconditional=i,this.handlers=[],this.mql=t(e);var s=this;this.listener=function(t){s.mql=t,s.assess()},this.mql.addListener(this.listener)}function o(){if(!t)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return n.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(t){return this.options===t||this.options.match===t}},r.prototype={addHandler:function(t){var e=new n(t);this.handlers.push(e),this.matches()&&e.on()},removeHandler:function(t){var i=this.handlers;e(i,function(e,s){return e.equals(t)?(e.destroy(),!i.splice(s,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){e(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";e(this.handlers,function(e){e[t]()})}},o.prototype={register:function(t,n,o){var a=this.queries,l=o&&this.browserIsIncapable;return a[t]||(a[t]=new r(t,l)),s(n)&&(n={match:n}),i(n)||(n=[n]),e(n,function(e){a[t].addHandler(e)}),this},unregister:function(t,e){var i=this.queries[t];return i&&(e?i.removeHandler(e):(i.clear(),delete this.queries[t])),this}},new o})}])}); | ||
!function(){"use strict";function i(){for(var t=[],e=0;e<arguments.length;e++){var s=arguments[e];if(s){var r=typeof s;if("string"===r||"number"===r)t.push(s);else if(Array.isArray(s))t.push(i.apply(null,s));else if("object"===r)for(var o in s)n.call(s,o)&&s[o]&&t.push(o)}}return t.join(" ")}var n={}.hasOwnProperty;"undefined"!=typeof t&&t.exports?t.exports=i:(s=[],r=function(){return i}.apply(e,s),!(void 0!==r&&(t.exports=r)))}()},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.Track=void 0;var r=i(2),n=s(r),o=i(7),l=s(o),a=i(11),d=s(a),c=function(t){var e,i,s,r,n;return n=t.rtl?t.slideCount-1-t.index:t.index,s=0>n||n>=t.slideCount,t.centerMode?(r=Math.floor(t.slidesToShow/2),i=(n-t.currentSlide)%t.slideCount===0,n>t.currentSlide-r-1&&n<=t.currentSlide+r&&(e=!0)):e=t.currentSlide<=n&&n<t.currentSlide+t.slidesToShow,(0,d["default"])({"slick-slide":!0,"slick-active":e,"slick-center":i,"slick-cloned":s})},h=function(t){var e={};return void 0!==t.variableWidth&&t.variableWidth!==!1||(e.width=t.slideWidth),t.fade&&(e.position="relative",e.left=-t.index*t.slideWidth,e.opacity=t.currentSlide===t.index?1:0,e.transition="opacity "+t.speed+"ms "+t.cssEase,e.WebkitTransition="opacity "+t.speed+"ms "+t.cssEase),e},u=function(t,e){return null===t.key||void 0===t.key?e:t.key},p=function(t){var e,i=[],s=[],r=[],o=n["default"].Children.count(t.children);return n["default"].Children.forEach(t.children,function(a,p){var f=void 0,S={message:"children",index:p,slidesToScroll:t.slidesToScroll,currentSlide:t.currentSlide};f=!t.lazyLoad|(t.lazyLoad&&t.lazyLoadedList.indexOf(p)>=0)?a:n["default"].createElement("div",null);var v,g=h((0,l["default"])({},t,{index:p})),w=c((0,l["default"])({index:p},t));v=f.props.className?(0,d["default"])(w,f.props.className):w;var m=function(e){f.props&&f.props.onClick&&f.props.onClick(e),t.focusOnSelect&&t.focusOnSelect(S)};if(i.push(n["default"].cloneElement(f,{key:"original"+u(f,p),"data-index":p,className:v,tabIndex:"-1",style:(0,l["default"])({outline:"none"},f.props.style||{},g),onClick:m})),t.infinite&&t.fade===!1){var y=t.variableWidth?t.slidesToShow+1:t.slidesToShow;p>=o-y&&(e=-(o-p),s.push(n["default"].cloneElement(f,{key:"precloned"+u(f,e),"data-index":e,className:v,style:(0,l["default"])({},f.props.style||{},g),onClick:m}))),y>p&&(e=o+p,r.push(n["default"].cloneElement(f,{key:"postcloned"+u(f,e),"data-index":e,className:v,style:(0,l["default"])({},f.props.style||{},g),onClick:m})))}}),t.rtl?s.concat(i,r).reverse():s.concat(i,r)};e.Track=n["default"].createClass({displayName:"Track",render:function(){var t=p.call(this,this.props);return n["default"].createElement("div",{className:"slick-track",style:this.props.trackStyle},t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.Dots=void 0;var r=i(2),n=s(r),o=i(11),l=s(o),a=function(t){var e;return e=Math.ceil(t.slideCount/t.slidesToScroll)};e.Dots=n["default"].createClass({displayName:"Dots",clickHandler:function(t,e){e.preventDefault(),this.props.clickHandler(t)},render:function(){var t=this,e=a({slideCount:this.props.slideCount,slidesToScroll:this.props.slidesToScroll}),i=Array.apply(null,Array(e+1).join("0").split("")).map(function(e,i){var s=i*t.props.slidesToScroll,r=i*t.props.slidesToScroll+(t.props.slidesToScroll-1),o=(0,l["default"])({"slick-active":t.props.currentSlide>=s&&t.props.currentSlide<=r}),a={message:"dots",index:i,slidesToScroll:t.props.slidesToScroll,currentSlide:t.props.currentSlide};return n["default"].createElement("li",{key:i,className:o},n["default"].createElement("button",{onClick:t.clickHandler.bind(t,a)},i+1))});return n["default"].createElement("ul",{className:this.props.dotsClass,style:{display:"block"}},i)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.NextArrow=e.PrevArrow=void 0;var r=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},n=i(2),o=s(n),l=i(11),a=s(l);e.PrevArrow=o["default"].createClass({displayName:"PrevArrow",clickHandler:function(t,e){e&&e.preventDefault(),this.props.clickHandler(t,e)},render:function(){var t={"slick-arrow":!0,"slick-prev":!0},e=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(0===this.props.currentSlide||this.props.slideCount<=this.props.slidesToShow)&&(t["slick-disabled"]=!0,e=null);var i,s={key:"0","data-role":"none",className:(0,a["default"])(t),style:{display:"block"},onClick:e};return i=this.props.prevArrow?o["default"].cloneElement(this.props.prevArrow,s):o["default"].createElement("button",r({key:"0",type:"button"},s)," Previous")}}),e.NextArrow=o["default"].createClass({displayName:"NextArrow",clickHandler:function(t,e){e&&e.preventDefault(),this.props.clickHandler(t,e)},render:function(){var t={"slick-arrow":!0,"slick-next":!0},e=this.clickHandler.bind(this,{message:"next"});this.props.infinite||(this.props.centerMode&&this.props.currentSlide>=this.props.slideCount-1?(t["slick-disabled"]=!0,e=null):this.props.currentSlide>=this.props.slideCount-this.props.slidesToShow&&(t["slick-disabled"]=!0,e=null),this.props.slideCount<=this.props.slidesToShow&&(t["slick-disabled"]=!0,e=null));var i,s={key:"1","data-role":"none",className:(0,a["default"])(t),style:{display:"block"},onClick:e};return i=this.props.nextArrow?o["default"].cloneElement(this.props.nextArrow,s):o["default"].createElement("button",r({key:"1",type:"button"},s)," Next")}})},function(t,e,i){var s=i(16),r=function(t){var e=/[height|width]$/;return e.test(t)},n=function(t){var e="",i=Object.keys(t);return i.forEach(function(n,o){var l=t[n];n=s(n),r(n)&&"number"==typeof l&&(l+="px"),e+=l===!0?n:l===!1?"not "+n:"("+n+": "+l+")",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+=n(i),s<t.length-1&&(e+=", ")}),e):n(t)};t.exports=o},function(t,e){var i=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}).toLowerCase()};t.exports=i},function(t,e,i){var s=i(18),r=s&&i(19),n=i(15),o={media:function(t,e){t=n(t),"function"==typeof e&&(e={match:e}),s&&r.register(t,e),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:t,handler:e})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(t){s&&r.unregister(t.query,t.handler)})}};t.exports=o},function(t,e){var i=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=i},function(t,e,i){var s;!function(r,n,o){var l=window.matchMedia;"undefined"!=typeof t&&t.exports?t.exports=o(l):(s=function(){return n[r]=o(l)}.call(e,i,e,t),!(void 0!==s&&(t.exports=s)))}("enquire",this,function(t){"use strict";function e(t,e){var i,s=0,r=t.length;for(s;r>s&&(i=e(t[s],s),i!==!1);s++);}function i(t){return"[object Array]"===Object.prototype.toString.apply(t)}function s(t){return"function"==typeof t}function r(t){this.options=t,!t.deferSetup&&this.setup()}function n(e,i){this.query=e,this.isUnconditional=i,this.handlers=[],this.mql=t(e);var s=this;this.listener=function(t){s.mql=t,s.assess()},this.mql.addListener(this.listener)}function o(){if(!t)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return r.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(t){return this.options===t||this.options.match===t}},n.prototype={addHandler:function(t){var e=new r(t);this.handlers.push(e),this.matches()&&e.on()},removeHandler:function(t){var i=this.handlers;e(i,function(e,s){return e.equals(t)?(e.destroy(),!i.splice(s,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){e(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";e(this.handlers,function(e){e[t]()})}},o.prototype={register:function(t,r,o){var l=this.queries,a=o&&this.browserIsIncapable;return l[t]||(l[t]=new n(t,a)),s(r)&&(r={match:r}),i(r)||(r=[r]),e(r,function(e){l[t].addHandler(e)}),this},unregister:function(t,e){var i=this.queries[t];return i&&(e?i.removeHandler(e):(i.clear(),delete this.queries[t])),this}},new o})}])}); |
@@ -25,2 +25,3 @@ 'use strict'; | ||
import DynamicSlides from '../examples/DynamicSlides' | ||
import VerticalMode from '../examples/VerticalMode' | ||
@@ -50,2 +51,3 @@ export default class App extends React.Component { | ||
<DynamicSlides /> | ||
<VerticalMode /> | ||
</div> | ||
@@ -52,0 +54,0 @@ ); |
@@ -11,7 +11,8 @@ "use strict"; | ||
direction: 1, | ||
// listWidth: null, | ||
// listHeight: null, | ||
listWidth: null, | ||
listHeight: null, | ||
// loadIndex: 0, | ||
slideCount: null, | ||
slideWidth: null, | ||
slideHeight: null, | ||
// sliding: false, | ||
@@ -18,0 +19,0 @@ // slideOffset: 0, |
@@ -32,2 +32,6 @@ 'use strict'; | ||
var _objectAssign = require('object-assign'); | ||
var _objectAssign2 = _interopRequireDefault(_objectAssign); | ||
var _track = require('./track'); | ||
@@ -85,2 +89,7 @@ | ||
this.adaptHeight(); | ||
// To support server-side rendering | ||
if (!window) { | ||
return; | ||
} | ||
if (window.addEventListener) { | ||
@@ -102,3 +111,3 @@ window.addEventListener('resize', this.onWindowResized); | ||
if (this.state.autoPlayTimer) { | ||
window.clearInterval(this.state.autoPlayTimer); | ||
clearInterval(this.state.autoPlayTimer); | ||
} | ||
@@ -151,3 +160,5 @@ }, | ||
render: function render() { | ||
var className = (0, _classnames2.default)('slick-initialized', 'slick-slider', this.props.className); | ||
var className = (0, _classnames2.default)('slick-initialized', 'slick-slider', this.props.className, { | ||
'slick-vertical': this.props.vertical | ||
}); | ||
@@ -160,3 +171,3 @@ var trackProps = { | ||
centerMode: this.props.centerMode, | ||
focusOnSelect: this.props.focusOnSelect ? this.selectHandler : new Function(), | ||
focusOnSelect: this.props.focusOnSelect ? this.selectHandler : null, | ||
currentSlide: this.state.currentSlide, | ||
@@ -207,2 +218,10 @@ lazyLoad: this.props.lazyLoad, | ||
var verticalHeightStyle = null; | ||
if (this.props.vertical) { | ||
verticalHeightStyle = { | ||
height: this.state.listHeight | ||
}; | ||
} | ||
var centerPaddingStyle = null; | ||
@@ -224,2 +243,4 @@ | ||
var listStyle = (0, _objectAssign2.default)({}, verticalHeightStyle, centerPaddingStyle); | ||
return _react2.default.createElement( | ||
@@ -234,3 +255,3 @@ 'div', | ||
className: 'slick-list', | ||
style: centerPaddingStyle, | ||
style: listStyle, | ||
onMouseDown: this.swipeStart, | ||
@@ -237,0 +258,0 @@ onMouseMove: this.state.dragging ? this.swipeMove : null, |
@@ -119,4 +119,12 @@ 'use strict'; | ||
if (this.props.verticalSwiping) { | ||
touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curY - touchObject.startY, 2))); | ||
} | ||
positionOffset = (this.props.rtl === false ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1); | ||
if (this.props.verticalSwiping) { | ||
positionOffset = touchObject.curY > touchObject.startY ? 1 : -1; | ||
} | ||
var currentSlide = this.state.currentSlide; | ||
@@ -143,3 +151,12 @@ var dotCount = Math.ceil(this.state.slideCount / this.props.slidesToScroll); | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
if (!this.props.vertical) { | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
} else { | ||
swipeLeft = curLeft + touchSwipeLength * (this.state.listHeight / this.state.listWidth) * positionOffset; | ||
} | ||
if (this.props.verticalSwiping) { | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
} | ||
this.setState({ | ||
@@ -167,2 +184,6 @@ touchObject: touchObject, | ||
if (this.props.verticalSwiping) { | ||
minSwipe = this.state.listHeight / this.props.touchThreshold; | ||
} | ||
// reset the state of touch related state variables. | ||
@@ -182,8 +203,15 @@ this.setState({ | ||
e.preventDefault(); | ||
if (swipeDirection === 'left') { | ||
this.slideHandler(this.state.currentSlide + this.props.slidesToScroll); | ||
} else if (swipeDirection === 'right') { | ||
this.slideHandler(this.state.currentSlide - this.props.slidesToScroll); | ||
} else { | ||
this.slideHandler(this.state.currentSlide); | ||
switch (swipeDirection) { | ||
case 'left': | ||
case 'down': | ||
this.slideHandler(this.state.currentSlide + this.props.slidesToScroll); | ||
break; | ||
case 'right': | ||
case 'up': | ||
this.slideHandler(this.state.currentSlide - this.props.slidesToScroll); | ||
break; | ||
default: | ||
} | ||
@@ -190,0 +218,0 @@ } else { |
@@ -23,7 +23,18 @@ 'use strict'; | ||
initialize: function initialize(props) { | ||
var slickList = _reactDom2.default.findDOMNode(this.list); | ||
var slideCount = _react2.default.Children.count(props.children); | ||
var listWidth = this.getWidth(_reactDom2.default.findDOMNode(this.list)); | ||
var listWidth = this.getWidth(slickList); | ||
var trackWidth = this.getWidth(_reactDom2.default.findDOMNode(this.track)); | ||
var slideWidth = trackWidth / props.slidesToShow; | ||
var slideWidth; | ||
if (!props.vertical) { | ||
slideWidth = trackWidth / props.slidesToShow; | ||
} else { | ||
slideWidth = trackWidth; | ||
} | ||
var slideHeight = this.getHeight(slickList.querySelector('[data-index="0"]')); | ||
var listHeight = slideHeight * props.slidesToShow; | ||
var currentSlide = props.rtl ? slideCount - 1 - props.initialSlide : props.initialSlide; | ||
@@ -36,3 +47,5 @@ | ||
trackWidth: trackWidth, | ||
currentSlide: currentSlide | ||
currentSlide: currentSlide, | ||
slideHeight: slideHeight, | ||
listHeight: listHeight | ||
}, function () { | ||
@@ -53,9 +66,19 @@ | ||
update: function update(props) { | ||
var slickList = _reactDom2.default.findDOMNode(this.list); | ||
// This method has mostly same code as initialize method. | ||
// Refactor it | ||
var slideCount = _react2.default.Children.count(props.children); | ||
var listWidth = this.getWidth(_reactDom2.default.findDOMNode(this.list)); | ||
var listWidth = this.getWidth(slickList); | ||
var trackWidth = this.getWidth(_reactDom2.default.findDOMNode(this.track)); | ||
var slideWidth = this.getWidth(_reactDom2.default.findDOMNode(this)) / props.slidesToShow; | ||
var slideWidth; | ||
if (!props.vertical) { | ||
slideWidth = trackWidth / props.slidesToShow; | ||
} else { | ||
slideWidth = trackWidth; | ||
} | ||
var slideHeight = this.getHeight(slickList.querySelector('[data-index="0"]')); | ||
var listHeight = slideHeight * props.slidesToShow; | ||
// pause slider if autoplay is set to false | ||
@@ -68,3 +91,5 @@ if (!props.autoplay) this.pause(); | ||
listWidth: listWidth, | ||
trackWidth: trackWidth | ||
trackWidth: trackWidth, | ||
slideHeight: slideHeight, | ||
listHeight: listHeight | ||
}, function () { | ||
@@ -85,2 +110,6 @@ | ||
}, | ||
getHeight: function getHeight(elem) { | ||
return elem.getBoundingClientRect().height || elem.offsetHeight; | ||
}, | ||
adaptHeight: function adaptHeight() { | ||
@@ -271,2 +300,9 @@ if (this.props.adaptiveHeight) { | ||
} | ||
if (this.props.verticalSwiping === true) { | ||
if (swipeAngle >= 35 && swipeAngle <= 135) { | ||
return 'down'; | ||
} else { | ||
return 'up'; | ||
} | ||
} | ||
@@ -289,3 +325,3 @@ return 'vertical'; | ||
this.setState({ | ||
autoPlayTimer: window.setInterval(play, this.props.autoplaySpeed) | ||
autoPlayTimer: setInterval(play, this.props.autoplaySpeed) | ||
}); | ||
@@ -296,3 +332,3 @@ } | ||
if (this.state.autoPlayTimer) { | ||
window.clearInterval(this.state.autoPlayTimer); | ||
clearInterval(this.state.autoPlayTimer); | ||
this.setState({ | ||
@@ -299,0 +335,0 @@ autoPlayTimer: null |
@@ -10,2 +10,6 @@ 'use strict'; | ||
var _objectAssign = require('object-assign'); | ||
var _objectAssign2 = _interopRequireDefault(_objectAssign); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -22,10 +26,16 @@ | ||
var trackWidth; | ||
var trackWidth, trackHeight; | ||
if (spec.variableWidth) { | ||
trackWidth = (spec.slideCount + 2 * spec.slidesToShow) * spec.slideWidth; | ||
} else if (spec.centerMode) { | ||
trackWidth = (spec.slideCount + 2 * (spec.slidesToShow + 1)) * spec.slideWidth; | ||
var trackChildren = spec.slideCount + 2 * spec.slidesToShow; | ||
if (!spec.vertical) { | ||
if (spec.variableWidth) { | ||
trackWidth = (spec.slideCount + 2 * spec.slidesToShow) * spec.slideWidth; | ||
} else if (spec.centerMode) { | ||
trackWidth = (spec.slideCount + 2 * (spec.slidesToShow + 1)) * spec.slideWidth; | ||
} else { | ||
trackWidth = (spec.slideCount + 2 * spec.slidesToShow) * spec.slideWidth; | ||
} | ||
} else { | ||
trackWidth = (spec.slideCount + 2 * spec.slidesToShow) * spec.slideWidth; | ||
trackHeight = trackChildren * spec.slideHeight; | ||
} | ||
@@ -35,13 +45,24 @@ | ||
opacity: 1, | ||
width: trackWidth, | ||
WebkitTransform: 'translate3d(' + spec.left + 'px, 0px, 0px)', | ||
transform: 'translate3d(' + spec.left + 'px, 0px, 0px)', | ||
WebkitTransform: !spec.vertical ? 'translate3d(' + spec.left + 'px, 0px, 0px)' : 'translate3d(0px, ' + spec.left + 'px, 0px)', | ||
transform: !spec.vertical ? 'translate3d(' + spec.left + 'px, 0px, 0px)' : 'translate3d(0px, ' + spec.left + 'px, 0px)', | ||
transition: '', | ||
WebkitTransition: '', | ||
msTransform: 'translateX(' + spec.left + 'px)' | ||
msTransform: !spec.vertical ? 'translateX(' + spec.left + 'px)' : 'translateY(' + spec.left + 'px)' | ||
}; | ||
if (trackWidth) { | ||
(0, _objectAssign2.default)(style, { width: trackWidth }); | ||
} | ||
if (trackHeight) { | ||
(0, _objectAssign2.default)(style, { height: trackHeight }); | ||
} | ||
// Fallback for IE8 | ||
if (!window.addEventListener && window.attachEvent) { | ||
style.marginLeft = spec.left + 'px'; | ||
if (window && !window.addEventListener && window.attachEvent) { | ||
if (!spec.vertical) { | ||
style.marginLeft = spec.left + 'px'; | ||
} else { | ||
style.marginTop = spec.left + 'px'; | ||
} | ||
} | ||
@@ -64,3 +85,3 @@ | ||
checkSpecKeys(spec, ['slideIndex', 'trackRef', 'infinite', 'centerMode', 'slideCount', 'slidesToShow', 'slidesToScroll', 'slideWidth', 'listWidth', 'variableWidth']); | ||
checkSpecKeys(spec, ['slideIndex', 'trackRef', 'infinite', 'centerMode', 'slideCount', 'slidesToShow', 'slidesToScroll', 'slideWidth', 'listWidth', 'variableWidth', 'slideHeight']); | ||
@@ -70,2 +91,3 @@ var slideOffset = 0; | ||
var targetSlide; | ||
var verticalOffset = 0; | ||
@@ -77,4 +99,5 @@ if (spec.fade) { | ||
if (spec.infinite) { | ||
if (spec.slideCount > spec.slidesToShow) { | ||
if (spec.slideCount >= spec.slidesToShow) { | ||
slideOffset = spec.slideWidth * spec.slidesToShow * -1; | ||
verticalOffset = spec.slideHeight * spec.slidesToShow * -1; | ||
} | ||
@@ -85,4 +108,6 @@ if (spec.slideCount % spec.slidesToScroll !== 0) { | ||
slideOffset = (spec.slidesToShow - (spec.slideIndex - spec.slideCount)) * spec.slideWidth * -1; | ||
verticalOffset = (spec.slidesToShow - (spec.slideIndex - spec.slideCount)) * spec.slideHeight * -1; | ||
} else { | ||
slideOffset = spec.slideCount % spec.slidesToScroll * spec.slideWidth * -1; | ||
verticalOffset = spec.slideCount % spec.slidesToScroll * spec.slideHeight * -1; | ||
} | ||
@@ -109,3 +134,7 @@ } | ||
targetLeft = spec.slideIndex * spec.slideWidth * -1 + slideOffset; | ||
if (!spec.vertical) { | ||
targetLeft = spec.slideIndex * spec.slideWidth * -1 + slideOffset; | ||
} else { | ||
targetLeft = spec.slideIndex * spec.slideHeight * -1 + verticalOffset; | ||
} | ||
@@ -112,0 +141,0 @@ if (spec.variableWidth === true) { |
@@ -104,3 +104,5 @@ 'use strict'; | ||
child.props && child.props.onClick && child.props.onClick(e); | ||
spec.focusOnSelect(childOnClickOptions); | ||
if (spec.focusOnSelect) { | ||
spec.focusOnSelect(childOnClickOptions); | ||
} | ||
}; | ||
@@ -107,0 +109,0 @@ |
{ | ||
"name": "react-slick", | ||
"version": "0.13.6", | ||
"version": "0.14.0", | ||
"description": " React port of slick carousel", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -9,3 +9,8 @@ # react-slick | ||
### Important | ||
* slickGoTo prop is deprecated in favor of slickGoTo method. Check this [slickGoTo usage example](https://github.com/akiran/react-slick/blob/master/examples/SlickGoTo.js). slickGoTo prop will be removed in react-slick@0.14 | ||
### Breaking changes in react-slick@0.14 | ||
* slickGoTo prop is deprecated in favor of slickGoTo method. Check this [slickGoTo usage example](https://github.com/akiran/react-slick/blob/master/examples/SlickGoTo.js). | ||
* dist folder will be removed from the repo to simply PR review process. If you are using bower or relying on the dist files in githib repo, use dist files from unpkg.com | ||
``` | ||
https://unpkg.com/react-slick@0.13.6/dist/react-slick.min.js | ||
``` | ||
@@ -12,0 +17,0 @@ ### Installation |
@@ -9,7 +9,8 @@ var initialState = { | ||
direction: 1, | ||
// listWidth: null, | ||
// listHeight: null, | ||
listWidth: null, | ||
listHeight: null, | ||
// loadIndex: 0, | ||
slideCount: null, | ||
slideWidth: null, | ||
slideHeight: null, | ||
// sliding: false, | ||
@@ -16,0 +17,0 @@ // slideOffset: 0, |
@@ -9,2 +9,3 @@ 'use strict'; | ||
import classnames from 'classnames'; | ||
import assign from 'object-assign'; | ||
@@ -57,2 +58,7 @@ import {Track} from './track'; | ||
this.adaptHeight(); | ||
// To support server-side rendering | ||
if (!window) { | ||
return | ||
} | ||
if (window.addEventListener) { | ||
@@ -74,3 +80,3 @@ window.addEventListener('resize', this.onWindowResized); | ||
if (this.state.autoPlayTimer) { | ||
window.clearInterval(this.state.autoPlayTimer); | ||
clearInterval(this.state.autoPlayTimer); | ||
} | ||
@@ -123,3 +129,5 @@ }, | ||
render: function () { | ||
var className = classnames('slick-initialized', 'slick-slider', this.props.className); | ||
var className = classnames('slick-initialized', 'slick-slider', this.props.className, { | ||
'slick-vertical': this.props.vertical, | ||
}); | ||
@@ -132,3 +140,3 @@ var trackProps = { | ||
centerMode: this.props.centerMode, | ||
focusOnSelect: this.props.focusOnSelect ? this.selectHandler : new Function(), | ||
focusOnSelect: this.props.focusOnSelect ? this.selectHandler : null, | ||
currentSlide: this.state.currentSlide, | ||
@@ -179,2 +187,10 @@ lazyLoad: this.props.lazyLoad, | ||
var verticalHeightStyle = null; | ||
if (this.props.vertical) { | ||
verticalHeightStyle = { | ||
height: this.state.listHeight, | ||
}; | ||
} | ||
var centerPaddingStyle = null; | ||
@@ -196,2 +212,4 @@ | ||
const listStyle = assign({}, verticalHeightStyle, centerPaddingStyle); | ||
return ( | ||
@@ -203,3 +221,3 @@ <div className={className} onMouseEnter={this.onInnerSliderEnter} onMouseLeave={this.onInnerSliderLeave}> | ||
className="slick-list" | ||
style={centerPaddingStyle} | ||
style={listStyle} | ||
onMouseDown={this.swipeStart} | ||
@@ -206,0 +224,0 @@ onMouseMove={this.state.dragging ? this.swipeMove: null} |
@@ -103,4 +103,12 @@ 'use strict'; | ||
if (this.props.verticalSwiping) { | ||
touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curY - touchObject.startY, 2))); | ||
} | ||
positionOffset = (this.props.rtl === false ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1); | ||
if (this.props.verticalSwiping) { | ||
positionOffset = touchObject.curY > touchObject.startY ? 1 : -1; | ||
} | ||
var currentSlide = this.state.currentSlide; | ||
@@ -127,3 +135,12 @@ var dotCount = Math.ceil(this.state.slideCount / this.props.slidesToScroll); | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
if (!this.props.vertical) { | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
} else { | ||
swipeLeft = curLeft + (touchSwipeLength * (this.state.listHeight / this.state.listWidth)) * positionOffset; | ||
} | ||
if (this.props.verticalSwiping) { | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
} | ||
this.setState({ | ||
@@ -150,2 +167,6 @@ touchObject: touchObject, | ||
if (this.props.verticalSwiping) { | ||
minSwipe = this.state.listHeight/this.props.touchThreshold; | ||
} | ||
// reset the state of touch related state variables. | ||
@@ -165,8 +186,15 @@ this.setState({ | ||
e.preventDefault(); | ||
if (swipeDirection === 'left') { | ||
this.slideHandler(this.state.currentSlide + this.props.slidesToScroll); | ||
} else if (swipeDirection === 'right') { | ||
this.slideHandler(this.state.currentSlide - this.props.slidesToScroll); | ||
} else { | ||
this.slideHandler(this.state.currentSlide); | ||
switch (swipeDirection) { | ||
case 'left': | ||
case 'down': | ||
this.slideHandler(this.state.currentSlide + this.props.slidesToScroll); | ||
break; | ||
case 'right': | ||
case 'up': | ||
this.slideHandler(this.state.currentSlide - this.props.slidesToScroll); | ||
break; | ||
default: | ||
} | ||
@@ -173,0 +201,0 @@ } else { |
@@ -10,15 +10,28 @@ 'use strict'; | ||
initialize: function (props) { | ||
const slickList = ReactDOM.findDOMNode(this.list); | ||
var slideCount = React.Children.count(props.children); | ||
var listWidth = this.getWidth(ReactDOM.findDOMNode(this.list)); | ||
var listWidth = this.getWidth(slickList); | ||
var trackWidth = this.getWidth(ReactDOM.findDOMNode(this.track)); | ||
var slideWidth = trackWidth/props.slidesToShow; | ||
var slideWidth; | ||
if (!props.vertical) { | ||
slideWidth = trackWidth/props.slidesToShow; | ||
} else { | ||
slideWidth = trackWidth; | ||
} | ||
const slideHeight = this.getHeight(slickList.querySelector('[data-index="0"]')); | ||
const listHeight = slideHeight * props.slidesToShow; | ||
var currentSlide = props.rtl ? slideCount - 1 - props.initialSlide : props.initialSlide; | ||
this.setState({ | ||
slideCount: slideCount, | ||
slideWidth: slideWidth, | ||
listWidth: listWidth, | ||
trackWidth: trackWidth, | ||
currentSlide: currentSlide | ||
slideCount, | ||
slideWidth, | ||
listWidth, | ||
trackWidth, | ||
currentSlide, | ||
slideHeight, | ||
listHeight, | ||
}, function () { | ||
@@ -39,9 +52,19 @@ | ||
update: function (props) { | ||
const slickList = ReactDOM.findDOMNode(this.list); | ||
// This method has mostly same code as initialize method. | ||
// Refactor it | ||
var slideCount = React.Children.count(props.children); | ||
var listWidth = this.getWidth(ReactDOM.findDOMNode(this.list)); | ||
var listWidth = this.getWidth(slickList); | ||
var trackWidth = this.getWidth(ReactDOM.findDOMNode(this.track)); | ||
var slideWidth = this.getWidth(ReactDOM.findDOMNode(this))/props.slidesToShow; | ||
var slideWidth; | ||
if (!props.vertical) { | ||
slideWidth = trackWidth/props.slidesToShow; | ||
} else { | ||
slideWidth = trackWidth; | ||
} | ||
const slideHeight = this.getHeight(slickList.querySelector('[data-index="0"]')); | ||
const listHeight = slideHeight * props.slidesToShow; | ||
// pause slider if autoplay is set to false | ||
@@ -52,6 +75,8 @@ if(!props.autoplay) | ||
this.setState({ | ||
slideCount: slideCount, | ||
slideWidth: slideWidth, | ||
listWidth: listWidth, | ||
trackWidth: trackWidth | ||
slideCount, | ||
slideWidth, | ||
listWidth, | ||
trackWidth, | ||
slideHeight, | ||
listHeight, | ||
}, function () { | ||
@@ -72,2 +97,5 @@ | ||
}, | ||
getHeight(elem) { | ||
return elem.getBoundingClientRect().height || elem.offsetHeight; | ||
}, | ||
adaptHeight: function () { | ||
@@ -259,2 +287,9 @@ if (this.props.adaptiveHeight) { | ||
} | ||
if (this.props.verticalSwiping === true) { | ||
if ((swipeAngle >= 35) && (swipeAngle <= 135)) { | ||
return 'down'; | ||
} else { | ||
return 'up'; | ||
} | ||
} | ||
@@ -277,3 +312,3 @@ return 'vertical'; | ||
this.setState({ | ||
autoPlayTimer: window.setInterval(play, this.props.autoplaySpeed) | ||
autoPlayTimer: setInterval(play, this.props.autoplaySpeed) | ||
}); | ||
@@ -284,3 +319,3 @@ } | ||
if (this.state.autoPlayTimer) { | ||
window.clearInterval(this.state.autoPlayTimer); | ||
clearInterval(this.state.autoPlayTimer); | ||
this.setState({ | ||
@@ -287,0 +322,0 @@ autoPlayTimer: null |
'use strict'; | ||
import ReactDOM from 'react-dom'; | ||
import assign from 'object-assign'; | ||
@@ -15,10 +16,16 @@ var checkSpecKeys = function (spec, keysArray) { | ||
var trackWidth; | ||
var trackWidth, trackHeight; | ||
if (spec.variableWidth) { | ||
trackWidth = (spec.slideCount + 2*spec.slidesToShow) * spec.slideWidth; | ||
} else if (spec.centerMode) { | ||
trackWidth = (spec.slideCount + 2*(spec.slidesToShow + 1)) * spec.slideWidth; | ||
const trackChildren = (spec.slideCount + 2 * spec.slidesToShow); | ||
if (!spec.vertical) { | ||
if (spec.variableWidth) { | ||
trackWidth = (spec.slideCount + 2*spec.slidesToShow) * spec.slideWidth; | ||
} else if (spec.centerMode) { | ||
trackWidth = (spec.slideCount + 2*(spec.slidesToShow + 1)) * spec.slideWidth; | ||
} else { | ||
trackWidth = (spec.slideCount + 2*spec.slidesToShow) * spec.slideWidth; | ||
} | ||
} else { | ||
trackWidth = (spec.slideCount + 2*spec.slidesToShow) * spec.slideWidth; | ||
trackHeight = trackChildren * spec.slideHeight; | ||
} | ||
@@ -28,13 +35,24 @@ | ||
opacity: 1, | ||
width: trackWidth, | ||
WebkitTransform: 'translate3d(' + spec.left + 'px, 0px, 0px)', | ||
transform: 'translate3d(' + spec.left + 'px, 0px, 0px)', | ||
WebkitTransform: !spec.vertical ? 'translate3d(' + spec.left + 'px, 0px, 0px)' : 'translate3d(0px, ' + spec.left + 'px, 0px)', | ||
transform: !spec.vertical ? 'translate3d(' + spec.left + 'px, 0px, 0px)' : 'translate3d(0px, ' + spec.left + 'px, 0px)', | ||
transition: '', | ||
WebkitTransition: '', | ||
msTransform: 'translateX(' + spec.left + 'px)' | ||
msTransform: !spec.vertical ? 'translateX(' + spec.left + 'px)' : 'translateY(' + spec.left + 'px)', | ||
}; | ||
if (trackWidth) { | ||
assign(style, { width: trackWidth }); | ||
} | ||
if (trackHeight) { | ||
assign(style, { height: trackHeight }); | ||
} | ||
// Fallback for IE8 | ||
if (!window.addEventListener && window.attachEvent) { | ||
style.marginLeft = spec.left + 'px'; | ||
if (window && !window.addEventListener && window.attachEvent) { | ||
if (!spec.vertical) { | ||
style.marginLeft = spec.left + 'px'; | ||
} else { | ||
style.marginTop = spec.left + 'px'; | ||
} | ||
} | ||
@@ -61,3 +79,3 @@ | ||
'slideIndex', 'trackRef', 'infinite', 'centerMode', 'slideCount', 'slidesToShow', | ||
'slidesToScroll', 'slideWidth', 'listWidth', 'variableWidth']); | ||
'slidesToScroll', 'slideWidth', 'listWidth', 'variableWidth', 'slideHeight']); | ||
@@ -67,2 +85,3 @@ var slideOffset = 0; | ||
var targetSlide; | ||
var verticalOffset = 0; | ||
@@ -74,4 +93,5 @@ if (spec.fade) { | ||
if (spec.infinite) { | ||
if (spec.slideCount > spec.slidesToShow) { | ||
slideOffset = (spec.slideWidth * spec.slidesToShow) * -1; | ||
if (spec.slideCount >= spec.slidesToShow) { | ||
slideOffset = (spec.slideWidth * spec.slidesToShow) * -1; | ||
verticalOffset = (spec.slideHeight * spec.slidesToShow) * -1; | ||
} | ||
@@ -82,4 +102,6 @@ if (spec.slideCount % spec.slidesToScroll !== 0) { | ||
slideOffset = ((spec.slidesToShow - (spec.slideIndex - spec.slideCount)) * spec.slideWidth) * -1; | ||
verticalOffset = ((spec.slidesToShow - (spec.slideIndex - spec.slideCount)) * spec.slideHeight) * -1; | ||
} else { | ||
slideOffset = ((spec.slideCount % spec.slidesToScroll) * spec.slideWidth) * -1; | ||
verticalOffset = ((spec.slideCount % spec.slidesToScroll) * spec.slideHeight) * -1; | ||
} | ||
@@ -108,3 +130,7 @@ } | ||
targetLeft = ((spec.slideIndex * spec.slideWidth) * -1) + slideOffset; | ||
if (!spec.vertical) { | ||
targetLeft = ((spec.slideIndex * spec.slideWidth) * -1) + slideOffset; | ||
} else { | ||
targetLeft = ((spec.slideIndex * spec.slideHeight) * -1) + verticalOffset; | ||
} | ||
@@ -111,0 +137,0 @@ if (spec.variableWidth === true) { |
@@ -92,3 +92,5 @@ 'use strict'; | ||
child.props && child.props.onClick && child.props.onClick(e) | ||
spec.focusOnSelect(childOnClickOptions) | ||
if (spec.focusOnSelect) { | ||
spec.focusOnSelect(childOnClickOptions) | ||
} | ||
} | ||
@@ -95,0 +97,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
350037
68
5222
157
0