data_center/public/pc/_nuxt/index.9543b00a.js

2 lines
8.8 KiB
JavaScript
Raw Permalink Normal View History

2023-09-18 09:11:13 +08:00
import{s as ue,b3 as Te,b4 as Ae,Q as ie,b5 as Be,a as j,af as ce,r as g,V as $,u as e,M as H,aa as fe,aS as De,aQ as Le,ag as Oe,o as _,h as k,i as L,c as W,k as T,ai as K,Y as b,b6 as F,j as S,G as oe,b7 as Ve,am as Q,an as ne,p as O,b8 as Pe,X as de,B as ve,H as me,b9 as pe,t as ze,Z as he,aJ as He,N as _e,T as Fe,f as je,K as Re,ba as Ue,ap as We,aV as Ke,bb as Qe,w as qe,bc as Je}from"./entry.834fe740.js";import{_ as Xe}from"./card.vue_vue_type_script_setup_true_lang.b114a108.js";import{u as Ye}from"./asyncData.ac40d117.js";import{t as le,E as Ge}from"./empty_news.70229e1b.js";import"./items.vue_vue_type_script_setup_true_lang.8121b615.js";import"./debounce.738623ac.js";const ge=Symbol("carouselContextKey"),Ze=(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=Ze(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=j({name:"ElCarousel"}),lt=j({...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=$(()=>a.arrow!=="never"&&!e(A)),V=$(()=>o.value.some(t=>t.props.label.toString().length>0)),q=$(()=>{const t=[l.b(),l.m(a.direction)];return e(P)&&t.push(l.m("card")),t}),J=$(()=>{const t=[l.e("indicators"),l.em("indicators",a.direction)];return V.value&&t.push(l.em("indicators","labels")),(a.indicatorPosition==="outside"||e(P))&&t.push(l.em("indicators","outside")),t}),P=$(()=>a.type==="card"),A=$(()=>a.direction==="vertical"),R=le(t=>{i(t)},re,{trailing:!0}),X=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(He(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&&w(v),ee()}function w(t){o.value.forEach((u,v)=>{u.translateItem(v,s.value,t)})}function B(t,u){var v,I,D,te;const z=e(o),ae=z.length;if(ae===0||!t.states.inStage)return!1;const ke=u+1,Se=u-1,se=ae-1,Ee=z[se].states.active,Ne=z[0].states.active,$e=(I=(v=z[ke])==null?void 0:v.states)==null?void 0:I.active,Me=(te=(D=z[Se])==null?void 0:D.states)==null?void 0:te.active;return u===se&&Ne||$e?"left":u===0&&Ee||Me?"right":!1}function N(){h.value=!0,a.pauseOnHover&&n()}function Y(){h.value=!1,r()}function Z(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 we(){i(s.value-1)}function be(){i(s.value+1)}function ee(){n(),r()}H(()=>s.value,(t,u)=>{w(u),u>-1&&f("change",t,u)}),H(()=>a.autoplay,t=>{t?r():n()}),H(()=>a.loop,()=>{i(s.value)}),H(()=>a.interval,()=>{ee()}),H(()=>o.value,()=>{o.value.length>0&&i(a.initialIndex)});const G=ue();return fe(()=>{G.value=De(E.value,()=>{w()}),r()}),Le(()=>{n(),E.value&&G.value&&G.value.stop()}),Oe(ge,{root:E,isCardType:P,isVertical:A,items:o,l