react-slick
Advanced tools
Comparing version 0.12.3 to 0.12.4
@@ -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=i(2),r=s(n),o=i(3),a=i(11),l=s(a),d=i(18),u=s(d),c=i(20),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?(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})})}},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,l["default"])({},this.props,e[0].settings)):t=(0,l["default"])({},f["default"],this.props);var s=this.props.children;return Array.isArray(s)||(s=[s]),s=s.filter(function(t){return!!t}),"unslick"===t?r["default"].createElement("div",null,s):r["default"].createElement(o.InnerSlider,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),u=s(d),c=i(12),h=s(c),p=i(13),f=s(p),v=i(14),S=s(v),w=i(15),m=i(16),g=i(17);e.InnerSlider=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<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(){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?this.changeSlide({message:"index",index:t.slickGoTo,currentSlide:this.state.currentSlide}):this.update(t)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.update(this.props)},render:function(){var t,e=(0,S["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};this.props.arrows&&(r=o["default"].createElement(g.PrevArrow,l),a=o["default"].createElement(g.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},o["default"].createElement("div",{ref:"list",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},o["default"].createElement(w.Track,n({ref:"track"},i),this.props.children)),r,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(11)),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,u=d.slideCount,c=d.currentSlide;if(n=u%a!==0,e=n?0:(u-c)%a,"previous"===t.message)s=0===e?a:l-e,r=c-s,this.props.lazyLoad&&(i=c-s,r=-1===i?u-1:i);else if("next"===t.message)s=0===e?a:e,r=c+s;else if("dots"===t.message){if(r=t.index*t.slidesToScroll,r===t.currentSlide)return}else if("index"===t.message&&(r=t.index,r===t.currentSlide))return;this.slideHandler(r)},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=(0,n.getTrackLeft)((0,a["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 o=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===o&&"right"===d||o+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:(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){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.refs.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)),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 n;t.slideCount<=t.slidesToShow||t.infinite===!1?i=r["default"].findDOMNode(t.trackRef).childNodes[t.slideIndex]:(n=t.slideIndex+t.slidesToShow,i=r["default"].findDOMNode(t.trackRef).childNodes[n]),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(8),d=s(l),u=i(5),c=i(11),h=s(c),p={initialize:function(t){var e=r["default"].Children.count(t.children),i=this.getWidth(a["default"].findDOMNode(this.refs.list)),s=this.getWidth(a["default"].findDOMNode(this.refs.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,u.getTrackLeft)((0,h["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=(0,u.getTrackCSS)((0,h["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.refs.list)),s=this.getWidth(a["default"].findDOMNode(this.refs.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,u.getTrackLeft)((0,h["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=(0,u.getTrackCSS)((0,h["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.refs.list){var e=a["default"].findDOMNode(this.refs.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)return i=this.state.currentSlide,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),d["default"].removeEndEventListener(a["default"].findDOMNode(o.refs.track).children[i],r)},this.setState({animating:!0,currentSlide:e},function(){d["default"].addEndEventListener(a["default"].findDOMNode(this.refs.track).children[i],r)}),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,u.getTrackLeft)((0,h["default"])({slideIndex:e,trackRef:this.refs.track},this.props,this.state)),n=(0,u.getTrackLeft)((0,h["default"])({slideIndex:i,trackRef:this.refs.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 l=!0,c=[],p=e;p<e+this.props.slidesToShow;p++)l=l&&this.state.lazyLoadedList.indexOf(p)>=0,l||c.push(p);l||this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(c)})}if(this.props.useCSS===!1)this.setState({currentSlide:i,trackStyle:(0,u.getTrackCSS)((0,h["default"])({left:n},this.props,this.state))},function(){this.props.afterChange&&this.props.afterChange(i)});else{var f={animating:!1,currentSlide:i,trackStyle:(0,u.getTrackCSS)((0,h["default"])({left:n},this.props,this.state)),swipeLeft:null};r=function(){o.setState(f),o.props.afterChange&&o.props.afterChange(i),d["default"].removeEndEventListener(a["default"].findDOMNode(o.refs.track),r)},this.setState({animating:!0,currentSlide:i,trackStyle:(0,u.getTrackAnimateCSS)((0,h["default"])({left:s},this.props,this.state))},function(){d["default"].addEndEventListener(a["default"].findDOMNode(this.refs.track),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;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"]=p},function(t,e,i){"use strict";function s(){var t=a("animationend"),e=a("transitionend");t&&l.push(t),e&&l.push(e)}function n(t,e,i){t.addEventListener(e,i,!1)}function r(t,e,i){t.removeEventListener(e,i,!1)}var o=i(9),a=i(10),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){"use strict";var i=!("undefined"==typeof window||!window.document||!window.document.createElement),s={canUseDOM:i,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:i&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:i&&!!window.screen,isInWorker:!i};t.exports=s},function(t,e,i){"use strict";function s(t,e){var i={};return i[t.toLowerCase()]=e.toLowerCase(),i["Webkit"+t]="webkit"+e,i["Moz"+t]="moz"+e,i["ms"+t]="MS"+e,i["O"+t]="o"+e.toLowerCase(),i}function n(t){if(a[t])return a[t];if(!o[t])return t;var e=o[t];for(var i in e)if(e.hasOwnProperty(i)&&i in l)return a[t]=e[i];return""}var r=i(9),o={animationend:s("Animation","AnimationEnd"),animationiteration:s("Animation","AnimationIteration"),animationstart:s("Animation","AnimationStart"),transitionend:s("Transition","TransitionEnd")},a={},l={};r.canUseDOM&&(l=document.createElement("div").style,"AnimationEvent"in window||(delete o.animationend.animation,delete o.animationiteration.animation,delete o.animationstart.animation),"TransitionEvent"in window||delete o.transitionend.transition),t.exports=n},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 u=0;u<o.length;u++)r.call(s,o[u])&&(a[o[u]]=s[o[u]])}}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:"",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:!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,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 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(2),r=s(n),o=i(3),a=i(11),l=s(a),d=i(18),u=s(d),c=i(20),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?(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})})}},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,l["default"])({},this.props,e[0].settings)):t=(0,l["default"])({},f["default"],this.props);var s=this.props.children;return Array.isArray(s)||(s=[s]),s=s.filter(function(t){return!!t}),"unslick"===t?r["default"].createElement("div",null,s):r["default"].createElement(o.InnerSlider,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),u=s(d),c=i(12),h=s(c),p=i(13),f=s(p),v=i(14),S=s(v),w=i(15),g=i(16),m=i(17);e.InnerSlider=o["default"].createClass({displayName:"InnerSlider",mixins:[u["default"],l["default"]],getInitialState:function(){return Object.assign({},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(){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?this.changeSlide({message:"index",index:t.slickGoTo,currentSlide:this.state.currentSlide}):this.update(t)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.update(this.props),this.setState({animating:!1})},render:function(){var t,e=(0,S["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(g.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(m.PrevArrow,l),a=o["default"].createElement(m.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},o["default"].createElement("div",{ref:"list",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},o["default"].createElement(w.Track,n({ref:"track"},i),this.props.children)),r,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(11)),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,u=d.slideCount,c=d.currentSlide;if(n=u%a!==0,e=n?0:(u-c)%a,"previous"===t.message)s=0===e?a:l-e,r=c-s,this.props.lazyLoad&&(i=c-s,r=-1===i?u-1:i);else if("next"===t.message)s=0===e?a:e,r=(c+a)%u+e;else if("dots"===t.message){if(r=t.index*t.slidesToScroll,r===t.currentSlide)return}else if("index"===t.message&&(r=t.index,r===t.currentSlide))return;this.slideHandler(r)},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)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.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 o=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===o&&"right"===d||o+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:(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.refs.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)),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 n;t.slideCount<=t.slidesToShow||t.infinite===!1?i=r["default"].findDOMNode(t.trackRef).childNodes[t.slideIndex]:(n=t.slideIndex+t.slidesToShow,i=r["default"].findDOMNode(t.trackRef).childNodes[n]),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(8),d=s(l),u=i(5),c=i(11),h=s(c),p={initialize:function(t){var e=r["default"].Children.count(t.children),i=this.getWidth(a["default"].findDOMNode(this.refs.list)),s=this.getWidth(a["default"].findDOMNode(this.refs.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,u.getTrackLeft)((0,h["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=(0,u.getTrackCSS)((0,h["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.refs.list)),s=this.getWidth(a["default"].findDOMNode(this.refs.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,u.getTrackLeft)((0,h["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=(0,u.getTrackCSS)((0,h["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.refs.list){var e=a["default"].findDOMNode(this.refs.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)return i=this.state.currentSlide,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),d["default"].removeEndEventListener(a["default"].findDOMNode(o.refs.track).children[i],r)},this.setState({animating:!0,currentSlide:e},function(){d["default"].addEndEventListener(a["default"].findDOMNode(this.refs.track).children[i],r)}),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,u.getTrackLeft)((0,h["default"])({slideIndex:e,trackRef:this.refs.track},this.props,this.state)),n=(0,u.getTrackLeft)((0,h["default"])({slideIndex:i,trackRef:this.refs.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 l=!0,c=[],p=e;p<e+this.props.slidesToShow;p++)l=l&&this.state.lazyLoadedList.indexOf(p)>=0,l||c.push(p);l||this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(c)})}if(this.props.useCSS===!1)this.setState({currentSlide:i,trackStyle:(0,u.getTrackCSS)((0,h["default"])({left:n},this.props,this.state))},function(){this.props.afterChange&&this.props.afterChange(i)});else{var f={animating:!1,currentSlide:i,trackStyle:(0,u.getTrackCSS)((0,h["default"])({left:n},this.props,this.state)),swipeLeft:null};r=function(){o.setState(f),o.props.afterChange&&o.props.afterChange(i),d["default"].removeEndEventListener(a["default"].findDOMNode(o.refs.track),r)},this.setState({animating:!0,currentSlide:i,trackStyle:(0,u.getTrackAnimateCSS)((0,h["default"])({left:s},this.props,this.state))},function(){d["default"].addEndEventListener(a["default"].findDOMNode(this.refs.track),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;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"]=p},function(t,e,i){"use strict";function s(){var t=a("animationend"),e=a("transitionend");t&&l.push(t),e&&l.push(e)}function n(t,e,i){t.addEventListener(e,i,!1)}function r(t,e,i){t.removeEventListener(e,i,!1)}var o=i(9),a=i(10),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){"use strict";var i=!("undefined"==typeof window||!window.document||!window.document.createElement),s={canUseDOM:i,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:i&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:i&&!!window.screen,isInWorker:!i};t.exports=s},function(t,e,i){"use strict";function s(t,e){var i={};return i[t.toLowerCase()]=e.toLowerCase(),i["Webkit"+t]="webkit"+e,i["Moz"+t]="moz"+e,i["ms"+t]="MS"+e,i["O"+t]="o"+e.toLowerCase(),i}function n(t){if(a[t])return a[t];if(!o[t])return t;var e=o[t];for(var i in e)if(e.hasOwnProperty(i)&&i in l)return a[t]=e[i];return""}var r=i(9),o={animationend:s("Animation","AnimationEnd"),animationiteration:s("Animation","AnimationIteration"),animationstart:s("Animation","AnimationStart"),transitionend:s("Transition","TransitionEnd")},a={},l={};r.canUseDOM&&(l=document.createElement("div").style,"AnimationEvent"in window||(delete o.animationend.animation,delete o.animationiteration.animation,delete o.animationstart.animation),"TransitionEvent"in window||delete o.transitionend.transition),t.exports=n},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 u=0;u<o.length;u++)r.call(s,o[u])&&(a[o[u]]=s[o[u]])}}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:"",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:!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,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;/*! | ||
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(11),a=s(o),l=i(14),d=s(l),u=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})},c=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=[],l=r["default"].Children.count(t.children);return r["default"].Children.forEach(t.children,function(p,f){i=!t.lazyLoad|(t.lazyLoad&&t.lazyLoadedList.indexOf(f)>=0)?p:r["default"].createElement("div",null);var v,S=c((0,a["default"])({},t,{index:f})),w=u((0,a["default"])({index:f},t));if(v=i.props.className?(0,d["default"])(w,i.props.className):w,s.push(r["default"].cloneElement(i,{key:"original"+h(i,f),"data-index":f,className:v,style:(0,a["default"])({},i.props.style||{},S)})),t.infinite&&t.fade===!1){var m=t.variableWidth?t.slidesToShow+1:t.slidesToShow;f>=l-m&&(e=-(l-f),n.push(r["default"].cloneElement(i,{key:"precloned"+h(i,e),"data-index":e,className:v,style:(0,a["default"])({},i.props.style||{},S)}))),m>f&&(e=l+f,o.push(r["default"].cloneElement(i,{key:"postcloned"+h(i,e),"data-index":e,className:v,style:(0,a["default"])({},i.props.style||{},S)})))}}),t.rtl?n.concat(s,o).reverse():n.concat(s,o)};e.Track=r["default"].createClass({displayName:"Track",render:function(){var t=p(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(14),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=(0,a["default"])({"slick-active":t.props.currentSlide===i*t.props.slidesToScroll}),n={message:"dots",index:i,slidesToScroll:t.props.slidesToScroll,currentSlide:t.props.currentSlide};return r["default"].createElement("li",{key:i,className:s},r["default"].createElement("button",{onClick:t.clickHandler.bind(t,n)},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(14),l=s(a);e.PrevArrow=o["default"].createClass({displayName:"PrevArrow",clickHandler:function(t,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.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(19),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(21),n=s&&i(22),r=i(18),o={media:function(t,e){t=r(t),"function"==typeof e&&(e={match:e}),n.register(t,e),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:t,handler:e})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(t){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 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(11),a=s(o),l=i(14),d=s(l),u=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})},c=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=[],l=r["default"].Children.count(t.children);return r["default"].Children.forEach(t.children,function(p,f){i=!t.lazyLoad|(t.lazyLoad&&t.lazyLoadedList.indexOf(f)>=0)?p:r["default"].createElement("div",null);var v,S=c((0,a["default"])({},t,{index:f})),w=u((0,a["default"])({index:f},t));if(v=i.props.className?(0,d["default"])(w,i.props.className):w,s.push(r["default"].cloneElement(i,{key:"original"+h(i,f),"data-index":f,className:v,style:(0,a["default"])({},i.props.style||{},S)})),t.infinite&&t.fade===!1){var g=t.variableWidth?t.slidesToShow+1:t.slidesToShow;f>=l-g&&(e=-(l-f),n.push(r["default"].cloneElement(i,{key:"precloned"+h(i,e),"data-index":e,className:v,style:(0,a["default"])({},i.props.style||{},S)}))),g>f&&(e=l+f,o.push(r["default"].cloneElement(i,{key:"postcloned"+h(i,e),"data-index":e,className:v,style:(0,a["default"])({},i.props.style||{},S)})))}}),t.rtl?n.concat(s,o).reverse():n.concat(s,o)};e.Track=r["default"].createClass({displayName:"Track",render:function(){var t=p(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(14),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(14),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(19),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(21),n=s&&i(22),r=i(18),o={media:function(t,e){t=r(t),"function"==typeof e&&(e={match:e}),n.register(t,e),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:t,handler:e})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(t){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})}])}); |
@@ -6,491 +6,23 @@ 'use strict'; | ||
var baseUrl = '/img/react-slick'; | ||
if (process.env.NODE_ENV === 'production') { | ||
baseUrl = 'https://s3.amazonaws.com/static.neostack.com/img/react-slick'; | ||
} | ||
import SimpleSlider from '../examples/SimpleSlider' | ||
import SlideChangeHooks from '../examples/SlideChangeHooks' | ||
import MultipleItems from '../examples/MultipleItems' | ||
import Responsive from '../examples/Responsive' | ||
import UnevenSets from '../examples/UnevenSets' | ||
import CenterMode from '../examples/CenterMode' | ||
import AutoPlay from '../examples/AutoPlay' | ||
import PauseOnHover from '../examples/PauseOnHover' | ||
import Rtl from '../examples/Rtl' | ||
import VariableWidth from '../examples/VariableWidth' | ||
import AdaptiveHeight from '../examples/AdaptiveHeight' | ||
import LazyLoad from '../examples/LazyLoad' | ||
import Fade from '../examples/Fade' | ||
import SlickGoTo from '../examples/SlickGoTo' | ||
import CustomArrows from '../examples/CustomArrows' | ||
var SingleItem = React.createClass({ | ||
getInitialState: function () { | ||
return {count: 10}; | ||
}, | ||
click: function () { | ||
this.setState({count: this.state.count + 1}); | ||
}, | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
waitForAnimate: false, | ||
beforeChange: function (currentSlide, nextSlide) { | ||
console.log('before change', currentSlide, nextSlide); | ||
}, | ||
afterChange: function (currentSlide) { | ||
console.log('after change', currentSlide); | ||
}, | ||
}; | ||
export default class App extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<h2> Single Item</h2> | ||
<Slider {...settings}> | ||
<div key={1} onClick={this.click}><h3>{this.state.count}</h3></div> | ||
<div key={2}><h3>2</h3></div> | ||
<div key={3}><h3>3</h3></div> | ||
<div key={4}><h3>4</h3></div> | ||
<div key={5}><h3>5</h3></div> | ||
<div key={6}><h3>6</h3></div> | ||
{false? <div key={6}><h3>6</h3></div>: null} | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var MultipleItems = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 3, | ||
slidesToScroll: 3 | ||
}; | ||
return ( | ||
<div> | ||
<h2> Multiple items </h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
<div><h3>7</h3></div> | ||
<div><h3>8</h3></div> | ||
<div><h3>9</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var Responsive = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: false, | ||
speed: 500, | ||
slidesToShow: 4, | ||
slidesToScroll: 4, | ||
responsive: [{ | ||
breakpoint: 1024, | ||
settings: { | ||
slidesToShow: 3, | ||
slidesToScroll: 3, | ||
infinite: true, | ||
dots: true | ||
} | ||
}, { | ||
breakpoint: 600, | ||
settings: { | ||
slidesToShow: 2, | ||
slidesToScroll: 2 | ||
} | ||
}, { | ||
breakpoint: 480, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToScroll: 1 | ||
} | ||
}] | ||
}; | ||
return ( | ||
<div> | ||
<h2> Responsive </h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
<div><h3>7</h3></div> | ||
<div><h3>8</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var UnevenSets = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToScroll: 4, | ||
slidesToShow: 4 | ||
}; | ||
return ( | ||
<div> | ||
<h2>Uneven sets</h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var CenterMode = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
className: 'center', | ||
centerMode: true, | ||
infinite: true, | ||
centerPadding: '60px', | ||
slidesToShow: 7, | ||
speed: 500, | ||
beforeChange: function (index) { | ||
console.log('Slider will change from:' + index); | ||
}, | ||
afterChange: function (currentSlide) { | ||
console.log('Slider Changed to :' + (currentSlide + 1)); | ||
} | ||
}; | ||
return ( | ||
<div> | ||
<h2>Center Mode</h2> | ||
<p>Fix flicker issue at warping</p> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
<div><h3>7</h3></div> | ||
<div><h3>8</h3></div> | ||
<div><h3>9</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var CenterModeWithInitial = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
className: 'center', | ||
centerMode: true, | ||
infinite: true, | ||
centerPadding: '60px', | ||
slidesToShow: 3, | ||
initialSlide: 3, | ||
speed: 500, | ||
afterChange: function (index) { | ||
console.log(`Slider Changed to: ${index + 1}, background: #222; color: #bada55`); | ||
} | ||
}; | ||
return ( | ||
<div> | ||
<h2>Center Mode With InitialSlide</h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var AutoPlay = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
autoplay: true, | ||
autoplaySpeed: 2000 | ||
}; | ||
return ( | ||
<div> | ||
<h2>Auto Play</h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var PauseOnHover = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
autoplay: true, | ||
autoplaySpeed: 2000, | ||
pauseOnHover: true | ||
}; | ||
return ( | ||
<div> | ||
<h2>Pause On Hover</h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var Rtl = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
autoplay: true, | ||
autoplaySpeed: 2000, | ||
rtl: true | ||
}; | ||
return ( | ||
<div> | ||
<h2>Right to Left</h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var VariableWidth = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
className: 'slider variable-width', | ||
dots: true, | ||
infinite: true, | ||
centerMode: true, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
variableWidth: true | ||
}; | ||
return ( | ||
<div> | ||
<h2>Variable width</h2> | ||
<Slider {...settings}> | ||
<div style={{width: 100}}><p>100</p></div> | ||
<div style={{width: 200}}><p>200</p></div> | ||
<div style={{width: 75}}><p>75</p></div> | ||
<div style={{width: 300}}><p>300</p></div> | ||
<div style={{width: 225}}><p>225</p></div> | ||
<div style={{width: 175}}><p>175</p></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var AdaptiveHeight = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
className: '', | ||
dots: true, | ||
infinite: true, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
adaptiveHeight: true | ||
}; | ||
return ( | ||
<div> | ||
<h2>Adaptive height</h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div> | ||
<h3>2</h3> | ||
<p>Hello</p> | ||
</div> | ||
<div> | ||
<h3>3</h3> | ||
<p>See ....</p> | ||
<p>Height is adaptive</p> | ||
</div> | ||
<div> | ||
<h3>4</h3> | ||
</div> | ||
<div> | ||
<h3>5</h3> | ||
</div> | ||
<div> | ||
<h3>6</h3> | ||
</div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var LazyLoad = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
lazyLoad: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1 | ||
}; | ||
return ( | ||
<div> | ||
<h2> Lazy Load</h2> | ||
<Slider {...settings}> | ||
<div><img src={baseUrl + '/abstract01.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract02.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract03.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract04.jpg'} /></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var Fade = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
fade: true, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1 | ||
}; | ||
return ( | ||
<div> | ||
<h2>Fade</h2> | ||
<Slider {...settings}> | ||
<div><img src={baseUrl + '/abstract01.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract02.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract03.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract04.jpg'} /></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var SlickGoTo = React.createClass({ | ||
getInitialState: function () { | ||
return { | ||
slickGoTo: 0 | ||
}; | ||
}, | ||
changeHandler: function(e) { | ||
this.setState({slickGoTo: e.target.value}); | ||
}, | ||
render: function () { | ||
var settings = { | ||
dots: false, | ||
infinite: true, | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
slickGoTo: this.state.slickGoTo || 0 | ||
}; | ||
return ( | ||
<div> | ||
<h2>Slick Go To</h2> | ||
<input onChange={this.changeHandler} value={this.state.slickGoTo} type='range' min={0} max={3} /> | ||
<Slider {...settings}> | ||
<div><img src={baseUrl + '/abstract01.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract02.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract03.jpg'} /></div> | ||
<div><img src={baseUrl + '/abstract04.jpg'} /></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var SampleNextArrow = React.createClass({ | ||
render: function() { | ||
return <div {...this.props} style={{display: 'block', background: 'red'}}></div>; | ||
} | ||
}); | ||
var SamplePrevArrow = React.createClass({ | ||
render: function() { | ||
return ( | ||
<div {...this.props} style={{display: 'block', background: 'red'}}></div> | ||
); | ||
} | ||
}); | ||
var CustomArrows = React.createClass({ | ||
render: function () { | ||
var settings = { | ||
dots: true, | ||
infinite: true, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
nextArrow: <SampleNextArrow />, | ||
prevArrow: <SamplePrevArrow /> | ||
}; | ||
return ( | ||
<div> | ||
<h2>Custom Arrows</h2> | ||
<Slider {...settings}> | ||
<div><h3>1</h3></div> | ||
<div><h3>2</h3></div> | ||
<div><h3>3</h3></div> | ||
<div><h3>4</h3></div> | ||
<div><h3>5</h3></div> | ||
<div><h3>6</h3></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var App = React.createClass({ | ||
render: function () { | ||
//need to add variable width and center mode demo | ||
return ( | ||
<div className='content'> | ||
<SingleItem /> | ||
<SimpleSlider /> | ||
<MultipleItems /> | ||
@@ -500,3 +32,2 @@ <Responsive /> | ||
<CenterMode /> | ||
<CenterModeWithInitial /> | ||
<AutoPlay /> | ||
@@ -509,2 +40,3 @@ <PauseOnHover /> | ||
<Fade /> | ||
<SlideChangeHooks /> | ||
<SlickGoTo /> | ||
@@ -515,4 +47,2 @@ <CustomArrows /> | ||
} | ||
}); | ||
module.exports = App; | ||
} |
'use strict'; | ||
var React = require('react'); | ||
var Demos = require('./demos'); | ||
import React from 'react' | ||
import Demos from './demos' | ||
var Docs = React.createClass({ | ||
render: function () { | ||
export default class Docs extends React.Component { | ||
render() { | ||
return ( | ||
<div className=''> | ||
<div className='title-bar primary'> | ||
<span className='title'>React Slick</span> | ||
</div> | ||
<div className='title-bar primary'> | ||
<span className='title'>React Slick</span> | ||
</div> | ||
<div className=''> | ||
<div className=''> | ||
<div className=''> | ||
<Demos /> | ||
</div> | ||
<Demos /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
}); | ||
module.exports = Docs; | ||
} |
'use strict'; | ||
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
var Docs = require('./docs'); | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import Docs from './docs' | ||
React.initializeTouchEvents && React.initializeTouchEvents(true); | ||
ReactDOM.render(<Docs />, document.getElementById('rapp')); |
@@ -23,3 +23,5 @@ 'use strict'; | ||
clickHandler: function clickHandler(options, e) { | ||
e.preventDefault(); | ||
if (e) { | ||
e.preventDefault(); | ||
} | ||
this.props.clickHandler(options, e); | ||
@@ -63,3 +65,5 @@ }, | ||
clickHandler: function clickHandler(options, e) { | ||
e.preventDefault(); | ||
if (e) { | ||
e.preventDefault(); | ||
} | ||
this.props.clickHandler(options, e); | ||
@@ -66,0 +70,0 @@ }, |
@@ -45,4 +45,6 @@ 'use strict'; | ||
var leftBound = i * _this.props.slidesToScroll; | ||
var rightBound = i * _this.props.slidesToScroll + (_this.props.slidesToScroll - 1); | ||
var className = (0, _classnames2.default)({ | ||
'slick-active': _this.props.currentSlide === i * _this.props.slidesToScroll | ||
'slick-active': _this.props.currentSlide >= leftBound && _this.props.currentSlide <= rightBound | ||
}); | ||
@@ -49,0 +51,0 @@ |
@@ -45,3 +45,5 @@ 'use strict'; | ||
getInitialState: function getInitialState() { | ||
return _initialState2.default; | ||
return Object.assign({}, _initialState2.default, { | ||
currentSlide: this.props.initialSlide | ||
}); | ||
}, | ||
@@ -107,2 +109,6 @@ getDefaultProps: function getDefaultProps() { | ||
this.update(this.props); | ||
// animating state should be cleared while resizing, otherwise autoplay stops working | ||
this.setState({ | ||
animating: false | ||
}); | ||
}, | ||
@@ -109,0 +115,0 @@ render: function render() { |
@@ -40,3 +40,4 @@ 'use strict'; | ||
slideOffset = indexOffset === 0 ? slidesToScroll : indexOffset; | ||
targetSlide = currentSlide + slideOffset; | ||
// targetSlide = currentSlide + slideOffset; | ||
targetSlide = (currentSlide + slidesToScroll) % slideCount + indexOffset; | ||
} else if (options.message === 'dots') { | ||
@@ -83,2 +84,3 @@ // Click on dots | ||
if (!this.state.dragging) { | ||
e.preventDefault(); | ||
return; | ||
@@ -140,2 +142,3 @@ } | ||
if (!this.state.dragging) { | ||
e.preventDefault(); | ||
return; | ||
@@ -142,0 +145,0 @@ } |
{ | ||
"name": "react-slick", | ||
"version": "0.12.3", | ||
"version": "0.12.4", | ||
"description": " React port of slick carousel", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -36,3 +36,3 @@ # react-slick | ||
### Filling issues | ||
### Filing issues | ||
Please replicate your issue with [jsfiddle template](https://jsfiddle.net/kirana/20bumb4g/) and post it along with issue to make it easy for me to debug. | ||
@@ -95,2 +95,3 @@ | ||
| lazyLoad | bool | Loads images or renders components on demands | Yes | | ||
| pauseOnHover | bool | prevents autoplay while hovering | Yes | | ||
| responsive | array | Array of objects in the form of `{ breakpoint: int, settings: { ... } }` The breakpoint _int_ is the `maxWidth` so the settings will be applied when resolution is below this value. Breakpoints in the array should be ordered from smalles to greatest. Use 'unslick' in place of the settings object to disable rendering the carousel at that breakpoint. Example: `[ { breakpoint: 768, settings: { slidesToShow: 3 } }, { breakpoint: 1024, settings: { slidesToShow: 5 } }, { breakpoint: 100000, settings: 'unslick' } ]`| Yes | | ||
@@ -97,0 +98,0 @@ | rtl | bool | Reverses the slide order | Yes | |
@@ -9,3 +9,3 @@ 'use strict'; | ||
clickHandler: function (options, e) { | ||
e.preventDefault(); | ||
if (e) { e.preventDefault(); } | ||
this.props.clickHandler(options, e); | ||
@@ -44,3 +44,3 @@ }, | ||
clickHandler: function (options, e) { | ||
e.preventDefault(); | ||
if (e) { e.preventDefault(); } | ||
this.props.clickHandler(options, e); | ||
@@ -47,0 +47,0 @@ }, |
@@ -33,4 +33,6 @@ 'use strict'; | ||
var leftBound = (i * this.props.slidesToScroll); | ||
var rightBound = (i * this.props.slidesToScroll) + (this.props.slidesToScroll - 1); | ||
var className = classnames({ | ||
'slick-active': (this.props.currentSlide === i * this.props.slidesToScroll) | ||
'slick-active': (this.props.currentSlide >= leftBound) && (this.props.currentSlide <= rightBound) | ||
}); | ||
@@ -37,0 +39,0 @@ |
@@ -17,3 +17,5 @@ 'use strict'; | ||
getInitialState: function () { | ||
return initialState; | ||
return Object.assign({}, initialState, { | ||
currentSlide: this.props.initialSlide | ||
}); | ||
}, | ||
@@ -79,2 +81,6 @@ getDefaultProps: function () { | ||
this.update(this.props); | ||
// animating state should be cleared while resizing, otherwise autoplay stops working | ||
this.setState({ | ||
animating: false | ||
}) | ||
}, | ||
@@ -81,0 +87,0 @@ render: function () { |
@@ -24,3 +24,4 @@ 'use strict'; | ||
slideOffset = (indexOffset === 0) ? slidesToScroll : indexOffset; | ||
targetSlide = currentSlide + slideOffset; | ||
// targetSlide = currentSlide + slideOffset; | ||
targetSlide = ((currentSlide + slidesToScroll) % slideCount) + indexOffset; | ||
} else if (options.message === 'dots') { | ||
@@ -71,2 +72,3 @@ // Click on dots | ||
if (!this.state.dragging) { | ||
e.preventDefault(); | ||
return; | ||
@@ -127,2 +129,3 @@ } | ||
if (!this.state.dragging) { | ||
e.preventDefault(); | ||
return; | ||
@@ -129,0 +132,0 @@ } |
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
362044
64
4717
146