"use strict";const e=require("vue"),d=require("../Shared/base-iCmnU-fv.js"),m={key:3,class:"fenceScrollX-cover"},S=e.defineComponent({name:"ClScrollXFence",__name:"Index",props:{isShowLeft:{type:Boolean,default:!0},isShowRight:{type:Boolean,default:!0},isShowCorner:{type:Boolean,default:!1},isShowCover:{type:Boolean,default:!1},cornerType:{type:String,default:""},leftWidth:{type:String,default:"0"},centerWidth:{type:String,default:"0"},rightWidth:{type:String,default:"0"},initLeft:String},emits:["onScrollX"],setup(l,{expose:i,emit:s}){const n=l,a=s,o=e.ref(null),u=e.computed(()=>{const t={"panel-fenceScrollX":!0};return n.isShowCorner&&n.cornerType.length>0&&(t[`fenceScrollX-showCorner-${n.cornerType}`]=!0),d.CommonBase.osType().isMobile&&(t["fenceScrollX-mob"]=!0),t}),f=e.computed(()=>{const t={"fenceScrollX-corner":!0};return n.cornerType.length>0&&(t[`fenceScrollX-corner-${n.cornerType}`]=!0),t}),c=t=>{a("onScrollX",t)};return e.onMounted(()=>{e.nextTick(()=>{o.value&&(o.value.addEventListener("scroll",c),n.initLeft&&(o.value.scrollLeft=parseInt(n.initLeft)))})}),e.onBeforeUnmount(()=>{o.value&&o.value.removeEventListener("scroll",c)}),i({setScrollLeft:t=>{o.value&&(o.value.scrollLeft=t)}}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value)},[l.isShowLeft?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fenceScrollX-left",style:e.normalizeStyle({width:l.leftWidth})},[...r[0]||(r[0]=[e.createElementVNode("div",null,null,-1)])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"fenceScrollX-center",ref_key:"refElScrollX",ref:o},[e.createElementVNode("div",{style:e.normalizeStyle({width:l.centerWidth})},null,4)],512),l.isShowRight?(e.openBlock(),e.createElementBlock("div",{key:1,class:"fenceScrollX-right",style:e.normalizeStyle({width:l.rightWidth})},[...r[1]||(r[1]=[e.createElementVNode("div",null,null,-1)])],4)):e.createCommentVNode("",!0),l.isShowCorner?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(f.value)},null,2)):e.createCommentVNode("",!0),l.isShowCover?(e.openBlock(),e.createElementBlock("div",m)):e.createCommentVNode("",!0)],2))}});module.exports=S;
//# sourceMappingURL=ClScrollXFence.cjs.map
