react-slick
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports.Slider=n(require("react")):t.Slider=n(t.React)}(this,function(t){return function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){t.exports=r(1)},function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}var o=r(15),i=e(o),u=r(16),s=e(u),c=r(47),a=e(c),l=r(61),f=e(l),p=r(2),h=e(p),d=r(36),v=e(d),g=r(76),y=e(g),b=r(78),j=e(b),m=i["default"].createClass({displayName:"Slider",mixins:[j["default"]],getInitialState:function(){return{breakpoint:null}},componentDidMount:function(){var t=a["default"](f["default"](this.props.responsive,"breakpoint"));t.forEach(function(n,r){var e;e=0===r?y["default"]({minWidth:0,maxWidth:n}):y["default"]({minWidth:t[r-1],maxWidth:n}),this.media(e,function(){this.setState({breakpoint:n})}.bind(this))}.bind(this));var n=y["default"]({minWidth:t.slice(-1)[0]});this.media(n,function(){this.setState({breakpoint:null})}.bind(this))},render:function(){var t,n;return this.state.breakpoint?(n=h["default"](this.props.responsive,{breakpoint:this.state.breakpoint}),t=v["default"]({},this.props,n[0].settings)):t=this.props,i["default"].createElement(s["default"],t)}});t.exports=m},function(t,n,r){function e(t,n,r){var e=s(t)?o:u;return n=i(n,r,3),e(t,n)}var o=r(3),i=r(4),u=r(13),s=r(6);t.exports=e},function(t,n,r){function e(t,n){for(var r=-1,e=t.length,o=-1,i=[];++r<e;){var u=t[r];n(u,r,t)&&(i[++o]=u)}return i}t.exports=e},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t,n,r){var e=typeof t;return"function"==e?void 0===n?t:S(t,n,r):null==t?j:"object"==e?s(t):void 0===n?m(t):c(t,n)}function i(t,n,r){if(null!=t){void 0!==r&&r in v(t)&&(n=[r]);for(var e=0,o=n.length;null!=t&&o>e;)t=t[n[e++]];return e&&e==o?t:void 0}}function u(t,n,r){var e=n.length,o=e,i=!r;if(null==t)return!o;for(t=v(t);e--;){var u=n[e];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++e<o;){u=n[e];var s=u[0],c=t[s],a=u[1];if(i&&u[2]){if(void 0===c&&!(s in t))return!1}else{var l=r?r(c,a,s):void 0;if(!(void 0===l?w(a,c,r,!0):l))return!1}}return!0}function s(t){var n=p(t);if(1==n.length&&n[0][2]){var r=n[0][0],e=n[0][1];return function(t){return null==t?!1:t[r]===e&&(void 0!==e||r in v(t))}}return function(t){return u(t,n)}}function c(t,n){var r=x(t),e=h(t)&&d(n),o=t+"";return t=g(t),function(u){if(null==u)return!1;var s=o;if(u=v(u),!(!r&&e||s in u)){if(u=1==t.length?u:i(u,f(t,0,-1)),null==u)return!1;s=y(t),u=v(u)}return u[s]===n?void 0!==n||s in u:w(n,u[s],void 0,!0)}}function a(t){return function(n){return null==n?void 0:n[t]}}function l(t){var n=t+"";return t=g(t),function(r){return i(r,t,n)}}function f(t,n,r){var e=-1,o=t.length;n=null==n?0:+n||0,0>n&&(n=-n>o?0:o+n),r=void 0===r||r>o?o:+r||0,0>r&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var i=Array(o);++e<o;)i[e]=t[e+n];return i}function p(t){for(var n=O(t),r=n.length;r--;)n[r][2]=d(n[r][1]);return n}function h(t,n){var r=typeof t;if("string"==r&&E.test(t)||"number"==r)return!0;if(x(t))return!1;var e=!A.test(t);return e||null!=n&&t in v(n)}function d(t){return t===t&&!b(t)}function v(t){return b(t)?t:Object(t)}function g(t){if(x(t))return t;var n=[];return e(t).replace(k,function(t,r,e,o){n.push(e?o.replace(C,"$1"):r||t)}),n}function y(t){var n=t?t.length:0;return n?t[n-1]:void 0}function b(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function j(t){return t}function m(t){return h(t)?a(t):l(t)}var w=r(5),S=r(11),x=r(6),O=r(12),A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,E=/^\w*$/,k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,C=/\\(\\)?/g;t.exports=o},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t,n){for(var r=-1,e=t.length;++r<e;)if(n(t[r],r,t))return!0;return!1}function i(t,n,r,o,s,c){return t===n?!0:null==t||null==n||!l(t)&&!e(n)?t!==t&&n!==n:u(t,n,i,r,o,s,c)}function u(t,n,r,e,o,i,u){var l=f(t),h=f(n),g=v,y=v;l||(g=A.call(t),g==d?g=m:g!=m&&(l=p(t))),h||(y=A.call(n),y==d?y=m:y!=m&&(h=p(n)));var b=g==m,j=y==m,w=g==y;if(w&&!l&&!b)return c(t,n,g);if(!o){var S=b&&O.call(t,"__wrapped__"),x=j&&O.call(n,"__wrapped__");if(S||x)return r(S?t.value():t,x?n.value():n,e,o,i,u)}if(!w)return!1;i||(i=[]),u||(u=[]);for(var E=i.length;E--;)if(i[E]==t)return u[E]==n;i.push(t),u.push(n);var k=(l?s:a)(t,n,r,e,o,i,u);return i.pop(),u.pop(),k}function s(t,n,r,e,i,u,s){var c=-1,a=t.length,l=n.length;if(a!=l&&!(i&&l>a))return!1;for(;++c<a;){var f=t[c],p=n[c],h=e?e(i?p:f,i?f:p,c):void 0;if(void 0!==h){if(h)continue;return!1}if(i){if(!o(n,function(t){return f===t||r(f,t,e,i,u,s)}))return!1}else if(f!==p&&!r(f,p,e,i,u,s))return!1}return!0}function c(t,n,r){switch(r){case g:case y:return+t==+n;case b:return t.name==n.name&&t.message==n.message;case j:return t!=+t?n!=+n:t==+n;case w:case S:return t==n+""}return!1}function a(t,n,r,e,o,i,u){var s=h(t),c=s.length,a=h(n),l=a.length;if(c!=l&&!o)return!1;for(var f=c;f--;){var p=s[f];if(!(o?p in n:O.call(n,p)))return!1}for(var d=o;++f<c;){p=s[f];var v=t[p],g=n[p],y=e?e(o?g:v,o?v:g,p):void 0;if(!(void 0===y?r(v,g,e,o,i,u):y))return!1;d||(d="constructor"==p)}if(!d){var b=t.constructor,j=n.constructor;if(b!=j&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof j&&j instanceof j))return!1}return!0}function l(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var f=r(6),p=r(7),h=r(8),d="[object Arguments]",v="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",j="[object Number]",m="[object Object]",w="[object RegExp]",S="[object String]",x=Object.prototype,O=x.hasOwnProperty,A=x.toString;t.exports=i},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return s(r)?r:void 0}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&m>=t}function s(t){return null==t?!1:y.call(t)==l?b.test(v.call(t)):o(t)&&h.test(t)}function c(t){return t=e(t),t&&p.test(t)?t.replace(f,"\\$&"):t}var a="[object Array]",l="[object Function]",f=/[.*+?^${}()|[\]\/\\]/g,p=RegExp(f.source),h=/^\[object .+?Constructor\]$/,d=Object.prototype,v=Function.prototype.toString,g=d.hasOwnProperty,y=d.toString,b=RegExp("^"+c(v.call(g)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=i(Array,"isArray"),m=9007199254740991,w=j||function(t){return o(t)&&u(t.length)&&y.call(t)==a};t.exports=w},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&$>=t}function i(t){return e(t)&&o(t.length)&&!!T[P.call(t)]}var u="[object Arguments]",s="[object Array]",c="[object Boolean]",a="[object Date]",l="[object Error]",f="[object Function]",p="[object Map]",h="[object Number]",d="[object Object]",v="[object RegExp]",g="[object Set]",y="[object String]",b="[object WeakMap]",j="[object ArrayBuffer]",m="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",x="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",E="[object Uint8ClampedArray]",k="[object Uint16Array]",C="[object Uint32Array]",T={};T[m]=T[w]=T[S]=T[x]=T[O]=T[A]=T[E]=T[k]=T[C]=!0,T[u]=T[s]=T[j]=T[c]=T[a]=T[l]=T[f]=T[p]=T[h]=T[d]=T[v]=T[g]=T[y]=T[b]=!1;var M=Object.prototype,P=M.toString,$=9007199254740991;t.exports=i},function(t,n,r){function e(t){return function(n){return null==n?void 0:n[t]}}function o(t){return null!=t&&u(b(t))}function i(t,n){return t="number"==typeof t||h.test(t)?+t:-1,n=null==n?y:n,t>-1&&t%1==0&&n>t}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function s(t){for(var n=a(t),r=n.length,e=r&&t.length,o=!!e&&u(e)&&(p(t)||f(t)),s=-1,c=[];++s<r;){var l=n[s];(o&&i(l,e)||v.call(t,l))&&c.push(l)}return c}function c(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function a(t){if(null==t)return[];c(t)||(t=Object(t));var n=t.length;n=n&&u(n)&&(p(t)||f(t))&&n||0;for(var r=t.constructor,e=-1,o="function"==typeof r&&r.prototype===t,s=Array(n),a=n>0;++e<n;)s[e]=e+"";for(var l in t)a&&i(l,n)||"constructor"==l&&(o||!v.call(t,l))||s.push(l);return s}var l=r(9),f=r(10),p=r(6),h=/^\d+$/,d=Object.prototype,v=d.hasOwnProperty,g=l(Object,"keys"),y=9007199254740991,b=e("length"),j=g?function(t){var n=null==t?null:t.constructor;return"function"==typeof n&&n.prototype===t||"function"!=typeof t&&o(t)?s(t):c(t)?g(t):[]}:s;t.exports=j},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return u(r)?r:void 0}function u(t){return null==t?!1:v.call(t)==c?g.test(h.call(t)):o(t)&&f.test(t)}function s(t){return t=e(t),t&&l.test(t)?t.replace(a,"\\$&"):t}var c="[object Function]",a=/[.*+?^${}()|[\]\/\\]/g,l=RegExp(a.source),f=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,d=p.hasOwnProperty,v=p.toString,g=RegExp("^"+s(h.call(d)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=i},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t){return null!=t&&u(p(t))}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function s(t){return e(t)&&i(t)&&l.call(t)==c}var c="[object Arguments]",a=Object.prototype,l=a.toString,f=9007199254740991,p=o("length");t.exports=s},function(t,n,r){function e(t,n,r){if("function"!=typeof t)return o;if(void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 3:return function(r,e,o){return t.call(n,r,e,o)};case 4:return function(r,e,o,i){return t.call(n,r,e,o,i)};case 5:return function(r,e,o,i,u){return t.call(n,r,e,o,i,u)}}return function(){return t.apply(n,arguments)}}function o(t){return t}t.exports=e},function(t,n,r){function e(t){return o(t)?t:Object(t)}function o(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function i(t){t=e(t);for(var n=-1,r=u(t),o=r.length,i=Array(o);++n<o;){var s=r[n];i[n]=[s,t[s]]}return i}var u=r(8);t.exports=i},function(t,n,r){function e(t,n){var r=[];return o(t,function(t,e,o){n(t,e,o)&&r.push(t)}),r}var o=r(14);t.exports=e},function(t,n,r){function e(t,n){return h(t,n,l)}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t,n){return function(r,e){var o=r?d(r):0;if(!s(o))return t(r,e);for(var i=n?o:-1,u=c(r);(n?i--:++i<o)&&e(u[i],i,u)!==!1;);return r}}function u(t){return function(n,r,e){for(var o=c(n),i=e(n),u=i.length,s=t?u:-1;t?s--:++s<u;){var a=i[s];if(r(o[a],a,o)===!1)break}return n}}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function c(t){return a(t)?t:Object(t)}function a(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var l=r(8),f=9007199254740991,p=i(e),h=u(),d=o("length");t.exports=p},function(n,r,e){n.exports=t},function(t,n,r){"use strict";var e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},o=r(15),i=r(22),u=r(19),s=r(33),c=r(17),a=r(34),l=r(35),f=r(36),p=o.createClass({displayName:"Slider",mixins:[s,c],getInitialState:function(){return a},getDefaultProps:function(){return l},componentDidMount:function(){this.initialize(this.props),this.adaptHeight()},componentDidUpdate:function(){this.adaptHeight()},componentWillReceiveProps:function(t){this.initialize(t)},renderDots:function(){var t,n=[];if(this.props.dots===!0&&this.state.slideCount>this.props.slidesToShow){for(var r=0;r<=this.getDotCount();r+=1){var e=u({"slick-active":this.state.currentSlide===r*this.props.slidesToScroll});t={message:"index",index:r},n.push(o.createElement("li",{key:r,className:e},o.createElement("button",{onClick:this.changeSlide.bind(this,t)},r)))}return o.createElement("ul",{className:this.props.dotsClass,style:{display:"block"}},n)}return null},renderSlides:function(){var t,n=[],r=[],e=[],u=o.Children.count(this.props.children);return o.Children.forEach(this.props.children,function(o,s){var c;n.push(i(o,{key:s,"data-index":s,className:this.getSlideClasses(s),style:f({},this.getSlideStyle(),o.props.style)})),this.props.infinite===!0&&(c=this.props.centerMode===!0?this.props.slidesToShow+1:this.props.slidesToShow,s>=u-c&&(t=-(u-s),r.push(i(o,{key:t,"data-index":t,className:this.getSlideClasses(t),style:f({},this.getSlideStyle(),o.props.style)}))),c>s&&(t=u+s,e.push(i(o,{key:t,"data-index":t,className:this.getSlideClasses(t),style:f({},this.getSlideStyle(),o.props.style)}))))}.bind(this)),r.concat(n,e)},renderTrack:function(){return o.createElement("div",{ref:"track",className:"slick-track",style:this.state.trackStyle},this.renderSlides())},renderArrows:function(){if(this.props.arrows===!0){var t={"slick-prev":!0},n={"slick-next":!0},r=this.changeSlide.bind(this,{message:"previous"}),i=this.changeSlide.bind(this,{message:"next"});this.props.infinite===!1&&(0===this.state.currentSlide&&(t["slick-disabled"]=!0,r=null),this.props.centerMode&&!this.props.infinite?this.state.currentSlide>=this.state.slideCount-1&&(n["slick-disabled"]=!0,i=null):this.state.currentSlide>=this.state.slideCount-this.props.slidesToShow&&(n["slick-disabled"]=!0,i=null));var s,c={key:"0",ref:"previous","data-role":"none",className:u(t),style:{display:"block"},onClick:r};s=this.props.prevArrow?o.createElement(this.props.prevArrow,c):o.createElement("button",e({type:"button"},c)," Previous");var a,l={key:"1",ref:"next","data-role":"none",className:u(n),style:{display:"block"},onClick:i};return a=this.props.nextArrow?o.createElement(this.props.nextArrow,l):o.createElement("button",e({type:"button"},l)," Next"),[s,a]}return null},render:function(){var t=u("slick-initialized","slick-slider",this.props.className);return o.createElement("div",{className:t},o.createElement("div",{ref:"list",className:"slick-list",onMouseDown:this.swipeStart,onMouseMove:this.state.dragging?this.swipeMove:null,onMouseUp:this.swipeEnd,onMouseLeave:this.state.dragging?this.swipeEnd:null,onTouchStart:this.swipeStart,onTouchMove:this.state.dragging?this.swipeMove:null,onTouchEnd:this.swipeEnd,onTouchCancel:this.state.dragging?this.swipeEnd:null},this.renderTrack()),this.renderArrows(),this.renderDots())}});t.exports=p},function(t,n,r){"use strict";var e=(r(18),r(15)),o=r(19),i=r(20),u={initialize:function(t){var n=e.Children.count(t.children),r=this.refs.list.getDOMNode().getBoundingClientRect().width,o=this.refs.track.getDOMNode().getBoundingClientRect().width,i=this.getDOMNode().getBoundingClientRect().width/t.slidesToShow;this.setState({slideCount:n,slideWidth:i,listWidth:r,trackWidth:o,currentSlide:t.initialSlide},function(){var t=this.getCSS(this.getLeft(this.state.currentSlide));this.setState({trackStyle:t}),this.autoPlay()})},getDotCount:function(){var t;return t=Math.ceil(this.state.slideCount/this.props.slidesToScroll),t-1},getLeft:function(t){var n,r,e=0;if(this.props.infinite===!0&&(this.state.slideCount>this.props.slidesToShow&&(e=this.state.slideWidth*this.props.slidesToShow*-1),this.state.slideCount%this.props.slidesToScroll!==0&&t+this.props.slidesToScroll>this.state.slideCount&&this.state.slideCount>this.props.slidesToShow&&(e=t>this.state.slideCount?(this.props.slidesToShow-(t-this.state.slideCount))*this.state.slideWidth*-1:this.state.slideCount%this.props.slidesToScroll*this.state.slideWidth*-1)),this.props.centerMode===!0&&this.props.infinite===!0?e+=this.state.slideWidth*Math.floor(this.props.slidesToShow/2)-this.state.slideWidth:this.props.centerMode===!0&&(e=this.state.slideWidth*Math.floor(this.props.slidesToShow/2)),n=t*this.state.slideWidth*-1+e,this.props.variableWidth===!0){var o;this.state.slideCount<=this.props.slidesToShow||this.props.infinite===!1?r=this.refs.track.getDOMNode().childNodes[t]:(o=t+this.props.slidesToShow,r=this.refs.track.getDOMNode().childNodes[o]),n=r?-1*r.offsetLeft:0,this.props.centerMode===!0&&(r=this.props.infinite===!1?this.refs.track.getDOMNode().childNodes[t]:this.refs.track.getDOMNode().childNodes[t+this.props.slidesToShow+1],n=r?-1*r.offsetLeft:0,n+=(this.state.listWidth-r.offsetWidth)/2)}return n},getAnimateCSS:function(t){var n=this.getCSS(t);return n.WebkitTransition="-webkit-transform "+this.props.speed+"ms "+this.props.cssEase,n.transition="transform "+this.props.speed+"ms "+this.props.cssEase,n},getCSS:function(t){var n;n=this.props.variableWidth?(this.state.slideCount+2*this.props.slidesToShow)*this.state.slideWidth:this.props.centerMode?(this.state.slideCount+2*(this.props.slidesToShow+1))*this.state.slideWidth:(this.state.slideCount+2*this.props.slidesToShow)*this.state.slideWidth;var r={opacity:1,width:n,WebkitTransform:"translate3d("+t+"px, 0px, 0px)",transform:"translate3d("+t+"px, 0px, 0px)",transition:"",WebkitTransition:""};return r},getSlideStyle:function(){return{width:this.state.slideWidth}},getSlideClasses:function(t){var n,r,e,i,u=this.state.currentSlide;return e=0>t||t>=this.state.slideCount,this.props.centerMode?(i=Math.floor(this.props.slidesToShow/2),r=u===t,t>u-i-1&&u+i>=t&&(n=!0)):n=u===t,o({"slick-slide":!0,"slick-active":n,"slick-center":r,"slick-cloned":e})},adaptHeight:function(){if(this.props.adaptiveHeight){var t='[data-index="'+this.state.currentSlide+'"]';if(this.refs.list){var n=this.refs.list.getDOMNode();n.style.height=n.querySelector(t).offsetHeight+"px"}}},slideHandler:function(t,n,r){var e,o,u,s;if(this.state.animating!==!0&&!(this.props.fade===!0&&this.state.currentSlide===t||this.state.slideCount<=this.props.slidesToShow)){e=t,o=0>e?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.state.slideCount%this.props.slidesToScroll!==0?0:e-this.state.slideCount:e,u=this.getLeft(e,this.state),s=this.getLeft(o,this.state),this.props.infinite===!1&&(u=s),null!==this.props.afterChange&&this.props.afterChange(o);var c=function(){this.setState({animating:!1,trackStyle:this.getCSS(s),swipeLeft:null})}.bind(this);this.setState({animating:!0,currentSlide:o,currentLeft:s,trackStyle:this.getAnimateCSS(u)},function(){i.addEndEventListener(this.refs.track.getDOMNode(),c),setTimeout(c,this.props.speed)}),this.autoPlay()}},swipeDirection:function(t){var n,r,e,o;return n=t.startX-t.curX,r=t.startY-t.curY,e=Math.atan2(r,n),o=Math.round(180*e/Math.PI),0>o&&(o=360-Math.abs(o)),45>=o&&o>=0?this.props.rtl===!1?"left":"right":360>=o&&o>=315?this.props.rtl===!1?"left":"right":o>=135&&225>=o?this.props.rtl===!1?"right":"left":"vertical"},autoPlay:function(){var t=function(){this.isMounted()&&this.slideHandler(this.state.currentSlide+this.props.slidesToScroll)}.bind(this);this.props.autoplay&&(window.clearTimeout(this.state.autoPlayTimer),this.setState({autoPlayTimer:window.setTimeout(t,this.props.autoplaySpeed)}))}};t.exports=u},function(t,n,r){"use strict";function e(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=Object.assign||function(t,n){for(var r,o,i=e(t),u=1;u<arguments.length;u++){r=arguments[u],o=Object.keys(Object(r));for(var s=0;s<o.length;s++)i[o[s]]=r[o[s]]}return i}},function(t,n,r){/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Slider=t(require("react")):e.Slider=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var i=r(4),s=n(i),o=r(5),a=r(23),l=n(a),u=r(2),c=n(u),d=r(26),p=n(d),h=r(9),f=n(h),v=s["default"].createClass({displayName:"Slider",mixins:[p["default"]],getInitialState:function(){return{breakpoint:null}},componentDidMount:function(){var e=this;if(this.props.responsive){var t=this.props.responsive.map(function(e){return e.breakpoint});t.sort(function(e,t){return e-t}),t.forEach(function(r,n){var i;i=0===n?c["default"]({minWidth:0,maxWidth:r}):c["default"]({minWidth:t[n-1],maxWidth:r}),e.media(i,function(){e.setState({breakpoint:r})})});var r=c["default"]({minWidth:t.slice(-1)[0]});this.media(r,function(){e.setState({breakpoint:null})})}},render:function(){var e,t,r=this;return this.state.breakpoint?(t=this.props.responsive.filter(function(e){return e.breakpoint===r.state.breakpoint}),e="unslick"===t[0].settings?"unslick":l["default"]({},this.props,t[0].settings)):e=l["default"]({},f["default"],this.props),"unslick"===e?s["default"].createElement("div",null,this.props.children):s["default"].createElement(o.InnerSlider,e,this.props.children)}});e.exports=v},function(e,t,r){var n=r(3),i=function(e){var t=/[height|width]$/;return t.test(e)},s=function(e){var t="",r=Object.keys(e);return r.forEach(function(s,o){var a=e[s];s=n(s),i(s)&&"number"==typeof a&&(a+="px"),t+=a===!0?s:a===!1?"not "+s:"("+s+": "+a+")",o<r.length-1&&(t+=" and ")}),t},o=function(e){var t="";return"string"==typeof e?e:e instanceof Array?(e.forEach(function(r,n){t+=s(r),n<e.length-1&&(t+=", ")}),t):s(e)};e.exports=o},function(e,t,r){var n=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}).toLowerCase()};e.exports=n},function(t,r,n){t.exports=e},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=r(4),o=n(s),a=r(!function(){var e=new Error('Cannot find module "./mixins/event-handlers"');throw e.code="MODULE_NOT_FOUND",e}()),l=n(a),u=r(!function(){var e=new Error('Cannot find module "./mixins/helpers"');throw e.code="MODULE_NOT_FOUND",e}()),c=n(u),d=r(8),p=n(d),h=r(9),f=n(h),v=r(10),y=n(v),m=r(11),w=r(24),g=r(25),b=o["default"].createClass({displayName:"InnerSlider",mixins:[c["default"],l["default"]],getInitialState:function(){return p["default"]},getDefaultProps:function(){return f["default"]},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var e=[],t=0;t<this.props.children.length;t++)t>=this.state.currentSlide&&t<this.state.currentSlide+this.props.slidesToShow&&e.push(t);this.props.lazyLoad&&0===this.state.lazyLoadedList.length&&this.setState({lazyLoadedList:e})},componentDidMount:function(){this.initialize(this.props),this.adaptHeight()},componentDidUpdate:function(){this.adaptHeight()},componentWillReceiveProps:function(e){this.initialize(e)},render:function(){var e,t=y["default"]("slick-initialized","slick-slider",this.props.className),r={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 n={dotsClass:this.props.dotsClass,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,currentSlide:this.state.currentSlide,slidesToScroll:this.props.slidesToScroll,clickHandler:this.changeSlide};e=o["default"].createElement(w.Dots,n)}var s,a,l={infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,prevArrow:this.props.prevArrow,nextArrow:this.props.nextArrow,clickHandler:this.changeSlide};return this.props.arrows&&(s=o["default"].createElement(g.PrevArrow,l),a=o["default"].createElement(g.NextArrow,l)),o["default"].createElement("div",{className:t},o["default"].createElement("div",{ref:"list",className:"slick-list",onMouseDown:this.swipeStart,onMouseMove:this.state.dragging?this.swipeMove:null,onMouseUp:this.swipeEnd,onMouseLeave:this.state.dragging?this.swipeEnd:null,onTouchStart:this.swipeStart,onTouchMove:this.state.dragging?this.swipeMove:null,onTouchEnd:this.swipeEnd,onTouchCancel:this.state.dragging?this.swipeEnd:null},o["default"].createElement(m.Track,i({ref:"track"},r),this.props.children)),s,a,e)}});t.InnerSlider=b},,,function(e,t,r){var n={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};e.exports=n},function(e,t,r){var n={className:"",adaptiveHeight:!1,arrows:!0,autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:!1,responsive:null,rtl:!1,slide:"div",slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,afterChange:null,beforeChange:null,edgeEvent:null,init:null,swipeEvent:null,nextArrow:null,prevArrow:null};e.exports=n},function(e,t,r){/*! | ||
Copyright (c) 2015 Jed Watson. | ||
@@ -6,3 +6,2 @@ Licensed under the MIT License (MIT), see | ||
*/ | ||
function e(){"use strict";for(var t="",n=0;n<arguments.length;n++){var r=arguments[n];if(r){var o=typeof r;if("string"===o||"number"===o)t+=" "+r;else if(Array.isArray(r))t+=" "+e.apply(null,r);else if("object"===o)for(var i in r)r.hasOwnProperty(i)&&r[i]&&(t+=" "+i)}}return t.substr(1)}var o,i;"undefined"!=typeof t&&t.exports&&(t.exports=e),o=[],i=function(){return e}.apply(n,o),!(void 0!==i&&(t.exports=i))},function(t,n,r){"use strict";function e(){var t=document.createElement("div"),n=t.style;"AnimationEvent"in window||delete s.animationend.animation,"TransitionEvent"in window||delete s.transitionend.transition;for(var r in s){var e=s[r];for(var o in e)if(o in n){c.push(e[o]);break}}}function o(t,n,r){t.addEventListener(n,r,!1)}function i(t,n,r){t.removeEventListener(n,r,!1)}var u=r(21),s={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},c=[];u.canUseDOM&&e();var a={addEndEventListener:function(t,n){return 0===c.length?void window.setTimeout(n,0):void c.forEach(function(r){o(t,r,n)})},removeEndEventListener:function(t,n){0!==c.length&&c.forEach(function(r){i(t,r,n)})}};t.exports=a},function(t,n,r){"use strict";var e=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};t.exports=o},function(t,n,r){"use strict";function e(t,n){s(!t.ref,"You are calling cloneWithProps() on a child with a ref. This is dangerous because you're creating a new child which will not be added as a ref to its parent.");var r=i.mergeProps(n,t.props);return!r.hasOwnProperty(c)&&t.props.hasOwnProperty(c)&&(r.children=t.props.children),o.createElement(t.type,r)}var o=r(23),i=r(30),u=r(32),s=r(24),c=u({children:null});t.exports=e},function(t,n,r){"use strict";function e(t,n){Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[n]:null},set:function(t){c(!1,"Don't set the %s property of the React element. Instead, specify the correct value when initially creating the element.",n),this._store[n]=t}})}function o(t){try{var n={props:!0};for(var r in n)e(t,r);l=!0}catch(o){}}var i=r(26),u=r(29),s=r(27),c=r(24),a={key:!0,ref:!0},l=!1,f=function(t,n,r,e,o,i){this.type=t,this.key=n,this.ref=r,this._owner=e,this._context=o,this._store={props:i,originalProps:s({},i)};try{Object.defineProperty(this._store,"validated",{configurable:!1,enumerable:!1,writable:!0})}catch(u){}return this._store.validated=!1,l?void Object.freeze(this):void(this.props=i)};f.prototype={_isReactElement:!0},o(f.prototype),f.createElement=function(t,n,r){var e,o={},s=null,c=null;if(null!=n){c=void 0===n.ref?null:n.ref,s=void 0===n.key?null:""+n.key;for(e in n)n.hasOwnProperty(e)&&!a.hasOwnProperty(e)&&(o[e]=n[e])}var l=arguments.length-2;if(1===l)o.children=r;else if(l>1){for(var p=Array(l),h=0;l>h;h++)p[h]=arguments[h+2];o.children=p}if(t&&t.defaultProps){var d=t.defaultProps;for(e in d)"undefined"==typeof o[e]&&(o[e]=d[e])}return new f(t,s,c,u.current,i.current,o)},f.createFactory=function(t){var n=f.createElement.bind(null,t);return n.type=t,n},f.cloneAndReplaceProps=function(t,n){var r=new f(t.type,t.key,t.ref,t._owner,t._context,n);return r._store.validated=t._store.validated,r},f.cloneElement=function(t,n,r){var e,o=s({},t.props),i=t.key,c=t.ref,l=t._owner;if(null!=n){void 0!==n.ref&&(c=n.ref,l=u.current),void 0!==n.key&&(i=""+n.key);for(e in n)n.hasOwnProperty(e)&&!a.hasOwnProperty(e)&&(o[e]=n[e])}var p=arguments.length-2;if(1===p)o.children=r;else if(p>1){for(var h=Array(p),d=0;p>d;d++)h[d]=arguments[d+2];o.children=h}return new f(t.type,i,c,l,t._context,o)},f.isValidElement=function(t){var n=!(!t||!t._isReactElement);return n},t.exports=f},function(t,n,r){"use strict";var e=r(25),o=e;o=function(t,n){for(var r=[],e=2,o=arguments.length;o>e;e++)r.push(arguments[e]);if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(n.length<10||/^[s\W]*$/.test(n))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+n);if(0!==n.indexOf("Failed Composite propType: ")&&!t){var i=0,u="Warning: "+n.replace(/%s/g,function(){return r[i++]});console.warn(u);try{throw new Error(u)}catch(s){}}},t.exports=o},function(t,n,r){function e(t){return function(){return t}}function o(){}o.thatReturns=e,o.thatReturnsFalse=e(!1),o.thatReturnsTrue=e(!0),o.thatReturnsNull=e(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,n,r){"use strict";var e=r(27),o=r(28),i=r(24),u=!1,s={current:o,withContext:function(t,n){i(u,"withContext is deprecated and will be removed in a future version. Use a wrapper component with getChildContext instead."),u=!0;var r,o=s.current;s.current=e({},o,t);try{r=n()}finally{s.current=o}return r}};t.exports=s},function(t,n,r){"use strict";function e(t,n){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var r=Object(t),e=Object.prototype.hasOwnProperty,o=1;o<arguments.length;o++){var i=arguments[o];if(null!=i){var u=Object(i);for(var s in u)e.call(u,s)&&(r[s]=u[s])}}return r}t.exports=e},function(t,n,r){"use strict";var e={};Object.freeze(e),t.exports=e},function(t,n,r){"use strict";var e={current:null};t.exports=e},function(t,n,r){"use strict";function e(t){return function(n,r,e){n.hasOwnProperty(r)?n[r]=t(n[r],e):n[r]=e}}function o(t,n){for(var r in n)if(n.hasOwnProperty(r)){var e=a[r];e&&a.hasOwnProperty(r)?e(t,r,n[r]):t.hasOwnProperty(r)||(t[r]=n[r])}return t}var i=r(27),u=r(25),s=r(31),c=e(function(t,n){return i({},n,t)}),a={children:u,className:e(s),style:c},l={mergeProps:function(t,n){return o(i({},t),n)}};t.exports=l},function(t,n,r){"use strict";function e(t){t||(t="");var n,r=arguments.length;if(r>1)for(var e=1;r>e;e++)n=arguments[e],n&&(t=(t?t+" ":"")+n);return t}t.exports=e},function(t,n,r){var e=function(t){var n;for(n in t)if(t.hasOwnProperty(n))return n;return null};t.exports=e},function(t,n,r){"use strict";var e={changeSlide:function(t,n){var r,e,o;if(o=this.state.slideCount%this.props.slidesToScroll!==0,r=o?0:(this.state.slideCount-this.state.currentSlide)%this.props.slidesToScroll,"previous"===t.message)e=0===r?this.props.slidesToScroll:this.props.slidesToShow-r,this.state.slideCount>this.props.slidesToShow&&this.slideHandler(this.state.currentSlide-e,!1);else if("next"===t.message)e=0===r?this.props.slidesToScroll:r,this.state.slideCount>this.props.slidesToShow&&this.slideHandler(this.state.currentSlide+e,!1);else if("index"===t.message){var i=t.index*this.props.slidesToScroll;i!==this.state.currentSlide&&this.slideHandler(i)}},keyHandler:function(t){},selectHandler:function(t){},swipeStart:function(t){var n,r;this.props.swipe===!1||"ontouchend"in document&&this.props.swipe===!1||(this.props.draggable!==!1||-1===t.type.indexOf("mouse"))&&(n=void 0!==t.touches?t.touches[0].pageX:t.clientX,r=void 0!==t.touches?t.touches[0].pageY:t.clientY,this.setState({dragging:!0,touchObject:{startX:n,startY:r,curX:n,curY:r}}),t.preventDefault())},swipeMove:function(t){if(this.state.dragging&&!this.state.animating){var n,r,e,o=this.state.touchObject;r=this.getLeft(this.state.currentSlide),o.curX=t.touches?t.touches[0].pageX:t.clientX,o.curY=t.touches?t.touches[0].pageY:t.clientY,o.swipeLength=Math.round(Math.sqrt(Math.pow(o.curX-o.startX,2))),e=(this.props.rtl===!1?1:-1)*(o.curX>o.startX?1:-1),n=r+o.swipeLength*e,this.setState({touchObject:o,swipeLeft:n,trackStyle:this.getCSS(n)}),t.preventDefault()}},swipeEnd:function(t){if(t.preventDefault(),this.state.dragging){var n=this.state.touchObject,r=this.state.listWidth/this.props.touchThreshold,e=this.swipeDirection(n);this.setState({dragging:!1,swipeLeft:null,touchObject:{}}),n.swipeLength&&(n.swipeLength>r?"left"===e?this.slideHandler(this.state.currentSlide+this.props.slidesToScroll):"right"===e?this.slideHandler(this.state.currentSlide-this.props.slidesToScroll):this.slideHandler(this.state.currentSlide,null,!0):this.slideHandler(this.state.currentSlide,null,!0))}}};t.exports=e},function(t,n,r){var e={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},initialized:!1,trackStyle:{},trackWidth:0};t.exports=e},function(t,n,r){var e={className:"",adaptiveHeight:!1,arrows:!0,autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,responsive:null,rtl:!1,slide:"div",slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,variableWidth:!1,vertical:!1,afterChange:null,nextArrow:null,prevArrow:null};t.exports=e},function(t,n,r){function e(t,n,r){for(var e=-1,o=u(n),i=o.length;++e<i;){var s=o[e],c=t[s],a=r(c,n[s],s,t,n);(a===a?a===c:c!==c)&&(void 0!==c||s in t)||(t[s]=a)}return t}var o=r(37),i=r(43),u=r(39),s=i(function(t,n,r){return r?e(t,n,r):o(t,n)});t.exports=s},function(t,n,r){function e(t,n){return null==n?t:o(n,i(n),t)}var o=r(38),i=r(39);t.exports=e},function(t,n,r){function e(t,n,r){r||(r={});for(var e=-1,o=n.length;++e<o;){var i=n[e];r[i]=t[i]}return r}t.exports=e},function(t,n,r){function e(t){return function(n){return null==n?void 0:n[t]}}function o(t){return null!=t&&u(b(t))}function i(t,n){return t="number"==typeof t||h.test(t)?+t:-1,n=null==n?y:n,t>-1&&t%1==0&&n>t}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function s(t){for(var n=a(t),r=n.length,e=r&&t.length,o=!!e&&u(e)&&(p(t)||f(t)),s=-1,c=[];++s<r;){var l=n[s];(o&&i(l,e)||v.call(t,l))&&c.push(l)}return c}function c(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function a(t){if(null==t)return[];c(t)||(t=Object(t));var n=t.length;n=n&&u(n)&&(p(t)||f(t))&&n||0;for(var r=t.constructor,e=-1,o="function"==typeof r&&r.prototype===t,s=Array(n),a=n>0;++e<n;)s[e]=e+"";for(var l in t)a&&i(l,n)||"constructor"==l&&(o||!v.call(t,l))||s.push(l);return s}var l=r(40),f=r(41),p=r(42),h=/^\d+$/,d=Object.prototype,v=d.hasOwnProperty,g=l(Object,"keys"),y=9007199254740991,b=e("length"),j=g?function(t){var n=null==t?null:t.constructor;return"function"==typeof n&&n.prototype===t||"function"!=typeof t&&o(t)?s(t):c(t)?g(t):[]}:s;t.exports=j},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return u(r)?r:void 0}function u(t){return null==t?!1:v.call(t)==c?g.test(h.call(t)):o(t)&&f.test(t)}function s(t){return t=e(t),t&&l.test(t)?t.replace(a,"\\$&"):t}var c="[object Function]",a=/[.*+?^${}()|[\]\/\\]/g,l=RegExp(a.source),f=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,d=p.hasOwnProperty,v=p.toString,g=RegExp("^"+s(h.call(d)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=i},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t){return null!=t&&u(p(t))}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function s(t){return e(t)&&i(t)&&l.call(t)==c}var c="[object Arguments]",a=Object.prototype,l=a.toString,f=9007199254740991,p=o("length");t.exports=s},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return s(r)?r:void 0}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&m>=t}function s(t){return null==t?!1:y.call(t)==l?b.test(v.call(t)):o(t)&&h.test(t)}function c(t){return t=e(t),t&&p.test(t)?t.replace(f,"\\$&"):t}var a="[object Array]",l="[object Function]",f=/[.*+?^${}()|[\]\/\\]/g,p=RegExp(f.source),h=/^\[object .+?Constructor\]$/,d=Object.prototype,v=Function.prototype.toString,g=d.hasOwnProperty,y=d.toString,b=RegExp("^"+c(v.call(g)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=i(Array,"isArray"),m=9007199254740991,w=j||function(t){return o(t)&&u(t.length)&&y.call(t)==a};t.exports=w},function(t,n,r){function e(t){return u(function(n,r){var e=-1,u=null==n?0:r.length,s=u>2?r[u-2]:void 0,c=u>2?r[2]:void 0,a=u>1?r[u-1]:void 0;for("function"==typeof s?(s=o(s,a,5),u-=2):(s="function"==typeof a?a:void 0,u-=s?1:0),c&&i(r[0],r[1],c)&&(s=3>u?void 0:s,u=1);++e<u;){var l=r[e];l&&t(n,l,s)}return n})}var o=r(44),i=r(45),u=r(46);t.exports=e},function(t,n,r){function e(t,n,r){if("function"!=typeof t)return o;if(void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 3:return function(r,e,o){return t.call(n,r,e,o)};case 4:return function(r,e,o,i){return t.call(n,r,e,o,i)};case 5:return function(r,e,o,i,u){return t.call(n,r,e,o,i,u)}}return function(){return t.apply(n,arguments)}}function o(t){return t}t.exports=e},function(t,n,r){function e(t){return function(n){return null==n?void 0:n[t]}}function o(t){return null!=t&&s(f(t))}function i(t,n){return t="number"==typeof t||a.test(t)?+t:-1,n=null==n?l:n,t>-1&&t%1==0&&n>t}function u(t,n,r){if(!c(r))return!1;var e=typeof n;if("number"==e?o(r)&&i(n,r.length):"string"==e&&n in r){var u=r[n];return t===t?t===u:u!==u}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function c(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var a=/^\d+$/,l=9007199254740991,f=e("length");t.exports=u},function(t,n,r){function e(t,n){if("function"!=typeof t)throw new TypeError(o);return n=i(void 0===n?t.length-1:+n||0,0),function(){for(var r=arguments,e=-1,o=i(r.length-n,0),u=Array(o);++e<o;)u[e]=r[n+e];switch(n){case 0:return t.call(this,u);case 1:return t.call(this,r[0],u);case 2:return t.call(this,r[0],r[1],u)}var s=Array(n+1);for(e=-1;++e<n;)s[e]=r[e];return s[n]=u,t.apply(this,s)}}var o="Expected a function",i=Math.max;t.exports=e},function(t,n,r){function e(t,n){return l(t.criteria,n.criteria)||t.index-n.index}function o(t,n){var r=-1,e=u(t)?Array(t.length):[];return f(t,function(t,o,i){e[++r]=n(t,o,i)}),e}function i(t){return function(n){return null==n?void 0:n[t]}}function u(t){return null!=t&&s(v(t))}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&d>=t}function c(t,n,r){if(null==t)return[];r&&h(t,n,r)&&(n=null);var i=-1;n=a(n,r,3);var u=o(t,function(t,r,e){return{criteria:n(t,r,e),index:++i,value:t}});return p(u,e)}var a=r(48),l=r(57),f=r(58),p=r(59),h=r(60),d=9007199254740991,v=i("length");t.exports=c},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t,n,r){var e=typeof t;return"function"==e?void 0===n?t:S(t,n,r):null==t?j:"object"==e?s(t):void 0===n?m(t):c(t,n)}function i(t,n,r){if(null!=t){void 0!==r&&r in v(t)&&(n=[r]);for(var e=0,o=n.length;null!=t&&o>e;)t=t[n[e++]];return e&&e==o?t:void 0}}function u(t,n,r){var e=n.length,o=e,i=!r;if(null==t)return!o;for(t=v(t);e--;){var u=n[e];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++e<o;){u=n[e];var s=u[0],c=t[s],a=u[1];if(i&&u[2]){if(void 0===c&&!(s in t))return!1}else{var l=r?r(c,a,s):void 0;if(!(void 0===l?w(a,c,r,!0):l))return!1}}return!0}function s(t){var n=p(t);if(1==n.length&&n[0][2]){var r=n[0][0],e=n[0][1];return function(t){return null==t?!1:t[r]===e&&(void 0!==e||r in v(t))}}return function(t){return u(t,n)}}function c(t,n){var r=x(t),e=h(t)&&d(n),o=t+"";return t=g(t),function(u){if(null==u)return!1;var s=o;if(u=v(u),!(!r&&e||s in u)){if(u=1==t.length?u:i(u,f(t,0,-1)),null==u)return!1;s=y(t),u=v(u)}return u[s]===n?void 0!==n||s in u:w(n,u[s],void 0,!0)}}function a(t){return function(n){return null==n?void 0:n[t]}}function l(t){var n=t+"";return t=g(t),function(r){return i(r,t,n)}}function f(t,n,r){var e=-1,o=t.length;n=null==n?0:+n||0,0>n&&(n=-n>o?0:o+n),r=void 0===r||r>o?o:+r||0,0>r&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var i=Array(o);++e<o;)i[e]=t[e+n];return i}function p(t){for(var n=O(t),r=n.length;r--;)n[r][2]=d(n[r][1]);return n}function h(t,n){var r=typeof t;if("string"==r&&E.test(t)||"number"==r)return!0;if(x(t))return!1;var e=!A.test(t);return e||null!=n&&t in v(n)}function d(t){return t===t&&!b(t)}function v(t){return b(t)?t:Object(t)}function g(t){if(x(t))return t;var n=[];return e(t).replace(k,function(t,r,e,o){n.push(e?o.replace(C,"$1"):r||t)}),n}function y(t){var n=t?t.length:0;return n?t[n-1]:void 0}function b(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function j(t){return t}function m(t){return h(t)?a(t):l(t)}var w=r(49),S=r(55),x=r(50),O=r(56),A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,E=/^\w*$/,k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,C=/\\(\\)?/g;t.exports=o},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t,n){for(var r=-1,e=t.length;++r<e;)if(n(t[r],r,t))return!0;return!1}function i(t,n,r,o,s,c){return t===n?!0:null==t||null==n||!l(t)&&!e(n)?t!==t&&n!==n:u(t,n,i,r,o,s,c)}function u(t,n,r,e,o,i,u){var l=f(t),h=f(n),g=v,y=v;l||(g=A.call(t),g==d?g=m:g!=m&&(l=p(t))),h||(y=A.call(n),y==d?y=m:y!=m&&(h=p(n)));var b=g==m,j=y==m,w=g==y;if(w&&!l&&!b)return c(t,n,g);if(!o){var S=b&&O.call(t,"__wrapped__"),x=j&&O.call(n,"__wrapped__");if(S||x)return r(S?t.value():t,x?n.value():n,e,o,i,u)}if(!w)return!1;i||(i=[]),u||(u=[]);for(var E=i.length;E--;)if(i[E]==t)return u[E]==n;i.push(t),u.push(n);var k=(l?s:a)(t,n,r,e,o,i,u);return i.pop(),u.pop(),k}function s(t,n,r,e,i,u,s){var c=-1,a=t.length,l=n.length;if(a!=l&&!(i&&l>a))return!1;for(;++c<a;){var f=t[c],p=n[c],h=e?e(i?p:f,i?f:p,c):void 0;if(void 0!==h){if(h)continue;return!1}if(i){if(!o(n,function(t){return f===t||r(f,t,e,i,u,s)}))return!1}else if(f!==p&&!r(f,p,e,i,u,s))return!1}return!0}function c(t,n,r){switch(r){case g:case y:return+t==+n;case b:return t.name==n.name&&t.message==n.message;case j:return t!=+t?n!=+n:t==+n;case w:case S:return t==n+""}return!1}function a(t,n,r,e,o,i,u){var s=h(t),c=s.length,a=h(n),l=a.length;if(c!=l&&!o)return!1;for(var f=c;f--;){var p=s[f];if(!(o?p in n:O.call(n,p)))return!1}for(var d=o;++f<c;){p=s[f];var v=t[p],g=n[p],y=e?e(o?g:v,o?v:g,p):void 0;if(!(void 0===y?r(v,g,e,o,i,u):y))return!1;d||(d="constructor"==p)}if(!d){var b=t.constructor,j=n.constructor;if(b!=j&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof j&&j instanceof j))return!1}return!0}function l(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var f=r(50),p=r(51),h=r(52),d="[object Arguments]",v="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",j="[object Number]",m="[object Object]",w="[object RegExp]",S="[object String]",x=Object.prototype,O=x.hasOwnProperty,A=x.toString;t.exports=i},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return s(r)?r:void 0}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&m>=t}function s(t){return null==t?!1:y.call(t)==l?b.test(v.call(t)):o(t)&&h.test(t)}function c(t){return t=e(t),t&&p.test(t)?t.replace(f,"\\$&"):t}var a="[object Array]",l="[object Function]",f=/[.*+?^${}()|[\]\/\\]/g,p=RegExp(f.source),h=/^\[object .+?Constructor\]$/,d=Object.prototype,v=Function.prototype.toString,g=d.hasOwnProperty,y=d.toString,b=RegExp("^"+c(v.call(g)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=i(Array,"isArray"),m=9007199254740991,w=j||function(t){return o(t)&&u(t.length)&&y.call(t)==a};t.exports=w},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&$>=t}function i(t){return e(t)&&o(t.length)&&!!T[P.call(t)]}var u="[object Arguments]",s="[object Array]",c="[object Boolean]",a="[object Date]",l="[object Error]",f="[object Function]",p="[object Map]",h="[object Number]",d="[object Object]",v="[object RegExp]",g="[object Set]",y="[object String]",b="[object WeakMap]",j="[object ArrayBuffer]",m="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",x="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",E="[object Uint8ClampedArray]",k="[object Uint16Array]",C="[object Uint32Array]",T={};T[m]=T[w]=T[S]=T[x]=T[O]=T[A]=T[E]=T[k]=T[C]=!0,T[u]=T[s]=T[j]=T[c]=T[a]=T[l]=T[f]=T[p]=T[h]=T[d]=T[v]=T[g]=T[y]=T[b]=!1;var M=Object.prototype,P=M.toString,$=9007199254740991;t.exports=i},function(t,n,r){function e(t){return function(n){return null==n?void 0:n[t]}}function o(t){return null!=t&&u(b(t))}function i(t,n){return t="number"==typeof t||h.test(t)?+t:-1,n=null==n?y:n,t>-1&&t%1==0&&n>t}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function s(t){for(var n=a(t),r=n.length,e=r&&t.length,o=!!e&&u(e)&&(p(t)||f(t)),s=-1,c=[];++s<r;){var l=n[s];(o&&i(l,e)||v.call(t,l))&&c.push(l)}return c}function c(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function a(t){if(null==t)return[];c(t)||(t=Object(t));var n=t.length;n=n&&u(n)&&(p(t)||f(t))&&n||0;for(var r=t.constructor,e=-1,o="function"==typeof r&&r.prototype===t,s=Array(n),a=n>0;++e<n;)s[e]=e+"";for(var l in t)a&&i(l,n)||"constructor"==l&&(o||!v.call(t,l))||s.push(l);return s}var l=r(53),f=r(54),p=r(50),h=/^\d+$/,d=Object.prototype,v=d.hasOwnProperty,g=l(Object,"keys"),y=9007199254740991,b=e("length"),j=g?function(t){var n=null==t?null:t.constructor;return"function"==typeof n&&n.prototype===t||"function"!=typeof t&&o(t)?s(t):c(t)?g(t):[]}:s;t.exports=j},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return u(r)?r:void 0}function u(t){return null==t?!1:v.call(t)==c?g.test(h.call(t)):o(t)&&f.test(t)}function s(t){return t=e(t),t&&l.test(t)?t.replace(a,"\\$&"):t}var c="[object Function]",a=/[.*+?^${}()|[\]\/\\]/g,l=RegExp(a.source),f=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,d=p.hasOwnProperty,v=p.toString,g=RegExp("^"+s(h.call(d)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=i},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t){return null!=t&&u(p(t))}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function s(t){return e(t)&&i(t)&&l.call(t)==c}var c="[object Arguments]",a=Object.prototype,l=a.toString,f=9007199254740991,p=o("length");t.exports=s},function(t,n,r){function e(t,n,r){if("function"!=typeof t)return o;if(void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 3:return function(r,e,o){return t.call(n,r,e,o)};case 4:return function(r,e,o,i){return t.call(n,r,e,o,i)};case 5:return function(r,e,o,i,u){return t.call(n,r,e,o,i,u)}}return function(){return t.apply(n,arguments)}}function o(t){return t}t.exports=e},function(t,n,r){function e(t){return o(t)?t:Object(t)}function o(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function i(t){t=e(t);for(var n=-1,r=u(t),o=r.length,i=Array(o);++n<o;){var s=r[n];i[n]=[s,t[s]]}return i}var u=r(52);t.exports=i},function(t,n,r){function e(t,n){if(t!==n){var r=null===t,e=void 0===t,o=t===t,i=null===n,u=void 0===n,s=n===n;if(t>n&&!i||!o||r&&!u&&s||e&&s)return 1;if(n>t&&!r||!s||i&&!e&&o||u&&o)return-1}return 0}t.exports=e},function(t,n,r){function e(t,n){return h(t,n,l)}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t,n){return function(r,e){var o=r?d(r):0;if(!s(o))return t(r,e);for(var i=n?o:-1,u=c(r);(n?i--:++i<o)&&e(u[i],i,u)!==!1;);return r}}function u(t){return function(n,r,e){for(var o=c(n),i=e(n),u=i.length,s=t?u:-1;t?s--:++s<u;){var a=i[s];if(r(o[a],a,o)===!1)break}return n}}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function c(t){return a(t)?t:Object(t)}function a(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var l=r(52),f=9007199254740991,p=i(e),h=u(),d=o("length");t.exports=p},function(t,n,r){function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}t.exports=e},function(t,n,r){function e(t){return function(n){return null==n?void 0:n[t]}}function o(t){return null!=t&&s(f(t))}function i(t,n){return t="number"==typeof t||a.test(t)?+t:-1,n=null==n?l:n,t>-1&&t%1==0&&n>t}function u(t,n,r){if(!c(r))return!1;var e=typeof n;if("number"==e?o(r)&&i(n,r.length):"string"==e&&n in r){var u=r[n];return t===t?t===u:u!==u}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function c(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var a=/^\d+$/,l=9007199254740991,f=e("length");t.exports=u},function(t,n,r){function e(t){return function(n){return null==n?void 0:n[t]}}function o(t){var n=t+"";return t=f(t),function(r){return l(r,t,n)}}function i(t,n){var r=typeof t;if("string"==r&&v.test(t)||"number"==r)return!0;if(p(t))return!1;var e=!d.test(t);return e||null!=n&&t in u(n)}function u(t){return c(t)?t:Object(t)}function s(t,n){return h(t,a(n))}function c(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function a(t){return i(t)?e(t):o(t)}var l=r(62),f=r(63),p=r(64),h=r(65),d=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,v=/^\w*$/;t.exports=s},function(t,n,r){function e(t,n,r){if(null!=t){void 0!==r&&r in o(t)&&(n=[r]);for(var e=0,i=n.length;null!=t&&i>e;)t=t[n[e++]];return e&&e==i?t:void 0}}function o(t){return i(t)?t:Object(t)}function i(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}t.exports=e},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){if(i(t))return t;var n=[];return e(t).replace(u,function(t,r,e,o){n.push(e?o.replace(s,"$1"):r||t)}),n}var i=r(64),u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;t.exports=o},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return s(r)?r:void 0}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&m>=t}function s(t){return null==t?!1:y.call(t)==l?b.test(v.call(t)):o(t)&&h.test(t)}function c(t){return t=e(t),t&&p.test(t)?t.replace(f,"\\$&"):t}var a="[object Array]",l="[object Function]",f=/[.*+?^${}()|[\]\/\\]/g,p=RegExp(f.source),h=/^\[object .+?Constructor\]$/,d=Object.prototype,v=Function.prototype.toString,g=d.hasOwnProperty,y=d.toString,b=RegExp("^"+c(v.call(g)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=i(Array,"isArray"),m=9007199254740991,w=j||function(t){return o(t)&&u(t.length)&&y.call(t)==a};t.exports=w},function(t,n,r){function e(t,n){var r=-1,e=i(t)?Array(t.length):[];return l(t,function(t,o,i){e[++r]=n(t,o,i)}),e}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t){return null!=t&&u(h(t))}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&p>=t}function s(t,n,r){var o=f(t)?c:e;return n=a(n,r,3),o(t,n)}var c=r(66),a=r(67),l=r(75),f=r(64),p=9007199254740991,h=o("length");t.exports=s},function(t,n,r){function e(t,n){for(var r=-1,e=t.length,o=Array(e);++r<e;)o[r]=n(t[r],r,t);return o}t.exports=e},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t,n,r){var e=typeof t;return"function"==e?void 0===n?t:S(t,n,r):null==t?j:"object"==e?s(t):void 0===n?m(t):c(t,n)}function i(t,n,r){if(null!=t){void 0!==r&&r in v(t)&&(n=[r]);for(var e=0,o=n.length;null!=t&&o>e;)t=t[n[e++]];return e&&e==o?t:void 0}}function u(t,n,r){var e=n.length,o=e,i=!r;if(null==t)return!o;for(t=v(t);e--;){var u=n[e];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++e<o;){u=n[e];var s=u[0],c=t[s],a=u[1];if(i&&u[2]){if(void 0===c&&!(s in t))return!1}else{var l=r?r(c,a,s):void 0;if(!(void 0===l?w(a,c,r,!0):l))return!1}}return!0}function s(t){var n=p(t);if(1==n.length&&n[0][2]){var r=n[0][0],e=n[0][1];return function(t){return null==t?!1:t[r]===e&&(void 0!==e||r in v(t))}}return function(t){return u(t,n)}}function c(t,n){var r=x(t),e=h(t)&&d(n),o=t+"";return t=g(t),function(u){if(null==u)return!1;var s=o;if(u=v(u),!(!r&&e||s in u)){if(u=1==t.length?u:i(u,f(t,0,-1)),null==u)return!1;s=y(t),u=v(u)}return u[s]===n?void 0!==n||s in u:w(n,u[s],void 0,!0)}}function a(t){return function(n){return null==n?void 0:n[t]}}function l(t){var n=t+"";return t=g(t),function(r){return i(r,t,n)}}function f(t,n,r){var e=-1,o=t.length;n=null==n?0:+n||0,0>n&&(n=-n>o?0:o+n),r=void 0===r||r>o?o:+r||0,0>r&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var i=Array(o);++e<o;)i[e]=t[e+n];return i}function p(t){for(var n=O(t),r=n.length;r--;)n[r][2]=d(n[r][1]);return n}function h(t,n){var r=typeof t;if("string"==r&&E.test(t)||"number"==r)return!0;if(x(t))return!1;var e=!A.test(t);return e||null!=n&&t in v(n)}function d(t){return t===t&&!b(t)}function v(t){return b(t)?t:Object(t)}function g(t){if(x(t))return t;var n=[];return e(t).replace(k,function(t,r,e,o){n.push(e?o.replace(C,"$1"):r||t)}),n}function y(t){var n=t?t.length:0;return n?t[n-1]:void 0}function b(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function j(t){return t}function m(t){return h(t)?a(t):l(t)}var w=r(68),S=r(73),x=r(64),O=r(74),A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,E=/^\w*$/,k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,C=/\\(\\)?/g;t.exports=o},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t,n){for(var r=-1,e=t.length;++r<e;)if(n(t[r],r,t))return!0;return!1}function i(t,n,r,o,s,c){return t===n?!0:null==t||null==n||!l(t)&&!e(n)?t!==t&&n!==n:u(t,n,i,r,o,s,c)}function u(t,n,r,e,o,i,u){var l=f(t),h=f(n),g=v,y=v;l||(g=A.call(t),g==d?g=m:g!=m&&(l=p(t))),h||(y=A.call(n),y==d?y=m:y!=m&&(h=p(n)));var b=g==m,j=y==m,w=g==y;if(w&&!l&&!b)return c(t,n,g);if(!o){var S=b&&O.call(t,"__wrapped__"),x=j&&O.call(n,"__wrapped__");if(S||x)return r(S?t.value():t,x?n.value():n,e,o,i,u)}if(!w)return!1;i||(i=[]),u||(u=[]);for(var E=i.length;E--;)if(i[E]==t)return u[E]==n;i.push(t),u.push(n);var k=(l?s:a)(t,n,r,e,o,i,u);return i.pop(),u.pop(),k}function s(t,n,r,e,i,u,s){var c=-1,a=t.length,l=n.length;if(a!=l&&!(i&&l>a))return!1;for(;++c<a;){var f=t[c],p=n[c],h=e?e(i?p:f,i?f:p,c):void 0;if(void 0!==h){if(h)continue;return!1}if(i){if(!o(n,function(t){return f===t||r(f,t,e,i,u,s)}))return!1}else if(f!==p&&!r(f,p,e,i,u,s))return!1}return!0}function c(t,n,r){switch(r){case g:case y:return+t==+n;case b:return t.name==n.name&&t.message==n.message;case j:return t!=+t?n!=+n:t==+n;case w:case S:return t==n+""}return!1}function a(t,n,r,e,o,i,u){var s=h(t),c=s.length,a=h(n),l=a.length;if(c!=l&&!o)return!1;for(var f=c;f--;){var p=s[f];if(!(o?p in n:O.call(n,p)))return!1}for(var d=o;++f<c;){p=s[f];var v=t[p],g=n[p],y=e?e(o?g:v,o?v:g,p):void 0;if(!(void 0===y?r(v,g,e,o,i,u):y))return!1;d||(d="constructor"==p)}if(!d){var b=t.constructor,j=n.constructor;if(b!=j&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof j&&j instanceof j))return!1}return!0}function l(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var f=r(64),p=r(69),h=r(70),d="[object Arguments]",v="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",j="[object Number]",m="[object Object]",w="[object RegExp]",S="[object String]",x=Object.prototype,O=x.hasOwnProperty,A=x.toString;t.exports=i},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&$>=t}function i(t){return e(t)&&o(t.length)&&!!T[P.call(t)]}var u="[object Arguments]",s="[object Array]",c="[object Boolean]",a="[object Date]",l="[object Error]",f="[object Function]",p="[object Map]",h="[object Number]",d="[object Object]",v="[object RegExp]",g="[object Set]",y="[object String]",b="[object WeakMap]",j="[object ArrayBuffer]",m="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",x="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",E="[object Uint8ClampedArray]",k="[object Uint16Array]",C="[object Uint32Array]",T={}; | ||
T[m]=T[w]=T[S]=T[x]=T[O]=T[A]=T[E]=T[k]=T[C]=!0,T[u]=T[s]=T[j]=T[c]=T[a]=T[l]=T[f]=T[p]=T[h]=T[d]=T[v]=T[g]=T[y]=T[b]=!1;var M=Object.prototype,P=M.toString,$=9007199254740991;t.exports=i},function(t,n,r){function e(t){return function(n){return null==n?void 0:n[t]}}function o(t){return null!=t&&u(b(t))}function i(t,n){return t="number"==typeof t||h.test(t)?+t:-1,n=null==n?y:n,t>-1&&t%1==0&&n>t}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function s(t){for(var n=a(t),r=n.length,e=r&&t.length,o=!!e&&u(e)&&(p(t)||f(t)),s=-1,c=[];++s<r;){var l=n[s];(o&&i(l,e)||v.call(t,l))&&c.push(l)}return c}function c(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function a(t){if(null==t)return[];c(t)||(t=Object(t));var n=t.length;n=n&&u(n)&&(p(t)||f(t))&&n||0;for(var r=t.constructor,e=-1,o="function"==typeof r&&r.prototype===t,s=Array(n),a=n>0;++e<n;)s[e]=e+"";for(var l in t)a&&i(l,n)||"constructor"==l&&(o||!v.call(t,l))||s.push(l);return s}var l=r(71),f=r(72),p=r(64),h=/^\d+$/,d=Object.prototype,v=d.hasOwnProperty,g=l(Object,"keys"),y=9007199254740991,b=e("length"),j=g?function(t){var n=null==t?null:t.constructor;return"function"==typeof n&&n.prototype===t||"function"!=typeof t&&o(t)?s(t):c(t)?g(t):[]}:s;t.exports=j},function(t,n,r){function e(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t,n){var r=null==t?void 0:t[n];return u(r)?r:void 0}function u(t){return null==t?!1:v.call(t)==c?g.test(h.call(t)):o(t)&&f.test(t)}function s(t){return t=e(t),t&&l.test(t)?t.replace(a,"\\$&"):t}var c="[object Function]",a=/[.*+?^${}()|[\]\/\\]/g,l=RegExp(a.source),f=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,d=p.hasOwnProperty,v=p.toString,g=RegExp("^"+s(h.call(d)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=i},function(t,n,r){function e(t){return!!t&&"object"==typeof t}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t){return null!=t&&u(p(t))}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function s(t){return e(t)&&i(t)&&l.call(t)==c}var c="[object Arguments]",a=Object.prototype,l=a.toString,f=9007199254740991,p=o("length");t.exports=s},function(t,n,r){function e(t,n,r){if("function"!=typeof t)return o;if(void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 3:return function(r,e,o){return t.call(n,r,e,o)};case 4:return function(r,e,o,i){return t.call(n,r,e,o,i)};case 5:return function(r,e,o,i,u){return t.call(n,r,e,o,i,u)}}return function(){return t.apply(n,arguments)}}function o(t){return t}t.exports=e},function(t,n,r){function e(t){return o(t)?t:Object(t)}function o(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function i(t){t=e(t);for(var n=-1,r=u(t),o=r.length,i=Array(o);++n<o;){var s=r[n];i[n]=[s,t[s]]}return i}var u=r(70);t.exports=i},function(t,n,r){function e(t,n){return h(t,n,l)}function o(t){return function(n){return null==n?void 0:n[t]}}function i(t,n){return function(r,e){var o=r?d(r):0;if(!s(o))return t(r,e);for(var i=n?o:-1,u=c(r);(n?i--:++i<o)&&e(u[i],i,u)!==!1;);return r}}function u(t){return function(n,r,e){for(var o=c(n),i=e(n),u=i.length,s=t?u:-1;t?s--:++s<u;){var a=i[s];if(r(o[a],a,o)===!1)break}return n}}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function c(t){return a(t)?t:Object(t)}function a(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var l=r(70),f=9007199254740991,p=i(e),h=u(),d=o("length");t.exports=p},function(t,n,r){var e=r(77),o=function(t){var n=/[height|width]$/;return n.test(t)},i=function(t){var n="",r=Object.keys(t);return r.forEach(function(i,u){var s=t[i];i=e(i),o(i)&&"number"==typeof s&&(s+="px"),n+=s===!0?i:s===!1?"not "+i:"("+i+": "+s+")",u<r.length-1&&(n+=" and ")}),n},u=function(t){var n="";return"string"==typeof t?t:t instanceof Array?(t.forEach(function(r,e){n+=i(r),e<t.length-1&&(n+=", ")}),n):i(t)};t.exports=u},function(t,n,r){var e=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}).toLowerCase()};t.exports=e},function(t,n,r){var e=r(79),o=e&&r(80),i=r(76),u={media:function(t,n){t=i(t),"function"==typeof n&&(n={match:n}),o.register(t,n),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:t,handler:n})},componentWillUnmount:function(){this._responsiveMediaHandlers.forEach(function(t){o.unregister(t.query,t.handler)})}};t.exports=u},function(t,n,r){var e=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=e},function(t,n,r){var e;!function(o,i,u){var s=window.matchMedia;"undefined"!=typeof t&&t.exports?t.exports=u(s):(e=function(){return i[o]=u(s)}.call(n,r,n,t),!(void 0!==e&&(t.exports=e)))}("enquire",this,function(t){"use strict";function n(t,n){var r,e=0,o=t.length;for(e;o>e&&(r=n(t[e],e),r!==!1);e++);}function r(t){return"[object Array]"===Object.prototype.toString.apply(t)}function e(t){return"function"==typeof t}function o(t){this.options=t,!t.deferSetup&&this.setup()}function i(n,r){this.query=n,this.isUnconditional=r,this.handlers=[],this.mql=t(n);var e=this;this.listener=function(t){e.mql=t,e.assess()},this.mql.addListener(this.listener)}function u(){if(!t)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return o.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}},i.prototype={addHandler:function(t){var n=new o(t);this.handlers.push(n),this.matches()&&n.on()},removeHandler:function(t){var r=this.handlers;n(r,function(n,e){return n.equals(t)?(n.destroy(),!r.splice(e,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){n(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";n(this.handlers,function(n){n[t]()})}},u.prototype={register:function(t,o,u){var s=this.queries,c=u&&this.browserIsIncapable;return s[t]||(s[t]=new i(t,c)),e(o)&&(o={match:o}),r(o)||(o=[o]),n(o,function(n){s[t].addHandler(n)}),this},unregister:function(t,n){var r=this.queries[t];return r&&(n?r.removeHandler(n):(r.clear(),delete this.queries[t])),this}},new u})}])}); | ||
function n(){"use strict";for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e+=" "+r;else if(Array.isArray(r))e+=" "+n.apply(null,r);else if("object"===i)for(var s in r)r.hasOwnProperty(s)&&r[s]&&(e+=" "+s)}}return e.substr(1)}var i,s;"undefined"!=typeof e&&e.exports&&(e.exports=n),i=[],s=function(){return n}.apply(t,i),!(void 0!==s&&(e.exports=s))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=n(i),o=r(12),a=n(o),l=r(23),u=n(l),c=r(10),d=n(c),p=function(e){var t,r,n,i,s;return e.rtl?(s=e.slideCount-1-e.index,console.log()):s=e.index,n=0>s||s>=e.slideCount,e.centerMode?(i=Math.floor(e.slidesToShow/2),r=e.currentSlide===s,s>e.currentSlide-i-1&&s<=e.currentSlide+i&&(t=!0)):t=e.currentSlide<=s&&s<e.currentSlide+e.slidesToShow,d["default"]({"slick-slide":!0,"slick-active":t,"slick-center":r,"slick-cloned":n})},h=function(e){var t={};return(void 0===e.variableWidth||e.variableWidth===!1)&&(t.width=e.slideWidth),e.fade&&(t.position="relative",t.left=-e.index*e.slideWidth,t.opacity=e.currentSlide===e.index?1:0,t.transition="opacity "+e.speed+"ms "+e.cssEase,t.WebkitTransition="opacity "+e.speed+"ms "+e.cssEase),t},f=function(e){var t,r,n=[],i=[],o=[],l=s["default"].Children.count(e.children);return s["default"].Children.forEach(e.children,function(c,d){r=!e.lazyLoad|(e.lazyLoad&&e.lazyLoadedList.indexOf(d)>=0)?c:s["default"].createElement("div",null);var f=h(u["default"]({},e,{index:d}));if(n.push(a["default"](r,{key:d,"data-index":d,className:p(u["default"]({index:d},e)),style:f})),e.infinite&&e.fade===!1){var v=e.variableWidth?e.slidesToShow+1:e.slidesToShow;d>=l-v&&(t=-(l-d),i.push(a["default"](r,{key:t,"data-index":t,className:p(u["default"]({index:t},e)),style:f}))),v>d&&(t=l+d,o.push(a["default"](r,{key:t,"data-index":t,className:p(u["default"]({index:t},e)),style:f})))}}),e.rtl?i.concat(n,o).reverse():i.concat(n,o)},v=s["default"].createClass({displayName:"Track",render:function(){var e=f(this.props);return s["default"].createElement("div",{className:"slick-track",style:this.props.trackStyle},e)}});t.Track=v},function(e,t,r){"use strict";function n(e,t){a(!e.ref,"You are calling cloneWithProps() on a child with a ref. This is dangerous because you're creating a new child which will not be added as a ref to its parent.");var r=s.mergeProps(t,e.props);return!r.hasOwnProperty(l)&&e.props.hasOwnProperty(l)&&(r.children=e.props.children),i.createElement(e.type,r)}var i=r(13),s=r(20),o=r(22),a=r(14),l=o({children:null});e.exports=n},function(e,t,r){"use strict";function n(e,t){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[t]:null},set:function(e){l(!1,"Don't set the %s property of the React element. Instead, specify the correct value when initially creating the element.",t),this._store[t]=e}})}function i(e){try{var t={props:!0};for(var r in t)n(e,r);c=!0}catch(i){}}var s=r(16),o=r(19),a=r(17),l=r(14),u={key:!0,ref:!0},c=!1,d=function(e,t,r,n,i,s){this.type=e,this.key=t,this.ref=r,this._owner=n,this._context=i,this._store={props:s,originalProps:a({},s)};try{Object.defineProperty(this._store,"validated",{configurable:!1,enumerable:!1,writable:!0})}catch(o){}return this._store.validated=!1,c?void Object.freeze(this):void(this.props=s)};d.prototype={_isReactElement:!0},i(d.prototype),d.createElement=function(e,t,r){var n,i={},a=null,l=null;if(null!=t){l=void 0===t.ref?null:t.ref,a=void 0===t.key?null:""+t.key;for(n in t)t.hasOwnProperty(n)&&!u.hasOwnProperty(n)&&(i[n]=t[n])}var c=arguments.length-2;if(1===c)i.children=r;else if(c>1){for(var p=Array(c),h=0;c>h;h++)p[h]=arguments[h+2];i.children=p}if(e&&e.defaultProps){var f=e.defaultProps;for(n in f)"undefined"==typeof i[n]&&(i[n]=f[n])}return new d(e,a,l,o.current,s.current,i)},d.createFactory=function(e){var t=d.createElement.bind(null,e);return t.type=e,t},d.cloneAndReplaceProps=function(e,t){var r=new d(e.type,e.key,e.ref,e._owner,e._context,t);return r._store.validated=e._store.validated,r},d.cloneElement=function(e,t,r){var n,i=a({},e.props),s=e.key,l=e.ref,c=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,c=o.current),void 0!==t.key&&(s=""+t.key);for(n in t)t.hasOwnProperty(n)&&!u.hasOwnProperty(n)&&(i[n]=t[n])}var p=arguments.length-2;if(1===p)i.children=r;else if(p>1){for(var h=Array(p),f=0;p>f;f++)h[f]=arguments[f+2];i.children=h}return new d(e.type,s,l,c,e._context,i)},d.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},e.exports=d},function(e,t,r){"use strict";var n=r(15),i=n;i=function(e,t){for(var r=[],n=2,i=arguments.length;i>n;n++)r.push(arguments[n]);if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(0!==t.indexOf("Failed Composite propType: ")&&!e){var s=0,o="Warning: "+t.replace(/%s/g,function(){return r[s++]});console.warn(o);try{throw new Error(o)}catch(a){}}},e.exports=i},function(e,t,r){function n(e){return function(){return e}}function i(){}i.thatReturns=n,i.thatReturnsFalse=n(!1),i.thatReturnsTrue=n(!0),i.thatReturnsNull=n(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,r){"use strict";var n=r(17),i=r(18),s=r(14),o=!1,a={current:i,withContext:function(e,t){s(o,"withContext is deprecated and will be removed in a future version. Use a wrapper component with getChildContext instead."),o=!0;var r,i=a.current;a.current=n({},i,e);try{r=t()}finally{a.current=i}return r}};e.exports=a},function(e,t,r){"use strict";function n(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var r=Object(e),n=Object.prototype.hasOwnProperty,i=1;i<arguments.length;i++){var s=arguments[i];if(null!=s){var o=Object(s);for(var a in o)n.call(o,a)&&(r[a]=o[a])}}return r}e.exports=n},function(e,t,r){"use strict";var n={};Object.freeze(n),e.exports=n},function(e,t,r){"use strict";var n={current:null};e.exports=n},function(e,t,r){"use strict";function n(e){return function(t,r,n){t.hasOwnProperty(r)?t[r]=e(t[r],n):t[r]=n}}function i(e,t){for(var r in t)if(t.hasOwnProperty(r)){var n=u[r];n&&u.hasOwnProperty(r)?n(e,r,t[r]):e.hasOwnProperty(r)||(e[r]=t[r])}return e}var s=r(17),o=r(15),a=r(21),l=n(function(e,t){return s({},t,e)}),u={children:o,className:n(a),style:l},c={mergeProps:function(e,t){return i(s({},e),t)}};e.exports=c},function(e,t,r){"use strict";function n(e){e||(e="");var t,r=arguments.length;if(r>1)for(var n=1;r>n;n++)t=arguments[n],t&&(e=(e?e+" ":"")+t);return e}e.exports=n},function(e,t,r){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,r){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,s=n(e),o=1;o<arguments.length;o++){r=arguments[o],i=Object.keys(Object(r));for(var a=0;a<i.length;a++)s[i[a]]=r[i[a]]}return s}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),s=n(i),o=r(10),a=n(o),l=function(e){var t;return t=Math.ceil(e.slideCount/e.slidesToScroll)},u=s["default"].createClass({displayName:"Dots",clickHandler:function(e,t){t.preventDefault(),this.props.clickHandler(e)},render:function(){var e=this,t=l({slideCount:this.props.slideCount,slidesToScroll:this.props.slidesToScroll}),r=Array.apply(null,{length:t}).map(function(t,r){var n=a["default"]({"slick-active":e.props.currentSlide===r*e.props.slidesToScroll}),i={message:"dots",index:r,slidesToScroll:e.props.slidesToScroll,currentSlide:e.props.currentSlide};return s["default"].createElement("li",{key:r,className:n},s["default"].createElement("button",{onClick:e.clickHandler.bind(e,i)},r))});return s["default"].createElement("ul",{className:this.props.dotsClass,style:{display:"block"}},r)}});t.Dots=u},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=r(4),o=n(s),a=r(10),l=n(a),u=o["default"].createClass({displayName:"PrevArrow",clickHandler:function(e,t){t.preventDefault(),this.props.clickHandler(e,t)},render:function(){var e={"slick-prev":!0},t=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(0===this.props.currentSlide||this.props.slideCount<=this.props.slidesToShow)&&(e["slick-disabled"]=!0,t=null);var r,n={key:"0",ref:"previous","data-role":"none",className:l["default"](e),style:{display:"block"},onClick:t};return r=this.props.prevArrow?o["default"].createElement(this.props.prevArrow,n):o["default"].createElement("button",i({key:"0",type:"button"},n)," Previous")}});t.PrevArrow=u;var c=o["default"].createClass({displayName:"NextArrow",clickHandler:function(e,t){t.preventDefault(),this.props.clickHandler(e,t)},render:function(){var e={"slick-next":!0},t=this.clickHandler.bind(this,{message:"next"});this.props.infinite||(this.props.centerMode&&this.props.currentSlide>=this.props.slideCount-1?(e["slick-disabled"]=!0,t=null):this.props.currentSlide>=this.props.slideCount-this.props.slidesToShow&&(e["slick-disabled"]=!0,t=null),this.props.slideCount<=this.props.slidesToShow&&(e["slick-disabled"]=!0,t=null));var r,n={key:"1",ref:"next","data-role":"none",className:l["default"](e),style:{display:"block"},onClick:t};return r=this.props.nextArrow?o["default"].createElement(this.props.nextArrow,n):o["default"].createElement("button",i({key:"1",type:"button"},n)," Next")}});t.NextArrow=c},function(e,t,r){var n=r(27),i=n&&r(28),s=r(2),o={media:function(e,t){e=s(e),"function"==typeof t&&(t={match:t}),i.register(e,t),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:e,handler:t})},componentWillUnmount:function(){this._responsiveMediaHandlers.forEach(function(e){i.unregister(e.query,e.handler)})}};e.exports=o},function(e,t,r){var n=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=n},function(e,t,r){var n;!function(i,s,o){var a=window.matchMedia;"undefined"!=typeof e&&e.exports?e.exports=o(a):(n=function(){return s[i]=o(a)}.call(t,r,t,e),!(void 0!==n&&(e.exports=n)))}("enquire",this,function(e){"use strict";function t(e,t){var r,n=0,i=e.length;for(n;i>n&&(r=t(e[n],n),r!==!1);n++);}function r(e){return"[object Array]"===Object.prototype.toString.apply(e)}function n(e){return"function"==typeof e}function i(e){this.options=e,!e.deferSetup&&this.setup()}function s(t,r){this.query=t,this.isUnconditional=r,this.handlers=[],this.mql=e(t);var n=this;this.listener=function(e){n.mql=e,n.assess()},this.mql.addListener(this.listener)}function o(){if(!e)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!e("only all").matches}return i.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(e){return this.options===e||this.options.match===e}},s.prototype={addHandler:function(e){var t=new i(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(e){var r=this.handlers;t(r,function(t,n){return t.equals(e)?(t.destroy(),!r.splice(n,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){t(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var e=this.matches()?"on":"off";t(this.handlers,function(t){t[e]()})}},o.prototype={register:function(e,i,o){var a=this.queries,l=o&&this.browserIsIncapable;return a[e]||(a[e]=new s(e,l)),n(i)&&(i={match:i}),r(i)||(i=[i]),t(i,function(t){a[e].addHandler(t)}),this},unregister:function(e,t){var r=this.queries[e];return r&&(t?r.removeHandler(t):(r.clear(),delete this.queries[e])),this}},new o})}])}); |
'use strict'; | ||
var React = require('react'); | ||
var Slider = require('../lib/slider'); | ||
import React from 'react'; | ||
import Slider from '../src/slider'; | ||
@@ -142,4 +142,7 @@ var SingleItem = React.createClass({ | ||
speed: 500, | ||
beforeChange: function (index) { | ||
console.log('Slider will change from:' + index); | ||
}, | ||
afterChange: function (currentSlide) { | ||
alert('Slider Changed to :' + (currentSlide + 1)); | ||
console.log('Slider Changed to :' + (currentSlide + 1)); | ||
} | ||
@@ -178,3 +181,3 @@ }; | ||
afterChange: function (index) { | ||
console.log(`%c Slider Changed to: + ${index}, background: #222; color: #bada55`); | ||
console.log(`Slider Changed to: ${index + 1}, background: #222; color: #bada55`); | ||
} | ||
@@ -291,2 +294,52 @@ }; | ||
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="img/abstract01.jpg" /></div> | ||
<div><img src="img/abstract02.jpg" /></div> | ||
<div><img src="img/abstract03.jpg" /></div> | ||
<div><img src="img/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="img/abstract01.jpg" /></div> | ||
<div><img src="img/abstract02.jpg" /></div> | ||
<div><img src="img/abstract03.jpg" /></div> | ||
<div><img src="img/abstract04.jpg" /></div> | ||
</Slider> | ||
</div> | ||
); | ||
} | ||
}); | ||
var App = React.createClass({ | ||
@@ -306,2 +359,4 @@ render: function () { | ||
<AdaptiveHeight /> | ||
<LazyLoad /> | ||
<Fade /> | ||
</div> | ||
@@ -308,0 +363,0 @@ ); |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var gulp = require('gulp'); | ||
@@ -9,2 +11,4 @@ var del = require('del'); | ||
gulp.task('default', ['watch', 'server']); | ||
gulp.task('clean', function () { | ||
@@ -17,2 +21,4 @@ return del(['./build/*']); | ||
.pipe(gulp.dest('./build')); | ||
gulp.src('./docs/img/*') | ||
.pipe(gulp.dest('./build/img')); | ||
gulp.src('./node_modules/slick-carousel/slick/fonts/*') | ||
@@ -24,12 +30,5 @@ .pipe(gulp.dest('./build/fonts')); | ||
// gulp.task('sass', function () { | ||
// return gulp.src(['./docs/**/*.scss']) | ||
// .pipe(sass({ loadPath : ['bower_components', 'node_modules'],})) | ||
// .on('error', function (err) { console.log(err.message); }) | ||
// .pipe(gulp.dest('./build')); | ||
// }); | ||
gulp.task('sass', function () { | ||
return gulp.src(['./docs/**/*.{scss,sass}']) | ||
.pipe(sass({ includePaths : ['bower_components', 'node_modules'], errLogToConsole: true})) | ||
return gulp.src(['./docs/**/*.{scss,sass}']) | ||
.pipe(sass({ includePaths: ['bower_components', 'node_modules'], errLogToConsole: true})) | ||
.pipe(gulp.dest('./build')); | ||
@@ -41,18 +40,15 @@ }); | ||
gulp.watch(['./docs/index.html'], ['copy']); | ||
}); | ||
}); | ||
gulp.task('server', ['copy', 'sass'], function (callback) { | ||
var myConfig = require('./webpack.config.js'); | ||
var myConfig = require('./webpack.config'); | ||
myConfig.plugins = myConfig.plugins.concat( | ||
new webpack.DefinePlugin({ | ||
"process.env": { | ||
"NODE_ENV": JSON.stringify("dev_docs") | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify('dev_docs') | ||
} | ||
}) | ||
); | ||
var webpackCompiler = webpack(myConfig, function(err, stats) { | ||
}); | ||
new WebpackDevServer(webpackCompiler, { | ||
new WebpackDevServer(webpack(myConfig), { | ||
contentBase: './build', | ||
@@ -62,3 +58,7 @@ hot: true, | ||
}).listen(8000, process.env.HOST_IP || 'localhost', function (err, result) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
}); | ||
callback(); | ||
}); | ||
@@ -77,3 +77,3 @@ | ||
return webpack(unminConfig, function (err, stat) { | ||
console.log(err); | ||
console.error(err); | ||
cb(); | ||
@@ -95,3 +95,3 @@ }); | ||
return webpack(minConfig, function (err, stat) { | ||
console.log(err); | ||
console.error(err); | ||
cb(); | ||
@@ -102,3 +102,3 @@ }); | ||
gulp.task('dist', function (cb) { | ||
runSequence('dist-clean', 'dist-unmin', 'dist-min', cb) | ||
}); | ||
runSequence('dist-clean', 'dist-unmin', 'dist-min', cb); | ||
}); |
@@ -17,2 +17,3 @@ 'use strict'; | ||
easing: 'linear', | ||
edgeFriction: 0.35, | ||
fade: false, | ||
@@ -22,3 +23,3 @@ focusOnSelect: false, | ||
initialSlide: 0, | ||
// lazyLoad: 'ondemand', | ||
lazyLoad: false, | ||
responsive: null, | ||
@@ -34,3 +35,3 @@ rtl: false, | ||
touchThreshold: 5, | ||
// useCSS: true, | ||
useCSS: true, | ||
variableWidth: false, | ||
@@ -40,2 +41,7 @@ vertical: false, | ||
afterChange: null, | ||
beforeChange: null, | ||
edgeEvent: null, | ||
init: null, | ||
swipeEvent: null, | ||
// nextArrow, prevArrow are react componets | ||
nextArrow: null, | ||
@@ -42,0 +48,0 @@ prevArrow: null |
@@ -26,4 +26,8 @@ "use strict"; | ||
lazyLoadedList: [], | ||
// added for react | ||
initialized: false, | ||
edgeDragged: false, | ||
swiped: false, // used by swipeEvent. differentites between touch and swipe. | ||
trackStyle: {}, | ||
@@ -30,0 +34,0 @@ trackWidth: 0 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var React = require('react'); | ||
var cloneWithProps = require('react/lib/cloneWithProps'); | ||
var classnames = require('classnames'); | ||
var EventHandlersMixin = require('./mixins/event-handlers'); | ||
var HelpersMixin = require('./mixins/helpers'); | ||
var initialState = require('./initial-state'); | ||
var defaultProps = require('./default-props'); | ||
var _assign = require('lodash.assign'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var Slider = React.createClass({ | ||
displayName: 'Slider', | ||
var _react = require('react'); | ||
mixins: [EventHandlersMixin, HelpersMixin], | ||
var _react2 = _interopRequireDefault(_react); | ||
var _mixinsEventHandlers = require('./mixins/event-handlers'); | ||
var _mixinsEventHandlers2 = _interopRequireDefault(_mixinsEventHandlers); | ||
var _mixinsHelpers = require('./mixins/helpers'); | ||
var _mixinsHelpers2 = _interopRequireDefault(_mixinsHelpers); | ||
var _initialState = require('./initial-state'); | ||
var _initialState2 = _interopRequireDefault(_initialState); | ||
var _defaultProps = require('./default-props'); | ||
var _defaultProps2 = _interopRequireDefault(_defaultProps); | ||
var _classnames = require('classnames'); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _track = require('./track'); | ||
var _dots = require('./dots'); | ||
var _arrows = require('./arrows'); | ||
var InnerSlider = _react2['default'].createClass({ | ||
displayName: 'InnerSlider', | ||
mixins: [_mixinsHelpers2['default'], _mixinsEventHandlers2['default']], | ||
getInitialState: function getInitialState() { | ||
return initialState; | ||
return _initialState2['default']; | ||
}, | ||
getDefaultProps: function getDefaultProps() { | ||
return defaultProps; | ||
return _defaultProps2['default']; | ||
}, | ||
componentWillMount: function componentWillMount() { | ||
if (this.props.init) { | ||
this.props.init(); | ||
} | ||
this.setState({ | ||
mounted: true | ||
}); | ||
var lazyLoadedList = []; | ||
for (var i = 0; i < this.props.children.length; i++) { | ||
if (i >= this.state.currentSlide && i < this.state.currentSlide + this.props.slidesToShow) { | ||
lazyLoadedList.push(i); | ||
} | ||
} | ||
if (this.props.lazyLoad && this.state.lazyLoadedList.length === 0) { | ||
this.setState({ | ||
lazyLoadedList: lazyLoadedList | ||
}); | ||
} | ||
}, | ||
componentDidMount: function componentDidMount() { | ||
// Hack for autoplay -- Inspect Later | ||
this.initialize(this.props); | ||
@@ -34,164 +82,59 @@ this.adaptHeight(); | ||
}, | ||
renderDots: function renderDots() { | ||
var dotOptions; | ||
var dots = []; | ||
if (this.props.dots === true && this.state.slideCount > this.props.slidesToShow) { | ||
for (var i = 0; i <= this.getDotCount(); i += 1) { | ||
var className = classnames({ | ||
'slick-active': this.state.currentSlide === i * this.props.slidesToScroll | ||
}); | ||
dotOptions = { | ||
message: 'index', | ||
index: i | ||
}; | ||
dots.push(React.createElement( | ||
'li', | ||
{ key: i, className: className }, | ||
React.createElement( | ||
'button', | ||
{ onClick: this.changeSlide.bind(this, dotOptions) }, | ||
i | ||
) | ||
)); | ||
} | ||
return React.createElement( | ||
'ul', | ||
{ className: this.props.dotsClass, style: { display: 'block' } }, | ||
dots | ||
); | ||
} else { | ||
return null; | ||
} | ||
}, | ||
renderSlides: function renderSlides() { | ||
var key; | ||
var slides = []; | ||
var preCloneSlides = []; | ||
var postCloneSlides = []; | ||
var count = React.Children.count(this.props.children); | ||
React.Children.forEach(this.props.children, (function (child, index) { | ||
var infiniteCount; | ||
slides.push(cloneWithProps(child, { | ||
key: index, | ||
'data-index': index, | ||
className: this.getSlideClasses(index), | ||
style: _assign({}, this.getSlideStyle(), child.props.style) | ||
})); | ||
render: function render() { | ||
var className = (0, _classnames2['default'])('slick-initialized', 'slick-slider', this.props.className); | ||
if (this.props.infinite === true) { | ||
if (this.props.centerMode === true) { | ||
infiniteCount = this.props.slidesToShow + 1; | ||
} else { | ||
infiniteCount = this.props.slidesToShow; | ||
} | ||
var trackProps = { | ||
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 (index >= count - infiniteCount) { | ||
key = -(count - index); | ||
preCloneSlides.push(cloneWithProps(child, { | ||
key: key, | ||
'data-index': key, | ||
className: this.getSlideClasses(key), | ||
style: _assign({}, this.getSlideStyle(), child.props.style) | ||
})); | ||
} | ||
var dots; | ||
if (index < infiniteCount) { | ||
key = count + index; | ||
postCloneSlides.push(cloneWithProps(child, { | ||
key: key, | ||
'data-index': key, | ||
className: this.getSlideClasses(key), | ||
style: _assign({}, this.getSlideStyle(), child.props.style) | ||
})); | ||
} | ||
} | ||
}).bind(this)); | ||
return preCloneSlides.concat(slides, postCloneSlides); | ||
}, | ||
renderTrack: function renderTrack() { | ||
return React.createElement( | ||
'div', | ||
{ ref: 'track', className: 'slick-track', style: this.state.trackStyle }, | ||
this.renderSlides() | ||
); | ||
}, | ||
renderArrows: function renderArrows() { | ||
if (this.props.arrows === true) { | ||
var prevClasses = { 'slick-prev': true }; | ||
var nextClasses = { 'slick-next': true }; | ||
var prevHandler = this.changeSlide.bind(this, { message: 'previous' }); | ||
var nextHandler = this.changeSlide.bind(this, { message: 'next' }); | ||
if (this.props.infinite === false) { | ||
if (this.state.currentSlide === 0) { | ||
prevClasses['slick-disabled'] = true; | ||
prevHandler = null; | ||
} | ||
if (this.props.centerMode && !this.props.infinite) { | ||
if (this.state.currentSlide >= this.state.slideCount - 1) { | ||
nextClasses['slick-disabled'] = true; | ||
nextHandler = null; | ||
} | ||
} else { | ||
if (this.state.currentSlide >= this.state.slideCount - this.props.slidesToShow) { | ||
nextClasses['slick-disabled'] = true; | ||
nextHandler = null; | ||
} | ||
} | ||
} | ||
var prevArrowProps = { | ||
key: '0', | ||
ref: 'previous', | ||
'data-role': 'none', | ||
className: classnames(prevClasses), | ||
style: { display: 'block' }, | ||
onClick: prevHandler | ||
if (this.props.dots === true && this.state.slideCount > this.props.slidesToShow) { | ||
var dotProps = { | ||
dotsClass: this.props.dotsClass, | ||
slideCount: this.state.slideCount, | ||
slidesToShow: this.props.slidesToShow, | ||
currentSlide: this.state.currentSlide, | ||
slidesToScroll: this.props.slidesToScroll, | ||
clickHandler: this.changeSlide | ||
}; | ||
var prevArrow; | ||
if (this.props.prevArrow) { | ||
prevArrow = React.createElement(this.props.prevArrow, prevArrowProps); | ||
} else { | ||
prevArrow = React.createElement( | ||
'button', | ||
_extends({ type: 'button' }, prevArrowProps), | ||
' Previous' | ||
); | ||
} | ||
dots = _react2['default'].createElement(_dots.Dots, dotProps); | ||
} | ||
var nextArrowProps = { | ||
key: '1', | ||
ref: 'next', | ||
'data-role': 'none', | ||
className: classnames(nextClasses), | ||
style: { display: 'block' }, | ||
onClick: nextHandler | ||
}; | ||
var nextArrow; | ||
var prevArrow, nextArrow; | ||
if (this.props.nextArrow) { | ||
nextArrow = React.createElement(this.props.nextArrow, nextArrowProps); | ||
} else { | ||
nextArrow = React.createElement( | ||
'button', | ||
_extends({ type: 'button' }, nextArrowProps), | ||
' Next' | ||
); | ||
} | ||
var arrowProps = { | ||
infinite: this.props.infinite, | ||
centerMode: this.props.centerMode, | ||
currentSlide: this.state.currentSlide, | ||
slideCount: this.state.slideCount, | ||
slidesToShow: this.props.slidesToShow, | ||
prevArrow: this.props.prevArrow, | ||
nextArrow: this.props.nextArrow, | ||
clickHandler: this.changeSlide | ||
}; | ||
return [prevArrow, nextArrow]; | ||
} else { | ||
return null; | ||
if (this.props.arrows) { | ||
prevArrow = _react2['default'].createElement(_arrows.PrevArrow, arrowProps); | ||
nextArrow = _react2['default'].createElement(_arrows.NextArrow, arrowProps); | ||
} | ||
}, | ||
render: function render() { | ||
var className = classnames('slick-initialized', 'slick-slider', this.props.className); | ||
return React.createElement( | ||
return _react2['default'].createElement( | ||
'div', | ||
{ className: className }, | ||
React.createElement( | ||
_react2['default'].createElement( | ||
'div', | ||
@@ -209,10 +152,14 @@ { | ||
onTouchCancel: this.state.dragging ? this.swipeEnd : null }, | ||
this.renderTrack() | ||
_react2['default'].createElement( | ||
_track.Track, | ||
_extends({ ref: 'track' }, trackProps), | ||
this.props.children | ||
) | ||
), | ||
this.renderArrows(), | ||
this.renderDots() | ||
prevArrow, | ||
nextArrow, | ||
dots | ||
); | ||
} | ||
}); | ||
module.exports = Slider; | ||
exports.InnerSlider = InnerSlider; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _trackHelper = require('./trackHelper'); | ||
var _objectAssign = require('object-assign'); | ||
var _objectAssign2 = _interopRequireDefault(_objectAssign); | ||
var EventHandlers = { | ||
// Event handler for previous and next | ||
changeSlide: function changeSlide(options, e) { | ||
// console.log('changeSlide'); | ||
var indexOffset, slideOffset, unevenOffset; | ||
changeSlide: function changeSlide(options) { | ||
var indexOffset, slideOffset, unevenOffset, targetSlide; | ||
unevenOffset = this.state.slideCount % this.props.slidesToScroll !== 0; | ||
@@ -13,17 +23,15 @@ indexOffset = unevenOffset ? 0 : (this.state.slideCount - this.state.currentSlide) % this.props.slidesToScroll; | ||
slideOffset = indexOffset === 0 ? this.props.slidesToScroll : this.props.slidesToShow - indexOffset; | ||
if (this.state.slideCount > this.props.slidesToShow) { | ||
this.slideHandler(this.state.currentSlide - slideOffset, false); | ||
} | ||
targetSlide = this.state.currentSlide - slideOffset; | ||
} else if (options.message === 'next') { | ||
slideOffset = indexOffset === 0 ? this.props.slidesToScroll : indexOffset; | ||
if (this.state.slideCount > this.props.slidesToShow) { | ||
this.slideHandler(this.state.currentSlide + slideOffset, false); | ||
} | ||
} else if (options.message === 'index') { | ||
targetSlide = this.state.currentSlide + slideOffset; | ||
} else if (options.message === 'dots') { | ||
// Click on dots | ||
var targetSlide = options.index * this.props.slidesToScroll; | ||
if (targetSlide !== this.state.currentSlide) { | ||
this.slideHandler(targetSlide); | ||
targetSlide = options.index * options.slidesToScroll; | ||
if (targetSlide === options.currentSlide) { | ||
return; | ||
} | ||
} | ||
this.slideHandler(targetSlide); | ||
}, | ||
@@ -66,3 +74,6 @@ // Accessiblity handler for previous and next | ||
curLeft = this.getLeft(this.state.currentSlide); | ||
curLeft = (0, _trackHelper.getTrackLeft)((0, _objectAssign2['default'])({ | ||
slideIndex: this.state.currentSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
touchObject.curX = e.touches ? e.touches[0].pageX : e.clientX; | ||
@@ -73,7 +84,29 @@ touchObject.curY = e.touches ? e.touches[0].pageY : e.clientY; | ||
positionOffset = (this.props.rtl === false ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1); | ||
swipeLeft = curLeft + touchObject.swipeLength * positionOffset; | ||
var currentSlide = this.state.currentSlide; | ||
var dotCount = Math.ceil(this.state.slideCount / this.props.slidesToScroll); | ||
var swipeDirection = this.swipeDirection(this.state.touchObject); | ||
var touchSwipeLength = touchObject.swipeLength; | ||
if (this.props.infinite === false) { | ||
if (currentSlide === 0 && swipeDirection === 'right' || currentSlide + 1 >= dotCount && swipeDirection === 'left') { | ||
touchSwipeLength = touchObject.swipeLength * this.props.edgeFriction; | ||
if (this.state.edgeDragged === false && this.props.edgeEvent) { | ||
this.props.edgeEvent(swipeDirection); | ||
this.setState({ edgeDragged: true }); | ||
} | ||
} | ||
} | ||
if (this.state.swiped === false && this.props.swipeEvent) { | ||
this.props.swipeEvent(swipeDirection); | ||
this.setState({ swiped: true }); | ||
} | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
this.setState({ | ||
touchObject: touchObject, | ||
swipeLeft: swipeLeft, | ||
trackStyle: this.getCSS(swipeLeft) | ||
trackStyle: (0, _trackHelper.getTrackCSS)((0, _objectAssign2['default'])({ left: swipeLeft }, this.props, this.state)) | ||
}); | ||
@@ -90,4 +123,8 @@ e.preventDefault(); | ||
var swipeDirection = this.swipeDirection(touchObject); | ||
// reset the state of touch related state variables. | ||
this.setState({ | ||
dragging: false, | ||
edgeDragged: false, | ||
swiped: false, | ||
swipeLeft: null, | ||
@@ -106,6 +143,14 @@ touchObject: {} | ||
} else { | ||
this.slideHandler(this.state.currentSlide, null, true); | ||
this.slideHandler(this.state.currentSlide); | ||
} | ||
} else { | ||
this.slideHandler(this.state.currentSlide, null, true); | ||
// Adjust the track back to it's original position. | ||
var currentLeft = (0, _trackHelper.getTrackLeft)((0, _objectAssign2['default'])({ | ||
slideIndex: this.state.currentSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
this.setState({ | ||
trackStyle: (0, _trackHelper.getTrackAnimateCSS)((0, _objectAssign2['default'])({ left: currentLeft }, this.props, this.state)) | ||
}); | ||
} | ||
@@ -115,2 +160,3 @@ } | ||
module.exports = EventHandlers; | ||
exports['default'] = EventHandlers; | ||
module.exports = exports['default']; |
'use strict'; | ||
var assign = require('object-assign'); | ||
var React = require('react'); | ||
var classnames = require('classnames'); | ||
var ReactTransitionEvents = require('react/lib/ReactTransitionEvents'); | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactLibReactTransitionEvents = require('react/lib/ReactTransitionEvents'); | ||
var _reactLibReactTransitionEvents2 = _interopRequireDefault(_reactLibReactTransitionEvents); | ||
var _trackHelper = require('./trackHelper'); | ||
var _objectAssign = require('object-assign'); | ||
var _objectAssign2 = _interopRequireDefault(_objectAssign); | ||
var helpers = { | ||
initialize: function initialize(props) { | ||
var slideCount = React.Children.count(props.children); | ||
var slideCount = _react2['default'].Children.count(props.children); | ||
var listWidth = this.refs.list.getDOMNode().getBoundingClientRect().width; | ||
@@ -15,2 +30,4 @@ var trackWidth = this.refs.track.getDOMNode().getBoundingClientRect().width; | ||
var currentSlide = props.rtl ? slideCount - 1 - props.initialSlide : props.initialSlide; | ||
this.setState({ | ||
@@ -21,7 +38,13 @@ slideCount: slideCount, | ||
trackWidth: trackWidth, | ||
currentSlide: props.initialSlide | ||
currentSlide: currentSlide | ||
}, function () { | ||
var targetLeft = (0, _trackHelper.getTrackLeft)((0, _objectAssign2['default'])({ | ||
slideIndex: this.state.currentSlide, | ||
trackRef: this.refs.track | ||
}, props, this.state)); | ||
// getCSS function needs previously set state | ||
var trackStyle = this.getCSS(this.getLeft(this.state.currentSlide)); | ||
var trackStyle = (0, _trackHelper.getTrackCSS)((0, _objectAssign2['default'])({ left: targetLeft }, props, this.state)); | ||
this.setState({ trackStyle: trackStyle }); | ||
@@ -32,110 +55,2 @@ | ||
}, | ||
getDotCount: function getDotCount() { | ||
var pagerQty; | ||
pagerQty = Math.ceil(this.state.slideCount / this.props.slidesToScroll); | ||
return pagerQty - 1; | ||
}, | ||
getLeft: function getLeft(slideIndex) { | ||
var slideOffset = 0; | ||
var targetLeft; | ||
var targetSlide; | ||
if (this.props.infinite === true) { | ||
if (this.state.slideCount > this.props.slidesToShow) { | ||
slideOffset = this.state.slideWidth * this.props.slidesToShow * -1; | ||
} | ||
if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
if (slideIndex + this.props.slidesToScroll > this.state.slideCount && this.state.slideCount > this.props.slidesToShow) { | ||
if (slideIndex > this.state.slideCount) { | ||
slideOffset = (this.props.slidesToShow - (slideIndex - this.state.slideCount)) * this.state.slideWidth * -1; | ||
} else { | ||
slideOffset = this.state.slideCount % this.props.slidesToScroll * this.state.slideWidth * -1; | ||
} | ||
} | ||
} | ||
} else {} | ||
if (this.props.centerMode === true && this.props.infinite === true) { | ||
slideOffset += this.state.slideWidth * Math.floor(this.props.slidesToShow / 2) - this.state.slideWidth; | ||
} else if (this.props.centerMode === true) { | ||
slideOffset = this.state.slideWidth * Math.floor(this.props.slidesToShow / 2); | ||
} | ||
targetLeft = slideIndex * this.state.slideWidth * -1 + slideOffset; | ||
if (this.props.variableWidth === true) { | ||
var targetSlideIndex; | ||
if (this.state.slideCount <= this.props.slidesToShow || this.props.infinite === false) { | ||
targetSlide = this.refs.track.getDOMNode().childNodes[slideIndex]; | ||
} else { | ||
targetSlideIndex = slideIndex + this.props.slidesToShow; | ||
targetSlide = this.refs.track.getDOMNode().childNodes[targetSlideIndex]; | ||
} | ||
targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0; | ||
if (this.props.centerMode === true) { | ||
if (this.props.infinite === false) { | ||
targetSlide = this.refs.track.getDOMNode().childNodes[slideIndex]; | ||
} else { | ||
targetSlide = this.refs.track.getDOMNode().childNodes[slideIndex + this.props.slidesToShow + 1]; | ||
} | ||
targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0; | ||
targetLeft += (this.state.listWidth - targetSlide.offsetWidth) / 2; | ||
} | ||
} | ||
return targetLeft; | ||
}, | ||
getAnimateCSS: function getAnimateCSS(targetLeft) { | ||
var style = this.getCSS(targetLeft); | ||
style.WebkitTransition = '-webkit-transform ' + this.props.speed + 'ms ' + this.props.cssEase; | ||
style.transition = 'transform ' + this.props.speed + 'ms ' + this.props.cssEase; | ||
return style; | ||
}, | ||
getCSS: function getCSS(targetLeft) { | ||
// implemented this instead of setCSS | ||
var trackWidth; | ||
if (this.props.variableWidth) { | ||
trackWidth = (this.state.slideCount + 2 * this.props.slidesToShow) * this.state.slideWidth; | ||
} else if (this.props.centerMode) { | ||
trackWidth = (this.state.slideCount + 2 * (this.props.slidesToShow + 1)) * this.state.slideWidth; | ||
} else { | ||
trackWidth = (this.state.slideCount + 2 * this.props.slidesToShow) * this.state.slideWidth; | ||
} | ||
var style = { | ||
opacity: 1, | ||
width: trackWidth, | ||
WebkitTransform: 'translate3d(' + targetLeft + 'px, 0px, 0px)', | ||
transform: 'translate3d(' + targetLeft + 'px, 0px, 0px)', | ||
transition: '', | ||
WebkitTransition: '' | ||
}; | ||
return style; | ||
}, | ||
getSlideStyle: function getSlideStyle() { | ||
return { | ||
width: this.state.slideWidth | ||
}; | ||
}, | ||
getSlideClasses: function getSlideClasses(index) { | ||
var slickActive, slickCenter, slickCloned; | ||
var currentSlide = this.state.currentSlide; | ||
var centerOffset; | ||
slickCloned = index < 0 || index >= this.state.slideCount; | ||
if (this.props.centerMode) { | ||
centerOffset = Math.floor(this.props.slidesToShow / 2); | ||
slickCenter = currentSlide === index; | ||
if (index > currentSlide - centerOffset - 1 && index <= currentSlide + centerOffset) { | ||
slickActive = true; | ||
} | ||
} else { | ||
slickActive = currentSlide === index; | ||
} | ||
return classnames({ | ||
'slick-slide': true, | ||
'slick-active': slickActive, | ||
'slick-center': slickCenter, | ||
'slick-cloned': slickCloned | ||
}); | ||
}, | ||
adaptHeight: function adaptHeight() { | ||
@@ -150,3 +65,5 @@ if (this.props.adaptiveHeight) { | ||
}, | ||
slideHandler: function slideHandler(index, sync, dontAnimate) { | ||
slideHandler: function slideHandler(index) { | ||
var _this = this; | ||
// Functionality of animateSlide and postSlide is merged into this function | ||
@@ -156,18 +73,56 @@ // console.log('slideHandler', index); | ||
var targetLeft, currentLeft; | ||
var callback; | ||
if (this.state.animating === true) { | ||
if (this.state.animating === true || this.state.currentSlide === index) { | ||
return; | ||
} | ||
// To prevent the slider from sticking in animating state, If we click on already active dot | ||
if (this.props.fade === true && this.state.currentSlide === index) { | ||
if (this.props.fade) { | ||
currentSlide = this.state.currentSlide; | ||
if (this.props.beforeChange) { | ||
this.props.beforeChange(currentSlide); | ||
} | ||
// Shifting targetSlide back into the range | ||
if (index < 0) { | ||
targetSlide = index + this.state.slideCount; | ||
} else if (index >= this.state.slideCount) { | ||
targetSlide = index - this.state.slideCount; | ||
} else { | ||
targetSlide = index; | ||
} | ||
if (this.props.lazyLoad && this.state.lazyLoadedList.indexOf(targetSlide) < 0) { | ||
this.setState({ | ||
lazyLoadedList: this.state.lazyLoadedList.concat(targetSlide) | ||
}); | ||
} | ||
callback = function () { | ||
_this.setState({ | ||
animating: false | ||
}); | ||
if (_this.props.afterChange) { | ||
_this.props.afterChange(currentSlide); | ||
} | ||
_reactLibReactTransitionEvents2['default'].removeEndEventListener(_this.refs.track.getDOMNode().children[currentSlide], callback); | ||
}; | ||
this.setState({ | ||
animating: true, | ||
currentSlide: targetSlide | ||
}, function () { | ||
_reactLibReactTransitionEvents2['default'].addEndEventListener(this.refs.track.getDOMNode().children[currentSlide], callback); | ||
}); | ||
this.autoPlay(); | ||
return; | ||
} | ||
if (this.state.slideCount <= this.props.slidesToShow) { | ||
return; | ||
} | ||
targetSlide = index; | ||
if (targetSlide < 0) { | ||
if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
if (this.props.infinite === false) { | ||
currentSlide = 0; | ||
} else if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
currentSlide = this.state.slideCount - this.state.slideCount % this.props.slidesToScroll; | ||
@@ -178,3 +133,5 @@ } else { | ||
} else if (targetSlide >= this.state.slideCount) { | ||
if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
if (this.props.infinite === false) { | ||
currentSlide = this.state.slideCount - this.props.slidesToShow; | ||
} else if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
currentSlide = 0; | ||
@@ -188,5 +145,12 @@ } else { | ||
targetLeft = this.getLeft(targetSlide, this.state); | ||
currentLeft = this.getLeft(currentSlide, this.state); | ||
targetLeft = (0, _trackHelper.getTrackLeft)((0, _objectAssign2['default'])({ | ||
slideIndex: targetSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
currentLeft = (0, _trackHelper.getTrackLeft)((0, _objectAssign2['default'])({ | ||
slideIndex: currentSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
if (this.props.infinite === false) { | ||
@@ -196,24 +160,63 @@ targetLeft = currentLeft; | ||
if (this.props.afterChange !== null) { | ||
this.props.afterChange(currentSlide); | ||
if (this.props.beforeChange) { | ||
this.props.beforeChange(currentSlide); | ||
} | ||
var callback = (function () { | ||
if (this.props.lazyLoad) { | ||
var loaded = true; | ||
var slidesToLoad = []; | ||
for (var i = targetSlide; i < targetSlide + this.props.slidesToShow; i++) { | ||
loaded = loaded && this.state.lazyLoadedList.indexOf(i) >= 0; | ||
if (!loaded) { | ||
slidesToLoad.push(i); | ||
} | ||
} | ||
if (!loaded) { | ||
this.setState({ | ||
lazyLoadedList: this.state.lazyLoadedList.concat(slidesToLoad) | ||
}); | ||
} | ||
} | ||
// Slide Transition happens here. | ||
// animated transition happens to target Slide and | ||
// non - animated transition happens to current Slide | ||
// If CSS transitions are false, directly go the current slide. | ||
if (this.props.useCSS === false) { | ||
this.setState({ | ||
currentSlide: currentSlide, | ||
trackStyle: (0, _trackHelper.getTrackCSS)((0, _objectAssign2['default'])({ left: currentLeft }, this.props, this.state)) | ||
}, function () { | ||
if (this.props.afterChange) { | ||
this.props.afterChange(currentSlide); | ||
} | ||
}); | ||
} else { | ||
var nextStateChanges = { | ||
animating: false, | ||
trackStyle: this.getCSS(currentLeft), | ||
currentSlide: currentSlide, | ||
trackStyle: (0, _trackHelper.getTrackCSS)((0, _objectAssign2['default'])({ left: currentLeft }, this.props, this.state)), | ||
swipeLeft: null | ||
}; | ||
callback = function () { | ||
_this.setState(nextStateChanges); | ||
if (_this.props.afterChange) { | ||
_this.props.afterChange(currentSlide); | ||
} | ||
_reactLibReactTransitionEvents2['default'].removeEndEventListener(_this.refs.track.getDOMNode(), callback); | ||
}; | ||
this.setState({ | ||
animating: true, | ||
currentSlide: targetSlide, | ||
trackStyle: (0, _trackHelper.getTrackAnimateCSS)((0, _objectAssign2['default'])({ left: targetLeft }, this.props, this.state)) | ||
}, function () { | ||
_reactLibReactTransitionEvents2['default'].addEndEventListener(this.refs.track.getDOMNode(), callback); | ||
}); | ||
}).bind(this); | ||
} | ||
this.setState({ | ||
animating: true, | ||
currentSlide: currentSlide, | ||
currentLeft: currentLeft, | ||
trackStyle: this.getAnimateCSS(targetLeft) | ||
}, function () { | ||
ReactTransitionEvents.addEndEventListener(this.refs.track.getDOMNode(), callback); | ||
setTimeout(callback, this.props.speed); | ||
}); | ||
this.autoPlay(); | ||
@@ -232,8 +235,5 @@ }, | ||
} | ||
if (swipeAngle <= 45 && swipeAngle >= 0) { | ||
if (swipeAngle <= 45 && swipeAngle >= 0 || swipeAngle <= 360 && swipeAngle >= 315) { | ||
return this.props.rtl === false ? 'left' : 'right'; | ||
} | ||
if (swipeAngle <= 360 && swipeAngle >= 315) { | ||
return this.props.rtl === false ? 'left' : 'right'; | ||
} | ||
if (swipeAngle >= 135 && swipeAngle <= 225) { | ||
@@ -246,7 +246,9 @@ return this.props.rtl === false ? 'right' : 'left'; | ||
autoPlay: function autoPlay() { | ||
var play = (function () { | ||
if (this.isMounted()) { | ||
this.slideHandler(this.state.currentSlide + this.props.slidesToScroll); | ||
var _this2 = this; | ||
var play = function play() { | ||
if (_this2.state.mounted) { | ||
_this2.slideHandler(_this2.state.currentSlide + _this2.props.slidesToScroll); | ||
} | ||
}).bind(this); | ||
}; | ||
if (this.props.autoplay) { | ||
@@ -261,2 +263,3 @@ window.clearTimeout(this.state.autoPlayTimer); | ||
module.exports = helpers; | ||
exports['default'] = helpers; | ||
module.exports = exports['default']; |
@@ -11,20 +11,6 @@ 'use strict'; | ||
var _innerSlider2 = _interopRequireDefault(_innerSlider); | ||
var _objectAssign = require('object-assign'); | ||
var _lodashSortby = require('lodash.sortby'); | ||
var _objectAssign2 = _interopRequireDefault(_objectAssign); | ||
var _lodashSortby2 = _interopRequireDefault(_lodashSortby); | ||
var _lodashPluck = require('lodash.pluck'); | ||
var _lodashPluck2 = _interopRequireDefault(_lodashPluck); | ||
var _lodashFilter = require('lodash.filter'); | ||
var _lodashFilter2 = _interopRequireDefault(_lodashFilter); | ||
var _lodashAssign = require('lodash.assign'); | ||
var _lodashAssign2 = _interopRequireDefault(_lodashAssign); | ||
var _json2mq = require('json2mq'); | ||
@@ -38,2 +24,6 @@ | ||
var _defaultProps = require('./default-props'); | ||
var _defaultProps2 = _interopRequireDefault(_defaultProps); | ||
var Slider = _react2['default'].createClass({ | ||
@@ -49,33 +39,59 @@ displayName: 'Slider', | ||
componentDidMount: function componentDidMount() { | ||
var breakpoints = (0, _lodashSortby2['default'])((0, _lodashPluck2['default'])(this.props.responsive, 'breakpoint')); | ||
var _this = this; | ||
breakpoints.forEach((function (breakpoint, index) { | ||
var query; | ||
if (index === 0) { | ||
query = (0, _json2mq2['default'])({ minWidth: 0, maxWidth: breakpoint }); | ||
} else { | ||
query = (0, _json2mq2['default'])({ minWidth: breakpoints[index - 1], maxWidth: breakpoint }); | ||
} | ||
this.media(query, (function () { | ||
this.setState({ breakpoint: breakpoint }); | ||
}).bind(this)); | ||
}).bind(this)); | ||
if (this.props.responsive) { | ||
var breakpoints = this.props.responsive.map(function (breakpt) { | ||
return breakpt.breakpoint; | ||
}); | ||
breakpoints.sort(function (x, y) { | ||
return x - y; | ||
}); | ||
// Register media query for full screen. Need to support resize from small to large | ||
var query = (0, _json2mq2['default'])({ minWidth: breakpoints.slice(-1)[0] }); | ||
breakpoints.forEach(function (breakpoint, index) { | ||
var bQuery; | ||
if (index === 0) { | ||
bQuery = (0, _json2mq2['default'])({ minWidth: 0, maxWidth: breakpoint }); | ||
} else { | ||
bQuery = (0, _json2mq2['default'])({ minWidth: breakpoints[index - 1], maxWidth: breakpoint }); | ||
} | ||
_this.media(bQuery, function () { | ||
_this.setState({ breakpoint: breakpoint }); | ||
}); | ||
}); | ||
this.media(query, (function () { | ||
this.setState({ breakpoint: null }); | ||
}).bind(this)); | ||
// Register media query for full screen. Need to support resize from small to large | ||
var query = (0, _json2mq2['default'])({ minWidth: breakpoints.slice(-1)[0] }); | ||
this.media(query, function () { | ||
_this.setState({ breakpoint: null }); | ||
}); | ||
} | ||
}, | ||
render: function render() { | ||
var _this2 = this; | ||
var settings; | ||
var newProps; | ||
if (this.state.breakpoint) { | ||
newProps = (0, _lodashFilter2['default'])(this.props.responsive, { breakpoint: this.state.breakpoint }); | ||
settings = (0, _lodashAssign2['default'])({}, this.props, newProps[0].settings); | ||
newProps = this.props.responsive.filter(function (resp) { | ||
return resp.breakpoint === _this2.state.breakpoint; | ||
}); | ||
settings = newProps[0].settings === 'unslick' ? 'unslick' : (0, _objectAssign2['default'])({}, this.props, newProps[0].settings); | ||
} else { | ||
settings = this.props; | ||
settings = (0, _objectAssign2['default'])({}, _defaultProps2['default'], this.props); | ||
} | ||
return _react2['default'].createElement(_innerSlider2['default'], settings); | ||
if (settings === 'unslick') { | ||
// if 'unslick' responsive breakpoint setting used, just return the <Slider> tag nested HTML | ||
return _react2['default'].createElement( | ||
'div', | ||
null, | ||
this.props.children | ||
); | ||
} else { | ||
return _react2['default'].createElement( | ||
_innerSlider.InnerSlider, | ||
settings, | ||
this.props.children | ||
); | ||
} | ||
} | ||
@@ -82,0 +98,0 @@ }); |
{ | ||
"name": "react-slick", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": " React port of slick carousel", | ||
@@ -28,5 +28,9 @@ "main": "./lib", | ||
"babel-core": "^5.4.7", | ||
"babel-eslint": "^3.1.10", | ||
"babel-loader": "^5.1.3", | ||
"css-loader": "^0.14.4", | ||
"deepmerge": "^0.2.10", | ||
"del": "^1.2.0", | ||
"eslint": "^0.22.1", | ||
"eslint-plugin-react": "^2.4.0", | ||
"express": "^5.0.0-alpha.1", | ||
@@ -42,2 +46,3 @@ "foundation-apps": "^1.1.0", | ||
"node-sass": "^3.1.2", | ||
"postcss-loader": "^0.4.4", | ||
"react": "^0.13.3", | ||
@@ -47,3 +52,5 @@ "react-hot-loader": "^1.2.7", | ||
"run-sequence": "^1.1.0", | ||
"sass-loader": "^1.0.2", | ||
"sinon": "^1.14.1", | ||
"style-loader": "^0.12.3", | ||
"webpack": "^1.9.10", | ||
@@ -55,8 +62,4 @@ "webpack-dev-server": "^1.9.0" | ||
"json2mq": "^0.2.0", | ||
"lodash.assign": "^3.2.0", | ||
"lodash.filter": "^3.1.1", | ||
"lodash.pluck": "^3.1.2", | ||
"lodash.sortby": "^3.1.4", | ||
"object-assign": "^2.0.0", | ||
"react-responsive-mixin": "^0.3.3", | ||
"react-responsive-mixin": "^0.3.5", | ||
"slick-carousel": "^1.5.5" | ||
@@ -63,0 +66,0 @@ }, |
@@ -5,3 +5,3 @@ # react-slick | ||
# Road to 1.0 | ||
react-slick is under active development now. | ||
react-slick is under active development now. | ||
Soon this project will have all the features of slick carousel. | ||
@@ -27,3 +27,3 @@ We encourage your feedback and support. | ||
### Starter Kit | ||
Checkout [yeoman generator](https://github.com/akiran/generator-react-slick) to quickly | ||
Checkout [yeoman generator](https://github.com/akiran/generator-react-slick) to quickly | ||
get started with react-slick. | ||
@@ -61,4 +61,4 @@ | ||
| ------------- | ---- | ----------- | ------- | | ||
| className | String |Additional class name for the inner slider div | Yes | | ||
| adaptiveHeight | | | | | ||
| className | String |Additional class name for the inner slider div | Yes | | ||
| adaptiveHeight | bool | Adjust the slide's height automatically | Yes | | ||
| arrows | bool | Should we show Left and right nav arrows | Yes | | ||
@@ -69,13 +69,14 @@ | autoplay | bool | Should the scroller auto scroll? | Yes | | ||
| centerPadding | | | | | ||
| cssEase | | | | | ||
| cssEase | | | | | ||
| dots |bool | Should we show the dots at the bottom of the gallery | Yes | | ||
| dotsClass | string | Class applied to the dots if they are enabled | Yes | | ||
| dotsClass | string | Class applied to the dots if they are enabled | Yes | | ||
| draggable | bool | Is the gallery scrollable via dragging on desktop? | Yes | | ||
| easing | string | | | | ||
| fade | bool | | | | ||
| focusOnSelect | bool | | | | ||
| fade | bool | Slides use fade for transition | Yes | | ||
| focusOnSelect | bool | | | | ||
| infinite | should the gallery wrap around it's contents | Yes | | ||
| initialSlide | int | which item should be the first to be displayed | Yes (since pull req #17) | | ||
| 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. Example: `[ { breakpoint: 768, settings: { slidesToShow: 3 } }, { breakpoint: 1024, settings: { slidesToShow: 5 } } ]`| Yes | | ||
| rtl | bool | | | | ||
| initialSlide | int | which item should be the first to be displayed | Yes | | ||
| lazyLoad | bool | Loads images or renders components on demands | 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 | | ||
| rtl | bool | Reverses the slide order | Yes | | ||
| slide | string ||| | ||
@@ -90,4 +91,6 @@ | slidesToShow | int | Number of slides to be visible at a time | Yes | | ||
| variableWidth | bool ||| | ||
| useCSS | bool | Enable/Disable CSS Transitions | Yes | | ||
| vertical | bool ||| | ||
| afterChange | function | callback function called when the current index changes | Yes (since pull req #17) | | ||
| afterChange | function | callback function called after the current index changes | Yes | | ||
| beforeChange | function | callback function called before the current index changes | Yes | | ||
@@ -102,3 +105,1 @@ ### Development | ||
``` | ||
@@ -15,2 +15,3 @@ var defaultProps = { | ||
easing: 'linear', | ||
edgeFriction: 0.35, | ||
fade: false, | ||
@@ -20,3 +21,3 @@ focusOnSelect: false, | ||
initialSlide: 0, | ||
// lazyLoad: 'ondemand', | ||
lazyLoad: false, | ||
responsive: null, | ||
@@ -32,3 +33,3 @@ rtl: false, | ||
touchThreshold: 5, | ||
// useCSS: true, | ||
useCSS: true, | ||
variableWidth: false, | ||
@@ -38,2 +39,7 @@ vertical: false, | ||
afterChange: null, | ||
beforeChange: null, | ||
edgeEvent: null, | ||
init: null, | ||
swipeEvent: null, | ||
// nextArrow, prevArrow are react componets | ||
nextArrow: null, | ||
@@ -40,0 +46,0 @@ prevArrow: null |
@@ -24,4 +24,8 @@ var initialState = { | ||
lazyLoadedList: [], | ||
// added for react | ||
initialized: false, | ||
edgeDragged: false, | ||
swiped: false, // used by swipeEvent. differentites between touch and swipe. | ||
trackStyle: {}, | ||
@@ -28,0 +32,0 @@ trackWidth: 0 |
'use strict'; | ||
var React = require('react'); | ||
var cloneWithProps = require('react/lib/cloneWithProps'); | ||
var classnames = require('classnames'); | ||
var EventHandlersMixin = require('./mixins/event-handlers'); | ||
var HelpersMixin = require('./mixins/helpers'); | ||
var initialState = require('./initial-state'); | ||
var defaultProps = require('./default-props'); | ||
var _assign = require('lodash.assign'); | ||
import React from 'react'; | ||
import EventHandlersMixin from './mixins/event-handlers'; | ||
import HelpersMixin from './mixins/helpers'; | ||
import initialState from './initial-state'; | ||
import defaultProps from './default-props'; | ||
import classnames from 'classnames'; | ||
var Slider = React.createClass({ | ||
mixins: [EventHandlersMixin, HelpersMixin], | ||
import {Track} from './track'; | ||
import {Dots} from './dots'; | ||
import {PrevArrow, NextArrow} from './arrows'; | ||
export var InnerSlider = React.createClass({ | ||
mixins: [HelpersMixin, EventHandlersMixin], | ||
getInitialState: function () { | ||
@@ -20,3 +22,24 @@ return initialState; | ||
}, | ||
componentWillMount: function () { | ||
if (this.props.init) { | ||
this.props.init(); | ||
} | ||
this.setState({ | ||
mounted: true | ||
}); | ||
var lazyLoadedList = []; | ||
for (var i = 0; i < this.props.children.length; i++) { | ||
if (i >= this.state.currentSlide && i < this.state.currentSlide + this.props.slidesToShow) { | ||
lazyLoadedList.push(i); | ||
} | ||
} | ||
if (this.props.lazyLoad && this.state.lazyLoadedList.length === 0) { | ||
this.setState({ | ||
lazyLoadedList: lazyLoadedList | ||
}); | ||
} | ||
}, | ||
componentDidMount: function () { | ||
// Hack for autoplay -- Inspect Later | ||
this.initialize(this.props); | ||
@@ -31,151 +54,60 @@ this.adaptHeight(); | ||
}, | ||
renderDots: function () { | ||
var dotOptions; | ||
var dots = []; | ||
if (this.props.dots === true && this.state.slideCount > this.props.slidesToShow) { | ||
for (var i=0; i <= this.getDotCount(); i += 1) { | ||
var className = classnames({ | ||
'slick-active': (this.state.currentSlide === i * this.props.slidesToScroll) | ||
}); | ||
dotOptions = { | ||
message: 'index', | ||
index: i | ||
}; | ||
dots.push(<li key={i} className={className}><button onClick={this.changeSlide.bind(this, dotOptions)}>{i}</button></li>); | ||
} | ||
return ( | ||
<ul className={this.props.dotsClass} style={{display: 'block'}}> | ||
{dots} | ||
</ul> | ||
); | ||
} else { | ||
return null; | ||
} | ||
}, | ||
renderSlides: function () { | ||
var key; | ||
var slides = []; | ||
var preCloneSlides = []; | ||
var postCloneSlides = []; | ||
var count = React.Children.count(this.props.children); | ||
React.Children.forEach(this.props.children, function (child, index) { | ||
var infiniteCount; | ||
slides.push(cloneWithProps(child, { | ||
key: index, | ||
'data-index': index, | ||
className: this.getSlideClasses(index), | ||
style: _assign({}, this.getSlideStyle(), child.props.style) | ||
})); | ||
render: function () { | ||
var className = classnames('slick-initialized', 'slick-slider', this.props.className); | ||
if (this.props.infinite === true) { | ||
if (this.props.centerMode === true) { | ||
infiniteCount = this.props.slidesToShow + 1; | ||
} else { | ||
infiniteCount = this.props.slidesToShow; | ||
} | ||
var trackProps = { | ||
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 (index >= (count - infiniteCount)) { | ||
key = -(count - index); | ||
preCloneSlides.push(cloneWithProps(child, { | ||
key: key, | ||
'data-index': key, | ||
className: this.getSlideClasses(key), | ||
style: _assign({}, this.getSlideStyle(), child.props.style) | ||
})); | ||
} | ||
var dots; | ||
if (index < infiniteCount) { | ||
key = count + index; | ||
postCloneSlides.push(cloneWithProps(child, { | ||
key: key, | ||
'data-index': key, | ||
className: this.getSlideClasses(key), | ||
style: _assign({}, this.getSlideStyle(), child.props.style) | ||
})); | ||
} | ||
} | ||
}.bind(this)); | ||
return preCloneSlides.concat(slides, postCloneSlides); | ||
}, | ||
renderTrack: function () { | ||
return ( | ||
<div ref='track' className='slick-track' style={this.state.trackStyle}> | ||
{ this.renderSlides() } | ||
</div> | ||
); | ||
}, | ||
renderArrows: function () { | ||
if (this.props.arrows === true) { | ||
var prevClasses = { 'slick-prev': true}; | ||
var nextClasses = { 'slick-next': true}; | ||
var prevHandler = this.changeSlide.bind(this, {message: 'previous'}); | ||
var nextHandler = this.changeSlide.bind(this, {message: 'next'}); | ||
if (this.props.infinite === false) { | ||
if (this.state.currentSlide === 0) { | ||
prevClasses['slick-disabled'] = true; | ||
prevHandler = null; | ||
} | ||
if (this.props.centerMode && !this.props.infinite) | ||
{ | ||
if (this.state.currentSlide >= (this.state.slideCount - 1)) { | ||
nextClasses['slick-disabled'] = true; | ||
nextHandler = null; | ||
} | ||
}else | ||
{ | ||
if (this.state.currentSlide >= (this.state.slideCount - this.props.slidesToShow)) { | ||
nextClasses['slick-disabled'] = true; | ||
nextHandler = null; | ||
} | ||
} | ||
} | ||
var prevArrowProps = { | ||
key: '0', | ||
ref: 'previous', | ||
'data-role': 'none', | ||
className: classnames(prevClasses), | ||
style: {display: 'block'}, | ||
onClick: prevHandler | ||
if (this.props.dots === true && this.state.slideCount > this.props.slidesToShow) { | ||
var dotProps = { | ||
dotsClass: this.props.dotsClass, | ||
slideCount: this.state.slideCount, | ||
slidesToShow: this.props.slidesToShow, | ||
currentSlide: this.state.currentSlide, | ||
slidesToScroll: this.props.slidesToScroll, | ||
clickHandler: this.changeSlide | ||
}; | ||
var prevArrow; | ||
if (this.props.prevArrow) { | ||
prevArrow = <this.props.prevArrow {...prevArrowProps} />; | ||
} else { | ||
prevArrow = <button type="button" {...prevArrowProps}> Previous</button>; | ||
} | ||
dots = (<Dots {...dotProps} />); | ||
} | ||
var nextArrowProps = { | ||
key: '1', | ||
ref: 'next', | ||
'data-role': 'none', | ||
className: classnames(nextClasses), | ||
style: {display: 'block'}, | ||
onClick: nextHandler | ||
}; | ||
var nextArrow; | ||
var prevArrow, nextArrow; | ||
if (this.props.nextArrow) { | ||
nextArrow = <this.props.nextArrow {...nextArrowProps} />; | ||
} else { | ||
nextArrow = <button type="button" {...nextArrowProps}> Next</button>; | ||
} | ||
var arrowProps = { | ||
infinite: this.props.infinite, | ||
centerMode: this.props.centerMode, | ||
currentSlide: this.state.currentSlide, | ||
slideCount: this.state.slideCount, | ||
slidesToShow: this.props.slidesToShow, | ||
prevArrow: this.props.prevArrow, | ||
nextArrow: this.props.nextArrow, | ||
clickHandler: this.changeSlide | ||
}; | ||
return [prevArrow, nextArrow]; | ||
} else { | ||
return null; | ||
if (this.props.arrows) { | ||
prevArrow = (<PrevArrow {...arrowProps} />); | ||
nextArrow = (<NextArrow {...arrowProps} />); | ||
} | ||
}, | ||
render: function () { | ||
var className = classnames('slick-initialized', 'slick-slider', this.props.className); | ||
return ( | ||
<div className={className} > | ||
<div className={className}> | ||
<div | ||
ref='list' | ||
className='slick-list' | ||
className="slick-list" | ||
onMouseDown={this.swipeStart} | ||
@@ -189,6 +121,9 @@ onMouseMove={this.state.dragging ? this.swipeMove: null} | ||
onTouchCancel={this.state.dragging ? this.swipeEnd: null}> | ||
{this.renderTrack()} | ||
<Track ref='track' {...trackProps}> | ||
{this.props.children} | ||
</Track> | ||
</div> | ||
{this.renderArrows()} | ||
{this.renderDots()} | ||
{prevArrow} | ||
{nextArrow} | ||
{dots} | ||
</div> | ||
@@ -198,3 +133,1 @@ ); | ||
}); | ||
module.exports = Slider; |
'use strict'; | ||
import {getTrackCSS, getTrackLeft, getTrackAnimateCSS} from './trackHelper'; | ||
import assign from 'object-assign'; | ||
var EventHandlers = { | ||
// Event handler for previous and next | ||
changeSlide: function (options, e) { | ||
// console.log('changeSlide'); | ||
var indexOffset, slideOffset, unevenOffset; | ||
changeSlide: function (options) { | ||
var indexOffset, slideOffset, unevenOffset, targetSlide; | ||
unevenOffset = (this.state.slideCount % this.props.slidesToScroll !== 0); | ||
@@ -13,18 +14,15 @@ indexOffset = unevenOffset ? 0 : (this.state.slideCount - this.state.currentSlide) % this.props.slidesToScroll; | ||
slideOffset = (indexOffset === 0) ? this.props.slidesToScroll : this.props.slidesToShow - indexOffset; | ||
if (this.state.slideCount > this.props.slidesToShow) { | ||
this.slideHandler(this.state.currentSlide - slideOffset, false); | ||
} | ||
targetSlide = this.state.currentSlide - slideOffset; | ||
} else if (options.message === 'next') { | ||
slideOffset = (indexOffset === 0) ? this.props.slidesToScroll : indexOffset; | ||
if (this.state.slideCount > this.props.slidesToShow) { | ||
this.slideHandler(this.state.currentSlide + slideOffset, false); | ||
} | ||
} else if (options.message === 'index') { | ||
targetSlide = this.state.currentSlide + slideOffset; | ||
} else if (options.message === 'dots') { | ||
// Click on dots | ||
var targetSlide = options.index*this.props.slidesToScroll; | ||
if (targetSlide !== this.state.currentSlide) { | ||
this.slideHandler(targetSlide); | ||
targetSlide = options.index * options.slidesToScroll; | ||
if (targetSlide === options.currentSlide) { | ||
return; | ||
} | ||
} | ||
this.slideHandler(targetSlide); | ||
}, | ||
@@ -71,3 +69,6 @@ // Accessiblity handler for previous and next | ||
curLeft = this.getLeft(this.state.currentSlide); | ||
curLeft = getTrackLeft(assign({ | ||
slideIndex: this.state.currentSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
touchObject.curX = (e.touches) ? e.touches[0].pageX : e.clientX; | ||
@@ -78,7 +79,29 @@ touchObject.curY = (e.touches) ? e.touches[0].pageY : e.clientY; | ||
positionOffset = (this.props.rtl === false ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1); | ||
swipeLeft = curLeft + touchObject.swipeLength * positionOffset; | ||
var currentSlide = this.state.currentSlide; | ||
var dotCount = Math.ceil(this.state.slideCount / this.props.slidesToScroll); | ||
var swipeDirection = this.swipeDirection(this.state.touchObject); | ||
var touchSwipeLength = touchObject.swipeLength; | ||
if (this.props.infinite === false) { | ||
if ((currentSlide === 0 && swipeDirection === 'right') || (currentSlide + 1 >= dotCount && swipeDirection === 'left')) { | ||
touchSwipeLength = touchObject.swipeLength * this.props.edgeFriction; | ||
if (this.state.edgeDragged === false && this.props.edgeEvent) { | ||
this.props.edgeEvent(swipeDirection); | ||
this.setState({ edgeDragged: true }); | ||
} | ||
} | ||
} | ||
if (this.state.swiped === false && this.props.swipeEvent) { | ||
this.props.swipeEvent(swipeDirection); | ||
this.setState({ swiped: true }); | ||
} | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
this.setState({ | ||
touchObject: touchObject, | ||
swipeLeft: swipeLeft, | ||
trackStyle: this.getCSS(swipeLeft) | ||
trackStyle: getTrackCSS(assign({left: swipeLeft}, this.props, this.state)) | ||
}); | ||
@@ -95,4 +118,8 @@ e.preventDefault(); | ||
var swipeDirection = this.swipeDirection(touchObject); | ||
// reset the state of touch related state variables. | ||
this.setState({ | ||
dragging: false, | ||
edgeDragged: false, | ||
swiped: false, | ||
swipeLeft: null, | ||
@@ -111,6 +138,14 @@ touchObject: {} | ||
} else { | ||
this.slideHandler(this.state.currentSlide, null, true); | ||
this.slideHandler(this.state.currentSlide); | ||
} | ||
} else { | ||
this.slideHandler(this.state.currentSlide, null, true); | ||
// Adjust the track back to it's original position. | ||
var currentLeft = getTrackLeft(assign({ | ||
slideIndex: this.state.currentSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
this.setState({ | ||
trackStyle: getTrackAnimateCSS(assign({left: currentLeft}, this.props, this.state)) | ||
}); | ||
} | ||
@@ -120,2 +155,2 @@ } | ||
module.exports = EventHandlers; | ||
export default EventHandlers; |
'use strict'; | ||
var assign = require('object-assign'); | ||
var React = require('react'); | ||
var classnames = require('classnames'); | ||
var ReactTransitionEvents = require('react/lib/ReactTransitionEvents'); | ||
import React from 'react'; | ||
import ReactTransitionEvents from 'react/lib/ReactTransitionEvents'; | ||
import {getTrackCSS, getTrackLeft, getTrackAnimateCSS} from './trackHelper'; | ||
import assign from 'object-assign'; | ||
@@ -15,2 +15,4 @@ var helpers = { | ||
var currentSlide = props.rtl ? slideCount - 1 - props.initialSlide : props.initialSlide; | ||
this.setState({ | ||
@@ -21,8 +23,13 @@ slideCount: slideCount, | ||
trackWidth: trackWidth, | ||
currentSlide: props.initialSlide | ||
currentSlide: currentSlide | ||
}, function () { | ||
}, function () { | ||
var targetLeft = getTrackLeft(assign({ | ||
slideIndex: this.state.currentSlide, | ||
trackRef: this.refs.track | ||
}, props, this.state)); | ||
// getCSS function needs previously set state | ||
var trackStyle = this.getCSS(this.getLeft(this.state.currentSlide)); | ||
var trackStyle = getTrackCSS(assign({left: targetLeft}, props, this.state)); | ||
this.setState({trackStyle: trackStyle}); | ||
@@ -33,113 +40,2 @@ | ||
}, | ||
getDotCount: function () { | ||
var pagerQty; | ||
pagerQty = Math.ceil(this.state.slideCount /this.props.slidesToScroll); | ||
return pagerQty - 1; | ||
}, | ||
getLeft: function (slideIndex) { | ||
var slideOffset = 0; | ||
var targetLeft; | ||
var targetSlide; | ||
if (this.props.infinite === true) { | ||
if (this.state.slideCount > this.props.slidesToShow) { | ||
slideOffset = (this.state.slideWidth * this.props.slidesToShow) * -1; | ||
} | ||
if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
if (slideIndex + this.props.slidesToScroll > this.state.slideCount && this.state.slideCount > this.props.slidesToShow) { | ||
if(slideIndex > this.state.slideCount) { | ||
slideOffset = ((this.props.slidesToShow - (slideIndex - this.state.slideCount)) * this.state.slideWidth) * -1; | ||
} else { | ||
slideOffset = ((this.state.slideCount % this.props.slidesToScroll) * this.state.slideWidth) * -1; | ||
} | ||
} | ||
} | ||
} else { | ||
} | ||
if (this.props.centerMode === true && this.props.infinite === true) { | ||
slideOffset += this.state.slideWidth * Math.floor(this.props.slidesToShow / 2) - this.state.slideWidth; | ||
} else if (this.props.centerMode === true) { | ||
slideOffset = this.state.slideWidth * Math.floor(this.props.slidesToShow / 2); | ||
} | ||
targetLeft = ((slideIndex * this.state.slideWidth) * -1) + slideOffset; | ||
if (this.props.variableWidth === true) { | ||
var targetSlideIndex; | ||
if(this.state.slideCount <= this.props.slidesToShow || this.props.infinite === false) { | ||
targetSlide = this.refs.track.getDOMNode().childNodes[slideIndex]; | ||
} else { | ||
targetSlideIndex = (slideIndex + this.props.slidesToShow); | ||
targetSlide = this.refs.track.getDOMNode().childNodes[targetSlideIndex]; | ||
} | ||
targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0; | ||
if (this.props.centerMode === true) { | ||
if(this.props.infinite === false) { | ||
targetSlide = this.refs.track.getDOMNode().childNodes[slideIndex]; | ||
} else { | ||
targetSlide = this.refs.track.getDOMNode().childNodes[(slideIndex + this.props.slidesToShow + 1)]; | ||
} | ||
targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0; | ||
targetLeft += (this.state.listWidth - targetSlide.offsetWidth) / 2; | ||
} | ||
} | ||
return targetLeft; | ||
}, | ||
getAnimateCSS: function (targetLeft) { | ||
var style = this.getCSS(targetLeft); | ||
style.WebkitTransition = '-webkit-transform ' + this.props.speed + 'ms ' + this.props.cssEase; | ||
style.transition = 'transform ' + this.props.speed + 'ms ' + this.props.cssEase; | ||
return style; | ||
}, | ||
getCSS: function (targetLeft) { | ||
// implemented this instead of setCSS | ||
var trackWidth; | ||
if (this.props.variableWidth) { | ||
trackWidth = (this.state.slideCount + 2*this.props.slidesToShow)*this.state.slideWidth; | ||
} else if (this.props.centerMode) { | ||
trackWidth = (this.state.slideCount + 2*(this.props.slidesToShow + 1)) *this.state.slideWidth; | ||
} else { | ||
trackWidth = (this.state.slideCount + 2*this.props.slidesToShow )*this.state.slideWidth; | ||
} | ||
var style = { | ||
opacity: 1, | ||
width: trackWidth, | ||
WebkitTransform: 'translate3d(' + targetLeft + 'px, 0px, 0px)', | ||
transform: 'translate3d(' + targetLeft + 'px, 0px, 0px)', | ||
transition: '', | ||
WebkitTransition: '' | ||
}; | ||
return style; | ||
}, | ||
getSlideStyle: function () { | ||
return { | ||
width: this.state.slideWidth | ||
}; | ||
}, | ||
getSlideClasses: function (index) { | ||
var slickActive, slickCenter, slickCloned; | ||
var currentSlide = this.state.currentSlide; | ||
var centerOffset; | ||
slickCloned = (index < 0) || (index >= this.state.slideCount); | ||
if (this.props.centerMode) { | ||
centerOffset = Math.floor(this.props.slidesToShow / 2); | ||
slickCenter = (currentSlide === index); | ||
if ((index > currentSlide - centerOffset - 1) && (index <= currentSlide + centerOffset)) { | ||
slickActive = true; | ||
} | ||
} else { | ||
slickActive = (currentSlide === index); | ||
} | ||
return classnames({ | ||
'slick-slide': true, | ||
'slick-active': slickActive, | ||
'slick-center': slickCenter, | ||
'slick-cloned': slickCloned | ||
}); | ||
}, | ||
adaptHeight: function () { | ||
@@ -154,3 +50,3 @@ if (this.props.adaptiveHeight) { | ||
}, | ||
slideHandler: function (index, sync, dontAnimate) { | ||
slideHandler: function (index) { | ||
// Functionality of animateSlide and postSlide is merged into this function | ||
@@ -160,18 +56,56 @@ // console.log('slideHandler', index); | ||
var targetLeft, currentLeft; | ||
var callback; | ||
if (this.state.animating === true) { | ||
if (this.state.animating === true || this.state.currentSlide === index) { | ||
return; | ||
} | ||
// To prevent the slider from sticking in animating state, If we click on already active dot | ||
if (this.props.fade === true && this.state.currentSlide === index) { | ||
if (this.props.fade) { | ||
currentSlide = this.state.currentSlide; | ||
if (this.props.beforeChange) { | ||
this.props.beforeChange(currentSlide); | ||
} | ||
// Shifting targetSlide back into the range | ||
if (index < 0) { | ||
targetSlide = index + this.state.slideCount; | ||
} else if (index >= this.state.slideCount) { | ||
targetSlide = index - this.state.slideCount; | ||
} else { | ||
targetSlide = index; | ||
} | ||
if (this.props.lazyLoad && this.state.lazyLoadedList.indexOf(targetSlide) < 0) { | ||
this.setState({ | ||
lazyLoadedList: this.state.lazyLoadedList.concat(targetSlide) | ||
}); | ||
} | ||
callback = () => { | ||
this.setState({ | ||
animating: false | ||
}); | ||
if (this.props.afterChange) { | ||
this.props.afterChange(currentSlide); | ||
} | ||
ReactTransitionEvents.removeEndEventListener(this.refs.track.getDOMNode().children[currentSlide], callback); | ||
}; | ||
this.setState({ | ||
animating: true, | ||
currentSlide: targetSlide | ||
}, function () { | ||
ReactTransitionEvents.addEndEventListener(this.refs.track.getDOMNode().children[currentSlide], callback); | ||
}); | ||
this.autoPlay(); | ||
return; | ||
} | ||
if (this.state.slideCount <= this.props.slidesToShow) { | ||
return; | ||
} | ||
targetSlide = index; | ||
if (targetSlide < 0) { | ||
if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
if(this.props.infinite === false) { | ||
currentSlide = 0; | ||
} else if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
currentSlide = this.state.slideCount - (this.state.slideCount % this.props.slidesToScroll); | ||
@@ -182,3 +116,5 @@ } else { | ||
} else if (targetSlide >= this.state.slideCount) { | ||
if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
if(this.props.infinite === false) { | ||
currentSlide = this.state.slideCount - this.props.slidesToShow; | ||
} else if (this.state.slideCount % this.props.slidesToScroll !== 0) { | ||
currentSlide = 0; | ||
@@ -192,5 +128,12 @@ } else { | ||
targetLeft = this.getLeft(targetSlide, this.state); | ||
currentLeft = this.getLeft(currentSlide, this.state); | ||
targetLeft = getTrackLeft(assign({ | ||
slideIndex: targetSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
currentLeft = getTrackLeft(assign({ | ||
slideIndex: currentSlide, | ||
trackRef: this.refs.track | ||
}, this.props, this.state)); | ||
if (this.props.infinite === false) { | ||
@@ -200,24 +143,65 @@ targetLeft = currentLeft; | ||
if(this.props.afterChange!==null){ | ||
this.props.afterChange(currentSlide); | ||
if (this.props.beforeChange) { | ||
this.props.beforeChange(currentSlide); | ||
} | ||
var callback = function() { | ||
if (this.props.lazyLoad) { | ||
var loaded = true; | ||
var slidesToLoad = []; | ||
for (var i = targetSlide; i < targetSlide + this.props.slidesToShow; i++ ) { | ||
loaded = loaded && (this.state.lazyLoadedList.indexOf(i) >= 0); | ||
if (!loaded) { | ||
slidesToLoad.push(i); | ||
} | ||
} | ||
if (!loaded) { | ||
this.setState({ | ||
animating: false, | ||
trackStyle: this.getCSS(currentLeft), | ||
swipeLeft: null | ||
lazyLoadedList: this.state.lazyLoadedList.concat(slidesToLoad) | ||
}); | ||
}.bind(this); | ||
} | ||
} | ||
this.setState({ | ||
animating: true, | ||
currentSlide: currentSlide, | ||
currentLeft: currentLeft, | ||
trackStyle: this.getAnimateCSS(targetLeft) | ||
}, function () { | ||
ReactTransitionEvents.addEndEventListener(this.refs.track.getDOMNode(), callback); | ||
setTimeout(callback, this.props.speed); | ||
}); | ||
// Slide Transition happens here. | ||
// animated transition happens to target Slide and | ||
// non - animated transition happens to current Slide | ||
// If CSS transitions are false, directly go the current slide. | ||
if (this.props.useCSS === false) { | ||
this.setState({ | ||
currentSlide: currentSlide, | ||
trackStyle: getTrackCSS(assign({left: currentLeft}, this.props, this.state)) | ||
}, function () { | ||
if (this.props.afterChange) { | ||
this.props.afterChange(currentSlide); | ||
} | ||
}); | ||
} else { | ||
var nextStateChanges = { | ||
animating: false, | ||
currentSlide: currentSlide, | ||
trackStyle: getTrackCSS(assign({left: currentLeft}, this.props, this.state)), | ||
swipeLeft: null | ||
}; | ||
callback = () => { | ||
this.setState(nextStateChanges); | ||
if (this.props.afterChange) { | ||
this.props.afterChange(currentSlide); | ||
} | ||
ReactTransitionEvents.removeEndEventListener(this.refs.track.getDOMNode(), callback); | ||
}; | ||
this.setState({ | ||
animating: true, | ||
currentSlide: targetSlide, | ||
trackStyle: getTrackAnimateCSS(assign({left: targetLeft}, this.props, this.state)) | ||
}, function () { | ||
ReactTransitionEvents.addEndEventListener(this.refs.track.getDOMNode(), callback); | ||
}); | ||
} | ||
this.autoPlay(); | ||
@@ -236,8 +220,5 @@ }, | ||
} | ||
if ((swipeAngle <= 45) && (swipeAngle >= 0)) { | ||
if ((swipeAngle <= 45) && (swipeAngle >= 0) || (swipeAngle <= 360) && (swipeAngle >= 315)) { | ||
return (this.props.rtl === false ? 'left' : 'right'); | ||
} | ||
if ((swipeAngle <= 360) && (swipeAngle >= 315)) { | ||
return (this.props.rtl === false ? 'left' : 'right'); | ||
} | ||
if ((swipeAngle >= 135) && (swipeAngle <= 225)) { | ||
@@ -250,7 +231,7 @@ return (this.props.rtl === false ? 'right' : 'left'); | ||
autoPlay: function () { | ||
var play = function () { | ||
if (this.isMounted()) { | ||
var play = () => { | ||
if (this.state.mounted) { | ||
this.slideHandler(this.state.currentSlide + this.props.slidesToScroll); | ||
} | ||
}.bind(this); | ||
}; | ||
if (this.props.autoplay) { | ||
@@ -265,2 +246,2 @@ window.clearTimeout(this.state.autoPlayTimer); | ||
module.exports = helpers; | ||
export default helpers; |
'use strict'; | ||
import React from 'react'; | ||
import InnerSlider from './inner-slider'; | ||
import _sortBy from 'lodash.sortby'; | ||
import _pluck from 'lodash.pluck'; | ||
import _filter from 'lodash.filter'; | ||
import _assign from 'lodash.assign'; | ||
import {InnerSlider} from './inner-slider'; | ||
import assign from 'object-assign'; | ||
import json2mq from 'json2mq'; | ||
import ResponsiveMixin from 'react-responsive-mixin'; | ||
import defaultProps from './default-props'; | ||
@@ -21,22 +18,25 @@ var Slider = React.createClass({ | ||
componentDidMount: function () { | ||
var breakpoints = _sortBy(_pluck(this.props.responsive, 'breakpoint')); | ||
if (this.props.responsive) { | ||
var breakpoints = this.props.responsive.map(breakpt => breakpt.breakpoint); | ||
breakpoints.sort((x, y) => x - y); | ||
breakpoints.forEach(function (breakpoint, index) { | ||
var query; | ||
if (index === 0) { | ||
query = json2mq({minWidth: 0, maxWidth: breakpoint}); | ||
} else { | ||
query = json2mq({minWidth: breakpoints[index-1], maxWidth: breakpoint}); | ||
} | ||
this.media(query, function () { | ||
this.setState({breakpoint: breakpoint}); | ||
}.bind(this)); | ||
}.bind(this)); | ||
breakpoints.forEach((breakpoint, index) => { | ||
var bQuery; | ||
if (index === 0) { | ||
bQuery = json2mq({minWidth: 0, maxWidth: breakpoint}); | ||
} else { | ||
bQuery = json2mq({minWidth: breakpoints[index-1], maxWidth: breakpoint}); | ||
} | ||
this.media(bQuery, () => { | ||
this.setState({breakpoint: breakpoint}); | ||
}); | ||
}); | ||
// Register media query for full screen. Need to support resize from small to large | ||
var query = json2mq({minWidth: breakpoints.slice(-1)[0]}); | ||
// Register media query for full screen. Need to support resize from small to large | ||
var query = json2mq({minWidth: breakpoints.slice(-1)[0]}); | ||
this.media(query, function () { | ||
this.setState({breakpoint: null}); | ||
}.bind(this)); | ||
this.media(query, () => { | ||
this.setState({breakpoint: null}); | ||
}); | ||
} | ||
}, | ||
@@ -47,10 +47,19 @@ render: function () { | ||
if (this.state.breakpoint) { | ||
newProps = _filter(this.props.responsive, {breakpoint: this.state.breakpoint}); | ||
settings = _assign({}, this.props, newProps[0].settings); | ||
newProps = this.props.responsive.filter(resp => resp.breakpoint === this.state.breakpoint); | ||
settings = newProps[0].settings === 'unslick' ? 'unslick' : assign({}, this.props, newProps[0].settings); | ||
} else { | ||
settings = this.props; | ||
settings = assign({}, defaultProps, this.props); | ||
} | ||
return ( | ||
<InnerSlider {...settings}/> | ||
); | ||
if (settings === 'unslick') { | ||
// if 'unslick' responsive breakpoint setting used, just return the <Slider> tag nested HTML | ||
return ( | ||
<div>{this.props.children}</div> | ||
); | ||
} else { | ||
return ( | ||
<InnerSlider {...settings}> | ||
{this.props.children} | ||
</InnerSlider> | ||
); | ||
} | ||
} | ||
@@ -57,0 +66,0 @@ }); |
@@ -10,3 +10,3 @@ var webpack = require('webpack'); | ||
libraryTarget: 'umd', | ||
path: path.join(__dirname, 'dist'), | ||
path: path.join(__dirname, 'dist') | ||
}, | ||
@@ -16,7 +16,7 @@ | ||
loaders: [ | ||
{test: /\.jsx$/, loaders: ['babel']}, | ||
], | ||
{test: /\.jsx$/, loaders: ['babel']} | ||
] | ||
}, | ||
resolve : { | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'] | ||
@@ -27,7 +27,7 @@ }, | ||
{ | ||
"react": { | ||
root: "React", | ||
commonjs2: "react", | ||
commonjs: "react", | ||
amd: "react" | ||
'react': { | ||
root: 'React', | ||
commonjs2: 'react', | ||
commonjs: 'react', | ||
amd: 'react' | ||
} | ||
@@ -46,2 +46,2 @@ } | ||
] | ||
}; | ||
}; |
@@ -8,3 +8,7 @@ var webpack = require('webpack'); | ||
entry: { | ||
'docs.js': './docs/index.jsx' | ||
'docs.js': [ | ||
'./docs/index.jsx', | ||
'webpack/hot/only-dev-server', | ||
'webpack-dev-server/client?http://localhost:8000' | ||
] | ||
}, | ||
@@ -17,8 +21,8 @@ output: { | ||
loaders: [ | ||
{test: /\.jsx$/, loaders: ['babel']}, | ||
{test: /\.jsx$/, loaders: ['react-hot', 'babel']}, | ||
{test: /\.js$/, loaders: ['babel'], exclude: /node_modules/}, | ||
{ | ||
test: /\.scss$/, | ||
loader: 'style!css!postcss!sass?outputStyle=expanded&includePaths[]=' + | ||
(path.resolve(__dirname, './node_modules')) + '&includePaths[]=' + (path.resolve(__dirname, './bower_components')) | ||
loader: 'style!css!sass?outputStyle=expanded&' + 'includePaths[]=' + | ||
(path.resolve(__dirname, './node_modules')) | ||
}, | ||
@@ -30,5 +34,2 @@ { test: /\.md$/, loader: 'html!markdown' } | ||
resolve: { | ||
alias: { | ||
}, | ||
extensions: ['', '.js', '.jsx'] | ||
@@ -38,4 +39,5 @@ }, | ||
new webpack.HotModuleReplacementPlugin(), | ||
new webpack.NoErrorsPlugin(), | ||
new webpack.IgnorePlugin(/vertx/) | ||
] | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6
59
100
4
662169
30
13749
- Removedlodash.assign@^3.2.0
- Removedlodash.filter@^3.1.1
- Removedlodash.pluck@^3.1.2
- Removedlodash.sortby@^3.1.4
- Removedlodash._arrayfilter@3.0.0(transitive)
- Removedlodash._arraymap@3.0.0(transitive)
- Removedlodash._baseassign@3.2.0(transitive)
- Removedlodash._basecallback@3.3.1(transitive)
- Removedlodash._basecompareascending@3.0.2(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._baseeach@3.0.4(transitive)
- Removedlodash._basefilter@3.0.0(transitive)
- Removedlodash._baseget@3.7.2(transitive)
- Removedlodash._baseisequal@3.0.7(transitive)
- Removedlodash._basesortby@3.0.0(transitive)
- Removedlodash._bindcallback@3.0.1(transitive)
- Removedlodash._createassigner@3.1.1(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._topath@3.8.1(transitive)
- Removedlodash.assign@3.2.0(transitive)
- Removedlodash.filter@3.1.1(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.istypedarray@3.0.6(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.map@3.1.4(transitive)
- Removedlodash.pairs@3.0.1(transitive)
- Removedlodash.pluck@3.1.2(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.sortby@3.1.5(transitive)