react-simply-carousel
Advanced tools
Comparing version 8.4.2 to 8.4.3
@@ -1,1 +0,1 @@ | ||
import e,{memo as t,useState as n,useRef as r,Children as i,useCallback as o,useEffect as c}from"react";function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],c=!0,d=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){d=!0,i=e}finally{try{c||null==n.return||n.return()}finally{if(d)throw i}}return o}(e,t)||m(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 v(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(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 m(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=["responsiveProps"],b=["minWidth","maxWidth"],y=["style","onClickCapture"],w=["style"],x=["style","onTouchStart","onMouseDown","onTransitionEnd"],g=["children","show"],S=["children","show"],E=["className","style"],I=["className","style"],T=["className","onClick","style"],O=["props"];function C(t){var d=t.responsiveProps,l=void 0===d?[]:d,m=s(t,p),h=f(n(0),2),C=h[0],L=h[1],k=f(n(m.activeSlideIndex),2),M=k[0],P=k[1],j=r(null),W=r(null),A=r(null),X=r(0),N=r(!1),D=r(""),F=r(null),V=r(null),z=r(0),B=r(M),q=l.reduce((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.minWidth,r=void 0===n?0:n,i=t.maxWidth,o=void 0===i?null:i,c=s(t,b);return C>r&&(!o||C<=o)?a(a({},e),c):e}),m),H=i.toArray(q.children),R=C?a(a({},q),{},{activeSlideIndex:Math.max(0,Math.min(q.activeSlideIndex,H.length-1)),itemsToShow:Math.min(H.length,q.itemsToShow||0),itemsToScroll:Math.min(H.length,q.itemsToScroll||1)}):m,U=R.containerProps,$=(U=void 0===U?{}:U).style,G=void 0===$?{}:$,J=U.onClickCapture,K=void 0===J?null:J,Q=s(U,y),Y=R.innerProps,Z=(Y=void 0===Y?{}:Y).style,_=void 0===Z?{}:Z,ee=s(Y,w),te=R.itemsListProps,ne=(te=void 0===te?{}:te).style,re=void 0===ne?{}:ne,ie=te.onTouchStart,oe=void 0===ie?null:ie,ce=te.onMouseDown,de=void 0===ce?null:ce,ae=te.onTransitionEnd,le=void 0===ae?null:ae,ue=s(te,x),se=R.backwardBtnProps,fe=(se=void 0===se?{}:se).children,ve=void 0===fe?null:fe,me=se.show,he=void 0===me||me,pe=s(se,g),be=R.forwardBtnProps,ye=(be=void 0===be?{}:be).children,we=void 0===ye?null:ye,xe=be.show,ge=void 0===xe||xe,Se=s(be,S),Ee=R.activeSlideProps,Ie=(Ee=void 0===Ee?{}:Ee).className,Te=void 0===Ie?"":Ie,Oe=Ee.style,Ce=void 0===Oe?{}:Oe,Le=s(Ee,E),ke=R.visibleSlideProps,Me=(ke=void 0===ke?{}:ke).className,Pe=void 0===Me?"":Me,je=ke.style,We=void 0===je?{}:je,Ae=s(ke,I),Xe=R.updateOnItemClick,Ne=void 0!==Xe&&Xe,De=R.activeSlideIndex,Fe=R.onRequestChange,Ve=R.speed,ze=void 0===Ve?0:Ve,Be=R.delay,qe=void 0===Be?0:Be,He=R.easing,Re=void 0===He?"linear":He,Ue=R.itemsToShow,$e=void 0===Ue?0:Ue,Ge=R.itemsToScroll,Je=void 0===Ge?1:Ge,Ke=R.children,Qe=R.onAfterChange,Ye=R.autoplay,Ze=void 0!==Ye&&Ye,_e=R.autoplayDirection,et=void 0===_e?"forward":_e,tt=R.disableNavIfAllVisible,nt=void 0===tt||tt,rt=R.hideNavIfAllVisible,it=void 0===rt||rt,ot=R.centerMode,ct=void 0!==ot&&ot,dt=R.infinite,at=void 0===dt||dt,lt=R.disableNavIfEdgeVisible,ut=void 0===lt||lt,st=R.disableNavIfEdgeActive,ft=void 0===st||st,vt=R.dotsNav,mt=void 0===vt?{}:vt,ht=R.persistentChangeCallbacks,pt=void 0!==ht&&ht,bt=R.autoplayDelay,yt=void 0===bt?0:bt,wt=mt||{},xt=wt.show,gt=void 0!==xt&&xt,St=wt.containerProps,Et=void 0===St?{}:St,It=wt.itemBtnProps,Tt=void 0===It?{}:It,Ot=wt.activeItemBtnProps,Ct=void 0===Ot?{}:Ot,Lt=i.count(Ke)-1,kt=$e===H.length,Mt=it&&kt,Pt=nt&&kt,jt=De-M==0||!ze&&!qe?"none":"transform ".concat(ze,"ms ").concat(Re," ").concat(qe,"ms"),Wt=o((function(e){var t=e.correctionSlideIndex,n=e.prevCorrectionSlideIndex,r=e.curActiveSlideIndex,i=A.current.offsetWidth,o=A.current.children,c=o.length,d=at?v(o).slice(c/3-n,c/3-n+c/3):v(o),a=d[r].offsetWidth,l=$e?d.reduce((function(e,t,n){return n>=r&&n<r+$e||n<r&&n<r+$e-d.length?e+t.offsetWidth:e}),0):W.current.offsetWidth,u=i-l,s=ct&&at?-(l-a)/2:0,f=at?i/3:0,m=t-r==0?0:"forward"===D.current&&r<t?f:"backward"===D.current&&r>t?-f:0,h=r-t!=0,p=function(e){var t=d.reduce((function(t,n,r){return r>=e?t:t+(n.offsetWidth||0)}),0);return at?t:Math.min(u,t)},b=h&&at?p(t):0,y=h||!at?p(r):0,w=Pt?0:y-b+s+m+f,x="translateX(-".concat(w,"px)"),g=at?f+s:Math.min(u,d.reduce((function(e,t,n){return n<r?e+t.offsetWidth:e}),0)),S=g+l,E=d.map((function(e,t){return{slideIndex:t,htmlElement:e}})),I=at?[].concat(v(d.slice(r).map((function(e,t){return{slideIndex:t+r,htmlElement:e}}))),v(E),v(E),v(d.slice(0,r).map((function(e,t){return{slideIndex:t,htmlElement:e}})))):E,T=I.reduce((function(e,t){var n=t.slideIndex,r=t.htmlElement.offsetWidth;return(e.summ>=g&&e.summ<S||e.summ+r>g&&e.summ+r<=S)&&e.items.push({slideIndex:n,isFullyVisible:e.summ+r<=S&&e.summ>=g}),e.summ+=r,e}),{summ:0,items:[]}),O=!!T.items.find((function(e){return 0===e.slideIndex})),C=!!T.items.find((function(e){return e.slideIndex===d.length-1}));return{slidesHTMLElements:d,innerMaxWidth:l,itemsListMaxTranslateX:u,activeSlideWidth:a,offsetCorrectionForCenterMode:s,offsetCorrectionForInfiniteMode:f,itemsListTranslateX:w,itemsListTransform:x,visibleSlides:T.items,isFirstSlideVisible:O,isLastSlideVisible:C}}),[ct,Pt,at,$e]),At=C?Wt({prevCorrectionSlideIndex:B.current,curActiveSlideIndex:De,correctionSlideIndex:M}):{},Xt=At.innerMaxWidth,Nt=void 0===Xt?0:Xt,Dt=At.itemsListMaxTranslateX,Ft=void 0===Dt?0:Dt,Vt=At.activeSlideWidth,zt=void 0===Vt?0:Vt,Bt=At.offsetCorrectionForCenterMode,qt=void 0===Bt?0:Bt,Ht=At.offsetCorrectionForInfiniteMode,Rt=void 0===Ht?0:Ht,Ut=At.itemsListTranslateX,$t=void 0===Ut?0:Ut,Gt=At.itemsListTransform,Jt=void 0===Gt?"none":Gt,Kt=At.visibleSlides,Qt=void 0===Kt?[]:Kt,Yt=o((function(e){if("forward"===e){var t=De+Je;return t>Lt?at?t-Lt-1:Lt:t}if("backward"===e){var n=De-Je;return n<0?at?Lt+1+n:0:n}return De}),[De,Je,Lt,at]),Zt=o((function(e,t){if(D.current=t,A.current.style.transition=ze||qe?"transform ".concat(ze,"ms ").concat(Re," ").concat(qe,"ms"):"none",e!==De||pt){clearTimeout(F.current);var n=Wt({correctionSlideIndex:M,prevCorrectionSlideIndex:M,curActiveSlideIndex:e}),r=n.visibleSlides,i=n.isFirstSlideVisible,o=n.isLastSlideVisible;Fe(e,{visibleSlides:r,isFirstSlideVisible:i,isLastSlideVisible:o})}else X.current=0,A.current.style.transform="translateX(-".concat(qt+Rt+(at?0:$t),"px)")}),[pt,De,qt,qe,Re,ze,Fe,Rt,at,$t,M,Wt]),_t=o((function(){Ze&&(clearTimeout(F.current),F.current=setTimeout((function(){Zt(Yt(et),et)}),yt||qe))}),[Ze,et,yt,Zt,Yt,qe]),en=o((function(e){N.current&&(e.preventDefault(),e.stopPropagation(),K&&K(e))}),[K]),tn=o((function(){Zt(Yt("backward"),"backward")}),[Zt,Yt]),nn=o((function(e){N.current=!0;var t=e.touches&&e.touches[0]?e.touches[0].clientX:e.clientX,n=X.current-t+qt+Rt+(at?0:$t),r=A.current.offsetWidth-W.current.offsetWidth,i=Math.max(Math.min(0,-n),-r);A.current.style.transition="none",A.current.style.transform="translateX(".concat(i,"px)")}),[qt,Rt,at,$t]),rn=o((function(e){if(A.current.removeEventListener("mouseout",rn),A.current.removeEventListener("dragstart",rn),document.removeEventListener("mousemove",nn),document.removeEventListener("mouseup",rn),document.removeEventListener("touchmove",nn),document.removeEventListener("touchend",rn),N.current){var t=e.changedTouches&&e.changedTouches.length?e.changedTouches[e.changedTouches.length-1].clientX:e.clientX,n=X.current-t,r=n>zt/2?{index:Yt("forward"),direction:"forward"}:n<-zt/2?{index:Yt("backward"),direction:"backward"}:{index:De,direction:"forward"};r.index===De&&(N.current=!1),Zt(r.index,r.direction)}}),[De,zt,Zt,Yt,nn]),on=o((function(e){clearTimeout(F.current),N.current||(X.current=e.clientX,document.addEventListener("mousemove",nn),document.addEventListener("mouseup",rn),A.current.addEventListener("mouseout",rn),A.current.addEventListener("dragstart",rn)),de&&de(e)}),[nn,rn,de]),cn=o((function(e){clearTimeout(F.current),N.current||(X.current=e.touches[0].clientX,document.addEventListener("touchmove",nn),document.addEventListener("touchend",rn)),oe&&oe(e)}),[nn,rn,oe]),dn=o((function(e){P(De),le&&le(e)}),[De,le]),an=o((function(){Zt(Yt("forward"),"forward")}),[Zt,Yt]),ln=function(e,t,n){return e.map((function(e,r){var i=e.props,o=(i=void 0===i?{}:i).className,c=void 0===o?"":o,d=i.onClick,l=void 0===d?null:d,u=i.style,f=void 0===u?{}:u,v=s(i,T),m=s(e,O),h=at?z.current>=H.length?"forward":"backward":r>=De?"forward":"backward",p=r+t===De,b=Qt.find((function(e){return e.slideIndex===r+t})),y="".concat(c," ").concat(h," ").concat(p?Te:""," ").concat(b?Pe:""),w=a(a(a(a({},f),b?We:{}),p?Ce:{}),{},{boxSizing:"border-box",margin:0}),x=!n&&Ne?function(e){var t=e.direction,n=e.index,r=e.onClick;return function(e){Zt(n,t||(De<n?"forward":"")||(De>n?"backward":"")),r&&r(e)}}({direction:h,index:r+t,onClick:l}):l,g=a(a(a({role:"tabpanel",className:y,style:w,onClick:x},v),b?Ae:{}),p?Le:{});return z.current+=1,a({props:g},m)}))};return c((function(){return X.current=0,M===De&&(N.current=!1),D.current="",De!==M?ze||qe||P(De):(Qe&&Qe(De,M),(at||"forward"===et&&De!==Lt||"backward"===et&&0!==De)&&_t()),function(){clearTimeout(F.current)}}),[M,De,Qe,ze,qe,_t,at,Lt,et]),c((function(){return C&&_t(),function(){clearTimeout(F.current)}}),[C]),c((function(){var e=A.current;function t(){clearTimeout(V.current),clearTimeout(F.current),V.current=setTimeout((function(){C!==window.innerWidth&&L(window.innerWidth)}),400)}return C!==window.innerWidth&&L(window.innerWidth),window.addEventListener("resize",t),function(){clearTimeout(V.current),window.removeEventListener("resize",t),document.removeEventListener("mousemove",nn),document.removeEventListener("mouseup",rn),document.removeEventListener("touchmove",nn),document.removeEventListener("touchend",rn),e.removeEventListener("mouseout",rn),e.removeEventListener("dragstart",rn)}}),[nn,rn]),z.current=0,B.current=M,e.createElement("div",u({onClickCapture:en,style:a({display:"flex",flexFlow:"row wrap",boxSizing:"border-box",justifyContent:"center",width:"100%"},G)},Q,{ref:j}),he&&!Mt&&e.createElement("button",u({},pe,{type:"button",onClick:(0===$t&&ut||0===De&&ft)&&!at?void 0:tn,disabled:"boolean"==typeof pe.disabled?pe.disabled:!(!(0===$t&&ut||0===De&&ft)||at)}),ve),e.createElement("div",u({},ee,{style:a(a({},_),{},{display:"flex",boxSizing:"border-box",flexFlow:"row wrap",padding:"0",overflow:"hidden",maxWidth:Nt?"".concat(Nt,"px"):void 0,flex:Nt?void 0:"1 0"}),ref:W}),e.createElement("div",u({},ue,{style:a(a({},re),{},{display:"flex",boxSizing:"border-box",outline:"none",transition:jt,transform:Jt}),onTouchStart:Pt?void 0:cn,onMouseDown:Pt?void 0:on,onTransitionEnd:ze||qe?dn:void 0,tabIndex:-1,role:"presentation",ref:A}),at&&ln(H.slice(M),M,Pt),ln(H,0,Pt),at&&ln(H,0,Pt),at&&ln(H.slice(0,M),0,Pt))),ge&&!Mt&&e.createElement("button",u({},Se,{type:"button",onClick:($t===Ft&&ut||De===Lt&&ft)&&!at?void 0:an,disabled:"boolean"==typeof Se.disabled?Se.disabled:!(!($t===Ft&&ut||De===Lt&&ft)||at)}),we),!!gt&&e.createElement("div",u({style:{width:"100%",display:"flex",justifyContent:"center"}},Et),Array.from({length:Math.ceil(H.length/Je)}).map((function(t,n){return e.createElement("button",u({type:"button",key:n,title:"".concat(n)},Tt,De>=n*Je&&De<Math.min(Je*(n+1),Lt+1)?Ct:{},{onClick:function(){Zt(Math.min(n*Je,H.length-1),Math.min(n*Je,H.length-1)>De?"forward":"backward")}}))}))))}var L=t(C);export{L as default}; | ||
import e,{memo as t,useState as n,useRef as r,Children as i,useCallback as o,useEffect as c}from"react";function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],c=!0,d=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){d=!0,i=e}finally{try{c||null==n.return||n.return()}finally{if(d)throw i}}return o}(e,t)||m(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 v(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(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 m(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=["responsiveProps"],b=["minWidth","maxWidth"],y=["style","onClickCapture"],w=["style"],x=["style","onTouchStart","onMouseDown","onTransitionEnd"],g=["children","show"],S=["children","show"],E=["className","style"],I=["className","style"],T=["className","onClick","style"],O=["props"];function C(t){var d=t.responsiveProps,l=void 0===d?[]:d,m=s(t,p),h=f(n(0),2),C=h[0],L=h[1],k=f(n(m.activeSlideIndex),2),M=k[0],P=k[1],j=r(null),W=r(null),A=r(null),X=r(0),N=r(!1),D=r(""),F=r(null),V=r(null),z=r(0),B=r(M),q=l.reduce((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.minWidth,r=void 0===n?0:n,i=t.maxWidth,o=void 0===i?null:i,c=s(t,b);return C>r&&(!o||C<=o)?a(a({},e),c):e}),m),H=i.toArray(q.children),R=C?a(a({},q),{},{activeSlideIndex:Math.max(0,Math.min(q.activeSlideIndex,H.length-1)),itemsToShow:Math.min(H.length,q.itemsToShow||0),itemsToScroll:Math.min(H.length,q.itemsToScroll||1)}):m,U=R.containerProps,$=(U=void 0===U?{}:U).style,G=void 0===$?{}:$,J=U.onClickCapture,K=void 0===J?null:J,Q=s(U,y),Y=R.innerProps,Z=(Y=void 0===Y?{}:Y).style,_=void 0===Z?{}:Z,ee=s(Y,w),te=R.itemsListProps,ne=(te=void 0===te?{}:te).style,re=void 0===ne?{}:ne,ie=te.onTouchStart,oe=void 0===ie?null:ie,ce=te.onMouseDown,de=void 0===ce?null:ce,ae=te.onTransitionEnd,le=void 0===ae?null:ae,ue=s(te,x),se=R.backwardBtnProps,fe=(se=void 0===se?{}:se).children,ve=void 0===fe?null:fe,me=se.show,he=void 0===me||me,pe=s(se,g),be=R.forwardBtnProps,ye=(be=void 0===be?{}:be).children,we=void 0===ye?null:ye,xe=be.show,ge=void 0===xe||xe,Se=s(be,S),Ee=R.activeSlideProps,Ie=(Ee=void 0===Ee?{}:Ee).className,Te=void 0===Ie?"":Ie,Oe=Ee.style,Ce=void 0===Oe?{}:Oe,Le=s(Ee,E),ke=R.visibleSlideProps,Me=(ke=void 0===ke?{}:ke).className,Pe=void 0===Me?"":Me,je=ke.style,We=void 0===je?{}:je,Ae=s(ke,I),Xe=R.updateOnItemClick,Ne=void 0!==Xe&&Xe,De=R.activeSlideIndex,Fe=R.onRequestChange,Ve=R.speed,ze=void 0===Ve?0:Ve,Be=R.delay,qe=void 0===Be?0:Be,He=R.easing,Re=void 0===He?"linear":He,Ue=R.itemsToShow,$e=void 0===Ue?0:Ue,Ge=R.itemsToScroll,Je=void 0===Ge?1:Ge,Ke=R.children,Qe=R.onAfterChange,Ye=R.autoplay,Ze=void 0!==Ye&&Ye,_e=R.autoplayDirection,et=void 0===_e?"forward":_e,tt=R.disableNavIfAllVisible,nt=void 0===tt||tt,rt=R.hideNavIfAllVisible,it=void 0===rt||rt,ot=R.centerMode,ct=void 0!==ot&&ot,dt=R.infinite,at=void 0===dt||dt,lt=R.disableNavIfEdgeVisible,ut=void 0===lt||lt,st=R.disableNavIfEdgeActive,ft=void 0===st||st,vt=R.dotsNav,mt=void 0===vt?{}:vt,ht=R.persistentChangeCallbacks,pt=void 0!==ht&&ht,bt=R.autoplayDelay,yt=void 0===bt?0:bt,wt=mt||{},xt=wt.show,gt=void 0!==xt&&xt,St=wt.containerProps,Et=void 0===St?{}:St,It=wt.itemBtnProps,Tt=void 0===It?{}:It,Ot=wt.activeItemBtnProps,Ct=void 0===Ot?{}:Ot,Lt=i.count(Ke)-1,kt=$e===H.length,Mt=it&&kt,Pt=nt&&kt,jt=De-M==0||!ze&&!qe?"none":"transform ".concat(ze,"ms ").concat(Re," ").concat(qe,"ms"),Wt=o((function(e){var t,n=e.correctionSlideIndex,r=e.prevCorrectionSlideIndex,i=e.curActiveSlideIndex,o=A.current.offsetWidth,c=A.current.children,d=c.length,a=at?v(c).slice(d/3-r,d/3-r+d/3):v(c),l=null===(t=a[i])||void 0===t?void 0:t.offsetWidth,u=$e?a.reduce((function(e,t,n){return n>=i&&n<i+$e||n<i&&n<i+$e-a.length?e+t.offsetWidth:e}),0):W.current.offsetWidth,s=o-u,f=ct&&at?-(u-l)/2:0,m=at?o/3:0,h=n-i==0?0:"forward"===D.current&&i<n?m:"backward"===D.current&&i>n?-m:0,p=i-n!=0,b=function(e){var t=a.reduce((function(t,n,r){return r>=e?t:t+(n.offsetWidth||0)}),0);return at?t:Math.min(s,t)},y=p&&at?b(n):0,w=p||!at?b(i):0,x=Pt?0:w-y+f+h+m,g="translateX(-".concat(x,"px)"),S=at?m+f:Math.min(s,a.reduce((function(e,t,n){return n<i?e+t.offsetWidth:e}),0)),E=S+u,I=a.map((function(e,t){return{slideIndex:t,htmlElement:e}})),T=at?[].concat(v(a.slice(i).map((function(e,t){return{slideIndex:t+i,htmlElement:e}}))),v(I),v(I),v(a.slice(0,i).map((function(e,t){return{slideIndex:t,htmlElement:e}})))):I,O=T.reduce((function(e,t){var n=t.slideIndex,r=t.htmlElement.offsetWidth;return(e.summ>=S&&e.summ<E||e.summ+r>S&&e.summ+r<=E)&&e.items.push({slideIndex:n,isFullyVisible:e.summ+r<=E&&e.summ>=S}),e.summ+=r,e}),{summ:0,items:[]}),C=!!O.items.find((function(e){return 0===e.slideIndex})),L=!!O.items.find((function(e){return e.slideIndex===a.length-1}));return{slidesHTMLElements:a,innerMaxWidth:u,itemsListMaxTranslateX:s,activeSlideWidth:l,offsetCorrectionForCenterMode:f,offsetCorrectionForInfiniteMode:m,itemsListTranslateX:x,itemsListTransform:g,visibleSlides:O.items,isFirstSlideVisible:C,isLastSlideVisible:L}}),[ct,Pt,at,$e]),At=C?Wt({prevCorrectionSlideIndex:B.current,curActiveSlideIndex:De,correctionSlideIndex:M}):{},Xt=At.innerMaxWidth,Nt=void 0===Xt?0:Xt,Dt=At.itemsListMaxTranslateX,Ft=void 0===Dt?0:Dt,Vt=At.activeSlideWidth,zt=void 0===Vt?0:Vt,Bt=At.offsetCorrectionForCenterMode,qt=void 0===Bt?0:Bt,Ht=At.offsetCorrectionForInfiniteMode,Rt=void 0===Ht?0:Ht,Ut=At.itemsListTranslateX,$t=void 0===Ut?0:Ut,Gt=At.itemsListTransform,Jt=void 0===Gt?"none":Gt,Kt=At.visibleSlides,Qt=void 0===Kt?[]:Kt,Yt=o((function(e){if("forward"===e){var t=De+Je;return t>Lt?at?t-Lt-1:Lt:t}if("backward"===e){var n=De-Je;return n<0?at?Lt+1+n:0:n}return De}),[De,Je,Lt,at]),Zt=o((function(e,t){if(D.current=t,A.current.style.transition=ze||qe?"transform ".concat(ze,"ms ").concat(Re," ").concat(qe,"ms"):"none",e!==De||pt){clearTimeout(F.current);var n=Wt({correctionSlideIndex:M,prevCorrectionSlideIndex:M,curActiveSlideIndex:e}),r=n.visibleSlides,i=n.isFirstSlideVisible,o=n.isLastSlideVisible;Fe(e,{visibleSlides:r,isFirstSlideVisible:i,isLastSlideVisible:o})}else X.current=0,A.current.style.transform="translateX(-".concat(qt+Rt+(at?0:$t),"px)")}),[pt,De,qt,qe,Re,ze,Fe,Rt,at,$t,M,Wt]),_t=o((function(){Ze&&(clearTimeout(F.current),F.current=setTimeout((function(){Zt(Yt(et),et)}),yt||qe))}),[Ze,et,yt,Zt,Yt,qe]),en=o((function(e){N.current&&(e.preventDefault(),e.stopPropagation(),K&&K(e))}),[K]),tn=o((function(){Zt(Yt("backward"),"backward")}),[Zt,Yt]),nn=o((function(e){N.current=!0;var t=e.touches&&e.touches[0]?e.touches[0].clientX:e.clientX,n=X.current-t+qt+Rt+(at?0:$t),r=A.current.offsetWidth-W.current.offsetWidth,i=Math.max(Math.min(0,-n),-r);A.current.style.transition="none",A.current.style.transform="translateX(".concat(i,"px)")}),[qt,Rt,at,$t]),rn=o((function(e){if(A.current.removeEventListener("mouseout",rn),A.current.removeEventListener("dragstart",rn),document.removeEventListener("mousemove",nn),document.removeEventListener("mouseup",rn),document.removeEventListener("touchmove",nn),document.removeEventListener("touchend",rn),N.current){var t=e.changedTouches&&e.changedTouches.length?e.changedTouches[e.changedTouches.length-1].clientX:e.clientX,n=X.current-t,r=n>zt/2?{index:Yt("forward"),direction:"forward"}:n<-zt/2?{index:Yt("backward"),direction:"backward"}:{index:De,direction:"forward"};r.index===De&&(N.current=!1),Zt(r.index,r.direction)}}),[De,zt,Zt,Yt,nn]),on=o((function(e){clearTimeout(F.current),N.current||(X.current=e.clientX,document.addEventListener("mousemove",nn),document.addEventListener("mouseup",rn),A.current.addEventListener("mouseout",rn),A.current.addEventListener("dragstart",rn)),de&&de(e)}),[nn,rn,de]),cn=o((function(e){clearTimeout(F.current),N.current||(X.current=e.touches[0].clientX,document.addEventListener("touchmove",nn),document.addEventListener("touchend",rn)),oe&&oe(e)}),[nn,rn,oe]),dn=o((function(e){P(De),le&&le(e)}),[De,le]),an=o((function(){Zt(Yt("forward"),"forward")}),[Zt,Yt]),ln=function(e,t,n){return e.map((function(e,r){var i=e.props,o=(i=void 0===i?{}:i).className,c=void 0===o?"":o,d=i.onClick,l=void 0===d?null:d,u=i.style,f=void 0===u?{}:u,v=s(i,T),m=s(e,O),h=at?z.current>=H.length?"forward":"backward":r>=De?"forward":"backward",p=r+t===De,b=Qt.find((function(e){return e.slideIndex===r+t})),y="".concat(c," ").concat(h," ").concat(p?Te:""," ").concat(b?Pe:""),w=a(a(a(a({},f),b?We:{}),p?Ce:{}),{},{boxSizing:"border-box",margin:0}),x=!n&&Ne?function(e){var t=e.direction,n=e.index,r=e.onClick;return function(e){Zt(n,t||(De<n?"forward":"")||(De>n?"backward":"")),r&&r(e)}}({direction:h,index:r+t,onClick:l}):l,g=a(a(a({role:"tabpanel",className:y,style:w,onClick:x},v),b?Ae:{}),p?Le:{});return z.current+=1,a({props:g},m)}))};return c((function(){return X.current=0,M===De&&(N.current=!1),D.current="",De!==M?ze||qe||P(De):(Qe&&Qe(De,M),(at||"forward"===et&&De!==Lt||"backward"===et&&0!==De)&&_t()),function(){clearTimeout(F.current)}}),[M,De,Qe,ze,qe,_t,at,Lt,et]),c((function(){return C&&_t(),function(){clearTimeout(F.current)}}),[C]),c((function(){var e=A.current;function t(){clearTimeout(V.current),clearTimeout(F.current),V.current=setTimeout((function(){C!==window.innerWidth&&L(window.innerWidth)}),400)}return C!==window.innerWidth&&L(window.innerWidth),window.addEventListener("resize",t),function(){clearTimeout(V.current),window.removeEventListener("resize",t),document.removeEventListener("mousemove",nn),document.removeEventListener("mouseup",rn),document.removeEventListener("touchmove",nn),document.removeEventListener("touchend",rn),e.removeEventListener("mouseout",rn),e.removeEventListener("dragstart",rn)}}),[nn,rn]),z.current=0,B.current=M,e.createElement("div",u({onClickCapture:en,style:a({display:"flex",flexFlow:"row wrap",boxSizing:"border-box",justifyContent:"center",width:"100%"},G)},Q,{ref:j}),he&&!Mt&&e.createElement("button",u({},pe,{type:"button",onClick:(0===$t&&ut||0===De&&ft)&&!at?void 0:tn,disabled:"boolean"==typeof pe.disabled?pe.disabled:!(!(0===$t&&ut||0===De&&ft)||at)}),ve),e.createElement("div",u({},ee,{style:a(a({},_),{},{display:"flex",boxSizing:"border-box",flexFlow:"row wrap",padding:"0",overflow:"hidden",maxWidth:Nt?"".concat(Nt,"px"):void 0,flex:Nt?void 0:"1 0"}),ref:W}),e.createElement("div",u({},ue,{style:a(a({},re),{},{display:"flex",boxSizing:"border-box",outline:"none",transition:jt,transform:Jt}),onTouchStart:Pt?void 0:cn,onMouseDown:Pt?void 0:on,onTransitionEnd:ze||qe?dn:void 0,tabIndex:-1,role:"presentation",ref:A}),at&&ln(H.slice(M),M,Pt),ln(H,0,Pt),at&&ln(H,0,Pt),at&&ln(H.slice(0,M),0,Pt))),ge&&!Mt&&e.createElement("button",u({},Se,{type:"button",onClick:($t===Ft&&ut||De===Lt&&ft)&&!at?void 0:an,disabled:"boolean"==typeof Se.disabled?Se.disabled:!(!($t===Ft&&ut||De===Lt&&ft)||at)}),we),!!gt&&e.createElement("div",u({style:{width:"100%",display:"flex",justifyContent:"center"}},Et),Array.from({length:Math.ceil(H.length/Je)}).map((function(t,n){return e.createElement("button",u({type:"button",key:n,title:"".concat(n)},Tt,De>=n*Je&&De<Math.min(Je*(n+1),Lt+1)?Ct:{},{onClick:function(){Zt(Math.min(n*Je,H.length-1),Math.min(n*Je,H.length-1)>De?"forward":"backward")}}))}))))}var L=t(C);export{L as default}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).ReactSimplyCarousel=t(e.React)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function a(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],c=!0,a=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){a=!0,i=e}finally{try{c||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||d(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 u(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)||d(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 d(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=["responsiveProps"],m=["minWidth","maxWidth"],v=["style","onClickCapture"],h=["style"],b=["style","onTouchStart","onMouseDown","onTransitionEnd"],p=["children","show"],y=["children","show"],w=["className","style"],x=["className","style"],g=["className","onClick","style"],S=["props"];function C(t){var r=t.responsiveProps,o=void 0===r?[]:r,d=a(t,f),s=l(e.useState(0),2),C=s[0],E=s[1],k=l(e.useState(d.activeSlideIndex),2),T=k[0],I=k[1],O=e.useRef(null),L=e.useRef(null),j=e.useRef(null),M=e.useRef(0),P=e.useRef(!1),W=e.useRef(""),A=e.useRef(null),R=e.useRef(null),X=e.useRef(0),N=e.useRef(T),D=o.reduce((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.minWidth,r=void 0===n?0:n,o=t.maxWidth,c=void 0===o?null:o,l=a(t,m);return C>r&&(!c||C<=c)?i(i({},e),l):e}),d),F=e.Children.toArray(D.children),V=C?i(i({},D),{},{activeSlideIndex:Math.max(0,Math.min(D.activeSlideIndex,F.length-1)),itemsToShow:Math.min(F.length,D.itemsToShow||0),itemsToScroll:Math.min(F.length,D.itemsToScroll||1)}):d,z=V.containerProps,B=(z=void 0===z?{}:z).style,q=void 0===B?{}:B,H=z.onClickCapture,U=void 0===H?null:H,$=a(z,v),G=V.innerProps,J=(G=void 0===G?{}:G).style,K=void 0===J?{}:J,Q=a(G,h),Y=V.itemsListProps,Z=(Y=void 0===Y?{}:Y).style,_=void 0===Z?{}:Z,ee=Y.onTouchStart,te=void 0===ee?null:ee,ne=Y.onMouseDown,re=void 0===ne?null:ne,ie=Y.onTransitionEnd,oe=void 0===ie?null:ie,ce=a(Y,b),ae=V.backwardBtnProps,le=(ae=void 0===ae?{}:ae).children,ue=void 0===le?null:le,de=ae.show,se=void 0===de||de,fe=a(ae,p),me=V.forwardBtnProps,ve=(me=void 0===me?{}:me).children,he=void 0===ve?null:ve,be=me.show,pe=void 0===be||be,ye=a(me,y),we=V.activeSlideProps,xe=(we=void 0===we?{}:we).className,ge=void 0===xe?"":xe,Se=we.style,Ce=void 0===Se?{}:Se,Ee=a(we,w),ke=V.visibleSlideProps,Te=(ke=void 0===ke?{}:ke).className,Ie=void 0===Te?"":Te,Oe=ke.style,Le=void 0===Oe?{}:Oe,je=a(ke,x),Me=V.updateOnItemClick,Pe=void 0!==Me&&Me,We=V.activeSlideIndex,Ae=V.onRequestChange,Re=V.speed,Xe=void 0===Re?0:Re,Ne=V.delay,De=void 0===Ne?0:Ne,Fe=V.easing,Ve=void 0===Fe?"linear":Fe,ze=V.itemsToShow,Be=void 0===ze?0:ze,qe=V.itemsToScroll,He=void 0===qe?1:qe,Ue=V.children,$e=V.onAfterChange,Ge=V.autoplay,Je=void 0!==Ge&&Ge,Ke=V.autoplayDirection,Qe=void 0===Ke?"forward":Ke,Ye=V.disableNavIfAllVisible,Ze=void 0===Ye||Ye,_e=V.hideNavIfAllVisible,et=void 0===_e||_e,tt=V.centerMode,nt=void 0!==tt&&tt,rt=V.infinite,it=void 0===rt||rt,ot=V.disableNavIfEdgeVisible,ct=void 0===ot||ot,at=V.disableNavIfEdgeActive,lt=void 0===at||at,ut=V.dotsNav,dt=void 0===ut?{}:ut,st=V.persistentChangeCallbacks,ft=void 0!==st&&st,mt=V.autoplayDelay,vt=void 0===mt?0:mt,ht=dt||{},bt=ht.show,pt=void 0!==bt&&bt,yt=ht.containerProps,wt=void 0===yt?{}:yt,xt=ht.itemBtnProps,gt=void 0===xt?{}:xt,St=ht.activeItemBtnProps,Ct=void 0===St?{}:St,Et=e.Children.count(Ue)-1,kt=Be===F.length,Tt=et&&kt,It=Ze&&kt,Ot=We-T==0||!Xe&&!De?"none":"transform ".concat(Xe,"ms ").concat(Ve," ").concat(De,"ms"),Lt=e.useCallback((function(e){var t=e.correctionSlideIndex,n=e.prevCorrectionSlideIndex,r=e.curActiveSlideIndex,i=j.current.offsetWidth,o=j.current.children,c=o.length,a=it?u(o).slice(c/3-n,c/3-n+c/3):u(o),l=a[r].offsetWidth,d=Be?a.reduce((function(e,t,n){return n>=r&&n<r+Be||n<r&&n<r+Be-a.length?e+t.offsetWidth:e}),0):L.current.offsetWidth,s=i-d,f=nt&&it?-(d-l)/2:0,m=it?i/3:0,v=t-r==0?0:"forward"===W.current&&r<t?m:"backward"===W.current&&r>t?-m:0,h=r-t!=0,b=function(e){var t=a.reduce((function(t,n,r){return r>=e?t:t+(n.offsetWidth||0)}),0);return it?t:Math.min(s,t)},p=h&&it?b(t):0,y=h||!it?b(r):0,w=It?0:y-p+f+v+m,x="translateX(-".concat(w,"px)"),g=it?m+f:Math.min(s,a.reduce((function(e,t,n){return n<r?e+t.offsetWidth:e}),0)),S=g+d,C=a.map((function(e,t){return{slideIndex:t,htmlElement:e}})),E=it?[].concat(u(a.slice(r).map((function(e,t){return{slideIndex:t+r,htmlElement:e}}))),u(C),u(C),u(a.slice(0,r).map((function(e,t){return{slideIndex:t,htmlElement:e}})))):C,k=E.reduce((function(e,t){var n=t.slideIndex,r=t.htmlElement.offsetWidth;return(e.summ>=g&&e.summ<S||e.summ+r>g&&e.summ+r<=S)&&e.items.push({slideIndex:n,isFullyVisible:e.summ+r<=S&&e.summ>=g}),e.summ+=r,e}),{summ:0,items:[]}),T=!!k.items.find((function(e){return 0===e.slideIndex})),I=!!k.items.find((function(e){return e.slideIndex===a.length-1}));return{slidesHTMLElements:a,innerMaxWidth:d,itemsListMaxTranslateX:s,activeSlideWidth:l,offsetCorrectionForCenterMode:f,offsetCorrectionForInfiniteMode:m,itemsListTranslateX:w,itemsListTransform:x,visibleSlides:k.items,isFirstSlideVisible:T,isLastSlideVisible:I}}),[nt,It,it,Be]),jt=C?Lt({prevCorrectionSlideIndex:N.current,curActiveSlideIndex:We,correctionSlideIndex:T}):{},Mt=jt.innerMaxWidth,Pt=void 0===Mt?0:Mt,Wt=jt.itemsListMaxTranslateX,At=void 0===Wt?0:Wt,Rt=jt.activeSlideWidth,Xt=void 0===Rt?0:Rt,Nt=jt.offsetCorrectionForCenterMode,Dt=void 0===Nt?0:Nt,Ft=jt.offsetCorrectionForInfiniteMode,Vt=void 0===Ft?0:Ft,zt=jt.itemsListTranslateX,Bt=void 0===zt?0:zt,qt=jt.itemsListTransform,Ht=void 0===qt?"none":qt,Ut=jt.visibleSlides,$t=void 0===Ut?[]:Ut,Gt=e.useCallback((function(e){if("forward"===e){var t=We+He;return t>Et?it?t-Et-1:Et:t}if("backward"===e){var n=We-He;return n<0?it?Et+1+n:0:n}return We}),[We,He,Et,it]),Jt=e.useCallback((function(e,t){if(W.current=t,j.current.style.transition=Xe||De?"transform ".concat(Xe,"ms ").concat(Ve," ").concat(De,"ms"):"none",e!==We||ft){clearTimeout(A.current);var n=Lt({correctionSlideIndex:T,prevCorrectionSlideIndex:T,curActiveSlideIndex:e}),r=n.visibleSlides,i=n.isFirstSlideVisible,o=n.isLastSlideVisible;Ae(e,{visibleSlides:r,isFirstSlideVisible:i,isLastSlideVisible:o})}else M.current=0,j.current.style.transform="translateX(-".concat(Dt+Vt+(it?0:Bt),"px)")}),[ft,We,Dt,De,Ve,Xe,Ae,Vt,it,Bt,T,Lt]),Kt=e.useCallback((function(){Je&&(clearTimeout(A.current),A.current=setTimeout((function(){Jt(Gt(Qe),Qe)}),vt||De))}),[Je,Qe,vt,Jt,Gt,De]),Qt=e.useCallback((function(e){P.current&&(e.preventDefault(),e.stopPropagation(),U&&U(e))}),[U]),Yt=e.useCallback((function(){Jt(Gt("backward"),"backward")}),[Jt,Gt]),Zt=e.useCallback((function(e){P.current=!0;var t=e.touches&&e.touches[0]?e.touches[0].clientX:e.clientX,n=M.current-t+Dt+Vt+(it?0:Bt),r=j.current.offsetWidth-L.current.offsetWidth,i=Math.max(Math.min(0,-n),-r);j.current.style.transition="none",j.current.style.transform="translateX(".concat(i,"px)")}),[Dt,Vt,it,Bt]),_t=e.useCallback((function(e){if(j.current.removeEventListener("mouseout",_t),j.current.removeEventListener("dragstart",_t),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",_t),document.removeEventListener("touchmove",Zt),document.removeEventListener("touchend",_t),P.current){var t=e.changedTouches&&e.changedTouches.length?e.changedTouches[e.changedTouches.length-1].clientX:e.clientX,n=M.current-t,r=n>Xt/2?{index:Gt("forward"),direction:"forward"}:n<-Xt/2?{index:Gt("backward"),direction:"backward"}:{index:We,direction:"forward"};r.index===We&&(P.current=!1),Jt(r.index,r.direction)}}),[We,Xt,Jt,Gt,Zt]),en=e.useCallback((function(e){clearTimeout(A.current),P.current||(M.current=e.clientX,document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",_t),j.current.addEventListener("mouseout",_t),j.current.addEventListener("dragstart",_t)),re&&re(e)}),[Zt,_t,re]),tn=e.useCallback((function(e){clearTimeout(A.current),P.current||(M.current=e.touches[0].clientX,document.addEventListener("touchmove",Zt),document.addEventListener("touchend",_t)),te&&te(e)}),[Zt,_t,te]),nn=e.useCallback((function(e){I(We),oe&&oe(e)}),[We,oe]),rn=e.useCallback((function(){Jt(Gt("forward"),"forward")}),[Jt,Gt]),on=function(e,t,n){return e.map((function(e,r){var o=e.props,c=(o=void 0===o?{}:o).className,l=void 0===c?"":c,u=o.onClick,d=void 0===u?null:u,s=o.style,f=void 0===s?{}:s,m=a(o,g),v=a(e,S),h=it?X.current>=F.length?"forward":"backward":r>=We?"forward":"backward",b=r+t===We,p=$t.find((function(e){return e.slideIndex===r+t})),y="".concat(l," ").concat(h," ").concat(b?ge:""," ").concat(p?Ie:""),w=i(i(i(i({},f),p?Le:{}),b?Ce:{}),{},{boxSizing:"border-box",margin:0}),x=!n&&Pe?function(e){var t=e.direction,n=e.index,r=e.onClick;return function(e){Jt(n,t||(We<n?"forward":"")||(We>n?"backward":"")),r&&r(e)}}({direction:h,index:r+t,onClick:d}):d,C=i(i(i({role:"tabpanel",className:y,style:w,onClick:x},m),p?je:{}),b?Ee:{});return X.current+=1,i({props:C},v)}))};return e.useEffect((function(){return M.current=0,T===We&&(P.current=!1),W.current="",We!==T?Xe||De||I(We):($e&&$e(We,T),(it||"forward"===Qe&&We!==Et||"backward"===Qe&&0!==We)&&Kt()),function(){clearTimeout(A.current)}}),[T,We,$e,Xe,De,Kt,it,Et,Qe]),e.useEffect((function(){return C&&Kt(),function(){clearTimeout(A.current)}}),[C]),e.useEffect((function(){var e=j.current;function t(){clearTimeout(R.current),clearTimeout(A.current),R.current=setTimeout((function(){C!==window.innerWidth&&E(window.innerWidth)}),400)}return C!==window.innerWidth&&E(window.innerWidth),window.addEventListener("resize",t),function(){clearTimeout(R.current),window.removeEventListener("resize",t),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",_t),document.removeEventListener("touchmove",Zt),document.removeEventListener("touchend",_t),e.removeEventListener("mouseout",_t),e.removeEventListener("dragstart",_t)}}),[Zt,_t]),X.current=0,N.current=T,n.default.createElement("div",c({onClickCapture:Qt,style:i({display:"flex",flexFlow:"row wrap",boxSizing:"border-box",justifyContent:"center",width:"100%"},q)},$,{ref:O}),se&&!Tt&&n.default.createElement("button",c({},fe,{type:"button",onClick:(0===Bt&&ct||0===We&<)&&!it?void 0:Yt,disabled:"boolean"==typeof fe.disabled?fe.disabled:!(!(0===Bt&&ct||0===We&<)||it)}),ue),n.default.createElement("div",c({},Q,{style:i(i({},K),{},{display:"flex",boxSizing:"border-box",flexFlow:"row wrap",padding:"0",overflow:"hidden",maxWidth:Pt?"".concat(Pt,"px"):void 0,flex:Pt?void 0:"1 0"}),ref:L}),n.default.createElement("div",c({},ce,{style:i(i({},_),{},{display:"flex",boxSizing:"border-box",outline:"none",transition:Ot,transform:Ht}),onTouchStart:It?void 0:tn,onMouseDown:It?void 0:en,onTransitionEnd:Xe||De?nn:void 0,tabIndex:-1,role:"presentation",ref:j}),it&&on(F.slice(T),T,It),on(F,0,It),it&&on(F,0,It),it&&on(F.slice(0,T),0,It))),pe&&!Tt&&n.default.createElement("button",c({},ye,{type:"button",onClick:(Bt===At&&ct||We===Et&<)&&!it?void 0:rn,disabled:"boolean"==typeof ye.disabled?ye.disabled:!(!(Bt===At&&ct||We===Et&<)||it)}),he),!!pt&&n.default.createElement("div",c({style:{width:"100%",display:"flex",justifyContent:"center"}},wt),Array.from({length:Math.ceil(F.length/He)}).map((function(e,t){return n.default.createElement("button",c({type:"button",key:t,title:"".concat(t)},gt,We>=t*He&&We<Math.min(He*(t+1),Et+1)?Ct:{},{onClick:function(){Jt(Math.min(t*He,F.length-1),Math.min(t*He,F.length-1)>We?"forward":"backward")}}))}))))}return e.memo(C)})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).ReactSimplyCarousel=t(e.React)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function a(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],c=!0,a=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){a=!0,i=e}finally{try{c||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||d(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 u(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)||d(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 d(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=["responsiveProps"],v=["minWidth","maxWidth"],m=["style","onClickCapture"],h=["style"],b=["style","onTouchStart","onMouseDown","onTransitionEnd"],p=["children","show"],y=["children","show"],w=["className","style"],x=["className","style"],g=["className","onClick","style"],S=["props"];function C(t){var r=t.responsiveProps,o=void 0===r?[]:r,d=a(t,f),s=l(e.useState(0),2),C=s[0],E=s[1],k=l(e.useState(d.activeSlideIndex),2),T=k[0],I=k[1],O=e.useRef(null),L=e.useRef(null),j=e.useRef(null),M=e.useRef(0),P=e.useRef(!1),W=e.useRef(""),A=e.useRef(null),R=e.useRef(null),X=e.useRef(0),N=e.useRef(T),D=o.reduce((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.minWidth,r=void 0===n?0:n,o=t.maxWidth,c=void 0===o?null:o,l=a(t,v);return C>r&&(!c||C<=c)?i(i({},e),l):e}),d),F=e.Children.toArray(D.children),V=C?i(i({},D),{},{activeSlideIndex:Math.max(0,Math.min(D.activeSlideIndex,F.length-1)),itemsToShow:Math.min(F.length,D.itemsToShow||0),itemsToScroll:Math.min(F.length,D.itemsToScroll||1)}):d,z=V.containerProps,B=(z=void 0===z?{}:z).style,q=void 0===B?{}:B,H=z.onClickCapture,U=void 0===H?null:H,$=a(z,m),G=V.innerProps,J=(G=void 0===G?{}:G).style,K=void 0===J?{}:J,Q=a(G,h),Y=V.itemsListProps,Z=(Y=void 0===Y?{}:Y).style,_=void 0===Z?{}:Z,ee=Y.onTouchStart,te=void 0===ee?null:ee,ne=Y.onMouseDown,re=void 0===ne?null:ne,ie=Y.onTransitionEnd,oe=void 0===ie?null:ie,ce=a(Y,b),ae=V.backwardBtnProps,le=(ae=void 0===ae?{}:ae).children,ue=void 0===le?null:le,de=ae.show,se=void 0===de||de,fe=a(ae,p),ve=V.forwardBtnProps,me=(ve=void 0===ve?{}:ve).children,he=void 0===me?null:me,be=ve.show,pe=void 0===be||be,ye=a(ve,y),we=V.activeSlideProps,xe=(we=void 0===we?{}:we).className,ge=void 0===xe?"":xe,Se=we.style,Ce=void 0===Se?{}:Se,Ee=a(we,w),ke=V.visibleSlideProps,Te=(ke=void 0===ke?{}:ke).className,Ie=void 0===Te?"":Te,Oe=ke.style,Le=void 0===Oe?{}:Oe,je=a(ke,x),Me=V.updateOnItemClick,Pe=void 0!==Me&&Me,We=V.activeSlideIndex,Ae=V.onRequestChange,Re=V.speed,Xe=void 0===Re?0:Re,Ne=V.delay,De=void 0===Ne?0:Ne,Fe=V.easing,Ve=void 0===Fe?"linear":Fe,ze=V.itemsToShow,Be=void 0===ze?0:ze,qe=V.itemsToScroll,He=void 0===qe?1:qe,Ue=V.children,$e=V.onAfterChange,Ge=V.autoplay,Je=void 0!==Ge&&Ge,Ke=V.autoplayDirection,Qe=void 0===Ke?"forward":Ke,Ye=V.disableNavIfAllVisible,Ze=void 0===Ye||Ye,_e=V.hideNavIfAllVisible,et=void 0===_e||_e,tt=V.centerMode,nt=void 0!==tt&&tt,rt=V.infinite,it=void 0===rt||rt,ot=V.disableNavIfEdgeVisible,ct=void 0===ot||ot,at=V.disableNavIfEdgeActive,lt=void 0===at||at,ut=V.dotsNav,dt=void 0===ut?{}:ut,st=V.persistentChangeCallbacks,ft=void 0!==st&&st,vt=V.autoplayDelay,mt=void 0===vt?0:vt,ht=dt||{},bt=ht.show,pt=void 0!==bt&&bt,yt=ht.containerProps,wt=void 0===yt?{}:yt,xt=ht.itemBtnProps,gt=void 0===xt?{}:xt,St=ht.activeItemBtnProps,Ct=void 0===St?{}:St,Et=e.Children.count(Ue)-1,kt=Be===F.length,Tt=et&&kt,It=Ze&&kt,Ot=We-T==0||!Xe&&!De?"none":"transform ".concat(Xe,"ms ").concat(Ve," ").concat(De,"ms"),Lt=e.useCallback((function(e){var t,n=e.correctionSlideIndex,r=e.prevCorrectionSlideIndex,i=e.curActiveSlideIndex,o=j.current.offsetWidth,c=j.current.children,a=c.length,l=it?u(c).slice(a/3-r,a/3-r+a/3):u(c),d=null===(t=l[i])||void 0===t?void 0:t.offsetWidth,s=Be?l.reduce((function(e,t,n){return n>=i&&n<i+Be||n<i&&n<i+Be-l.length?e+t.offsetWidth:e}),0):L.current.offsetWidth,f=o-s,v=nt&&it?-(s-d)/2:0,m=it?o/3:0,h=n-i==0?0:"forward"===W.current&&i<n?m:"backward"===W.current&&i>n?-m:0,b=i-n!=0,p=function(e){var t=l.reduce((function(t,n,r){return r>=e?t:t+(n.offsetWidth||0)}),0);return it?t:Math.min(f,t)},y=b&&it?p(n):0,w=b||!it?p(i):0,x=It?0:w-y+v+h+m,g="translateX(-".concat(x,"px)"),S=it?m+v:Math.min(f,l.reduce((function(e,t,n){return n<i?e+t.offsetWidth:e}),0)),C=S+s,E=l.map((function(e,t){return{slideIndex:t,htmlElement:e}})),k=it?[].concat(u(l.slice(i).map((function(e,t){return{slideIndex:t+i,htmlElement:e}}))),u(E),u(E),u(l.slice(0,i).map((function(e,t){return{slideIndex:t,htmlElement:e}})))):E,T=k.reduce((function(e,t){var n=t.slideIndex,r=t.htmlElement.offsetWidth;return(e.summ>=S&&e.summ<C||e.summ+r>S&&e.summ+r<=C)&&e.items.push({slideIndex:n,isFullyVisible:e.summ+r<=C&&e.summ>=S}),e.summ+=r,e}),{summ:0,items:[]}),I=!!T.items.find((function(e){return 0===e.slideIndex})),O=!!T.items.find((function(e){return e.slideIndex===l.length-1}));return{slidesHTMLElements:l,innerMaxWidth:s,itemsListMaxTranslateX:f,activeSlideWidth:d,offsetCorrectionForCenterMode:v,offsetCorrectionForInfiniteMode:m,itemsListTranslateX:x,itemsListTransform:g,visibleSlides:T.items,isFirstSlideVisible:I,isLastSlideVisible:O}}),[nt,It,it,Be]),jt=C?Lt({prevCorrectionSlideIndex:N.current,curActiveSlideIndex:We,correctionSlideIndex:T}):{},Mt=jt.innerMaxWidth,Pt=void 0===Mt?0:Mt,Wt=jt.itemsListMaxTranslateX,At=void 0===Wt?0:Wt,Rt=jt.activeSlideWidth,Xt=void 0===Rt?0:Rt,Nt=jt.offsetCorrectionForCenterMode,Dt=void 0===Nt?0:Nt,Ft=jt.offsetCorrectionForInfiniteMode,Vt=void 0===Ft?0:Ft,zt=jt.itemsListTranslateX,Bt=void 0===zt?0:zt,qt=jt.itemsListTransform,Ht=void 0===qt?"none":qt,Ut=jt.visibleSlides,$t=void 0===Ut?[]:Ut,Gt=e.useCallback((function(e){if("forward"===e){var t=We+He;return t>Et?it?t-Et-1:Et:t}if("backward"===e){var n=We-He;return n<0?it?Et+1+n:0:n}return We}),[We,He,Et,it]),Jt=e.useCallback((function(e,t){if(W.current=t,j.current.style.transition=Xe||De?"transform ".concat(Xe,"ms ").concat(Ve," ").concat(De,"ms"):"none",e!==We||ft){clearTimeout(A.current);var n=Lt({correctionSlideIndex:T,prevCorrectionSlideIndex:T,curActiveSlideIndex:e}),r=n.visibleSlides,i=n.isFirstSlideVisible,o=n.isLastSlideVisible;Ae(e,{visibleSlides:r,isFirstSlideVisible:i,isLastSlideVisible:o})}else M.current=0,j.current.style.transform="translateX(-".concat(Dt+Vt+(it?0:Bt),"px)")}),[ft,We,Dt,De,Ve,Xe,Ae,Vt,it,Bt,T,Lt]),Kt=e.useCallback((function(){Je&&(clearTimeout(A.current),A.current=setTimeout((function(){Jt(Gt(Qe),Qe)}),mt||De))}),[Je,Qe,mt,Jt,Gt,De]),Qt=e.useCallback((function(e){P.current&&(e.preventDefault(),e.stopPropagation(),U&&U(e))}),[U]),Yt=e.useCallback((function(){Jt(Gt("backward"),"backward")}),[Jt,Gt]),Zt=e.useCallback((function(e){P.current=!0;var t=e.touches&&e.touches[0]?e.touches[0].clientX:e.clientX,n=M.current-t+Dt+Vt+(it?0:Bt),r=j.current.offsetWidth-L.current.offsetWidth,i=Math.max(Math.min(0,-n),-r);j.current.style.transition="none",j.current.style.transform="translateX(".concat(i,"px)")}),[Dt,Vt,it,Bt]),_t=e.useCallback((function(e){if(j.current.removeEventListener("mouseout",_t),j.current.removeEventListener("dragstart",_t),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",_t),document.removeEventListener("touchmove",Zt),document.removeEventListener("touchend",_t),P.current){var t=e.changedTouches&&e.changedTouches.length?e.changedTouches[e.changedTouches.length-1].clientX:e.clientX,n=M.current-t,r=n>Xt/2?{index:Gt("forward"),direction:"forward"}:n<-Xt/2?{index:Gt("backward"),direction:"backward"}:{index:We,direction:"forward"};r.index===We&&(P.current=!1),Jt(r.index,r.direction)}}),[We,Xt,Jt,Gt,Zt]),en=e.useCallback((function(e){clearTimeout(A.current),P.current||(M.current=e.clientX,document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",_t),j.current.addEventListener("mouseout",_t),j.current.addEventListener("dragstart",_t)),re&&re(e)}),[Zt,_t,re]),tn=e.useCallback((function(e){clearTimeout(A.current),P.current||(M.current=e.touches[0].clientX,document.addEventListener("touchmove",Zt),document.addEventListener("touchend",_t)),te&&te(e)}),[Zt,_t,te]),nn=e.useCallback((function(e){I(We),oe&&oe(e)}),[We,oe]),rn=e.useCallback((function(){Jt(Gt("forward"),"forward")}),[Jt,Gt]),on=function(e,t,n){return e.map((function(e,r){var o=e.props,c=(o=void 0===o?{}:o).className,l=void 0===c?"":c,u=o.onClick,d=void 0===u?null:u,s=o.style,f=void 0===s?{}:s,v=a(o,g),m=a(e,S),h=it?X.current>=F.length?"forward":"backward":r>=We?"forward":"backward",b=r+t===We,p=$t.find((function(e){return e.slideIndex===r+t})),y="".concat(l," ").concat(h," ").concat(b?ge:""," ").concat(p?Ie:""),w=i(i(i(i({},f),p?Le:{}),b?Ce:{}),{},{boxSizing:"border-box",margin:0}),x=!n&&Pe?function(e){var t=e.direction,n=e.index,r=e.onClick;return function(e){Jt(n,t||(We<n?"forward":"")||(We>n?"backward":"")),r&&r(e)}}({direction:h,index:r+t,onClick:d}):d,C=i(i(i({role:"tabpanel",className:y,style:w,onClick:x},v),p?je:{}),b?Ee:{});return X.current+=1,i({props:C},m)}))};return e.useEffect((function(){return M.current=0,T===We&&(P.current=!1),W.current="",We!==T?Xe||De||I(We):($e&&$e(We,T),(it||"forward"===Qe&&We!==Et||"backward"===Qe&&0!==We)&&Kt()),function(){clearTimeout(A.current)}}),[T,We,$e,Xe,De,Kt,it,Et,Qe]),e.useEffect((function(){return C&&Kt(),function(){clearTimeout(A.current)}}),[C]),e.useEffect((function(){var e=j.current;function t(){clearTimeout(R.current),clearTimeout(A.current),R.current=setTimeout((function(){C!==window.innerWidth&&E(window.innerWidth)}),400)}return C!==window.innerWidth&&E(window.innerWidth),window.addEventListener("resize",t),function(){clearTimeout(R.current),window.removeEventListener("resize",t),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",_t),document.removeEventListener("touchmove",Zt),document.removeEventListener("touchend",_t),e.removeEventListener("mouseout",_t),e.removeEventListener("dragstart",_t)}}),[Zt,_t]),X.current=0,N.current=T,n.default.createElement("div",c({onClickCapture:Qt,style:i({display:"flex",flexFlow:"row wrap",boxSizing:"border-box",justifyContent:"center",width:"100%"},q)},$,{ref:O}),se&&!Tt&&n.default.createElement("button",c({},fe,{type:"button",onClick:(0===Bt&&ct||0===We&<)&&!it?void 0:Yt,disabled:"boolean"==typeof fe.disabled?fe.disabled:!(!(0===Bt&&ct||0===We&<)||it)}),ue),n.default.createElement("div",c({},Q,{style:i(i({},K),{},{display:"flex",boxSizing:"border-box",flexFlow:"row wrap",padding:"0",overflow:"hidden",maxWidth:Pt?"".concat(Pt,"px"):void 0,flex:Pt?void 0:"1 0"}),ref:L}),n.default.createElement("div",c({},ce,{style:i(i({},_),{},{display:"flex",boxSizing:"border-box",outline:"none",transition:Ot,transform:Ht}),onTouchStart:It?void 0:tn,onMouseDown:It?void 0:en,onTransitionEnd:Xe||De?nn:void 0,tabIndex:-1,role:"presentation",ref:j}),it&&on(F.slice(T),T,It),on(F,0,It),it&&on(F,0,It),it&&on(F.slice(0,T),0,It))),pe&&!Tt&&n.default.createElement("button",c({},ye,{type:"button",onClick:(Bt===At&&ct||We===Et&<)&&!it?void 0:rn,disabled:"boolean"==typeof ye.disabled?ye.disabled:!(!(Bt===At&&ct||We===Et&<)||it)}),he),!!pt&&n.default.createElement("div",c({style:{width:"100%",display:"flex",justifyContent:"center"}},wt),Array.from({length:Math.ceil(F.length/He)}).map((function(e,t){return n.default.createElement("button",c({type:"button",key:t,title:"".concat(t)},gt,We>=t*He&&We<Math.min(He*(t+1),Et+1)?Ct:{},{onClick:function(){Jt(Math.min(t*He,F.length-1),Math.min(t*He,F.length-1)>We?"forward":"backward")}}))}))))}return e.memo(C)})); |
{ | ||
"name": "react-simply-carousel", | ||
"version": "8.4.2", | ||
"version": "8.4.3", | ||
"description": "A simple, lightweight, fully controlled isomorphic (with SSR support) React.js carousel component. Touch enabled and responsive. With support for autoplay and infinity options. Fully customizable", | ||
@@ -5,0 +5,0 @@ "files": [ |
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
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
52006
1