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

react-slick

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-slick - npm Package Compare versions

Comparing version 0.15.1 to 0.15.2

2

dist/react-slick.min.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.Slider=e(require("react"),require("react-dom")):t.Slider=e(t.React,t.ReactDOM)}(this,function(t,e){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";t.exports=i(1)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},l=i(2),c=s(l),d=i(3),u=i(7),p=s(u),h=i(21),f=s(h),g=i(10),y=s(g),v=i(23),m=s(v),S=m.default&&i(24),w=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i));return s.state={breakpoint:null},s._responsiveMediaHandlers=[],s.innerSliderRefHandler=s.innerSliderRefHandler.bind(s),s}return o(e,t),e.prototype.innerSliderRefHandler=function(t){this.innerSlider=t},e.prototype.media=function(t,e){S.register(t,e),this._responsiveMediaHandlers.push({query:t,handler:e})},e.prototype.componentWillMount=function(){var t=this;if(this.props.responsive){var e=this.props.responsive.map(function(t){return t.breakpoint});e.sort(function(t,e){return t-e}),e.forEach(function(i,s){var n;n=0===s?(0,f.default)({minWidth:0,maxWidth:i}):(0,f.default)({minWidth:e[s-1],maxWidth:i}),m.default&&t.media(n,function(){t.setState({breakpoint:i})})});var i=(0,f.default)({minWidth:e.slice(-1)[0]});m.default&&this.media(i,function(){t.setState({breakpoint:null})})}},e.prototype.componentWillUnmount=function(){this._responsiveMediaHandlers.forEach(function(t){S.unregister(t.query,t.handler)})},e.prototype.slickPrev=function(){this.innerSlider.slickPrev()},e.prototype.slickNext=function(){this.innerSlider.slickNext()},e.prototype.slickGoTo=function(t){this.innerSlider.slickGoTo(t)},e.prototype.render=function(){var t,e,i=this;this.state.breakpoint?(e=this.props.responsive.filter(function(t){return t.breakpoint===i.state.breakpoint}),t="unslick"===e[0].settings?"unslick":(0,p.default)({},this.props,e[0].settings)):t=(0,p.default)({},y.default,this.props);var s=this.props.children;return Array.isArray(s)||(s=[s]),s=s.filter(function(t){return!!t}),"unslick"===t?c.default.createElement("div",{className:this.props.className+" unslicked"},s):c.default.createElement(d.InnerSlider,a({ref:this.innerSliderRefHandler},t),s)},e}(c.default.Component);e.default=w},function(e,i){e.exports=t},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.InnerSlider=void 0;var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},r=i(2),o=s(r),a=i(4),l=s(a),c=i(8),d=s(c),u=i(9),p=s(u),h=i(10),f=s(h),g=i(11),y=s(g),v=i(17),m=s(v),S=i(7),w=s(S),b=i(18),T=i(19),k=i(20);e.InnerSlider=(0,y.default)({displayName:"InnerSlider",mixins:[d.default,l.default],list:null,track:null,listRefHandler:function(t){this.list=t},trackRefHandler:function(t){this.track=t},getInitialState:function(){return n({},p.default,{currentSlide:this.props.initialSlide})},getDefaultProps:function(){return f.default},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var t=[],e=0;e<o.default.Children.count(this.props.children);e++)e>=this.state.currentSlide&&e<this.state.currentSlide+this.props.slidesToShow&&t.push(e);this.props.lazyLoad&&0===this.state.lazyLoadedList.length&&this.setState({lazyLoadedList:t})},componentDidMount:function(){this.initialize(this.props),this.adaptHeight(),window&&(window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized))},componentWillUnmount:function(){this.animationEndCallback&&clearTimeout(this.animationEndCallback),window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized),this.state.autoPlayTimer&&clearInterval(this.state.autoPlayTimer)},componentWillReceiveProps:function(t){this.props.slickGoTo!=t.slickGoTo?(console.warn("react-slick deprecation warning: slickGoTo prop is deprecated and it will be removed in next release. Use slickGoTo method instead"),this.changeSlide({message:"index",index:t.slickGoTo,currentSlide:this.state.currentSlide})):this.state.currentSlide>=t.children.length?(this.update(t),this.changeSlide({message:"index",index:t.children.length-t.slidesToShow,currentSlide:this.state.currentSlide})):this.update(t)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.update(this.props),this.setState({animating:!1}),clearTimeout(this.animationEndCallback),delete this.animationEndCallback},slickPrev:function(){this.changeSlide({message:"previous"})},slickNext:function(){this.changeSlide({message:"next"})},slickGoTo:function(t){t=Number(t),!isNaN(t)&&this.changeSlide({message:"index",index:t,currentSlide:this.state.currentSlide})},render:function(){var t,e=(0,m.default)("slick-initialized","slick-slider",this.props.className,{"slick-vertical":this.props.vertical}),i={fade:this.props.fade,cssEase:this.props.cssEase,speed:this.props.speed,infinite:this.props.infinite,centerMode:this.props.centerMode,focusOnSelect:this.props.focusOnSelect?this.selectHandler:null,currentSlide:this.state.currentSlide,lazyLoad:this.props.lazyLoad,lazyLoadedList:this.state.lazyLoadedList,rtl:this.props.rtl,slideWidth:this.state.slideWidth,slidesToShow:this.props.slidesToShow,slidesToScroll:this.props.slidesToScroll,slideCount:this.state.slideCount,trackStyle:this.state.trackStyle,variableWidth:this.props.variableWidth};if(this.props.dots===!0&&this.state.slideCount>=this.props.slidesToShow){var s={dotsClass:this.props.dotsClass,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,currentSlide:this.state.currentSlide,slidesToScroll:this.props.slidesToScroll,clickHandler:this.changeSlide,children:this.props.children,customPaging:this.props.customPaging};t=o.default.createElement(T.Dots,s)}var r,a,l={infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,prevArrow:this.props.prevArrow,nextArrow:this.props.nextArrow,clickHandler:this.changeSlide};this.props.arrows&&(r=o.default.createElement(k.PrevArrow,l),a=o.default.createElement(k.NextArrow,l));var c=null;this.props.vertical&&(c={height:this.state.listHeight});var d=null;this.props.vertical===!1?this.props.centerMode===!0&&(d={padding:"0px "+this.props.centerPadding}):this.props.centerMode===!0&&(d={padding:this.props.centerPadding+" 0px"});var u=(0,w.default)({},c,d);return o.default.createElement("div",{className:e,onMouseEnter:this.onInnerSliderEnter,onMouseLeave:this.onInnerSliderLeave,onMouseOver:this.onInnerSliderOver},r,o.default.createElement("div",{ref:this.listRefHandler,className:"slick-list",style:u,onMouseDown:this.swipeStart,onMouseMove:this.state.dragging?this.swipeMove:null,onMouseUp:this.swipeEnd,onMouseLeave:this.state.dragging?this.swipeEnd:null,onTouchStart:this.swipeStart,onTouchMove:this.state.dragging?this.swipeMove:null,onTouchEnd:this.swipeEnd,onTouchCancel:this.state.dragging?this.swipeEnd:null,onKeyDown:this.props.accessibility?this.keyHandler:null},o.default.createElement(b.Track,n({ref:this.trackRefHandler},i),this.props.children)),a,t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(5),r=i(8),o=(s(r),i(7)),a=s(o),l=i(6),c=s(l),d={changeSlide:function(t){var e,i,s,n,r,o=this.props,a=o.slidesToScroll,l=o.slidesToShow,c=this.state,d=c.slideCount,u=c.currentSlide;if(n=d%a!==0,e=n?0:(d-u)%a,"previous"===t.message)s=0===e?a:l-e,r=u-s,this.props.lazyLoad&&(i=u-s,r=i===-1?d-1:i);else if("next"===t.message)s=0===e?a:e,r=u+s,this.props.lazyLoad&&(r=(u+a)%d+e);else if("dots"===t.message||"children"===t.message){if(r=t.index*t.slidesToScroll,r===t.currentSlide)return}else if("index"===t.message&&(r=Number(t.index),r===t.currentSlide))return;this.slideHandler(r)},keyHandler:function(t){t.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===t.keyCode&&this.props.accessibility===!0?this.changeSlide({message:this.props.rtl===!0?"next":"previous"}):39===t.keyCode&&this.props.accessibility===!0&&this.changeSlide({message:this.props.rtl===!0?"previous":"next"}))},selectHandler:function(t){this.changeSlide(t)},swipeStart:function(t){var e,i;this.props.swipe===!1||"ontouchend"in document&&this.props.swipe===!1||this.props.draggable===!1&&t.type.indexOf("mouse")!==-1||(e=void 0!==t.touches?t.touches[0].pageX:t.clientX,i=void 0!==t.touches?t.touches[0].pageY:t.clientY,this.setState({dragging:!0,touchObject:{startX:e,startY:i,curX:e,curY:i}}))},swipeMove:function(t){if(!this.state.dragging)return void t.preventDefault();if(!this.state.scrolling){if(this.state.animating)return void t.preventDefault();this.props.vertical&&this.props.swipeToSlide&&this.props.verticalSwiping&&t.preventDefault();var e,i,s,r=this.state.touchObject,o=this.state.listWidth/this.props.touchThreshold;this.props.verticalSwiping&&(o=this.state.listHeight/this.props.touchThreshold),i=(0,n.getTrackLeft)((0,a.default)({slideIndex:this.state.currentSlide,trackRef:this.track},this.props,this.state)),r.curX=t.touches?t.touches[0].pageX:t.clientX,r.curY=t.touches?t.touches[0].pageY:t.clientY,r.swipeLength=Math.round(Math.sqrt(Math.pow(r.curX-r.startX,2)));var l=Math.round(Math.sqrt(Math.pow(r.curY-r.startY,2)));if(!this.props.verticalSwiping&&!this.state.swiping&&l>o)return void this.setState({scrolling:!0});this.props.verticalSwiping&&(r.swipeLength=l),s=(this.props.rtl===!1?1:-1)*(r.curX>r.startX?1:-1),this.props.verticalSwiping&&(s=r.curY>r.startY?1:-1);var c=this.state.currentSlide,d=Math.ceil(this.state.slideCount/this.props.slidesToScroll),u=this.swipeDirection(this.state.touchObject),p=r.swipeLength;this.props.infinite===!1&&(0===c&&"right"===u||c+1>=d&&"left"===u)&&(p=r.swipeLength*this.props.edgeFriction,this.state.edgeDragged===!1&&this.props.edgeEvent&&(this.props.edgeEvent(u),this.setState({edgeDragged:!0}))),this.state.swiped===!1&&this.props.swipeEvent&&(this.props.swipeEvent(u),this.setState({swiped:!0})),e=this.props.vertical?i+p*(this.state.listHeight/this.state.listWidth)*s:i+p*s,this.props.verticalSwiping&&(e=i+p*s),this.setState({touchObject:r,swipeLeft:e,trackStyle:(0,n.getTrackCSS)((0,a.default)({left:e},this.props,this.state))}),Math.abs(r.curX-r.startX)<.8*Math.abs(r.curY-r.startY)||r.swipeLength>o&&(this.setState({swiping:!0}),t.preventDefault())}},getNavigableIndexes:function(){var t=void 0,e=0,i=0,s=[];for(this.props.infinite?(e=this.props.slidesToShow*-1,i=this.props.slidesToShow*-1,t=2*this.state.slideCount):t=this.state.slideCount;e<t;)s.push(e),e=i+this.props.slidesToScroll,i+=this.props.slidesToScroll<=this.props.slidesToShow?this.props.slidesToScroll:this.props.slidesToShow;return s},checkNavigable:function(t){var e=this.getNavigableIndexes(),i=0;if(t>e[e.length-1])t=e[e.length-1];else for(var s in e){if(t<e[s]){t=i;break}i=e[s]}return t},getSlideCount:function(){var t=this,e=this.props.centerMode?this.state.slideWidth*Math.floor(this.props.slidesToShow/2):0;if(this.props.swipeToSlide){var i=void 0,s=c.default.findDOMNode(this.list),n=s.querySelectorAll(".slick-slide");Array.from(n).every(function(s){if(t.props.vertical){if(s.offsetTop+t.getHeight(s)/2>t.state.swipeLeft*-1)return i=s,!1}else if(s.offsetLeft-e+t.getWidth(s)/2>t.state.swipeLeft*-1)return i=s,!1;return!0});var r=Math.abs(i.dataset.index-this.state.currentSlide)||1;return r}return this.props.slidesToScroll},swipeEnd:function(t){if(!this.state.dragging)return void(this.props.swipe&&t.preventDefault());var e=this.state.touchObject,i=this.state.listWidth/this.props.touchThreshold,s=this.swipeDirection(e);this.props.verticalSwiping&&(i=this.state.listHeight/this.props.touchThreshold);var r=this.state.scrolling;if(this.setState({dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}}),!r&&e.swipeLength)if(e.swipeLength>i){t.preventDefault();var o=void 0,l=void 0;switch(s){case"left":case"down":l=this.state.currentSlide+this.getSlideCount(),o=this.props.swipeToSlide?this.checkNavigable(l):l,this.state.currentDirection=0;break;case"right":case"up":l=this.state.currentSlide-this.getSlideCount(),o=this.props.swipeToSlide?this.checkNavigable(l):l,this.state.currentDirection=1;break;default:o=this.state.currentSlide}this.slideHandler(o)}else{var c=(0,n.getTrackLeft)((0,a.default)({slideIndex:this.state.currentSlide,trackRef:this.track},this.props,this.state));this.setState({trackStyle:(0,n.getTrackAnimateCSS)((0,a.default)({left:c},this.props,this.state))})}},onInnerSliderEnter:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.pause()},onInnerSliderOver:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.pause()},onInnerSliderLeave:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.autoPlay()}};e.default=d},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.getTrackLeft=e.getTrackAnimateCSS=e.getTrackCSS=void 0;var n=i(6),r=s(n),o=i(7),a=s(o),l=function(t,e){return e.reduce(function(e,i){return e&&t.hasOwnProperty(i)},!0)?null:console.error("Keys Missing",t)},c=e.getTrackCSS=function(t){l(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var e,i,s=t.slideCount+2*t.slidesToShow;t.vertical?i=s*t.slideHeight:e=t.variableWidth?(t.slideCount+2*t.slidesToShow)*t.slideWidth:t.centerMode?(t.slideCount+2*(t.slidesToShow+1))*t.slideWidth:(t.slideCount+2*t.slidesToShow)*t.slideWidth;var n={opacity:1,WebkitTransform:t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",transform:t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",transition:"",WebkitTransition:"",msTransform:t.vertical?"translateY("+t.left+"px)":"translateX("+t.left+"px)"};return e&&(0,a.default)(n,{width:e}),i&&(0,a.default)(n,{height:i}),window&&!window.addEventListener&&window.attachEvent&&(t.vertical?n.marginTop=t.left+"px":n.marginLeft=t.left+"px"),n};e.getTrackAnimateCSS=function(t){l(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var e=c(t);return e.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,e.transition="transform "+t.speed+"ms "+t.cssEase,e},e.getTrackLeft=function(t){l(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var e,i,s=0,n=0;if(t.fade)return 0;if(t.infinite)t.slideCount>=t.slidesToShow&&(s=t.slideWidth*t.slidesToShow*-1,n=t.slideHeight*t.slidesToShow*-1),t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow&&(t.slideIndex>t.slideCount?(s=(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideWidth*-1,n=(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideHeight*-1):(s=t.slideCount%t.slidesToScroll*t.slideWidth*-1,n=t.slideCount%t.slidesToScroll*t.slideHeight*-1));else if(t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow){var o=t.slidesToShow-t.slideCount%t.slidesToScroll;s=o*t.slideWidth}if(t.centerMode&&(t.infinite?s+=t.slideWidth*Math.floor(t.slidesToShow/2):s=t.slideWidth*Math.floor(t.slidesToShow/2)),e=t.vertical?t.slideIndex*t.slideHeight*-1+n:t.slideIndex*t.slideWidth*-1+s,t.variableWidth===!0){var a;t.slideCount<=t.slidesToShow||t.infinite===!1?i=r.default.findDOMNode(t.trackRef).childNodes[t.slideIndex]:(a=t.slideIndex+t.slidesToShow,i=r.default.findDOMNode(t.trackRef).childNodes[a]),e=i?i.offsetLeft*-1:0,t.centerMode===!0&&(i=t.infinite===!1?r.default.findDOMNode(t.trackRef).children[t.slideIndex]:r.default.findDOMNode(t.trackRef).children[t.slideIndex+t.slidesToShow+1],i&&(e=i.offsetLeft*-1+(t.listWidth-i.offsetWidth)/2))}return e}},function(t,i){t.exports=e},function(t,e){/*
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.Slider=e(require("react"),require("react-dom")):t.Slider=e(t.React,t.ReactDOM)}(this,function(t,e){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";t.exports=i(1)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},l=i(2),c=s(l),d=i(3),u=i(7),p=s(u),h=i(21),f=s(h),g=i(10),y=s(g),v=i(23),m=s(v),S=m.default&&i(24),w=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i));return s.state={breakpoint:null},s._responsiveMediaHandlers=[],s.innerSliderRefHandler=s.innerSliderRefHandler.bind(s),s}return o(e,t),e.prototype.innerSliderRefHandler=function(t){this.innerSlider=t},e.prototype.media=function(t,e){S.register(t,e),this._responsiveMediaHandlers.push({query:t,handler:e})},e.prototype.componentWillMount=function(){var t=this;if(this.props.responsive){var e=this.props.responsive.map(function(t){return t.breakpoint});e.sort(function(t,e){return t-e}),e.forEach(function(i,s){var n;n=0===s?(0,f.default)({minWidth:0,maxWidth:i}):(0,f.default)({minWidth:e[s-1],maxWidth:i}),m.default&&t.media(n,function(){t.setState({breakpoint:i})})});var i=(0,f.default)({minWidth:e.slice(-1)[0]});m.default&&this.media(i,function(){t.setState({breakpoint:null})})}},e.prototype.componentWillUnmount=function(){this._responsiveMediaHandlers.forEach(function(t){S.unregister(t.query,t.handler)})},e.prototype.slickPrev=function(){this.innerSlider.slickPrev()},e.prototype.slickNext=function(){this.innerSlider.slickNext()},e.prototype.slickGoTo=function(t){this.innerSlider.slickGoTo(t)},e.prototype.render=function(){var t,e,i=this;this.state.breakpoint?(e=this.props.responsive.filter(function(t){return t.breakpoint===i.state.breakpoint}),t="unslick"===e[0].settings?"unslick":(0,p.default)({},this.props,e[0].settings)):t=(0,p.default)({},y.default,this.props);var s=this.props.children;return Array.isArray(s)||(s=[s]),s=s.filter(function(t){return!!t}),"unslick"===t?c.default.createElement("div",{className:this.props.className+" unslicked"},s):c.default.createElement(d.InnerSlider,a({ref:this.innerSliderRefHandler},t),s)},e}(c.default.Component);e.default=w},function(e,i){e.exports=t},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.InnerSlider=void 0;var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},r=i(2),o=s(r),a=i(4),l=s(a),c=i(8),d=s(c),u=i(9),p=s(u),h=i(10),f=s(h),g=i(11),y=s(g),v=i(17),m=s(v),S=i(7),w=s(S),b=i(18),T=i(19),k=i(20);e.InnerSlider=(0,y.default)({displayName:"InnerSlider",mixins:[d.default,l.default],list:null,track:null,listRefHandler:function(t){this.list=t},trackRefHandler:function(t){this.track=t},getInitialState:function(){return n({},p.default,{currentSlide:this.props.initialSlide})},getDefaultProps:function(){return f.default},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var t=[],e=0;e<o.default.Children.count(this.props.children);e++)e>=this.state.currentSlide&&e<this.state.currentSlide+this.props.slidesToShow&&t.push(e);this.props.lazyLoad&&0===this.state.lazyLoadedList.length&&this.setState({lazyLoadedList:t})},componentDidMount:function(){this.initialize(this.props),this.adaptHeight(),window&&(window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized))},componentWillUnmount:function(){this.animationEndCallback&&clearTimeout(this.animationEndCallback),window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized),this.state.autoPlayTimer&&clearInterval(this.state.autoPlayTimer)},componentWillReceiveProps:function(t){this.props.slickGoTo!=t.slickGoTo?(console.warn("react-slick deprecation warning: slickGoTo prop is deprecated and it will be removed in next release. Use slickGoTo method instead"),this.changeSlide({message:"index",index:t.slickGoTo,currentSlide:this.state.currentSlide})):this.state.currentSlide>=t.children.length?(this.update(t),this.changeSlide({message:"index",index:t.children.length-t.slidesToShow,currentSlide:this.state.currentSlide})):this.update(t)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.update(this.props),this.setState({animating:!1}),clearTimeout(this.animationEndCallback),delete this.animationEndCallback},slickPrev:function(){this.changeSlide({message:"previous"})},slickNext:function(){this.changeSlide({message:"next"})},slickGoTo:function(t){t=Number(t),!isNaN(t)&&this.changeSlide({message:"index",index:t,currentSlide:this.state.currentSlide})},render:function(){var t,e=(0,m.default)("slick-initialized","slick-slider",this.props.className,{"slick-vertical":this.props.vertical}),i={fade:this.props.fade,cssEase:this.props.cssEase,speed:this.props.speed,infinite:this.props.infinite,centerMode:this.props.centerMode,focusOnSelect:this.props.focusOnSelect?this.selectHandler:null,currentSlide:this.state.currentSlide,lazyLoad:this.props.lazyLoad,lazyLoadedList:this.state.lazyLoadedList,rtl:this.props.rtl,slideWidth:this.state.slideWidth,slidesToShow:this.props.slidesToShow,slidesToScroll:this.props.slidesToScroll,slideCount:this.state.slideCount,trackStyle:this.state.trackStyle,variableWidth:this.props.variableWidth};if(this.props.dots===!0&&this.state.slideCount>=this.props.slidesToShow){var s={dotsClass:this.props.dotsClass,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,currentSlide:this.state.currentSlide,slidesToScroll:this.props.slidesToScroll,clickHandler:this.changeSlide,children:this.props.children,customPaging:this.props.customPaging};t=o.default.createElement(T.Dots,s)}var r,a,l={infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,prevArrow:this.props.prevArrow,nextArrow:this.props.nextArrow,clickHandler:this.changeSlide};this.props.arrows&&(r=o.default.createElement(k.PrevArrow,l),a=o.default.createElement(k.NextArrow,l));var c=null;this.props.vertical&&(c={height:this.state.listHeight});var d=null;this.props.vertical===!1?this.props.centerMode===!0&&(d={padding:"0px "+this.props.centerPadding}):this.props.centerMode===!0&&(d={padding:this.props.centerPadding+" 0px"});var u=(0,w.default)({},c,d);return o.default.createElement("div",{className:e,onMouseEnter:this.onInnerSliderEnter,onMouseLeave:this.onInnerSliderLeave,onMouseOver:this.onInnerSliderOver},r,o.default.createElement("div",{ref:this.listRefHandler,className:"slick-list",style:u,onMouseDown:this.swipeStart,onMouseMove:this.state.dragging?this.swipeMove:null,onMouseUp:this.swipeEnd,onMouseLeave:this.state.dragging?this.swipeEnd:null,onTouchStart:this.swipeStart,onTouchMove:this.state.dragging?this.swipeMove:null,onTouchEnd:this.swipeEnd,onTouchCancel:this.state.dragging?this.swipeEnd:null,onKeyDown:this.props.accessibility?this.keyHandler:null},o.default.createElement(b.Track,n({ref:this.trackRefHandler},i),this.props.children)),a,t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(5),r=i(8),o=(s(r),i(7)),a=s(o),l=i(6),c=s(l),d={changeSlide:function(t){var e,i,s,n,r,o=this.props,a=o.slidesToScroll,l=o.slidesToShow,c=this.state,d=c.slideCount,u=c.currentSlide;if(n=d%a!==0,e=n?0:(d-u)%a,"previous"===t.message)s=0===e?a:l-e,r=u-s,this.props.lazyLoad&&(i=u-s,r=i===-1?d-1:i);else if("next"===t.message)s=0===e?a:e,r=u+s,this.props.lazyLoad&&(r=(u+a)%d+e);else if("dots"===t.message||"children"===t.message){if(r=t.index*t.slidesToScroll,r===t.currentSlide)return}else if("index"===t.message&&(r=Number(t.index),r===t.currentSlide))return;this.slideHandler(r)},keyHandler:function(t){t.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===t.keyCode&&this.props.accessibility===!0?this.changeSlide({message:this.props.rtl===!0?"next":"previous"}):39===t.keyCode&&this.props.accessibility===!0&&this.changeSlide({message:this.props.rtl===!0?"previous":"next"}))},selectHandler:function(t){this.changeSlide(t)},swipeStart:function(t){var e,i;this.props.swipe===!1||"ontouchend"in document&&this.props.swipe===!1||this.props.draggable===!1&&t.type.indexOf("mouse")!==-1||(e=void 0!==t.touches?t.touches[0].pageX:t.clientX,i=void 0!==t.touches?t.touches[0].pageY:t.clientY,this.setState({dragging:!0,touchObject:{startX:e,startY:i,curX:e,curY:i}}))},swipeMove:function(t){if(!this.state.dragging)return void t.preventDefault();if(!this.state.scrolling){if(this.state.animating)return void t.preventDefault();this.props.vertical&&this.props.swipeToSlide&&this.props.verticalSwiping&&t.preventDefault();var e,i,s,r=this.state.touchObject;i=(0,n.getTrackLeft)((0,a.default)({slideIndex:this.state.currentSlide,trackRef:this.track},this.props,this.state)),r.curX=t.touches?t.touches[0].pageX:t.clientX,r.curY=t.touches?t.touches[0].pageY:t.clientY,r.swipeLength=Math.round(Math.sqrt(Math.pow(r.curX-r.startX,2)));var o=Math.round(Math.sqrt(Math.pow(r.curY-r.startY,2)));if(!this.props.verticalSwiping&&!this.state.swiping&&o>4)return void this.setState({scrolling:!0});this.props.verticalSwiping&&(r.swipeLength=o),s=(this.props.rtl===!1?1:-1)*(r.curX>r.startX?1:-1),this.props.verticalSwiping&&(s=r.curY>r.startY?1:-1);var l=this.state.currentSlide,c=Math.ceil(this.state.slideCount/this.props.slidesToScroll),d=this.swipeDirection(this.state.touchObject),u=r.swipeLength;this.props.infinite===!1&&(0===l&&"right"===d||l+1>=c&&"left"===d)&&(u=r.swipeLength*this.props.edgeFriction,this.state.edgeDragged===!1&&this.props.edgeEvent&&(this.props.edgeEvent(d),this.setState({edgeDragged:!0}))),this.state.swiped===!1&&this.props.swipeEvent&&(this.props.swipeEvent(d),this.setState({swiped:!0})),e=this.props.vertical?i+u*(this.state.listHeight/this.state.listWidth)*s:i+u*s,this.props.verticalSwiping&&(e=i+u*s),this.setState({touchObject:r,swipeLeft:e,trackStyle:(0,n.getTrackCSS)((0,a.default)({left:e},this.props,this.state))}),Math.abs(r.curX-r.startX)<.8*Math.abs(r.curY-r.startY)||r.swipeLength>4&&(this.setState({swiping:!0}),t.preventDefault())}},getNavigableIndexes:function(){var t=void 0,e=0,i=0,s=[];for(this.props.infinite?(e=this.props.slidesToShow*-1,i=this.props.slidesToShow*-1,t=2*this.state.slideCount):t=this.state.slideCount;e<t;)s.push(e),e=i+this.props.slidesToScroll,i+=this.props.slidesToScroll<=this.props.slidesToShow?this.props.slidesToScroll:this.props.slidesToShow;return s},checkNavigable:function(t){var e=this.getNavigableIndexes(),i=0;if(t>e[e.length-1])t=e[e.length-1];else for(var s in e){if(t<e[s]){t=i;break}i=e[s]}return t},getSlideCount:function(){var t=this,e=this.props.centerMode?this.state.slideWidth*Math.floor(this.props.slidesToShow/2):0;if(this.props.swipeToSlide){var i=void 0,s=c.default.findDOMNode(this.list),n=s.querySelectorAll(".slick-slide");Array.from(n).every(function(s){if(t.props.vertical){if(s.offsetTop+t.getHeight(s)/2>t.state.swipeLeft*-1)return i=s,!1}else if(s.offsetLeft-e+t.getWidth(s)/2>t.state.swipeLeft*-1)return i=s,!1;return!0});var r=Math.abs(i.dataset.index-this.state.currentSlide)||1;return r}return this.props.slidesToScroll},swipeEnd:function(t){if(!this.state.dragging)return void(this.props.swipe&&t.preventDefault());var e=this.state.touchObject,i=this.state.listWidth/this.props.touchThreshold,s=this.swipeDirection(e);this.props.verticalSwiping&&(i=this.state.listHeight/this.props.touchThreshold);var r=this.state.scrolling;if(this.setState({dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}}),!r&&e.swipeLength)if(e.swipeLength>i){t.preventDefault();var o=void 0,l=void 0;switch(s){case"left":case"down":l=this.state.currentSlide+this.getSlideCount(),o=this.props.swipeToSlide?this.checkNavigable(l):l,this.state.currentDirection=0;break;case"right":case"up":l=this.state.currentSlide-this.getSlideCount(),o=this.props.swipeToSlide?this.checkNavigable(l):l,this.state.currentDirection=1;break;default:o=this.state.currentSlide}this.slideHandler(o)}else{var c=(0,n.getTrackLeft)((0,a.default)({slideIndex:this.state.currentSlide,trackRef:this.track},this.props,this.state));this.setState({trackStyle:(0,n.getTrackAnimateCSS)((0,a.default)({left:c},this.props,this.state))})}},onInnerSliderEnter:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.pause()},onInnerSliderOver:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.pause()},onInnerSliderLeave:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.autoPlay()}};e.default=d},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.getTrackLeft=e.getTrackAnimateCSS=e.getTrackCSS=void 0;var n=i(6),r=s(n),o=i(7),a=s(o),l=function(t,e){return e.reduce(function(e,i){return e&&t.hasOwnProperty(i)},!0)?null:console.error("Keys Missing",t)},c=e.getTrackCSS=function(t){l(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var e,i,s=t.slideCount+2*t.slidesToShow;t.vertical?i=s*t.slideHeight:e=t.variableWidth?(t.slideCount+2*t.slidesToShow)*t.slideWidth:t.centerMode?(t.slideCount+2*(t.slidesToShow+1))*t.slideWidth:(t.slideCount+2*t.slidesToShow)*t.slideWidth;var n={opacity:1,WebkitTransform:t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",transform:t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",transition:"",WebkitTransition:"",msTransform:t.vertical?"translateY("+t.left+"px)":"translateX("+t.left+"px)"};return e&&(0,a.default)(n,{width:e}),i&&(0,a.default)(n,{height:i}),window&&!window.addEventListener&&window.attachEvent&&(t.vertical?n.marginTop=t.left+"px":n.marginLeft=t.left+"px"),n};e.getTrackAnimateCSS=function(t){l(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var e=c(t);return e.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,e.transition="transform "+t.speed+"ms "+t.cssEase,e},e.getTrackLeft=function(t){l(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var e,i,s=0,n=0;if(t.fade)return 0;if(t.infinite)t.slideCount>=t.slidesToShow&&(s=t.slideWidth*t.slidesToShow*-1,n=t.slideHeight*t.slidesToShow*-1),t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow&&(t.slideIndex>t.slideCount?(s=(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideWidth*-1,n=(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideHeight*-1):(s=t.slideCount%t.slidesToScroll*t.slideWidth*-1,n=t.slideCount%t.slidesToScroll*t.slideHeight*-1));else if(t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow){var o=t.slidesToShow-t.slideCount%t.slidesToScroll;s=o*t.slideWidth}if(t.centerMode&&(t.infinite?s+=t.slideWidth*Math.floor(t.slidesToShow/2):s=t.slideWidth*Math.floor(t.slidesToShow/2)),e=t.vertical?t.slideIndex*t.slideHeight*-1+n:t.slideIndex*t.slideWidth*-1+s,t.variableWidth===!0){var a;t.slideCount<=t.slidesToShow||t.infinite===!1?i=r.default.findDOMNode(t.trackRef).childNodes[t.slideIndex]:(a=t.slideIndex+t.slidesToShow,i=r.default.findDOMNode(t.trackRef).childNodes[a]),e=i?i.offsetLeft*-1:0,t.centerMode===!0&&(i=t.infinite===!1?r.default.findDOMNode(t.trackRef).children[t.slideIndex]:r.default.findDOMNode(t.trackRef).children[t.slideIndex+t.slidesToShow+1],i&&(e=i.offsetLeft*-1+(t.listWidth-i.offsetWidth)/2))}return e}},function(t,i){t.exports=e},function(t,e){/*
object-assign

@@ -3,0 +3,0 @@ (c) Sindre Sorhus

{
"name": "react-slick",
"version": "0.15.1",
"version": "0.15.2",
"description": " React port of slick carousel",

@@ -5,0 +5,0 @@ "main": "./lib",

@@ -110,4 +110,4 @@ # react-slick

| vertical | bool | Vertical slide mode | Yes |
| afterChange | function | callback function called after the current index changes | Yes |
| beforeChange | function | callback function called before the current index changes | Yes |
| afterChange | function | callback function called after the current index changes. The new index is accessible in the first parameter of the callback function. | Yes |
| beforeChange | function | callback function called before the current index changes. The old and the new indexes are accessible in the first and the second parameters of the callback function respectively. | Yes |
| slickGoTo | int | go to the specified slide number | |

@@ -114,0 +114,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc