UNPKG

custom-components-wr

Version:

2 lines (1 loc) 23.7 kB
(function(t,k){typeof exports=="object"&&typeof module<"u"?module.exports=k(require("vue")):typeof define=="function"&&define.amd?define(["vue"],k):(t=typeof globalThis<"u"?globalThis:t||self,t["custom-components-wr"]=k(t.Vue))})(this,function(t){"use strict";const k=(e,l)=>{const o=e.__vccOpts||e;for(const[i,r]of l)o[i]=r;return o},V={name:"pie3d",props:{data:{type:Array,default:[]},color:{type:Array,default:["#46ABFA","#6344C1","#00CB6C","#0A00FF","#FF693E","#E8FF00"]},deep:{type:Number,default:40},ece:{type:Number,default:.6},titleSize:{type:Number,default:14}},data(){return{width:400,height:400,loading:!0,hoverIndex:null,clickIndex:null}},computed:{effectData(){return this.data?this.data.filter(e=>e.value):[]},center(){return[this.width/2,this.height/2]},ellipse(){return[this.width/4,this.height/4*this.ece]},wholeValue(){return this.data.reduce((e,l)=>e+l.value,0)},transformStyle(){if(this.clickIndex===0||this.clickIndex){const e=this.pie[this.clickIndex].style;return{transform:`translate(${e[0]}px,${e[1]}px)`,opacity:"1 !important"}}else return{}},pie(){if(this.loading)return[];if(this.effectData.length){let e=[],l=0,o=0,i=0,r=[this.center[0],this.center[1]-this.ellipse[1]],n=[0,0],s=[0,0],f=null,a=null,u=null,m=null,g=null;return this.effectData.forEach((d,h)=>{if(o=h+1==this.effectData.length?360:l+d.value/this.wholeValue*360,n=this.getLocationOnEllipse(o),i=(l+o)/2,i>90&&i<270?s=this.getLocationOnEllipse(i,this.deep/2):s=this.getLocationOnEllipse(i),l>=90&&l<=270||o>=90&&o<=270||i>=90&&i<=270){let c=[];l<90?c=[[this.center[0]+this.ellipse[0],this.center[1]],[this.center[0]+this.ellipse[0],this.center[1]+this.deep]]:c=[[r[0],r[1]],[r[0],r[1]+this.deep]],o>270?(c.push([this.center[0]-this.ellipse[0],this.center[1]+this.deep]),c.push([this.center[0]-this.ellipse[0],this.center[1]])):(c.push([n[0],n[1]+this.deep]),c.push([n[0],n[1]])),a="M "+c[0][0]+" "+c[0][1]+" L "+c[1][0]+" "+c[1][1]+" A "+(this.ellipse[0]+1)+" "+(this.ellipse[1]-1)+" 0 0 1 "+c[2][0]+" "+c[2][1]+" L "+c[3][0]+" "+c[3][1]+" A "+(this.ellipse[0]+1)+" "+(this.ellipse[1]-1)+" 0 0 0 "+c[0][0]+" "+c[0][1]+" Z"}else a=null;o!=360?u="M "+this.center[0]+" "+(this.center[1]+this.deep)+" L "+this.center[0]+" "+this.center[1]+" L "+n[0]+" "+n[1]+" L "+n[0]+" "+(n[1]+this.deep)+" Z":u=null,f=this.getOffsetLocation(i),h===0?u=[null,u]:u=[e[h-1].inSidePath[1],u];let p=[[s[0]+f[0],s[1]+f[1]]];const Be=i>0&&i<180?Math.abs(i==90?0:Math.cos(i*Math.PI/180)):Math.abs(i==270?0:Math.cos(i*Math.PI/180)),De=i>0&&i<180?i>90?(i-90)/4+90:(90-i)/2+i:i>270?(i-270)/4+270:(270-i)/2+i,L=this.getOffsetLocation(De,Be*this.width/6);let y=[p[0][0]+L[0],p[0][1]+L[1]];if(h>0){if(i<180){const c=y[1]-e[h-1].textL[1]+5;c<this.titleSize+2&&(y[1]=this.titleSize-c+y[1]+2)}else if(e[h-1].middle>180){const c=Math.abs(y[1]-e[h-1].textL[1]+5);c<this.titleSize+2&&(y[1]=y[1]-(this.titleSize-c)-2)}}if(i>0&&i<180)g=[y[0]+5,y[1]+5];else{const c=this.getTextWidth(d.title,this.titleSize+"px");g=[y[0]-c-5,y[1]+5]}p.push(y),m="M "+s[0]+" "+s[1];for(let c=0;c<p.length;c++)m+=" L "+p[c][0]+" "+p[c][1];let C={title:d.title,from:l,to:o,fromL:r,linePath:m,toL:n,textL:g,sidePath:a,inSidePath:u,middleL:s,style:f,middle:i,color:d.color||this.getColor(h)};C.darkerColor=this.getDarkerColor(C.color),C.darkestColor=this.getDarkerColor(C.color,2),e.push(C),l=o,r=n}),e.sort((d,h)=>d.middleL[1]-h.middleL[1]),e}else return[]},onHover(){return this.hoverIndex===0||this.hoverIndex}},mounted(){this.init()},methods:{init(){this.$nextTick(()=>{var l;const e=(l=this.$refs.mainRef)==null?void 0:l.parentNode;e&&(e.clientWidth>e.clientHeight?this.width=e.clientHeight:this.width=e.clientWidth,this.height=this.width,this.loading=!1)})},getDarkerColor(e,l=1){let o=e;o.indexOf("#")===0&&(o=o.slice(1));let i=parseInt(o.slice(0,2),16),r=parseInt(o.slice(2,4),16),n=parseInt(o.slice(4,6),16);return i=i,r=r-20*l,n=n-20*l,i=i<0?0:i,r=r<0?0:r,n=n<0?0:n,"rgb("+i+","+r+","+n+")"},getRandomColor(){let e=Math.floor(Math.random()*256),l=Math.floor(Math.random()*256),o=Math.floor(Math.random()*256);return`rgb(${e},${l},${o})`},getColor(e){let l=e%this.color.length;return this.color[l]},getLocationByAngleAndRadius(e,l){let o=this.center[0]+l*Math.cos(e*Math.PI/180),i=this.center[1]+l*Math.sin(e*Math.PI/180);return[o,i]},getLocationOnEllipse(e,l=0){let o=this.center[0]+this.ellipse[0]*Math.cos((e-90)*Math.PI/180),i=this.center[1]+l+this.ellipse[1]*Math.sin((e-90)*Math.PI/180);return[o,i]},getOffsetLocation(e,l=this.deep/2){let o=l*Math.cos((e-90)*Math.PI/180),i=l*Math.sin((e-90)*Math.PI/180);return[o,i]},getTextWidth(e,l="14px"){const o=document.createElement("span");o.style.cssText="font-size: "+l+"; font-weight: blod; white-space: nowrap;",o.style.visibility="hidden",o.style.position="absolute",o.textContent=e,document.body.appendChild(o);const i=o.offsetWidth;return document.body.removeChild(o),i},mouseenter(e){this.hoverIndex=e},mouseleave(e){this.hoverIndex===e&&(this.hoverIndex=null)},clickPie(e){this.clickIndex!==e?this.clickIndex=e:this.clickIndex=null}}},v=["width","height","viewBox"],z=["onMouseenter","onMouseleave","onClick"],R={key:0},A=["d","fill"],F=["d","fill"],H=["d","fill"],j={key:1},Q=["d","fill"],U=["cx","cy","rx","ry","fill"],q={key:2},Z=["d","fill"],G=["d","stroke"],X=["x","y"];function K(e,l,o,i,r,n){return t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["myPie",n.onHover?"hoverPie":""]),ref:"mainRef",width:r.width,height:r.height,viewBox:"0 0 "+r.width+" "+r.height,xmlns:"http://www.w3.org/2000/svg"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.pie,(s,f)=>(t.openBlock(),t.createElementBlock("g",{onMouseenter:a=>n.mouseenter(f),onMouseleave:a=>n.mouseleave(f),onClick:a=>n.clickPie(f),style:t.normalizeStyle(r.clickIndex===f?n.transformStyle:{})},[n.effectData.length&&n.effectData.length>1?(t.openBlock(),t.createElementBlock("g",R,[s.middle<180&&s.inSidePath[0]?(t.openBlock(),t.createElementBlock("path",{key:0,d:s.inSidePath[0],fill:s.darkestColor},null,8,A)):t.createCommentVNode("",!0),s.inSidePath[1]?(t.openBlock(),t.createElementBlock("path",{key:1,d:s.inSidePath[1],fill:s.darkestColor},null,8,F)):t.createCommentVNode("",!0),!(s.middle<180)&&s.inSidePath[0]?(t.openBlock(),t.createElementBlock("path",{key:2,d:s.inSidePath[0],fill:s.darkestColor},null,8,H)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),n.effectData.length?(t.openBlock(),t.createElementBlock("g",j,[n.effectData.length>1?(t.openBlock(),t.createElementBlock("path",{key:0,d:"M "+n.center[0]+" "+n.center[1]+" L "+s.fromL[0]+" "+s.fromL[1]+" A "+n.ellipse[0]+" "+n.ellipse[1]+" 0 "+(s.to-s.from>180?"1":"0")+" 1 "+s.toL[0]+" "+s.toL[1]+" Z",fill:s.color},null,8,Q)):(t.openBlock(),t.createElementBlock("ellipse",{key:1,cx:n.center[0],cy:n.center[1],rx:n.ellipse[0],ry:n.ellipse[1],fill:s.color},null,8,U))])):t.createCommentVNode("",!0),s.sidePath?(t.openBlock(),t.createElementBlock("g",q,[t.createElementVNode("path",{d:s.sidePath,fill:s.darkerColor},null,8,Z)])):t.createCommentVNode("",!0),t.createElementVNode("g",null,[t.createElementVNode("path",{d:s.linePath,"stroke-width":"2",stroke:s.color,fill:"none"},null,8,G),s.textL?(t.openBlock(),t.createElementBlock("text",{key:0,x:s.textL[0],y:s.textL[1]},t.toDisplayString(s.title),9,X)):t.createCommentVNode("",!0)])],44,z))),256))],10,v)}const J=k(V,[["render",K],["__scopeId","data-v-31ec9764"]]);var b;const E=typeof window<"u",Y=e=>typeof e=="string",I=()=>{},$=E&&((b=window==null?void 0:window.navigator)==null?void 0:b.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function T(e){return typeof e=="function"?e():t.unref(e)}function ee(e){return e}function te(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function w(e){var l;const o=T(e);return(l=o==null?void 0:o.$el)!=null?l:o}const _=E?window:void 0;function x(...e){let l,o,i,r;if(Y(e[0])||Array.isArray(e[0])?([o,i,r]=e,l=_):[l,o,i,r]=e,!l)return I;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const n=[],s=()=>{n.forEach(m=>m()),n.length=0},f=(m,g,d,h)=>(m.addEventListener(g,d,h),()=>m.removeEventListener(g,d,h)),a=t.watch(()=>[w(l),T(r)],([m,g])=>{s(),m&&n.push(...o.flatMap(d=>i.map(h=>f(m,d,h,g))))},{immediate:!0,flush:"post"}),u=()=>{a(),s()};return te(u),u}let B=!1;function D(e,l,o={}){const{window:i=_,ignore:r=[],capture:n=!0,detectIframe:s=!1}=o;if(!i)return;$&&!B&&(B=!0,Array.from(i.document.body.children).forEach(d=>d.addEventListener("click",I)));let f=!0;const a=d=>r.some(h=>{if(typeof h=="string")return Array.from(i.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=w(h);return p&&(d.target===p||d.composedPath().includes(p))}}),m=[x(i,"click",d=>{const h=w(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(f=!a(d)),!f){f=!0;return}l(d)}},{passive:!0,capture:n}),x(i,"pointerdown",d=>{const h=w(e);h&&(f=!d.composedPath().includes(h)&&!a(d))},{passive:!0}),s&&x(i,"blur",d=>{var h;const p=w(e);((h=i.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(i.document.activeElement))&&l(d)})].filter(Boolean);return()=>m.forEach(d=>d())}const O=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},S="__vueuse_ssr_handlers__";O[S]=O[S]||{};var M;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(M||(M={}));var le=Object.defineProperty,P=Object.getOwnPropertySymbols,oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,N=(e,l,o)=>l in e?le(e,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[l]=o,ne=(e,l)=>{for(var o in l||(l={}))oe.call(l,o)&&N(e,o,l[o]);if(P)for(var o of P(l))ie.call(l,o)&&N(e,o,l[o]);return e};ne({linear:ee},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const se={name:"colorpicker",props:{modelValue:"",defaultColor:{type:String,default:""},disabled:{type:Boolean,default:!1},transfer:{type:Boolean,default:!1},zIndex:{type:Number,default:null},closeable:{type:Boolean,default:!1}},emits:["update:modelValue","change","close"],data(){return{openStatus:!1,hoveColor:"",tColor:["#000000","#ffffff","#eeece1","#1e497b","#4e81bb","#e2534d","#9aba60","#8165a0","#47acc5","#f9974c"],colorConfig:[["#7f7f7f","#f2f2f2"],["#0d0d0d","#808080"],["#1c1a10","#ddd8c3"],["#0e243d","#c6d9f0"],["#233f5e","#dae5f0"],["#632623","#f2dbdb"],["#4d602c","#eaf1de"],["#3f3150","#e6e0ec"],["#1e5867","#d9eef3"],["#99490f","#fee9da"]],bColor:["#c21401","#ff1e02","#ffc12a","#ffff3a","#90cf5b","#00af57","#00afee","#0071be","#00215f","#72349d"],html5Color:this.modelValue,openScroll:!1,flashTime:null}},mounted(){let e=this.$refs.colorPicker;e&&D(e,this.closePanel)},methods:{openPanel(){this.openStatus=!this.disabled,this.transfer&&this.openStatus&&(this.render(),this.openScroll=!0)},render(){this.flashTime=requestAnimationFrame(this.render),this.scrollHandler()},setPositon(){var l;let e=(l=this.$refs.smallBlocksRef)==null?void 0:l.getBoundingClientRect();if(e){let o=this.$refs.colorTray;o.style.left=e.left+"px",o.style.top=e.top+e.height+2+"px"}},scrollHandler(){this.transfer&&this.openStatus&&this.setPositon()},closePanel(){this.openScroll&&(cancelAnimationFrame(this.flashTime),this.openScroll=!1),this.openStatus=!1},closePicker(){this.$emit("close")},handleOver(e){this.hoveColor=e},triggerHtml5Color(){var e;(e=this.$refs.html5ColorEl)==null||e.click()},updataValue(e){this.$emit("update:modelValue",e),this.$emit("change",e),this.closePanel()},handleDefaultColor(){this.updataValue(this.defaultColor)},parseColor(e){return e.length===4?e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]:e},rgbToHex(e,l,o){const i=(e<<16|l<<8|o).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i},hexToRgb(e){e=this.parseColor(e);let l=[];for(let o=1;o<7;o+=2)l.push(parseInt("0x"+e.slice(o,o+2)));return l},gradient(e,l,o){let i=this.hexToRgb(e),r=this.hexToRgb(l),n=(r[0]-i[0])/o,s=(r[1]-i[1])/o,f=(r[2]-i[2])/o,a=[];for(let u=0;u<o;u++)a.push(this.rgbToHex(n*u+i[0],s*u+i[1],f*u+i[2]));return a}},computed:{showPanelColor(){return this.hoveColor?this.hoveColor:this.showColor},showColor(){return this.modelValue?this.modelValue:this.defaultColor},colorPanel(){let e=[];for(let l of this.colorConfig)e.push(this.gradient(l[1],l[0],5));return e}}},W=e=>(t.pushScopeId("data-v-f1561d7b"),e=e(),t.popScopeId(),e),re={class:"hd"},ae={class:"bd"},de=W(()=>t.createElementVNode("h3",null,"主题颜色",-1)),he={class:"tColor"},ce=["onMouseover","onClick"],fe={class:"bColor"},ue=["onMouseover","onClick"],me=W(()=>t.createElementVNode("h3",null,"标准颜色",-1)),pe={class:"tColor"},ye=["onMouseover","onClick"];function ge(e,l,o,i,r,n){return t.openBlock(),t.createElementBlock("div",{class:"m-colorPicker",ref:"colorPicker",onClick:l[11]||(l[11]=s=>{s.stopPropagation()}),style:t.normalizeStyle(o.closeable?{padding:"6px 0"}:{})},[t.createElementVNode("div",{class:t.normalizeClass(["colorBtn",[{disabled:o.disabled},{empty:!n.showColor}]]),style:t.normalizeStyle(`background-color: ${n.showColor}`),onClick:l[1]||(l[1]=(...s)=>n.openPanel&&n.openPanel(...s)),ref:"smallBlocksRef"},[o.closeable?(t.openBlock(),t.createElementBlock("span",{key:0,class:"close",onClick:l[0]||(l[0]=t.withModifiers((...s)=>n.closePicker&&n.closePicker(...s),["stop"]))},"X")):t.createCommentVNode("",!0)],6),t.createElementVNode("div",{class:t.normalizeClass(["box",{open:r.openStatus}]),ref:"colorTray",style:t.normalizeStyle([o.transfer?{position:"fixed"}:{},o.zIndex?{zIndex:o.zIndex}:{}])},[t.createElementVNode("div",re,[t.createElementVNode("div",{class:t.normalizeClass(["colorView",[{empty:!n.showPanelColor}]]),style:t.normalizeStyle({"background-color":n.showPanelColor})},null,6),t.createElementVNode("div",{class:"defaultColor",onClick:l[2]||(l[2]=(...s)=>n.handleDefaultColor&&n.handleDefaultColor(...s)),onMouseover:l[3]||(l[3]=s=>n.handleOver(o.defaultColor)),onMouseout:l[4]||(l[4]=s=>n.handleOver(""))},"默认颜色",32)]),t.createElementVNode("div",ae,[de,t.createElementVNode("ul",he,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.tColor,(s,f)=>(t.openBlock(),t.createElementBlock("li",{key:f,style:t.normalizeStyle({backgroundColor:s}),onMouseover:a=>n.handleOver(s),onMouseout:l[5]||(l[5]=a=>n.handleOver("")),onClick:a=>n.updataValue(s)},null,44,ce))),128))]),t.createElementVNode("ul",fe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.colorPanel,(s,f)=>(t.openBlock(),t.createElementBlock("li",{key:f},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s,(a,u)=>(t.openBlock(),t.createElementBlock("li",{key:u,style:t.normalizeStyle({backgroundColor:a}),onMouseover:m=>n.handleOver(a),onMouseout:l[6]||(l[6]=m=>n.handleOver("")),onClick:m=>n.updataValue(a)},null,44,ue))),128))])]))),128))]),me,t.createElementVNode("ul",pe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.bColor,(s,f)=>(t.openBlock(),t.createElementBlock("li",{key:f,style:t.normalizeStyle({backgroundColor:s}),onMouseover:a=>n.handleOver(s),onMouseout:l[7]||(l[7]=a=>n.handleOver("")),onClick:a=>n.updataValue(s)},null,44,ye))),128))]),t.createElementVNode("h3",{onClick:l[8]||(l[8]=(...s)=>n.triggerHtml5Color&&n.triggerHtml5Color(...s))},"更多颜色..."),t.withDirectives(t.createElementVNode("input",{type:"color",ref:"html5ColorEl","onUpdate:modelValue":l[9]||(l[9]=s=>r.html5Color=s),onChange:l[10]||(l[10]=s=>n.updataValue(r.html5Color))},null,544),[[t.vModelText,r.html5Color]])])],6)],4)}const ke=k(se,[["render",ge],["__scopeId","data-v-f1561d7b"]]),we={name:"tooltip",props:{text:"",align:{type:String,default:"left"},alwaysShow:{type:Boolean,default:!1},lineClamp:{type:Number,default:1},width:{type:Number,default:null},delay:{type:Number,default:300},placement:{type:String,default:"middle",validator(e){return["left","right","middle"].includes(e)}}},data(){return{domDatas:null,isOverflow:!1,isOnFocus:!1,domText:"",timer:null,closeTimer:null,clickWatch:null,toolTipDom:null,domIndex:null}},computed:{tipText(){return this.text||this.text===0||this.text===!1?this.text:domText}},methods:{mouseover(){if(this.isOnFocus)return;const e=this.$el,l=e.getBoundingClientRect(),o=()=>{this.domText=e.textContent,this.isOnFocus=!0,this.toOpenToolTip()},i=()=>{let r=e,n=100;for(;r&&r.style&&r;)r.style.zIndex&&r.style.zIndex>n&&(n=r.style.zIndex),r=r.parentNode;return n};this.domIndex||(this.domIndex=i()),this.alwaysShow?o():this.domDatas&&this.domDatas.text===e.textContent&&this.domDatas.width===l.width&&this.domDatas.height===l.height?this.isOverflow&&o():(this.domDatas={text:e.textContent,width:l.width,height:l.height},this.getCloneDom(e,l).height>l.height?(this.isOverflow=!0,o()):this.getCloneDom(e,l,"noWrap").width+4>l.width?(this.isOverflow=!0,o()):this.isOverflow=!1)},getCloneDom(e,l,o){const i=e.cloneNode(!0);i.style.lineHeight=window.getComputedStyle(e).lineHeight,i.style.fontSize=window.getComputedStyle(e).fontSize,o?(i.style.width="fit-content",i.style.textWrap="noWrap"):(i.style.width=l.width+"px",i.style.textWrap="wrap"),i.style.display="block",document.body.appendChild(i);const r=i.getBoundingClientRect();return document.body.removeChild(i),r},mouseleave(){this.isOnFocus&&(this.isOnFocus=!1,window.removeEventListener("scroll",this.mouseleave),this.clickWatch&&(this.clickWatch(),this.clickWatch=null),this.timer?(clearTimeout(this.timer),this.timer=null):this.toolTipDom&&(this.toolTipDom.style.opacity=0,this.closeTimer&&clearTimeout(this.closeTimer),this.closeTimer=setTimeout(()=>{document.body.removeChild(this.toolTipDom),this.toolTipDom=null,this.closeTimer=null},300)))},toOpenToolTip(){this.timer=setTimeout(()=>{this.toolTipDom=document.createElement("div"),this.toolTipDom.textContent=this.domText;const l=this.$el.getBoundingClientRect();let o="";this.width&&(this.toolTipDom.style.maxWidth=this.width+"px"),this.toolTipDom.style.backgroundColor="var(--tooltip-bg-color)",this.toolTipDom.style.borderRadius="var(--tooltip-border-radius)",this.toolTipDom.style.fontSize="var(--tooltip-font-size)",this.toolTipDom.style.color="var(--tooltip-text-color)",this.toolTipDom.style.padding="var(--tooltip-padding)",this.toolTipDom.style.transition="opacity 0.3s ease-in-out",this.toolTipDom.style.zIndex=this.domIndex+2,this.toolTipDom.style.opacity=0,document.body.appendChild(this.toolTipDom),(()=>{this.toolTipDom.style.position="fixed";const f=this.toolTipDom.getBoundingClientRect();l.top<window.innerHeight/2?(this.toolTipDom.style.top=l.bottom+5+"px",o="bottom"):(this.toolTipDom.style.bottom=window.innerHeight-l.top+5+"px",o="top");let a={};this.placement==="left"?(a.left=l.left,o=o+"-left",a.left<2&&(a.left=2)):this.placement==="right"?(a.right=l.right,o=o+"-right",a.right<2&&(a.right=2)):(a.left=l.left+l.width/2-f.width/2,a.left<2?(a.left=2,o=o+"-left"):o=o+"-middle"),Object.keys(a).forEach(u=>{this.toolTipDom.style[u]=a[u]+"px"}),this.toolTipDom.style.opacity=1})(),this.clickWatch&&this.clickWatch(),this.clickWatch=D(this.toolTipDom,this.mouseleave),window.addEventListener("scroll",this.mouseleave),this.timer=null;const r=document.createElement("div");r.style.width="10px",r.style.height="10px",r.style.backgroundColor="var(--tooltip-bg-color)",r.style.transform="rotate(45deg)",r.style.zIndex=this.domIndex+1,this.toolTipDom.appendChild(r),r.style.position="absolute";const n=this.toolTipDom.getBoundingClientRect();window.innerWidth-n.right<30&&(o=o.replace("-left","-right").replace("-middle","-right")),o.includes("right")&&(this.toolTipDom.style.left="none",this.toolTipDom.style.right=document.documentElement.clientWidth-l.right+"px");const s=l.width>n.width?n.width:l.width;switch(o){case"bottom-left":r.style.left=parseInt(s/4)+"px",r.style.top="-5px";break;case"bottom-right":r.style.right=parseInt(s/4)-5+"px",r.style.top="-5px";break;case"bottom-middle":r.style.left=parseInt(n.width/2)+"px",r.style.top="-5px";break;case"top-left":r.style.left=parseInt(s/4)+"px",r.style.bottom="-5px";break;case"top-right":r.style.right=parseInt(s/4)-5+"px",r.style.bottom="-5px";break;case"top-middle":r.style.left=parseInt(n.width/2)+"px",r.style.bottom="-5px";break}},this.delay)}}};function Ce(e,l,o,i,r,n){return t.openBlock(),t.createElementBlock("div",{class:"tooltip-container",style:t.normalizeStyle([{lineClamp:o.lineClamp,textAlign:o.align}]),onMouseover:l[0]||(l[0]=(...s)=>n.mouseover&&n.mouseover(...s)),onMouseleave:l[1]||(l[1]=(...s)=>n.mouseleave&&n.mouseleave(...s))},[e.$slots.default?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(o.text||o.text===0||o.text===!1?o.text:"--"),1)],64)),t.renderSlot(e.$slots,"default",{},void 0,!0)],36)}const xe=k(we,[["render",Ce],["__scopeId","data-v-6a5b1102"]]),be={name:"render",props:{row:Object,render:Function,index:Number,column:{type:Object,default:null}},render(){if(!this.render)return null;const e={row:this.row,index:this.index,column:this.column||[]},l={resolveComponent:t.resolveComponent};return this.render(t.h,e,l)}},Ee={name:"split",props:{minWidth:{type:Number,default:100},dividerWidth:{type:Number,default:10},location:{type:Number,default:50,validator:function(e){return e>=0&&e<=100}}},data(){return{leftWidth:0,rightWidth:0,isDragging:!1}},mounted(){const e=this.$el.clientWidth;this.leftWidth=e*(this.location/100)-this.dividerWidth/2,this.rightWidth=e*((100-this.location)/100)-this.dividerWidth/2,window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp),window.addEventListener("resize",this.handleResize)},beforeDestroy(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("resize",this.handleResize)},methods:{handleMouseDown(e){this.isDragging=!0,document.body.style.cursor="col-resize",e.preventDefault()},handleMouseUp(){this.isDragging=!1,document.body.style.cursor="default"},handleMouseMove(e){if(!this.isDragging)return;const o=this.$el.getBoundingClientRect(),i=e.clientX-o.left;i<this.minWidth||o.width-i-this.dividerWidth<this.minWidth||(this.leftWidth=i,this.rightWidth=o.width-i-this.dividerWidth)},handleResize(){const e=this.$el.clientWidth;this.leftWidth=e/2-this.dividerWidth/2,this.rightWidth=e/2-this.dividerWidth/2}}},Ie={class:"split-pane"};function Te(e,l,o,i,r,n){return t.openBlock(),t.createElementBlock("div",Ie,[t.createElementVNode("div",{class:"left-pane",style:t.normalizeStyle({width:r.leftWidth+"px"})},[t.renderSlot(e.$slots,"left",{},void 0,!0)],4),t.createElementVNode("div",{class:"divider",style:t.normalizeStyle({width:o.dividerWidth+"px"}),onMousedown:l[0]||(l[0]=(...s)=>n.handleMouseDown&&n.handleMouseDown(...s))},[t.renderSlot(e.$slots,"divider",{},void 0,!0)],36),t.createElementVNode("div",{class:"right-pane",style:t.normalizeStyle({width:r.rightWidth+"px"})},[t.renderSlot(e.$slots,"right",{},void 0,!0)],4)])}const _e=[J,ke,xe,be,k(Ee,[["render",Te],["__scopeId","data-v-35e2cf1d"]])];return e=>{_e.forEach(l=>{e.component("wr-"+l.name,l)})}});