diff --git a/404.html b/404.html index 5072d42e..cb653ee7 100644 --- a/404.html +++ b/404.html @@ -17,7 +17,7 @@
- + \ No newline at end of file diff --git a/api/data.html b/api/data.html index 11fb70de..20e188c7 100644 --- a/api/data.html +++ b/api/data.html @@ -27,7 +27,7 @@ // Do your magic here } ....

Available Data

DataDescription
configthe current carousel configuration
slidesCountslides total count
slideWidthsingle slide width
currentSlidecurrent slide index
maxSlidemaximum slide index
minSlideminimum slide index
middleSlidemiddle slide index
- + \ No newline at end of file diff --git a/api/events.html b/api/events.html index 8fb4ba64..c5440366 100644 --- a/api/events.html +++ b/api/events.html @@ -38,7 +38,7 @@ }, }) </script>

@before-init

Triggers before the carousel initialized

@init

Triggers once the carousel is mounted and completely initialized

@slide-start

Triggers at the binging of sliding function. it emits the following data:

@slide-end

Triggers after finishing of sliding function and the current slide has been update. it emits the following data:

@loop

Triggers after the carousel is going to loop over, only on wrap-around mode. it emits the following data:

- + \ No newline at end of file diff --git a/api/methods.html b/api/methods.html index ca02a5e8..cfa78bc6 100644 --- a/api/methods.html +++ b/api/methods.html @@ -25,7 +25,7 @@ // Methods are available in this reference myCarousel.next() myCarousel.updateSlideWidth()

slideTo(index: number)

Slide to specific slide index

next()

Slide to the next slide

prev()

Slide to the previous slide

updateSlideWidth()

Update slideWidth value based on itemsToShow and the current carousel width

updateBreakpointsConfig()

Update the current carousel config based on breakpoints settings and screen width

updateSlidesData()

Update all the slide related date includes:

initDefaultConfig()

Init carousel default configurations

restartCarousel()

Restart the carousel settings and data, internally it calls:

- + \ No newline at end of file diff --git a/assets/chunks/ExampleBasic.Bf8QP3Fu.js b/assets/chunks/ExampleBasic.Bf8QP3Fu.js deleted file mode 100644 index 13cfd850..00000000 --- a/assets/chunks/ExampleBasic.Bf8QP3Fu.js +++ /dev/null @@ -1,5 +0,0 @@ -import{d as oe,p as u,h as M,a5 as T,V as x,v as Ce,P as Oe,x as Me,q as Z,a6 as ge,a7 as m,L as p,F as be,o as he,b as Ie,w as ee,k as $,G as te,c as Le,C as Ee,j as De,t as je}from"./framework.CH_Jd00V.js";/** - * Vue 3 Carousel 0.4.0 - * (c) 2024 - * @license MIT - */const we=["center","start","end","center-even","center-odd"],_e=["viewport","carousel"],xe=["ltr","rtl"],Pe={ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaGallery:"Gallery",itemXofY:"Item {currentSlide} of {slidesCount}",iconArrowUp:"Arrow pointing upwards",iconArrowDown:"Arrow pointing downwards",iconArrowRight:"Arrow pointing to the right",iconArrowLeft:"Arrow pointing to the left"},d={itemsToShow:1,itemsToScroll:1,modelValue:0,transition:300,autoplay:0,throttle:16,wrapAround:!1,pauseAutoplayOnHover:!1,mouseDrag:!0,touchDrag:!0,snapAlign:we[0],dir:xe[0],breakpointMode:_e[0],breakpoints:void 0,i18n:Pe},Se={itemsToShow:{default:d.itemsToShow,type:Number},itemsToScroll:{default:d.itemsToScroll,type:Number},wrapAround:{default:d.wrapAround,type:Boolean},throttle:{default:d.throttle,type:Number},snapAlign:{default:d.snapAlign,validator(e){return we.includes(e)}},transition:{default:d.transition,type:Number},breakpointMode:{default:d.breakpointMode,validator(e){return _e.includes(e)}},breakpoints:{default:d.breakpoints,type:Object},autoplay:{default:d.autoplay,type:Number},pauseAutoplayOnHover:{default:d.pauseAutoplayOnHover,type:Boolean},modelValue:{default:void 0,type:Number},mouseDrag:{default:d.mouseDrag,type:Boolean},touchDrag:{default:d.touchDrag,type:Boolean},dir:{default:d.dir,validator(e){return xe.includes(e)}},i18n:{default:d.i18n,type:Object}};function Be({config:e,slidesCount:n}){const{snapAlign:t,wrapAround:l,itemsToShow:r=1}=e;if(l)return Math.max(n-1,0);let i;switch(t){case"start":i=n-r;break;case"end":i=n-1;break;case"center":case"center-odd":i=n-Math.ceil((r-.5)/2);break;case"center-even":i=n-Math.ceil(r/2);break;default:i=0;break}return Math.max(i,0)}function Re({config:e,slidesCount:n}){const{wrapAround:t,snapAlign:l,itemsToShow:r=1}=e;let i=0;if(t||r>n)return i;switch(l){case"start":i=0;break;case"end":i=r-1;break;case"center":case"center-odd":i=Math.floor((r-1)/2);break;case"center-even":i=Math.floor((r-2)/2);break;default:i=0;break}return i}function ne({val:e,max:n,min:t}){return n{var l;return t.type===be?[...n,...ye(t.children)]:((l=t.type)===null||l===void 0?void 0:l.name)==="CarouselSlide"?[...n,t]:n},[]):[]}function F({val:e,max:n,min:t=0}){return e>n?F({val:e-(n+1),max:n,min:t}):et=!1,n))}:e}function Ue(e,n){let t;return function(...l){t&&clearTimeout(t),t=setTimeout(()=>{e(...l),t=null},n)}}function Ae(e="",n={}){return Object.entries(n).reduce((t,[l,r])=>t.replace(`{${l}}`,String(r)),e)}var Xe=oe({name:"ARIA",setup(){const e=p("config",T(Object.assign({},d))),n=p("currentSlide",u(0)),t=p("slidesCount",u(0));return()=>m("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},Ae(e.i18n.itemXofY,{currentSlide:n.value+1,slidesCount:t.value}))}}),$e=oe({name:"Carousel",props:Se,setup(e,{slots:n,emit:t,expose:l}){var r;const i=u(null),f=u([]),c=u(0),v=u(0),b=M(()=>Object.assign(Object.assign(Object.assign({},d),e),{i18n:Object.assign(Object.assign({},d.i18n),e.i18n),breakpoints:void 0})),o=T(Object.assign({},b.value)),s=u((r=e.modelValue)!==null&&r!==void 0?r:0),I=u(0),E=u(0),y=u(0),k=u(0);let L=null,G=null,D=null;x("config",o),x("slidesCount",v),x("currentSlide",s),x("maxSlide",y),x("minSlide",k),x("slideWidth",c);function B(){var a;if(!e.breakpoints)return;const g=(o.breakpointMode==="carousel"?(a=i.value)===null||a===void 0?void 0:a.getBoundingClientRect().width:window.innerWidth)||0,S=Object.keys(e.breakpoints||{}).map(w=>Number(w)).sort((w,_)=>+_-+w);let A=Object.assign({},b.value);S.some(w=>{var _;return g>=w?(A=Object.assign(Object.assign({},A),(_=e.breakpoints)===null||_===void 0?void 0:_[w]),!0):!1}),Object.assign(o,A)}const Y=Ue(()=>{B(),R(),j()},16);function j(){if(!i.value)return;const a=i.value.getBoundingClientRect();c.value=a.width/o.itemsToShow}function R(){v.value<=0||(E.value=Math.ceil((v.value-1)/2),y.value=Be({config:o,slidesCount:v.value}),k.value=Re({config:o,slidesCount:v.value}),o.wrapAround||(s.value=ne({val:s.value,max:y.value,min:k.value})))}Ce(()=>{Oe(()=>j()),setTimeout(()=>j(),1e3),B(),ue(),window.addEventListener("resize",Y,{passive:!0}),D=new ResizeObserver(Y),i.value&&D.observe(i.value),t("init")}),Me(()=>{G&&clearTimeout(G),L&&clearInterval(L),D&&i.value&&(D.unobserve(i.value),D=null),window.removeEventListener("resize",Y,{passive:!0})});let h=!1;const V={x:0,y:0},z={x:0,y:0},N=T({x:0,y:0}),U=u(!1),H=u(!1),Te=()=>{U.value=!0},ke=()=>{U.value=!1};function le(a){["INPUT","TEXTAREA","SELECT"].includes(a.target.tagName)||(h=a.type==="touchstart",h||a.preventDefault(),!(!h&&a.button!==0||C.value)&&(V.x=h?a.touches[0].clientX:a.clientX,V.y=h?a.touches[0].clientY:a.clientY,document.addEventListener(h?"touchmove":"mousemove",re),document.addEventListener(h?"touchend":"mouseup",se)))}const re=ze(a=>{H.value=!0,z.x=h?a.touches[0].clientX:a.clientX,z.y=h?a.touches[0].clientY:a.clientY;const g=z.x-V.x,S=z.y-V.y;N.y=S,N.x=g},o.throttle);function se(){const a=o.dir==="rtl"?-1:1,g=Math.sign(N.x)*.4,S=Math.round(N.x/c.value+g)*a;if(S&&!h){const A=w=>{w.preventDefault(),window.removeEventListener("click",A)};window.addEventListener("click",A)}O(s.value-S),N.x=0,N.y=0,H.value=!1,document.removeEventListener(h?"touchmove":"mousemove",re),document.removeEventListener(h?"touchend":"mouseup",se)}function ue(){!o.autoplay||o.autoplay<=0||(L=setInterval(()=>{o.pauseAutoplayOnHover&&U.value||X()},o.autoplay))}function ce(){L&&(clearInterval(L),L=null),ue()}const C=u(!1);function O(a){const g=o.wrapAround?a:ne({val:a,max:y.value,min:k.value});s.value===g||C.value||(t("slide-start",{slidingToIndex:a,currentSlideIndex:s.value,prevSlideIndex:I.value,slidesCount:v.value}),C.value=!0,I.value=s.value,s.value=g,G=setTimeout(()=>{if(o.wrapAround){const S=F({val:g,max:y.value,min:0});S!==s.value&&(s.value=S,t("loop",{currentSlideIndex:s.value,slidingToIndex:a}))}t("update:modelValue",s.value),t("slide-end",{currentSlideIndex:s.value,prevSlideIndex:I.value,slidesCount:v.value}),C.value=!1,ce()},o.transition))}function X(){O(s.value+o.itemsToScroll)}function W(){O(s.value-o.itemsToScroll)}const de={slideTo:O,next:X,prev:W};x("nav",de),x("isSliding",C);const ve=M(()=>Ve({config:o,currentSlide:s.value,slidesCount:v.value}));x("slidesToScroll",ve);const Ne=M(()=>{const a=o.dir==="rtl"?-1:1,g=ve.value*c.value*a;return{transform:`translateX(${N.x-g}px)`,transition:`${C.value?o.transition:0}ms`,margin:o.wrapAround?`0 -${v.value*c.value}px`:"",width:"100%"}});function fe(){B(),R(),j(),ce()}Object.keys(Se).forEach(a=>{["modelValue"].includes(a)||Z(()=>e[a],fe)}),Z(()=>e.modelValue,a=>{a!==s.value&&O(Number(a))}),Z(v,R),t("before-init");const pe={config:o,slidesCount:v,slideWidth:c,next:X,prev:W,slideTo:O,currentSlide:s,maxSlide:y,minSlide:k,middleSlide:E};l({updateBreakpointsConfig:B,updateSlidesData:R,updateSlideWidth:j,restartCarousel:fe,slideTo:O,next:X,prev:W,nav:de,data:pe});const q=n.default||n.slides,K=n.addons,me=T(pe);return()=>{const a=ye(q==null?void 0:q(me)),g=(K==null?void 0:K(me))||[];a.forEach((_,J)=>_.props.index=J);let S=a;if(o.wrapAround){const _=a.map((Q,P)=>ge(Q,{index:-a.length+P,isClone:!0,key:`clone-before-${P}`})),J=a.map((Q,P)=>ge(Q,{index:a.length+P,isClone:!0,key:`clone-after-${P}`}));S=[..._,...a,...J]}f.value=a,v.value=Math.max(a.length,1);const A=m("ol",{class:"carousel__track",style:Ne.value,onMousedownCapture:o.mouseDrag?le:null,onTouchstartPassiveCapture:o.touchDrag?le:null},S),w=m("div",{class:"carousel__viewport"},A);return m("section",{ref:i,class:{carousel:!0,"is-sliding":C.value,"is-dragging":H.value,"is-hover":U.value,"carousel--rtl":o.dir==="rtl"},dir:o.dir,"aria-label":o.i18n.ariaGallery,tabindex:"0",onMouseenter:Te,onMouseleave:ke},[w,g,m(Xe)])}}}),ae;(function(e){e.arrowUp="arrowUp",e.arrowDown="arrowDown",e.arrowRight="arrowRight",e.arrowLeft="arrowLeft"})(ae||(ae={}));const Fe={arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z",arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"};function Ge(e){return e in ae}const ie=e=>{const n=p("config",T(Object.assign({},d))),t=String(e.name),l=`icon${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!t||typeof t!="string"||!Ge(t))return;const r=Fe[t],i=m("path",{d:r}),f=n.i18n[l]||e.title||t,c=m("title",f);return m("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":f},[c,i])};ie.props={name:String,title:String};const Ye=(e,{slots:n,attrs:t})=>{const{next:l,prev:r}=n||{},i=p("config",T(Object.assign({},d))),f=p("maxSlide",u(1)),c=p("minSlide",u(1)),v=p("currentSlide",u(1)),b=p("nav",{}),{dir:o,wrapAround:s,i18n:I}=i,E=o==="rtl",y=m("button",{type:"button",class:["carousel__prev",!s&&v.value<=c.value&&"carousel__prev--disabled",t==null?void 0:t.class],"aria-label":I.ariaPreviousSlide,onClick:b.prev},(r==null?void 0:r())||m(ie,{name:E?"arrowRight":"arrowLeft"})),k=m("button",{type:"button",class:["carousel__next",!s&&v.value>=f.value&&"carousel__next--disabled",t==null?void 0:t.class],"aria-label":I.ariaNextSlide,onClick:b.next},(l==null?void 0:l())||m(ie,{name:E?"arrowLeft":"arrowRight"}));return[y,k]},He=()=>{const e=p("config",T(Object.assign({},d))),n=p("maxSlide",u(1)),t=p("minSlide",u(1)),l=p("currentSlide",u(1)),r=p("nav",{}),i=c=>F({val:l.value,max:n.value,min:0})===c,f=[];for(let c=t.value;cr.slideTo(c)}),b=m("li",{class:"carousel__pagination-item",key:c},v);f.push(b)}return m("ol",{class:"carousel__pagination"},f)};var We=oe({name:"CarouselSlide",props:{index:{type:Number,default:1},isClone:{type:Boolean,default:!1}},setup(e,{slots:n}){const t=p("config",T(Object.assign({},d))),l=p("currentSlide",u(0)),r=p("slidesToScroll",u(0)),i=p("isSliding",u(!1)),f=M(()=>e.index===l.value),c=M(()=>e.index===l.value-1),v=M(()=>e.index===l.value+1),b=M(()=>{const o=Math.floor(r.value),s=Math.ceil(r.value+t.itemsToShow-1);return e.index>=o&&e.index<=s});return()=>{var o;return m("li",{style:{width:`${100/t.itemsToShow}%`},class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":b.value,"carousel__slide--active":f.value,"carousel__slide--prev":c.value,"carousel__slide--next":v.value,"carousel__slide--sliding":i.value},"aria-hidden":!b.value},(o=n.default)===null||o===void 0?void 0:o.call(n,{isActive:f.value,isClone:e.isClone,isPrev:c.value,isNext:v.value,isSliding:i.value,isVisible:b.value}))}}});const qe={class:"carousel__item"},Je={__name:"ExampleBasic",setup(e){return(n,t)=>(he(),Ie($($e),null,{addons:ee(()=>[te($(Ye)),te($(He))]),default:ee(()=>[(he(),Le(be,null,Ee(10,l=>te($(We),{key:l},{default:ee(()=>[De("div",qe,je(l),1)]),_:2},1024)),64))]),_:1}))}};export{$e as C,Ye as N,We as S,Je as _}; diff --git a/assets/chunks/ExampleBasic.DkclXpYQ.js b/assets/chunks/ExampleBasic.DkclXpYQ.js new file mode 100644 index 00000000..3bc13930 --- /dev/null +++ b/assets/chunks/ExampleBasic.DkclXpYQ.js @@ -0,0 +1,5 @@ +import{d as oe,p as u,h as M,a5 as T,V as _,v as Ce,P as Oe,x as Me,q as Q,a6 as me,a7 as m,L as p,F as Se,o as ge,b as Ie,w as Z,k as $,G as ee,c as Le,C as Ee,j as De,t as je}from"./framework.CH_Jd00V.js";/** + * Vue 3 Carousel 0.4.0 + * (c) 2024 + * @license MIT + */const be=["center","start","end","center-even","center-odd"],we=["viewport","carousel"],xe=["ltr","rtl"],Pe={ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaGallery:"Gallery",itemXofY:"Item {currentSlide} of {slidesCount}",iconArrowUp:"Arrow pointing upwards",iconArrowDown:"Arrow pointing downwards",iconArrowRight:"Arrow pointing to the right",iconArrowLeft:"Arrow pointing to the left"},d={itemsToShow:1,itemsToScroll:1,modelValue:0,transition:300,autoplay:0,throttle:16,wrapAround:!1,pauseAutoplayOnHover:!1,mouseDrag:!0,touchDrag:!0,snapAlign:be[0],dir:xe[0],breakpointMode:we[0],breakpoints:void 0,i18n:Pe},he={itemsToShow:{default:d.itemsToShow,type:Number},itemsToScroll:{default:d.itemsToScroll,type:Number},wrapAround:{default:d.wrapAround,type:Boolean},throttle:{default:d.throttle,type:Number},snapAlign:{default:d.snapAlign,validator(e){return be.includes(e)}},transition:{default:d.transition,type:Number},breakpointMode:{default:d.breakpointMode,validator(e){return we.includes(e)}},breakpoints:{default:d.breakpoints,type:Object},autoplay:{default:d.autoplay,type:Number},pauseAutoplayOnHover:{default:d.pauseAutoplayOnHover,type:Boolean},modelValue:{default:void 0,type:Number},mouseDrag:{default:d.mouseDrag,type:Boolean},touchDrag:{default:d.touchDrag,type:Boolean},dir:{default:d.dir,validator(e){return xe.includes(e)}},i18n:{default:d.i18n,type:Object}};function Be({config:e,slidesCount:a}){const{snapAlign:t,wrapAround:l,itemsToShow:r=1}=e;if(l)return Math.max(a-1,0);let o;switch(t){case"start":o=a-r;break;case"end":o=a-1;break;case"center":case"center-odd":o=a-Math.ceil((r-.5)/2);break;case"center-even":o=a-Math.ceil(r/2);break;default:o=0;break}return Math.max(o,0)}function Re({config:e,slidesCount:a}){const{wrapAround:t,snapAlign:l,itemsToShow:r=1}=e;let o=0;if(t||r>a)return o;switch(l){case"start":o=0;break;case"end":o=r-1;break;case"center":case"center-odd":o=Math.floor((r-1)/2);break;case"center-even":o=Math.floor((r-2)/2);break;default:o=0;break}return o}function te({val:e,max:a,min:t}){return a{var l;return t.type===Se?[...a,..._e(t.children)]:((l=t.type)===null||l===void 0?void 0:l.name)==="CarouselSlide"?[...a,t]:a},[]):[]}function ye({val:e,max:a,min:t=0}){const l=a-t+1;return((e-t)%l+l)%l+t}function ze(e,a){let t;return a?function(...l){const r=this;t||(e.apply(r,l),t=!0,setTimeout(()=>t=!1,a))}:e}function Ue(e,a){let t;return function(...l){t&&clearTimeout(t),t=setTimeout(()=>{e(...l),t=null},a)}}function Ae(e="",a={}){return Object.entries(a).reduce((t,[l,r])=>t.replace(`{${l}}`,String(r)),e)}var Xe=oe({name:"ARIA",setup(){const e=p("config",T(Object.assign({},d))),a=p("currentSlide",u(0)),t=p("slidesCount",u(0));return()=>m("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},Ae(e.i18n.itemXofY,{currentSlide:a.value+1,slidesCount:t.value}))}}),$e=oe({name:"Carousel",props:he,setup(e,{slots:a,emit:t,expose:l}){var r;const o=u(null),f=u([]),c=u(0),v=u(0),b=M(()=>Object.assign(Object.assign(Object.assign({},d),e),{i18n:Object.assign(Object.assign({},d.i18n),e.i18n),breakpoints:void 0})),i=T(Object.assign({},b.value)),s=u((r=e.modelValue)!==null&&r!==void 0?r:0),I=u(0),E=u(0),y=u(0),k=u(0);let L=null,F=null,D=null;_("config",i),_("slidesCount",v),_("currentSlide",s),_("maxSlide",y),_("minSlide",k),_("slideWidth",c);function B(){var n;if(!e.breakpoints)return;const g=(i.breakpointMode==="carousel"?(n=o.value)===null||n===void 0?void 0:n.getBoundingClientRect().width:window.innerWidth)||0,S=Object.keys(e.breakpoints||{}).map(w=>Number(w)).sort((w,x)=>+x-+w);let A=Object.assign({},b.value);S.some(w=>{var x;return g>=w?(A=Object.assign(Object.assign({},A),(x=e.breakpoints)===null||x===void 0?void 0:x[w]),!0):!1}),Object.assign(i,A)}const G=Ue(()=>{B(),R(),j()},16);function j(){if(!o.value)return;const n=o.value.getBoundingClientRect();c.value=n.width/i.itemsToShow}function R(){v.value<=0||(E.value=Math.ceil((v.value-1)/2),y.value=Be({config:i,slidesCount:v.value}),k.value=Re({config:i,slidesCount:v.value}),i.wrapAround||(s.value=te({val:s.value,max:y.value,min:k.value})))}Ce(()=>{Oe(()=>j()),setTimeout(()=>j(),1e3),B(),se(),window.addEventListener("resize",G,{passive:!0}),D=new ResizeObserver(G),o.value&&D.observe(o.value),t("init")}),Me(()=>{F&&clearTimeout(F),L&&clearInterval(L),D&&o.value&&(D.unobserve(o.value),D=null),window.removeEventListener("resize",G,{passive:!0})});let h=!1;const V={x:0,y:0},z={x:0,y:0},N=T({x:0,y:0}),U=u(!1),Y=u(!1),Te=()=>{U.value=!0},ke=()=>{U.value=!1};function ie(n){["INPUT","TEXTAREA","SELECT"].includes(n.target.tagName)||(h=n.type==="touchstart",h||n.preventDefault(),!(!h&&n.button!==0||C.value)&&(V.x=h?n.touches[0].clientX:n.clientX,V.y=h?n.touches[0].clientY:n.clientY,document.addEventListener(h?"touchmove":"mousemove",le),document.addEventListener(h?"touchend":"mouseup",re)))}const le=ze(n=>{Y.value=!0,z.x=h?n.touches[0].clientX:n.clientX,z.y=h?n.touches[0].clientY:n.clientY;const g=z.x-V.x,S=z.y-V.y;N.y=S,N.x=g},i.throttle);function re(){const n=i.dir==="rtl"?-1:1,g=Math.sign(N.x)*.4,S=Math.round(N.x/c.value+g)*n;if(S&&!h){const A=w=>{w.preventDefault(),window.removeEventListener("click",A)};window.addEventListener("click",A)}O(s.value-S),N.x=0,N.y=0,Y.value=!1,document.removeEventListener(h?"touchmove":"mousemove",le),document.removeEventListener(h?"touchend":"mouseup",re)}function se(){!i.autoplay||i.autoplay<=0||(L=setInterval(()=>{i.pauseAutoplayOnHover&&U.value||X()},i.autoplay))}function ue(){L&&(clearInterval(L),L=null),se()}const C=u(!1);function O(n){const g=i.wrapAround?n:te({val:n,max:y.value,min:k.value});s.value===g||C.value||(t("slide-start",{slidingToIndex:n,currentSlideIndex:s.value,prevSlideIndex:I.value,slidesCount:v.value}),C.value=!0,I.value=s.value,s.value=g,F=setTimeout(()=>{if(i.wrapAround){const S=ye({val:g,max:y.value,min:0});S!==s.value&&(s.value=S,t("loop",{currentSlideIndex:s.value,slidingToIndex:n}))}t("update:modelValue",s.value),t("slide-end",{currentSlideIndex:s.value,prevSlideIndex:I.value,slidesCount:v.value}),C.value=!1,ue()},i.transition))}function X(){O(s.value+i.itemsToScroll)}function H(){O(s.value-i.itemsToScroll)}const ce={slideTo:O,next:X,prev:H};_("nav",ce),_("isSliding",C);const de=M(()=>Ve({config:i,currentSlide:s.value,slidesCount:v.value}));_("slidesToScroll",de);const Ne=M(()=>{const n=i.dir==="rtl"?-1:1,g=de.value*c.value*n;return{transform:`translateX(${N.x-g}px)`,transition:`${C.value?i.transition:0}ms`,margin:i.wrapAround?`0 -${v.value*c.value}px`:"",width:"100%"}});function ve(){B(),R(),j(),ue()}Object.keys(he).forEach(n=>{["modelValue"].includes(n)||Q(()=>e[n],ve)}),Q(()=>e.modelValue,n=>{n!==s.value&&O(Number(n))}),Q(v,R),t("before-init");const fe={config:i,slidesCount:v,slideWidth:c,next:X,prev:H,slideTo:O,currentSlide:s,maxSlide:y,minSlide:k,middleSlide:E};l({updateBreakpointsConfig:B,updateSlidesData:R,updateSlideWidth:j,restartCarousel:ve,slideTo:O,next:X,prev:H,nav:ce,data:fe});const W=a.default||a.slides,q=a.addons,pe=T(fe);return()=>{const n=_e(W==null?void 0:W(pe)),g=(q==null?void 0:q(pe))||[];n.forEach((x,K)=>x.props.index=K);let S=n;if(i.wrapAround){const x=n.map((J,P)=>me(J,{index:-n.length+P,isClone:!0,key:`clone-before-${P}`})),K=n.map((J,P)=>me(J,{index:n.length+P,isClone:!0,key:`clone-after-${P}`}));S=[...x,...n,...K]}f.value=n,v.value=Math.max(n.length,1);const A=m("ol",{class:"carousel__track",style:Ne.value,onMousedownCapture:i.mouseDrag?ie:null,onTouchstartPassiveCapture:i.touchDrag?ie:null},S),w=m("div",{class:"carousel__viewport"},A);return m("section",{ref:o,class:{carousel:!0,"is-sliding":C.value,"is-dragging":Y.value,"is-hover":U.value,"carousel--rtl":i.dir==="rtl"},dir:i.dir,"aria-label":i.i18n.ariaGallery,tabindex:"0",onMouseenter:Te,onMouseleave:ke},[w,g,m(Xe)])}}}),ne;(function(e){e.arrowUp="arrowUp",e.arrowDown="arrowDown",e.arrowRight="arrowRight",e.arrowLeft="arrowLeft"})(ne||(ne={}));const Fe={arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z",arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"};function Ge(e){return e in ne}const ae=e=>{const a=p("config",T(Object.assign({},d))),t=String(e.name),l=`icon${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!t||typeof t!="string"||!Ge(t))return;const r=Fe[t],o=m("path",{d:r}),f=a.i18n[l]||e.title||t,c=m("title",f);return m("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":f},[c,o])};ae.props={name:String,title:String};const Ye=(e,{slots:a,attrs:t})=>{const{next:l,prev:r}=a||{},o=p("config",T(Object.assign({},d))),f=p("maxSlide",u(1)),c=p("minSlide",u(1)),v=p("currentSlide",u(1)),b=p("nav",{}),{dir:i,wrapAround:s,i18n:I}=o,E=i==="rtl",y=m("button",{type:"button",class:["carousel__prev",!s&&v.value<=c.value&&"carousel__prev--disabled",t==null?void 0:t.class],"aria-label":I.ariaPreviousSlide,onClick:b.prev},(r==null?void 0:r())||m(ae,{name:E?"arrowRight":"arrowLeft"})),k=m("button",{type:"button",class:["carousel__next",!s&&v.value>=f.value&&"carousel__next--disabled",t==null?void 0:t.class],"aria-label":I.ariaNextSlide,onClick:b.next},(l==null?void 0:l())||m(ae,{name:E?"arrowLeft":"arrowRight"}));return[y,k]},He=()=>{const e=p("config",T(Object.assign({},d))),a=p("maxSlide",u(1)),t=p("minSlide",u(1)),l=p("currentSlide",u(1)),r=p("nav",{}),o=c=>ye({val:l.value,max:a.value,min:0})===c,f=[];for(let c=t.value;cr.slideTo(c)}),b=m("li",{class:"carousel__pagination-item",key:c},v);f.push(b)}return m("ol",{class:"carousel__pagination"},f)};var We=oe({name:"CarouselSlide",props:{index:{type:Number,default:1},isClone:{type:Boolean,default:!1}},setup(e,{slots:a}){const t=p("config",T(Object.assign({},d))),l=p("currentSlide",u(0)),r=p("slidesToScroll",u(0)),o=p("isSliding",u(!1)),f=M(()=>e.index===l.value),c=M(()=>e.index===l.value-1),v=M(()=>e.index===l.value+1),b=M(()=>{const i=Math.floor(r.value),s=Math.ceil(r.value+t.itemsToShow-1);return e.index>=i&&e.index<=s});return()=>{var i;return m("li",{style:{width:`${100/t.itemsToShow}%`},class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":b.value,"carousel__slide--active":f.value,"carousel__slide--prev":c.value,"carousel__slide--next":v.value,"carousel__slide--sliding":o.value},"aria-hidden":!b.value},(i=a.default)===null||i===void 0?void 0:i.call(a,{isActive:f.value,isClone:e.isClone,isPrev:c.value,isNext:v.value,isSliding:o.value,isVisible:b.value}))}}});const qe={class:"carousel__item"},Je={__name:"ExampleBasic",setup(e){return(a,t)=>(ge(),Ie($($e),null,{addons:Z(()=>[ee($(Ye)),ee($(He))]),default:Z(()=>[(ge(),Le(Se,null,Ee(10,l=>ee($(We),{key:l},{default:Z(()=>[De("div",qe,je(l),1)]),_:2},1024)),64))]),_:1}))}};export{$e as C,Ye as N,We as S,Je as _}; diff --git a/assets/dev.md.Dk2zIcFw.js b/assets/dev.md.DPp3BgC4.js similarity index 89% rename from assets/dev.md.Dk2zIcFw.js rename to assets/dev.md.DPp3BgC4.js index 7ceda5bb..f55618e0 100644 --- a/assets/dev.md.Dk2zIcFw.js +++ b/assets/dev.md.DPp3BgC4.js @@ -1 +1 @@ -import{_ as o}from"./chunks/ExampleBasic.Bf8QP3Fu.js";import{_ as s,c as r,j as a,a as n,G as c,B as d,o as i}from"./chunks/framework.CH_Jd00V.js";const p={components:{ExampleBasic:o}},u=JSON.parse('{"title":"Dev","description":"","frontmatter":{},"headers":[],"relativePath":"dev.md","filePath":"dev.md"}');function l(m,e,_,f,v,x){const t=d("ExampleBasic");return i(),r("div",null,[e[0]||(e[0]=a("h1",{id:"dev",tabindex:"-1"},[n("Dev "),a("a",{class:"header-anchor",href:"#dev","aria-label":'Permalink to "Dev"'},"​")],-1)),c(t)])}const $=s(p,[["render",l]]);export{u as __pageData,$ as default}; +import{_ as o}from"./chunks/ExampleBasic.DkclXpYQ.js";import{_ as s,c as r,j as a,a as n,G as c,B as d,o as i}from"./chunks/framework.CH_Jd00V.js";const p={components:{ExampleBasic:o}},u=JSON.parse('{"title":"Dev","description":"","frontmatter":{},"headers":[],"relativePath":"dev.md","filePath":"dev.md"}');function l(m,e,_,f,v,x){const t=d("ExampleBasic");return i(),r("div",null,[e[0]||(e[0]=a("h1",{id:"dev",tabindex:"-1"},[n("Dev "),a("a",{class:"header-anchor",href:"#dev","aria-label":'Permalink to "Dev"'},"​")],-1)),c(t)])}const $=s(p,[["render",l]]);export{u as __pageData,$ as default}; diff --git a/assets/dev.md.Dk2zIcFw.lean.js b/assets/dev.md.DPp3BgC4.lean.js similarity index 89% rename from assets/dev.md.Dk2zIcFw.lean.js rename to assets/dev.md.DPp3BgC4.lean.js index 7ceda5bb..f55618e0 100644 --- a/assets/dev.md.Dk2zIcFw.lean.js +++ b/assets/dev.md.DPp3BgC4.lean.js @@ -1 +1 @@ -import{_ as o}from"./chunks/ExampleBasic.Bf8QP3Fu.js";import{_ as s,c as r,j as a,a as n,G as c,B as d,o as i}from"./chunks/framework.CH_Jd00V.js";const p={components:{ExampleBasic:o}},u=JSON.parse('{"title":"Dev","description":"","frontmatter":{},"headers":[],"relativePath":"dev.md","filePath":"dev.md"}');function l(m,e,_,f,v,x){const t=d("ExampleBasic");return i(),r("div",null,[e[0]||(e[0]=a("h1",{id:"dev",tabindex:"-1"},[n("Dev "),a("a",{class:"header-anchor",href:"#dev","aria-label":'Permalink to "Dev"'},"​")],-1)),c(t)])}const $=s(p,[["render",l]]);export{u as __pageData,$ as default}; +import{_ as o}from"./chunks/ExampleBasic.DkclXpYQ.js";import{_ as s,c as r,j as a,a as n,G as c,B as d,o as i}from"./chunks/framework.CH_Jd00V.js";const p={components:{ExampleBasic:o}},u=JSON.parse('{"title":"Dev","description":"","frontmatter":{},"headers":[],"relativePath":"dev.md","filePath":"dev.md"}');function l(m,e,_,f,v,x){const t=d("ExampleBasic");return i(),r("div",null,[e[0]||(e[0]=a("h1",{id:"dev",tabindex:"-1"},[n("Dev "),a("a",{class:"header-anchor",href:"#dev","aria-label":'Permalink to "Dev"'},"​")],-1)),c(t)])}const $=s(p,[["render",l]]);export{u as __pageData,$ as default}; diff --git a/assets/test.md.CCk4TQhK.lean.js b/assets/test.md.DQfRvb2a.js similarity index 97% rename from assets/test.md.CCk4TQhK.lean.js rename to assets/test.md.DQfRvb2a.js index bd7d79cf..9b01634f 100644 --- a/assets/test.md.CCk4TQhK.lean.js +++ b/assets/test.md.DQfRvb2a.js @@ -1 +1 @@ -import{N as y,C as v,S as x,_ as V}from"./chunks/ExampleBasic.Bf8QP3Fu.js";import{o as r,b as w,w as o,a1 as A,a2 as E,k as s,G as t,c as p,C as h,F as c,j as e,t as g,_ as B,p as C,B as f,a3 as G,a4 as W,K as $,a as _}from"./chunks/framework.CH_Jd00V.js";const D={class:"carousel__item"},U={__name:"ExampleWrapAround",setup(k){const a={itemsToShow:2.5,wrapAround:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",D,g(n),1)]),_:2},1024)),64))]),_:1},16))}},z={style:{resize:"horizontal",border:"2px dashed gray",overflow:"auto"}},R={class:"carousel__item"},F={__name:"ExampleBreakpoints",setup(k){const a={itemsToShow:1,snapAlign:"center",breakpointMode:"carousel",breakpoints:{300:{itemsToShow:2,snapAlign:"center"},400:{itemsToShow:3,snapAlign:"start"},500:{itemsToShow:4,snapAlign:"start"}}};return(i,m)=>(r(),p("div",z,[t(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",R,g(n),1)]),_:2},1024)),64))]),_:1},16)]))}},M={class:"carousel__item"},O={__name:"ExampleAutoplay",setup(k){const a={autoplay:2e3,wrapAround:!0,pauseAutoplayOnHover:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",M,g(n),1)]),_:2},1024)),64))]),_:1},16))}},j={class:"carousel__item"},H={__name:"ExampleActiveClasses",setup(k){const a={itemsToShow:3.95,wrapAround:!0,transition:500};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",j,g(n),1)]),_:2},1024)),64))]),_:1},16))}},I=B(H,[["__scopeId","data-v-4c39cc47"]]),J={class:"carousel__item"},K={__name:"ExampleCustomNavigation",setup(k){const a=C(),i=C(0),m=()=>a.value.next(),n=()=>a.value.prev();return(b,u)=>{const l=f("Navigation");return r(),p(c,null,[t(s(v),{ref_key:"carouselRef",ref:a,modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=d=>i.value=d),snapAlign:"start"},{addons:o(()=>[t(l)]),default:o(()=>[(r(),p(c,null,h(10,d=>t(s(x),{key:d},{default:o(()=>[e("div",J,g(d-1),1)]),_:2},1024)),64))]),_:1},8,["modelValue"]),e("div",null,[e("button",{onClick:n},"Prev"),G(e("input",{type:"number",min:"0",max:"9","onUpdate:modelValue":u[1]||(u[1]=d=>i.value=d)},null,512),[[W,i.value]]),e("button",{onClick:m},"Next")])],64)}}},L={class:"carousel__item"},q=["onClick"],Q={__name:"ExampleGallery",setup(k){const a=C(0),i=b=>a.value=b,m={itemsToShow:1,mouseDrag:!1,touchDrag:!1,wrapAround:!1},n={itemsToShow:4,wrapAround:!0};return(b,u)=>(r(),p(c,null,[t(s(v),$({id:"gallery"},m,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=l=>a.value=l)}),{default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",L,g(l),1)]),_:2},1024)),64))]),_:1},16,["modelValue"]),t(s(v),$({id:"thumbnails"},n,{modelValue:a.value,"onUpdate:modelValue":u[1]||(u[1]=l=>a.value=l)}),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",{class:"carousel__item",onClick:d=>i(l-1)},g(l),9,q)]),_:2},1024)),64))]),_:1},16,["modelValue"])],64))}},X={components:{ExampleBasic:V,ExampleWrapAround:U,ExampleBreakpoints:F,ExampleAutoplay:O,ExampleActiveClasses:I,ExampleCustomNavigation:K,ExampleGallery:Q}},ea=JSON.parse('{"title":"Test","description":"","frontmatter":{},"headers":[],"relativePath":"test.md","filePath":"test.md"}');function Y(k,a,i,m,n,b){const u=f("ExampleBasic"),l=f("ExampleWrapAround"),d=f("ExampleBreakpoints"),N=f("ExampleAutoplay"),P=f("ExampleActiveClasses"),S=f("ExampleCustomNavigation"),T=f("ExampleGallery");return r(),p("div",null,[a[0]||(a[0]=e("h1",{id:"test",tabindex:"-1"},[_("Test "),e("a",{class:"header-anchor",href:"#test","aria-label":'Permalink to "Test"'},"​")],-1)),a[1]||(a[1]=e("h2",{id:"basic",tabindex:"-1"},[_("Basic "),e("a",{class:"header-anchor",href:"#basic","aria-label":'Permalink to "Basic"'},"​")],-1)),t(u),a[2]||(a[2]=e("h2",{id:"wrap-around",tabindex:"-1"},[_("Wrap Around "),e("a",{class:"header-anchor",href:"#wrap-around","aria-label":'Permalink to "Wrap Around"'},"​")],-1)),t(l),a[3]||(a[3]=e("h2",{id:"breakpoints",tabindex:"-1"},[_("Breakpoints "),e("a",{class:"header-anchor",href:"#breakpoints","aria-label":'Permalink to "Breakpoints"'},"​")],-1)),t(d),a[4]||(a[4]=e("h2",{id:"autoplay",tabindex:"-1"},[_("Autoplay "),e("a",{class:"header-anchor",href:"#autoplay","aria-label":'Permalink to "Autoplay"'},"​")],-1)),t(N),a[5]||(a[5]=e("h2",{id:"active-classes",tabindex:"-1"},[_("Active Classes "),e("a",{class:"header-anchor",href:"#active-classes","aria-label":'Permalink to "Active Classes"'},"​")],-1)),t(P),a[6]||(a[6]=e("h2",{id:"custom-navigation",tabindex:"-1"},[_("Custom Navigation "),e("a",{class:"header-anchor",href:"#custom-navigation","aria-label":'Permalink to "Custom Navigation"'},"​")],-1)),t(S),a[7]||(a[7]=e("h2",{id:"gallery",tabindex:"-1"},[_("Gallery "),e("a",{class:"header-anchor",href:"#gallery","aria-label":'Permalink to "Gallery"'},"​")],-1)),t(T)])}const ta=B(X,[["render",Y]]);export{ea as __pageData,ta as default}; +import{N as y,C as v,S as x,_ as V}from"./chunks/ExampleBasic.DkclXpYQ.js";import{o as r,b as w,w as o,a1 as A,a2 as E,k as s,G as t,c as p,C as h,F as c,j as e,t as g,_ as B,p as C,B as f,a3 as G,a4 as W,K as $,a as _}from"./chunks/framework.CH_Jd00V.js";const D={class:"carousel__item"},U={__name:"ExampleWrapAround",setup(k){const a={itemsToShow:2.5,wrapAround:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",D,g(n),1)]),_:2},1024)),64))]),_:1},16))}},z={style:{resize:"horizontal",border:"2px dashed gray",overflow:"auto"}},R={class:"carousel__item"},F={__name:"ExampleBreakpoints",setup(k){const a={itemsToShow:1,snapAlign:"center",breakpointMode:"carousel",breakpoints:{300:{itemsToShow:2,snapAlign:"center"},400:{itemsToShow:3,snapAlign:"start"},500:{itemsToShow:4,snapAlign:"start"}}};return(i,m)=>(r(),p("div",z,[t(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",R,g(n),1)]),_:2},1024)),64))]),_:1},16)]))}},M={class:"carousel__item"},O={__name:"ExampleAutoplay",setup(k){const a={autoplay:2e3,wrapAround:!0,pauseAutoplayOnHover:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",M,g(n),1)]),_:2},1024)),64))]),_:1},16))}},j={class:"carousel__item"},H={__name:"ExampleActiveClasses",setup(k){const a={itemsToShow:3.95,wrapAround:!0,transition:500};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",j,g(n),1)]),_:2},1024)),64))]),_:1},16))}},I=B(H,[["__scopeId","data-v-4c39cc47"]]),J={class:"carousel__item"},K={__name:"ExampleCustomNavigation",setup(k){const a=C(),i=C(0),m=()=>a.value.next(),n=()=>a.value.prev();return(b,u)=>{const l=f("Navigation");return r(),p(c,null,[t(s(v),{ref_key:"carouselRef",ref:a,modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=d=>i.value=d),snapAlign:"start"},{addons:o(()=>[t(l)]),default:o(()=>[(r(),p(c,null,h(10,d=>t(s(x),{key:d},{default:o(()=>[e("div",J,g(d-1),1)]),_:2},1024)),64))]),_:1},8,["modelValue"]),e("div",null,[e("button",{onClick:n},"Prev"),G(e("input",{type:"number",min:"0",max:"9","onUpdate:modelValue":u[1]||(u[1]=d=>i.value=d)},null,512),[[W,i.value]]),e("button",{onClick:m},"Next")])],64)}}},L={class:"carousel__item"},q=["onClick"],Q={__name:"ExampleGallery",setup(k){const a=C(0),i=b=>a.value=b,m={itemsToShow:1,mouseDrag:!1,touchDrag:!1,wrapAround:!1},n={itemsToShow:4,wrapAround:!0};return(b,u)=>(r(),p(c,null,[t(s(v),$({id:"gallery"},m,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=l=>a.value=l)}),{default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",L,g(l),1)]),_:2},1024)),64))]),_:1},16,["modelValue"]),t(s(v),$({id:"thumbnails"},n,{modelValue:a.value,"onUpdate:modelValue":u[1]||(u[1]=l=>a.value=l)}),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",{class:"carousel__item",onClick:d=>i(l-1)},g(l),9,q)]),_:2},1024)),64))]),_:1},16,["modelValue"])],64))}},X={components:{ExampleBasic:V,ExampleWrapAround:U,ExampleBreakpoints:F,ExampleAutoplay:O,ExampleActiveClasses:I,ExampleCustomNavigation:K,ExampleGallery:Q}},ea=JSON.parse('{"title":"Test","description":"","frontmatter":{},"headers":[],"relativePath":"test.md","filePath":"test.md"}');function Y(k,a,i,m,n,b){const u=f("ExampleBasic"),l=f("ExampleWrapAround"),d=f("ExampleBreakpoints"),N=f("ExampleAutoplay"),P=f("ExampleActiveClasses"),S=f("ExampleCustomNavigation"),T=f("ExampleGallery");return r(),p("div",null,[a[0]||(a[0]=e("h1",{id:"test",tabindex:"-1"},[_("Test "),e("a",{class:"header-anchor",href:"#test","aria-label":'Permalink to "Test"'},"​")],-1)),a[1]||(a[1]=e("h2",{id:"basic",tabindex:"-1"},[_("Basic "),e("a",{class:"header-anchor",href:"#basic","aria-label":'Permalink to "Basic"'},"​")],-1)),t(u),a[2]||(a[2]=e("h2",{id:"wrap-around",tabindex:"-1"},[_("Wrap Around "),e("a",{class:"header-anchor",href:"#wrap-around","aria-label":'Permalink to "Wrap Around"'},"​")],-1)),t(l),a[3]||(a[3]=e("h2",{id:"breakpoints",tabindex:"-1"},[_("Breakpoints "),e("a",{class:"header-anchor",href:"#breakpoints","aria-label":'Permalink to "Breakpoints"'},"​")],-1)),t(d),a[4]||(a[4]=e("h2",{id:"autoplay",tabindex:"-1"},[_("Autoplay "),e("a",{class:"header-anchor",href:"#autoplay","aria-label":'Permalink to "Autoplay"'},"​")],-1)),t(N),a[5]||(a[5]=e("h2",{id:"active-classes",tabindex:"-1"},[_("Active Classes "),e("a",{class:"header-anchor",href:"#active-classes","aria-label":'Permalink to "Active Classes"'},"​")],-1)),t(P),a[6]||(a[6]=e("h2",{id:"custom-navigation",tabindex:"-1"},[_("Custom Navigation "),e("a",{class:"header-anchor",href:"#custom-navigation","aria-label":'Permalink to "Custom Navigation"'},"​")],-1)),t(S),a[7]||(a[7]=e("h2",{id:"gallery",tabindex:"-1"},[_("Gallery "),e("a",{class:"header-anchor",href:"#gallery","aria-label":'Permalink to "Gallery"'},"​")],-1)),t(T)])}const ta=B(X,[["render",Y]]);export{ea as __pageData,ta as default}; diff --git a/assets/test.md.CCk4TQhK.js b/assets/test.md.DQfRvb2a.lean.js similarity index 97% rename from assets/test.md.CCk4TQhK.js rename to assets/test.md.DQfRvb2a.lean.js index bd7d79cf..9b01634f 100644 --- a/assets/test.md.CCk4TQhK.js +++ b/assets/test.md.DQfRvb2a.lean.js @@ -1 +1 @@ -import{N as y,C as v,S as x,_ as V}from"./chunks/ExampleBasic.Bf8QP3Fu.js";import{o as r,b as w,w as o,a1 as A,a2 as E,k as s,G as t,c as p,C as h,F as c,j as e,t as g,_ as B,p as C,B as f,a3 as G,a4 as W,K as $,a as _}from"./chunks/framework.CH_Jd00V.js";const D={class:"carousel__item"},U={__name:"ExampleWrapAround",setup(k){const a={itemsToShow:2.5,wrapAround:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",D,g(n),1)]),_:2},1024)),64))]),_:1},16))}},z={style:{resize:"horizontal",border:"2px dashed gray",overflow:"auto"}},R={class:"carousel__item"},F={__name:"ExampleBreakpoints",setup(k){const a={itemsToShow:1,snapAlign:"center",breakpointMode:"carousel",breakpoints:{300:{itemsToShow:2,snapAlign:"center"},400:{itemsToShow:3,snapAlign:"start"},500:{itemsToShow:4,snapAlign:"start"}}};return(i,m)=>(r(),p("div",z,[t(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",R,g(n),1)]),_:2},1024)),64))]),_:1},16)]))}},M={class:"carousel__item"},O={__name:"ExampleAutoplay",setup(k){const a={autoplay:2e3,wrapAround:!0,pauseAutoplayOnHover:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",M,g(n),1)]),_:2},1024)),64))]),_:1},16))}},j={class:"carousel__item"},H={__name:"ExampleActiveClasses",setup(k){const a={itemsToShow:3.95,wrapAround:!0,transition:500};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",j,g(n),1)]),_:2},1024)),64))]),_:1},16))}},I=B(H,[["__scopeId","data-v-4c39cc47"]]),J={class:"carousel__item"},K={__name:"ExampleCustomNavigation",setup(k){const a=C(),i=C(0),m=()=>a.value.next(),n=()=>a.value.prev();return(b,u)=>{const l=f("Navigation");return r(),p(c,null,[t(s(v),{ref_key:"carouselRef",ref:a,modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=d=>i.value=d),snapAlign:"start"},{addons:o(()=>[t(l)]),default:o(()=>[(r(),p(c,null,h(10,d=>t(s(x),{key:d},{default:o(()=>[e("div",J,g(d-1),1)]),_:2},1024)),64))]),_:1},8,["modelValue"]),e("div",null,[e("button",{onClick:n},"Prev"),G(e("input",{type:"number",min:"0",max:"9","onUpdate:modelValue":u[1]||(u[1]=d=>i.value=d)},null,512),[[W,i.value]]),e("button",{onClick:m},"Next")])],64)}}},L={class:"carousel__item"},q=["onClick"],Q={__name:"ExampleGallery",setup(k){const a=C(0),i=b=>a.value=b,m={itemsToShow:1,mouseDrag:!1,touchDrag:!1,wrapAround:!1},n={itemsToShow:4,wrapAround:!0};return(b,u)=>(r(),p(c,null,[t(s(v),$({id:"gallery"},m,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=l=>a.value=l)}),{default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",L,g(l),1)]),_:2},1024)),64))]),_:1},16,["modelValue"]),t(s(v),$({id:"thumbnails"},n,{modelValue:a.value,"onUpdate:modelValue":u[1]||(u[1]=l=>a.value=l)}),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",{class:"carousel__item",onClick:d=>i(l-1)},g(l),9,q)]),_:2},1024)),64))]),_:1},16,["modelValue"])],64))}},X={components:{ExampleBasic:V,ExampleWrapAround:U,ExampleBreakpoints:F,ExampleAutoplay:O,ExampleActiveClasses:I,ExampleCustomNavigation:K,ExampleGallery:Q}},ea=JSON.parse('{"title":"Test","description":"","frontmatter":{},"headers":[],"relativePath":"test.md","filePath":"test.md"}');function Y(k,a,i,m,n,b){const u=f("ExampleBasic"),l=f("ExampleWrapAround"),d=f("ExampleBreakpoints"),N=f("ExampleAutoplay"),P=f("ExampleActiveClasses"),S=f("ExampleCustomNavigation"),T=f("ExampleGallery");return r(),p("div",null,[a[0]||(a[0]=e("h1",{id:"test",tabindex:"-1"},[_("Test "),e("a",{class:"header-anchor",href:"#test","aria-label":'Permalink to "Test"'},"​")],-1)),a[1]||(a[1]=e("h2",{id:"basic",tabindex:"-1"},[_("Basic "),e("a",{class:"header-anchor",href:"#basic","aria-label":'Permalink to "Basic"'},"​")],-1)),t(u),a[2]||(a[2]=e("h2",{id:"wrap-around",tabindex:"-1"},[_("Wrap Around "),e("a",{class:"header-anchor",href:"#wrap-around","aria-label":'Permalink to "Wrap Around"'},"​")],-1)),t(l),a[3]||(a[3]=e("h2",{id:"breakpoints",tabindex:"-1"},[_("Breakpoints "),e("a",{class:"header-anchor",href:"#breakpoints","aria-label":'Permalink to "Breakpoints"'},"​")],-1)),t(d),a[4]||(a[4]=e("h2",{id:"autoplay",tabindex:"-1"},[_("Autoplay "),e("a",{class:"header-anchor",href:"#autoplay","aria-label":'Permalink to "Autoplay"'},"​")],-1)),t(N),a[5]||(a[5]=e("h2",{id:"active-classes",tabindex:"-1"},[_("Active Classes "),e("a",{class:"header-anchor",href:"#active-classes","aria-label":'Permalink to "Active Classes"'},"​")],-1)),t(P),a[6]||(a[6]=e("h2",{id:"custom-navigation",tabindex:"-1"},[_("Custom Navigation "),e("a",{class:"header-anchor",href:"#custom-navigation","aria-label":'Permalink to "Custom Navigation"'},"​")],-1)),t(S),a[7]||(a[7]=e("h2",{id:"gallery",tabindex:"-1"},[_("Gallery "),e("a",{class:"header-anchor",href:"#gallery","aria-label":'Permalink to "Gallery"'},"​")],-1)),t(T)])}const ta=B(X,[["render",Y]]);export{ea as __pageData,ta as default}; +import{N as y,C as v,S as x,_ as V}from"./chunks/ExampleBasic.DkclXpYQ.js";import{o as r,b as w,w as o,a1 as A,a2 as E,k as s,G as t,c as p,C as h,F as c,j as e,t as g,_ as B,p as C,B as f,a3 as G,a4 as W,K as $,a as _}from"./chunks/framework.CH_Jd00V.js";const D={class:"carousel__item"},U={__name:"ExampleWrapAround",setup(k){const a={itemsToShow:2.5,wrapAround:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",D,g(n),1)]),_:2},1024)),64))]),_:1},16))}},z={style:{resize:"horizontal",border:"2px dashed gray",overflow:"auto"}},R={class:"carousel__item"},F={__name:"ExampleBreakpoints",setup(k){const a={itemsToShow:1,snapAlign:"center",breakpointMode:"carousel",breakpoints:{300:{itemsToShow:2,snapAlign:"center"},400:{itemsToShow:3,snapAlign:"start"},500:{itemsToShow:4,snapAlign:"start"}}};return(i,m)=>(r(),p("div",z,[t(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",R,g(n),1)]),_:2},1024)),64))]),_:1},16)]))}},M={class:"carousel__item"},O={__name:"ExampleAutoplay",setup(k){const a={autoplay:2e3,wrapAround:!0,pauseAutoplayOnHover:!0};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",M,g(n),1)]),_:2},1024)),64))]),_:1},16))}},j={class:"carousel__item"},H={__name:"ExampleActiveClasses",setup(k){const a={itemsToShow:3.95,wrapAround:!0,transition:500};return(i,m)=>(r(),w(s(v),A(E(a)),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,n=>t(s(x),{key:n},{default:o(()=>[e("div",j,g(n),1)]),_:2},1024)),64))]),_:1},16))}},I=B(H,[["__scopeId","data-v-4c39cc47"]]),J={class:"carousel__item"},K={__name:"ExampleCustomNavigation",setup(k){const a=C(),i=C(0),m=()=>a.value.next(),n=()=>a.value.prev();return(b,u)=>{const l=f("Navigation");return r(),p(c,null,[t(s(v),{ref_key:"carouselRef",ref:a,modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=d=>i.value=d),snapAlign:"start"},{addons:o(()=>[t(l)]),default:o(()=>[(r(),p(c,null,h(10,d=>t(s(x),{key:d},{default:o(()=>[e("div",J,g(d-1),1)]),_:2},1024)),64))]),_:1},8,["modelValue"]),e("div",null,[e("button",{onClick:n},"Prev"),G(e("input",{type:"number",min:"0",max:"9","onUpdate:modelValue":u[1]||(u[1]=d=>i.value=d)},null,512),[[W,i.value]]),e("button",{onClick:m},"Next")])],64)}}},L={class:"carousel__item"},q=["onClick"],Q={__name:"ExampleGallery",setup(k){const a=C(0),i=b=>a.value=b,m={itemsToShow:1,mouseDrag:!1,touchDrag:!1,wrapAround:!1},n={itemsToShow:4,wrapAround:!0};return(b,u)=>(r(),p(c,null,[t(s(v),$({id:"gallery"},m,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=l=>a.value=l)}),{default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",L,g(l),1)]),_:2},1024)),64))]),_:1},16,["modelValue"]),t(s(v),$({id:"thumbnails"},n,{modelValue:a.value,"onUpdate:modelValue":u[1]||(u[1]=l=>a.value=l)}),{addons:o(()=>[t(s(y))]),default:o(()=>[(r(),p(c,null,h(10,l=>t(s(x),{key:l},{default:o(()=>[e("div",{class:"carousel__item",onClick:d=>i(l-1)},g(l),9,q)]),_:2},1024)),64))]),_:1},16,["modelValue"])],64))}},X={components:{ExampleBasic:V,ExampleWrapAround:U,ExampleBreakpoints:F,ExampleAutoplay:O,ExampleActiveClasses:I,ExampleCustomNavigation:K,ExampleGallery:Q}},ea=JSON.parse('{"title":"Test","description":"","frontmatter":{},"headers":[],"relativePath":"test.md","filePath":"test.md"}');function Y(k,a,i,m,n,b){const u=f("ExampleBasic"),l=f("ExampleWrapAround"),d=f("ExampleBreakpoints"),N=f("ExampleAutoplay"),P=f("ExampleActiveClasses"),S=f("ExampleCustomNavigation"),T=f("ExampleGallery");return r(),p("div",null,[a[0]||(a[0]=e("h1",{id:"test",tabindex:"-1"},[_("Test "),e("a",{class:"header-anchor",href:"#test","aria-label":'Permalink to "Test"'},"​")],-1)),a[1]||(a[1]=e("h2",{id:"basic",tabindex:"-1"},[_("Basic "),e("a",{class:"header-anchor",href:"#basic","aria-label":'Permalink to "Basic"'},"​")],-1)),t(u),a[2]||(a[2]=e("h2",{id:"wrap-around",tabindex:"-1"},[_("Wrap Around "),e("a",{class:"header-anchor",href:"#wrap-around","aria-label":'Permalink to "Wrap Around"'},"​")],-1)),t(l),a[3]||(a[3]=e("h2",{id:"breakpoints",tabindex:"-1"},[_("Breakpoints "),e("a",{class:"header-anchor",href:"#breakpoints","aria-label":'Permalink to "Breakpoints"'},"​")],-1)),t(d),a[4]||(a[4]=e("h2",{id:"autoplay",tabindex:"-1"},[_("Autoplay "),e("a",{class:"header-anchor",href:"#autoplay","aria-label":'Permalink to "Autoplay"'},"​")],-1)),t(N),a[5]||(a[5]=e("h2",{id:"active-classes",tabindex:"-1"},[_("Active Classes "),e("a",{class:"header-anchor",href:"#active-classes","aria-label":'Permalink to "Active Classes"'},"​")],-1)),t(P),a[6]||(a[6]=e("h2",{id:"custom-navigation",tabindex:"-1"},[_("Custom Navigation "),e("a",{class:"header-anchor",href:"#custom-navigation","aria-label":'Permalink to "Custom Navigation"'},"​")],-1)),t(S),a[7]||(a[7]=e("h2",{id:"gallery",tabindex:"-1"},[_("Gallery "),e("a",{class:"header-anchor",href:"#gallery","aria-label":'Permalink to "Gallery"'},"​")],-1)),t(T)])}const ta=B(X,[["render",Y]]);export{ea as __pageData,ta as default}; diff --git a/config.html b/config.html index b7ccf732..1513cb92 100644 --- a/config.html +++ b/config.html @@ -40,7 +40,7 @@ <Navigation v-if="slidesCount > 1" /> </template> </Carousel>

I18n

Avaialbe keys:

KeyDefaults
ariaNextSlide"Navigate to next slide"
ariaPreviousSlide"Navigate to previous slide"
ariaNavigateToSlide"Navigate to slide {slideNumber}"
ariaGallery"Gallery"
itemXofY"Item {currentSlide} of {slidesCount}"
iconArrowUp"Arrow pointing upwards"
iconArrowDown"Arrow pointing downwards"
iconArrowRight"Arrow pointing to the right"
iconArrowLeft"Arrow pointing to the left"
- + \ No newline at end of file diff --git a/dev.html b/dev.html index a99b4da4..497f8577 100644 --- a/dev.html +++ b/dev.html @@ -12,8 +12,8 @@ - - + + @@ -21,7 +21,7 @@
Skip to content

Dev

- + \ No newline at end of file diff --git a/examples.html b/examples.html index 9cfb0d44..527313d8 100644 --- a/examples.html +++ b/examples.html @@ -20,7 +20,7 @@
Skip to content

Examples

Basic

Wrap Around

Breakpoints

Autoplay

Active Classes

Custom Navigation

- + \ No newline at end of file diff --git a/getting-started.html b/getting-started.html index 694ed1c6..32ee06b7 100644 --- a/getting-started.html +++ b/getting-started.html @@ -50,7 +50,7 @@ }, } </script> - + \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index b30a5c9d..0e2eb9aa 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"api_data.md":"DGuZs0eM","api_events.md":"CNFvNnap","api_methods.md":"BMEyEW6H","config.md":"CIUa1BwL","dev.md":"Dk2zIcFw","examples.md":"Bfcn2AHb","getting-started.md":"CjmRUMT5","index.md":"BY99Y4OE","test.md":"CCk4TQhK"} +{"api_data.md":"DGuZs0eM","api_events.md":"CNFvNnap","api_methods.md":"BMEyEW6H","config.md":"CIUa1BwL","dev.md":"DPp3BgC4","examples.md":"Bfcn2AHb","getting-started.md":"CjmRUMT5","index.md":"BY99Y4OE","test.md":"DQfRvb2a"} diff --git a/index.html b/index.html index e2ddfecd..d654cfca 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@
Skip to content

Vue3-Carousel

For Your Next Awesome Project

Flexible, responsive, and highly customizable Vue carousel component to suit almost all your use cases

- + \ No newline at end of file diff --git a/test.html b/test.html index 21689ee9..b4e30ef5 100644 --- a/test.html +++ b/test.html @@ -12,8 +12,8 @@ - - + + @@ -21,7 +21,7 @@
Skip to content

Test

Basic

Wrap Around

Breakpoints

Autoplay

Active Classes

Custom Navigation

- + \ No newline at end of file