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

react-simply-carousel

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simply-carousel - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

2

dist/index.js

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

!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.ReactSimplyCarousel=t(require("react")):e.ReactSimplyCarousel=t(e.React)}(this,(function(e){return(()=>{var t={154:e=>{function t(){return e.exports=t=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},t.apply(this,arguments)}e.exports=t},767:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(154),o=r.n(n),c=r(383),a=r.n(c);function i({responsiveProps:e,...t}){const[r,n]=(0,c.useState)(0),[i,l]=(0,c.useState)(t.activeSlideIndex),s=(0,c.useRef)(null),u=(0,c.useRef)(null),d=(0,c.useRef)(null),m=(0,c.useRef)(null),f=(0,c.useRef)(!1),h=(0,c.useRef)(""),p=(0,c.useRef)(null),v=(0,c.useRef)(null),b=(0,c.useRef)(0),w=e.reduce(((e,{minWidth:t=0,maxWidth:n=null,...o}={})=>r>t&&(!n||r<=n)?{...e,...o}:e),t),y=c.Children.toArray(w.children),{containerProps:{style:g,onClickCapture:x,...E},innerProps:{style:k,...C},itemsListProps:{style:S,onTouchStart:T,onMouseDown:L,onTransitionEnd:P,...M},backwardBtnProps:{children:I=null,show:W=!0,...R},forwardBtnProps:{children:N=null,show:j=!0,...O},activeSlideProps:{className:A="",style:X={},...z},updateOnItemClick:V,activeSlideIndex:D,onRequestChange:B,speed:_,delay:q,easing:F,itemsToShow:G,itemsToScroll:H,children:J,onAfterChange:K,autoplay:Q,autoplayDirection:U,disableNavIfAllVisible:Y,hideNavIfAllVisible:Z,centerMode:$,infinite:ee,disableNavIfEdgeVisible:te,disableNavIfEdgeActive:re}=r?{...w,activeSlideIndex:Math.max(0,Math.min(w.activeSlideIndex,y.length-1)),itemsToShow:Math.min(y.length,w.itemsToShow),itemsToScroll:Math.min(y.length,w.itemsToScroll)}:t,ne=(0,c.useMemo)((()=>r?ee?[...d.current.children].slice(y.length-i,y.length-i+y.length):[...d.current.children]:[]),[i,y.length,r,ee]),oe=r?d.current.offsetWidth-u.current.offsetWidth:0,ce=e=>{const t=ne.reduce(((t,r,n)=>n>=e?t:t+(r.offsetWidth||0)),0);return ee?t:Math.min(oe,t)},ae=(0,c.useMemo)((()=>r&&G?ne.reduce(((e,t,r)=>r>=D&&r<D+G||r<D&&r<D+G-ne.length?e+t.offsetWidth:e),0):null),[D,G,ne,r]),ie=c.Children.count(J)-1,le=G===y.length,se=Z&&le,ue=Y&&le,de=D-i!=0,me=r&&de&&ee?ce(i):0,fe=!r||!de&&ee?0:ce(D),he=r?ne[D].offsetWidth:0,pe=r&&$&&ee?-(Math.min(ae||u.current.offsetWidth,u.current.offsetWidth)-he)/2:0,ve=(0,c.useMemo)((()=>ee&&r?d.current.offsetWidth/3:0),[r,ee]),be=i-D!=0&&d.current?"forward"===h.current.toLowerCase()&&D<i?ve:"backward"===h.current.toLowerCase()&&D>i?-ve:0:0,we=de&&(_||q)?"transform ".concat(_,"ms ").concat(F," ").concat(q,"ms"):null,ye=ue||!r?0:fe-me+pe+be+ve,ge=r?"translateX(-".concat(ye,"px)"):null,xe=(0,c.useCallback)((e=>{if("forward"===e){const e=D+H;return e>ie?ee?e-ie-1:D:e}if("backward"===e){const e=D-H;return e<0?ee?ie+1+e:D:e}return D}),[D,H,ie,ee]),Ee=(0,c.useCallback)(((e,t)=>{h.current=t,d.current.style.transition=_||q?"transform ".concat(_,"ms ").concat(F," ").concat(q,"ms"):null,e!==D?(clearTimeout(p.current),B(e)):(m.current=null,f.current=!1,d.current.style.transform="translateX(-".concat(pe+ve+(ee?0:ye),"px)"))}),[D,pe,q,F,_,B,ve,ee,ye]),ke=(0,c.useCallback)((()=>{Q&&(clearTimeout(p.current),p.current=setTimeout((()=>{Ee(xe(U),U)}),q))}),[Q,U,Ee,xe,q]),Ce=(0,c.useCallback)((e=>{f.current&&(e.preventDefault(),e.stopPropagation(),x&&x(e))}),[x]),Se=(0,c.useCallback)((()=>{Ee(xe("backward"),"backward")}),[Ee,xe]),Te=(0,c.useCallback)((e=>{f.current=!0;const t=e.touches&&e.touches[0]?e.touches[0].clientX:e.clientX,r=m.current-t+pe+ve+(ee?0:ye),n=d.current.offsetWidth-u.current.offsetWidth,o=Math.max(Math.min(0,-r),-n);d.current.style.transition=null,d.current.style.transform="translateX(".concat(o,"px)")}),[pe,ve,ee,ye]),Le=(0,c.useCallback)((e=>{if(d.current.removeEventListener("mouseout",Le),d.current.removeEventListener("dragstart",Le),document.removeEventListener("mousemove",Te),document.removeEventListener("mouseup",Le),document.removeEventListener("touchmove",Te),document.removeEventListener("touchend",Le),f.current){const t=e.changedTouches&&e.changedTouches.length?e.changedTouches[e.changedTouches.length-1].clientX:e.clientX,r=m.current-t;r>he/2?Ee(xe("forward"),"forward"):r<-he/2?Ee(xe("backward"),"backward"):Ee(D,"forward")}}),[D,he,Ee,xe,Te]),Pe=(0,c.useCallback)((e=>{clearTimeout(p.current),f.current||(m.current=e.clientX,document.addEventListener("mousemove",Te),document.addEventListener("mouseup",Le),d.current.addEventListener("mouseout",Le),d.current.addEventListener("dragstart",Le))}),[Te,Le]),Me=(0,c.useCallback)((e=>{clearTimeout(p.current),f.current||(m.current=e.touches[0].clientX,document.addEventListener("touchmove",Te),document.addEventListener("touchend",Le))}),[Te,Le]),Ie=(0,c.useCallback)((()=>{l(D)}),[D]),We=(0,c.useCallback)((()=>{Ee(xe("forward"),"forward")}),[Ee,xe]),Re=(e,t,r)=>e.map(((e,n)=>{const{props:{className:o="",onClick:c,style:a={},...i}={},...l}=e,s=ee?b.current>=y.length?"forward":"backward":n>=D?"forward":"backward",u=n+t===D,d={role:"tabpanel",className:"".concat(o," ").concat(s," ").concat(u?A:""),style:{...a,...u?X:{},boxSizing:"border-box",margin:0},onClick:!r&&V?(({direction:e,index:t,onClick:r})=>n=>{Ee(t,e||(D<t?"forward":"")||(D>t?"backward":"")),r&&r(n)})({direction:s,index:n+t,onClick:c}):c,...i,...u?z:{}};return b.current+=1,{props:d,...l}}));return(0,c.useEffect)((()=>(m.current=null,f.current=!1,h.current="",D!==i?_||q||l(D):(K&&K(D,i),(ee||"forward"===U&&D!==ie||"backward"===U&&0!==D)&&ke()),()=>{clearTimeout(p.current)})),[i,D,K,_,q,ke,ee,ie,U]),(0,c.useEffect)((()=>(r&&ke(),()=>{clearTimeout(p.current)})),[r]),(0,c.useEffect)((()=>{const e=d.current;function t(){clearTimeout(v.current),clearTimeout(p.current),v.current=setTimeout((()=>{n(window.innerWidth)}),400)}return n(window.innerWidth),window.addEventListener("resize",t),()=>{clearTimeout(v.current),window.removeEventListener("resize",t),document.removeEventListener("mousemove",Te),document.removeEventListener("mouseup",Le),document.removeEventListener("touchmove",Te),document.removeEventListener("touchend",Le),e.removeEventListener("mouseout",Le),e.removeEventListener("dragstart",Le)}}),[Te,Le]),b.current=0,r&&(d.current.style.transform=ge),a().createElement("div",o()({onClickCapture:Ce,style:{display:"flex",boxSizing:"border-box",justifyContent:"center",...g||{}}},E,{ref:s}),W&&!se&&a().createElement("button",o()({},R,{type:"button",onClick:(0===ye&&te||0===D&&re)&&!ee?null:Se}),I),a().createElement("div",o()({},C,{style:{...k||{},display:"flex",boxSizing:"border-box",flexFlow:"row wrap",padding:"0",overflow:"hidden",maxWidth:ae?"".concat(ae,"px"):"100%"},ref:u}),a().createElement("div",o()({},M,{style:{...S||{},display:"flex",boxSizing:"border-box",outline:"none",transition:we,transform:ge},"data-transform":ge,onTouchStart:ue?null:Me,onMouseDown:ue?null:Pe,onTransitionEnd:_||q?Ie:null,tabIndex:"-1",role:"presentation",ref:d}),!ue&&ee&&Re(y.slice(i),i),Re(y,0,ue),!ue&&ee&&Re(y,0),!ue&&ee&&Re(y.slice(0,i),0))),j&&!se&&a().createElement("button",o()({},O,{type:"button",onClick:(ye===oe&&te||D===ie&&re)&&!ee?null:We}),N))}i.defaultProps={activeSlideProps:{},autoplay:!1,autoplayDirection:"forward",backwardBtnProps:{},children:null,containerProps:{},delay:0,disableNavIfAllVisible:!0,easing:"linear",forwardBtnProps:{},hideNavIfAllVisible:!0,innerProps:{},itemsListProps:{},itemsToScroll:1,itemsToShow:0,onAfterChange:null,responsiveProps:[],speed:0,updateOnItemClick:!1,centerMode:!1,infinite:!0,disableNavIfEdgeVisible:!0,disableNavIfEdgeActive:!0};const l=(0,c.memo)(i)},383:t=>{"use strict";t.exports=e}},r={};function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(767)})()}));
!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.ReactSimplyCarousel=t(require("react")):e.ReactSimplyCarousel=t(e.React)}(this,(function(e){return(()=>{"use strict";var t={383:t=>{t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{default:()=>O});var e=n(383),t=n.n(e),r=["responsiveProps"],i=["minWidth","maxWidth"],c=["style","onClickCapture"],u=["style"],a=["style","onTouchStart","onMouseDown","onTransitionEnd"],l=["children","show"],s=["children","show"],d=["className","style"],f=["className","onClick","style"],m=["props"];function p(){return(p=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}).apply(this,arguments)}function v(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],c=!0,u=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(u)throw o}}return i}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function E(n){var o=n.responsiveProps,b=x(n,r),y=w((0,e.useState)(0),2),g=y[0],S=y[1],E=w((0,e.useState)(b.activeSlideIndex),2),O=E[0],k=E[1],C=(0,e.useRef)(null),P=(0,e.useRef)(null),T=(0,e.useRef)(null),j=(0,e.useRef)(null),L=(0,e.useRef)(!1),I=(0,e.useRef)(""),M=(0,e.useRef)(null),A=(0,e.useRef)(null),W=(0,e.useRef)(0),N=o.reduce((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minWidth,n=void 0===r?0:r,o=t.maxWidth,c=void 0===o?null:o,u=x(t,i);return g>n&&(!c||g<=c)?h(h({},e),u):e}),b),R=e.Children.toArray(N.children),D=g?h(h({},N),{},{activeSlideIndex:Math.max(0,Math.min(N.activeSlideIndex,R.length-1)),itemsToShow:Math.min(R.length,N.itemsToShow),itemsToScroll:Math.min(R.length,N.itemsToScroll)}):b,X=D.containerProps,z=X.style,V=X.onClickCapture,B=x(X,c),_=D.innerProps,q=_.style,F=x(_,u),U=D.itemsListProps,$=U.style,G=(U.onTouchStart,U.onMouseDown,U.onTransitionEnd,x(U,a)),H=D.backwardBtnProps,J=H.children,K=void 0===J?null:J,Q=H.show,Y=void 0===Q||Q,Z=x(H,l),ee=D.forwardBtnProps,te=ee.children,re=void 0===te?null:te,ne=ee.show,oe=void 0===ne||ne,ie=x(ee,s),ce=D.activeSlideProps,ue=ce.className,ae=void 0===ue?"":ue,le=ce.style,se=void 0===le?{}:le,de=x(ce,d),fe=D.updateOnItemClick,me=D.activeSlideIndex,pe=D.onRequestChange,ve=D.speed,be=D.delay,he=D.easing,ye=D.itemsToShow,we=D.itemsToScroll,ge=D.children,Se=D.onAfterChange,xe=D.autoplay,Ee=D.autoplayDirection,Oe=D.disableNavIfAllVisible,ke=D.hideNavIfAllVisible,Ce=D.centerMode,Pe=D.infinite,Te=D.disableNavIfEdgeVisible,je=D.disableNavIfEdgeActive,Le=(0,e.useMemo)((function(){return g?Pe?v(T.current.children).slice(R.length-O,R.length-O+R.length):v(T.current.children):[]}),[O,R.length,g,Pe]),Ie=g?T.current.offsetWidth-P.current.offsetWidth:0,Me=function(e){var t=Le.reduce((function(t,r,n){return n>=e?t:t+(r.offsetWidth||0)}),0);return Pe?t:Math.min(Ie,t)},Ae=(0,e.useMemo)((function(){return g&&ye?Le.reduce((function(e,t,r){return r>=me&&r<me+ye||r<me&&r<me+ye-Le.length?e+t.offsetWidth:e}),0):null}),[me,ye,Le,g]),We=e.Children.count(ge)-1,Ne=ye===R.length,Re=ke&&Ne,De=Oe&&Ne,Xe=me-O!=0,ze=g&&Xe&&Pe?Me(O):0,Ve=!g||!Xe&&Pe?0:Me(me),Be=g?Le[me].offsetWidth:0,_e=g&&Ce&&Pe?-(Math.min(Ae||P.current.offsetWidth,P.current.offsetWidth)-Be)/2:0,qe=(0,e.useMemo)((function(){return Pe&&g?T.current.offsetWidth/3:0}),[g,Pe]),Fe=O-me!=0&&T.current?"forward"===I.current.toLowerCase()&&me<O?qe:"backward"===I.current.toLowerCase()&&me>O?-qe:0:0,Ue=Xe&&(ve||be)?"transform ".concat(ve,"ms ").concat(he," ").concat(be,"ms"):null,$e=De||!g?0:Ve-ze+_e+Fe+qe,Ge=g?"translateX(-".concat($e,"px)"):null,He=(0,e.useCallback)((function(e){if("forward"===e){var t=me+we;return t>We?Pe?t-We-1:me:t}if("backward"===e){var r=me-we;return r<0?Pe?We+1+r:me:r}return me}),[me,we,We,Pe]),Je=(0,e.useCallback)((function(e,t){I.current=t,T.current.style.transition=ve||be?"transform ".concat(ve,"ms ").concat(he," ").concat(be,"ms"):null,e!==me?(clearTimeout(M.current),pe(e)):(j.current=null,L.current=!1,T.current.style.transform="translateX(-".concat(_e+qe+(Pe?0:$e),"px)"))}),[me,_e,be,he,ve,pe,qe,Pe,$e]),Ke=(0,e.useCallback)((function(){xe&&(clearTimeout(M.current),M.current=setTimeout((function(){Je(He(Ee),Ee)}),be))}),[xe,Ee,Je,He,be]),Qe=(0,e.useCallback)((function(e){L.current&&(e.preventDefault(),e.stopPropagation(),V&&V(e))}),[V]),Ye=(0,e.useCallback)((function(){Je(He("backward"),"backward")}),[Je,He]),Ze=(0,e.useCallback)((function(e){L.current=!0;var t=e.touches&&e.touches[0]?e.touches[0].clientX:e.clientX,r=j.current-t+_e+qe+(Pe?0:$e),n=T.current.offsetWidth-P.current.offsetWidth,o=Math.max(Math.min(0,-r),-n);T.current.style.transition=null,T.current.style.transform="translateX(".concat(o,"px)")}),[_e,qe,Pe,$e]),et=(0,e.useCallback)((function(e){if(T.current.removeEventListener("mouseout",et),T.current.removeEventListener("dragstart",et),document.removeEventListener("mousemove",Ze),document.removeEventListener("mouseup",et),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",et),L.current){var t=e.changedTouches&&e.changedTouches.length?e.changedTouches[e.changedTouches.length-1].clientX:e.clientX,r=j.current-t;r>Be/2?Je(He("forward"),"forward"):r<-Be/2?Je(He("backward"),"backward"):Je(me,"forward")}}),[me,Be,Je,He,Ze]),tt=(0,e.useCallback)((function(e){clearTimeout(M.current),L.current||(j.current=e.clientX,document.addEventListener("mousemove",Ze),document.addEventListener("mouseup",et),T.current.addEventListener("mouseout",et),T.current.addEventListener("dragstart",et))}),[Ze,et]),rt=(0,e.useCallback)((function(e){clearTimeout(M.current),L.current||(j.current=e.touches[0].clientX,document.addEventListener("touchmove",Ze),document.addEventListener("touchend",et))}),[Ze,et]),nt=(0,e.useCallback)((function(){k(me)}),[me]),ot=(0,e.useCallback)((function(){Je(He("forward"),"forward")}),[Je,He]),it=function(e,t,r){return e.map((function(e,n){var o=e.props,i=(o=void 0===o?{}:o).className,c=void 0===i?"":i,u=o.onClick,a=o.style,l=void 0===a?{}:a,s=x(o,f),d=x(e,m),p=Pe?W.current>=R.length?"forward":"backward":n>=me?"forward":"backward",v=n+t===me,b="".concat(c," ").concat(p," ").concat(v?ae:""),y=h(h(h({},l),v?se:{}),{},{boxSizing:"border-box",margin:0}),w=h(h({role:"tabpanel",className:b,style:y,onClick:!r&&fe?function(e){var t=e.direction,r=e.index,n=e.onClick;return function(e){Je(r,t||(me<r?"forward":"")||(me>r?"backward":"")),n&&n(e)}}({direction:p,index:n+t,onClick:u}):u},s),v?de:{});return W.current+=1,h({props:w},d)}))};return(0,e.useEffect)((function(){return j.current=null,L.current=!1,I.current="",me!==O?ve||be||k(me):(Se&&Se(me,O),(Pe||"forward"===Ee&&me!==We||"backward"===Ee&&0!==me)&&Ke()),function(){clearTimeout(M.current)}}),[O,me,Se,ve,be,Ke,Pe,We,Ee]),(0,e.useEffect)((function(){return g&&Ke(),function(){clearTimeout(M.current)}}),[g]),(0,e.useEffect)((function(){var e=T.current;function t(){clearTimeout(A.current),clearTimeout(M.current),A.current=setTimeout((function(){S(window.innerWidth)}),400)}return S(window.innerWidth),window.addEventListener("resize",t),function(){clearTimeout(A.current),window.removeEventListener("resize",t),document.removeEventListener("mousemove",Ze),document.removeEventListener("mouseup",et),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",et),e.removeEventListener("mouseout",et),e.removeEventListener("dragstart",et)}}),[Ze,et]),W.current=0,g&&(T.current.style.transform=Ge),t().createElement("div",p({onClickCapture:Qe,style:h({display:"flex",boxSizing:"border-box",justifyContent:"center"},z||{})},B,{ref:C}),Y&&!Re&&t().createElement("button",p({},Z,{type:"button",onClick:(0===$e&&Te||0===me&&je)&&!Pe?null:Ye}),K),t().createElement("div",p({},F,{style:h(h({},q||{}),{},{display:"flex",boxSizing:"border-box",flexFlow:"row wrap",padding:"0",overflow:"hidden",maxWidth:Ae?"".concat(Ae,"px"):"100%"}),ref:P}),t().createElement("div",p({},G,{style:h(h({},$||{}),{},{display:"flex",boxSizing:"border-box",outline:"none",transition:Ue,transform:Ge}),"data-transform":Ge,onTouchStart:De?null:rt,onMouseDown:De?null:tt,onTransitionEnd:ve||be?nt:null,tabIndex:"-1",role:"presentation",ref:T}),!De&&Pe&&it(R.slice(O),O),it(R,0,De),!De&&Pe&&it(R,0),!De&&Pe&&it(R.slice(0,O),0))),oe&&!Re&&t().createElement("button",p({},ie,{type:"button",onClick:($e===Ie&&Te||me===We&&je)&&!Pe?null:ot}),re))}E.defaultProps={activeSlideProps:{},autoplay:!1,autoplayDirection:"forward",backwardBtnProps:{},children:null,containerProps:{},delay:0,disableNavIfAllVisible:!0,easing:"linear",forwardBtnProps:{},hideNavIfAllVisible:!0,innerProps:{},itemsListProps:{},itemsToScroll:1,itemsToShow:0,onAfterChange:null,responsiveProps:[],speed:0,updateOnItemClick:!1,centerMode:!1,infinite:!0,disableNavIfEdgeVisible:!0,disableNavIfEdgeActive:!0};const O=(0,e.memo)(E)})(),o})()}));
{
"name": "react-simply-carousel",
"version": "5.0.0",
"version": "5.0.1",
"description": "Simple react.js carousel component",

@@ -58,3 +58,2 @@ "main": "dist/index.js",

"@babel/core": "^7.12.10",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",

@@ -89,3 +88,2 @@ "@babel/preset-react": "^7.12.10",

"dependencies": {
"@babel/runtime": "^7.12.5",
"core-js": "^3.8.1",

@@ -95,5 +93,5 @@ "prop-types": "^15.7.2"

"peerDependencies": {
"react": "^16.8.0 | ^17.0.0",
"react-dom": "^16.8.0 | ^17.0.0"
"react": "^16.8 | ^17",
"react-dom": "^16.8 | ^17"
}
}
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