Files
caszl_server/public/pc/_nuxt/index.9b83c369.js

2 lines
8.8 KiB
JavaScript
Raw Normal View History

2023-10-29 18:37:44 +08:00
import{s as ue,b4 as Te,b5 as Ae,R as ie,b6 as Be,a as W,ag as ce,r as g,W as N,u as e,N as V,ab as fe,aT as De,aR as Oe,ah as Le,o as _,h as k,i as O,c as U,k as T,aj as q,Z as w,b7 as R,j as S,H as oe,b8 as Pe,an as K,ao as ne,p as L,b9 as ze,Y as de,C as ve,I as me,ba as pe,t as He,$ as he,aK as Ve,O as _e,U as Re,f as We,M as je,bb as Fe,aq as Ue,aW as qe,bc as Ke,w as Ye,bd as Je}from"./entry.49b00e51.js";import{_ as Qe}from"./card.vue_vue_type_script_setup_true_lang.bdaeec43.js";import{u as Xe}from"./asyncData.c6aabeab.js";import{t as le,E as Ze}from"./empty_news.b72a5822.js";import"./items.vue_vue_type_script_setup_true_lang.1931f4cd.js";import"./debounce.66907efb.js";const ge=Symbol("carouselContextKey"),Ge=(y,m,f)=>Te(y.subTree).filter(o=>{var c;return Ae(o)&&((c=o.type)==null?void 0:c.name)===m&&!!o.component}).map(o=>o.component.uid).map(o=>f[o]).filter(o=>!!o),xe=(y,m)=>{const f={},a=ue([]);return{children:a,addChild:c=>{f[c.uid]=c,a.value=Ge(y,m,f)},removeChild:c=>{delete f[c],a.value=a.value.filter(C=>C.uid!==c)}}},et=ie({initialIndex:{type:Number,default:0},height:{type:String,default:""},trigger:{type:String,values:["hover","click"],default:"hover"},autoplay:{type:Boolean,default:!0},interval:{type:Number,default:3e3},indicatorPosition:{type:String,values:["","none","outside"],default:""},indicator:{type:Boolean,default:!0},arrow:{type:String,values:["always","hover","never"],default:"hover"},type:{type:String,values:["","card"],default:""},loop:{type:Boolean,default:!0},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},pauseOnHover:{type:Boolean,default:!0}}),tt={change:(y,m)=>[y,m].every(Be)},at=["onMouseenter","onMouseleave"],st=["onMouseenter","onClick"],ot={key:0},re=300,nt=W({name:"ElCarousel"}),lt=W({...nt,props:et,emits:tt,setup(y,{expose:m,emit:f}){const a=y,l=ce("carousel"),{children:o,addChild:c,removeChild:C}=xe(_e(),"ElCarouselItem"),s=g(-1),p=g(null),h=g(!1),E=g(),M=N(()=>a.arrow!=="never"&&!e(A)),P=N(()=>o.value.some(t=>t.props.label.toString().length>0)),Y=N(()=>{const t=[l.b(),l.m(a.direction)];return e(z)&&t.push(l.m("card")),t}),J=N(()=>{const t=[l.e("indicators"),l.em("indicators",a.direction)];return P.value&&t.push(l.em("indicators","labels")),(a.indicatorPosition==="outside"||e(z))&&t.push(l.em("indicators","outside")),t}),z=N(()=>a.type==="card"),A=N(()=>a.direction==="vertical"),j=le(t=>{i(t)},re,{trailing:!0}),Q=le(t=>{Ie(t)},re);function n(){p.value&&(clearInterval(p.value),p.value=null)}function r(){a.interval<=0||!a.autoplay||p.value||(p.value=setInterval(()=>d(),a.interval))}const d=()=>{s.value<o.value.length-1?s.value=s.value+1:a.loop&&(s.value=0)};function i(t){if(Ve(t)){const I=o.value.filter(D=>D.props.name===t);I.length>0&&(t=o.value.indexOf(I[0]))}if(t=Number(t),Number.isNaN(t)||t!==Math.floor(t))return;const u=o.value.length,v=s.value;t<0?s.value=a.loop?u-1:0:t>=u?s.value=a.loop?0:u-1:s.value=t,v===s.value&&b(v),ee()}function b(t){o.value.forEach((u,v)=>{u.translateItem(v,s.value,t)})}function B(t,u){var v,I,D,te;const H=e(o),ae=H.length;if(ae===0||!t.states.inStage)return!1;const ke=u+1,Se=u-1,se=ae-1,Ee=H[se].states.active,$e=H[0].states.active,Ne=(I=(v=H[ke])==null?void 0:v.states)==null?void 0:I.active,Me=(te=(D=H[Se])==null?void 0:D.states)==null?void 0:te.active;return u===se&&$e||Ne?"left":u===0&&Ee||Me?"right":!1}function $(){h.value=!0,a.pauseOnHover&&n()}function X(){h.value=!1,r()}function G(t){e(A)||o.value.forEach((u,v)=>{t===B(u,v)&&(u.states.hover=!0)})}function x(){e(A)||o.value.forEach(t=>{t.states.hover=!1})}function Ce(t){s.value=t}function Ie(t){a.trigger==="hover"&&t!==s.value&&(s.value=t)}function be(){i(s.value-1)}function we(){i(s.value+1)}function ee(){n(),r()}V(()=>s.value,(t,u)=>{b(u),u>-1&&f("change",t,u)}),V(()=>a.autoplay,t=>{t?r():n()}),V(()=>a.loop,()=>{i(s.value)}),V(()=>a.interval,()=>{ee()}),V(()=>o.value,()=>{o.value.length>0&&i(a.initialIndex)});const Z=ue();return fe(()=>{Z.value=De(E.value,()=>{b()}),r()}),Oe(()=>{n(),E.value&&Z.value&&Z.value.stop()}),Le(ge,{root:E,isCardType:z,isVertical:A,items:o,l