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.6.0 to 0.6.1

8

dist/react-slick.js

@@ -1826,5 +1826,7 @@ (function webpackUniversalModuleDefinition(root, factory) {

componentWillUnmount: function () {
this._responsiveMediaHandlers.forEach(function(obj) {
enquire.unregister(obj.query, obj.handler);
});
if (this._responsiveMediaHandlers) {
this._responsiveMediaHandlers.forEach(function(obj) {
enquire.unregister(obj.query, obj.handler);
});
}
}

@@ -1831,0 +1833,0 @@ };

@@ -6,2 +6,2 @@ !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){/*!

*/
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})}])});
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&&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})}])});

@@ -60,3 +60,2 @@ 'use strict';

});
e.preventDefault();
},

@@ -111,6 +110,11 @@ swipeMove: function swipeMove(e) {

});
e.preventDefault();
if (Math.abs(touchObject.curX - touchObject.startX) < Math.abs(touchObject.curY - touchObject.startY) * 0.8) {
return;
}
if (touchObject.swipeLength > 4) {
e.preventDefault();
}
},
swipeEnd: function swipeEnd(e) {
e.preventDefault();
if (!this.state.dragging) {

@@ -136,2 +140,3 @@ return;

if (touchObject.swipeLength > minSwipe) {
e.preventDefault();
if (swipeDirection === 'left') {

@@ -138,0 +143,0 @@ this.slideHandler(this.state.currentSlide + this.props.slidesToScroll);

{
"name": "react-slick",
"version": "0.6.0",
"version": "0.6.1",
"description": " React port of slick carousel",

@@ -8,3 +8,4 @@ "main": "./lib",

"start": "./node_modules/.bin/gulp server",
"prepublish": "./node_modules/.bin/babel ./src --out-dir ./lib && ./node_modules/.bin/gulp dist"
"prepublish": "./node_modules/.bin/babel ./src --out-dir ./lib && ./node_modules/.bin/gulp dist",
"test": "karma start"
},

@@ -11,0 +12,0 @@ "author": "Kiran Abburi",

Sorry, the diff of this file is not supported yet

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