mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-07 09:38:44 +08:00
2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
var e=Object.defineProperty,s=Object.defineProperties,t=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(s,t,l)=>t in s?e(s,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[t]=l,i=(e,s)=>{for(var t in s||(s={}))a.call(s,t)&&o(e,t,s[t]);if(l)for(var t of l(s))r.call(s,t)&&o(e,t,s[t]);return e},c=(e,l)=>s(e,t(l));import{d as n,r as u,c as p,H as h,G as d,J as v,Y as f,y as w,aE as b,b as g,g as y,w as _,h as m,i as z,q as x,D as O,aF as j,l as C,E as $}from"./index-ChV97F5w.js";import{a as S,b as E,_ as H}from"./base64.D3gEw_Hf.js";const P=c(i({},E),{customContainerClass:S("")}),I=H(n(c(i({},{name:"wd-resize",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}}),{props:P,emits:["resize"],setup(e,{emit:s}){const t=e,l=s,a=u(0),r=u(0),o=u(0),i=u(0),c=u(0),n=u(0),S=u(0),E=p((()=>{const e={width:h(n.value),height:h(c.value)};return`${d(e)}${t.customStyle}`}));let H=()=>{};const{proxy:P}=v(),I=u(`resize${f()}`);function W({lastWidth:e,lastHeight:s}){a.value=1e5+s,r.value=3*c.value+s,o.value=1e5+e,i.value=3*n.value+e}return w((()=>{b().in(P).select(`#${I.value}`).boundingClientRect().exec((([e])=>{let s=e.height,t=e.width;c.value=s,n.value=t,H=()=>{b().in(P).select(`#${I.value}`).boundingClientRect().exec((([e])=>{if(0==S.value++){const s={};["bottom","top","left","right","height","width"].forEach((t=>{s[t]=e[t]})),l("resize",s)}if(S.value<3)return;const a=e.height,r=e.width;c.value=a,n.value=r;const o=[];if(a!==s&&(s=a,o.push(1)),r!==t&&(t=r,o.push(1)),0!==o.length){const s={};["bottom","top","left","right","height","width"].forEach((t=>{s[t]=e[t]})),l("resize",s)}W({lastWidth:t,lastHeight:s})}))},W({lastWidth:t,lastHeight:s})}))})),(e,s)=>{const t=z,l=j;return y(),g(t,{class:x(`wd-resize ${e.customClass}`),style:$(E.value)},{default:_((()=>[m(t,{id:I.value,class:x(`wd-resize__container ${e.customContainerClass}`)},{default:_((()=>[O(e.$slots,"default",{},void 0,!0),m(l,{class:"wd-resize__wrapper","scroll-y":!0,"scroll-top":a.value,"scroll-x":!0,"scroll-left":o.value,onScroll:C(H)},{default:_((()=>[m(t,{class:"wd-resize__wrapper--placeholder",style:{height:"100000px",width:"100000px"}})])),_:1},8,["scroll-top","scroll-left","onScroll"]),m(l,{class:"wd-resize__wrapper","scroll-y":!0,"scroll-top":r.value,"scroll-x":!0,"scroll-left":i.value,onScroll:C(H)},{default:_((()=>[m(t,{class:"wd-resize__wrapper--placeholder",style:{height:"250%",width:"250%"}})])),_:1},8,["scroll-top","scroll-left","onScroll"])])),_:3},8,["id","class"])])),_:3},8,["class","style"])}}})),[["__scopeId","data-v-c60e4954"]]);export{I as w};
|