1 |
- var ct=Object.defineProperty,ft=Object.defineProperties;var gt=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var ut=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var J=(s,r,n)=>r in s?ct(s,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[r]=n,j=(s,r)=>{for(var n in r||(r={}))ut.call(r,n)&&J(s,n,r[n]);if(z)for(var n of z(r))dt.call(r,n)&&J(s,n,r[n]);return s},Q=(s,r)=>ft(s,gt(r));var N=(s,r,n)=>new Promise((q,T)=>{var I=g=>{try{o(n.next(g))}catch(p){T(p)}},t=g=>{try{o(n.throw(g))}catch(p){T(p)}},o=g=>g.done?q(g.value):Promise.resolve(g.value).then(I,t);o((n=n.apply(s,r)).next())});import{d as U,W as V,cX as ht,_ as tt,o as L,l as X,a as D,ai as v,X as O,q as et,r as W,j as ot,p as G,u as C,bK as pt,c6 as mt,aE as _t,aR as Ct,cY as yt,aG as h,aZ as Ht,A as y,K as nt,y as st,c as at,ap as bt,O as Ft,w as A,aq as $t,ar as vt,N as xt,b as St,t as wt,P as Pt,H as rt,ax as lt,__tla as Rt}from"./index-b5895273.js";import{o as kt,__tla as Wt}from"./onMountedOrActivated-6125a24a.js";import{u as Et,__tla as Bt}from"./useWindowSizeFn-a59bee15.js";import{u as Lt,__tla as Ot}from"./useContentViewHeight-cd147d02.js";let it,M,Y,Tt=Promise.all([(()=>{try{return Rt}catch(s){}})(),(()=>{try{return Wt}catch(s){}})(),(()=>{try{return Bt}catch(s){}})(),(()=>{try{return Ot}catch(s){}})()]).then(()=>N(void 0,null,function*(){const s=U({name:"PageFooter",inheritAttrs:!1,setup(){const{prefixCls:t}=V("page-footer"),{getCalcContentWidth:o}=ht();return{prefixCls:t,getCalcContentWidth:o}}});function r(t,o,g,p,H,w){return L(),X("div",{class:O(t.prefixCls),style:et({width:t.getCalcContentWidth})},[D("div",{class:O(`${t.prefixCls}__left`)},[v(t.$slots,"left",{},void 0,!0)],2),v(t.$slots,"default",{},void 0,!0),D("div",{class:O(`${t.prefixCls}__right`)},[v(t.$slots,"right",{},void 0,!0)],2)],6)}const n=tt(s,[["render",r],["__scopeId","data-v-b45042ac"]]);function q(t,o,g,p,H=0,w=W(0)){const b=W(null),{footerHeightRef:u}=Lt();let F={useLayoutFooter:!0};const E=a=>{F=a};function K(){G(()=>{R()})}function x(a,S="all"){var f,_,k,$;function m(e){return Number(e.replace(/[^\d]/g,""))}let c=0;const d="0px";if(a){const e=getComputedStyle(a),i=m((f=e==null?void 0:e.marginTop)!=null?f:d),l=m((_=e==null?void 0:e.marginBottom)!=null?_:d),B=m((k=e==null?void 0:e.paddingTop)!=null?k:d),Z=m(($=e==null?void 0:e.paddingBottom)!=null?$:d);S==="all"?(c+=i,c+=l,c+=B,c+=Z):S==="top"?(c+=i,c+=B):(c+=l,c+=Z)}return c}function P(a){return a==null?null:a instanceof HTMLDivElement?a:a.$el}function R(){return N(this,null,function*(){var $;if(!t.value)return;yield G();const a=P(C(o));if(!a)return;const{bottomIncludeBody:S}=pt(a);let m=0;g.forEach(e=>{var i,l;m+=(l=(i=P(C(e)))==null?void 0:i.offsetHeight)!=null?l:0});let c=($=x(a))!=null?$:0;p.forEach(e=>{c+=x(P(C(e)))});let d=0;function f(e,i){if(e&&i){const l=e.parentElement;l&&(_t(i)?l.classList.contains(i)?d+=x(l,"bottom"):(d+=x(l,"bottom"),f(l,i)):Ct(i)&&i>0&&(d+=x(l,"bottom"),f(l,--i)))}}mt(H)?f(a,C(H)):f(a,H);let _=S-C(u)-C(w)-m-c-d;const k=()=>{var e;(e=F.elements)==null||e.forEach(i=>{var l,B;_+=(B=(l=P(C(i)))==null?void 0:l.offsetHeight)!=null?B:0})};F.useLayoutFooter&&C(u)>0,k(),b.value=_})}return kt(()=>{G(()=>{R()})}),Et(()=>{R()},50,{immediate:!0}),ot(()=>[u.value],()=>{R()},{flush:"post",immediate:!0}),{redoHeight:K,setCompensation:E,contentHeight:b}}const T=U({name:"PageWrapper",components:{PageFooter:n,PageHeader:yt},inheritAttrs:!1,props:{title:h.string,dense:h.bool,ghost:h.bool,content:h.string,contentStyle:{type:Object},contentBackground:h.bool,contentFullHeight:h.bool,contentClass:h.string,fixedHeight:h.bool,upwardSpace:h.oneOfType([h.number,h.string]).def(0)},setup(t,{slots:o,attrs:g}){const p=W(null),H=W(null),w=W(null),b=W(null),{prefixCls:u}=V("page-wrapper");Ht(M,y(()=>t.fixedHeight));const F=y(()=>t.contentFullHeight),E=y(()=>t.upwardSpace),{redoHeight:K,setCompensation:x,contentHeight:P}=q(F,p,[H,b],[w],E);x({useLayoutFooter:!0,elements:[b]});const R=y(()=>{var f;return[u,{[`${u}--dense`]:t.dense},(f=g.class)!=null?f:{}]}),a=y(()=>t.content||(o==null?void 0:o.headerContent)||t.title||m.value.length),S=y(()=>(o==null?void 0:o.leftFooter)||(o==null?void 0:o.rightFooter)),m=y(()=>Object.keys(nt(o,"default","leftFooter","rightFooter","headerContent"))),c=y(()=>{const{contentFullHeight:f,contentStyle:_,fixedHeight:k}=t;if(!f)return j({},_);const $=`${C(P)}px`;return j(Q(j({},_),{minHeight:$}),k?{height:$}:{})}),d=y(()=>{const{contentBackground:f,contentClass:_}=t;return[`${u}-content`,_,{[`${u}-content-bg`]:f}]});return ot(()=>[S.value],()=>{K()},{flush:"post",immediate:!0}),{getContentStyle:c,wrapperRef:p,headerRef:H,contentRef:w,footerRef:b,getClass:R,getHeaderSlots:m,prefixCls:u,getShowHeader:a,getShowFooter:S,omit:nt,getContentClass:d}}});function I(t,o,g,p,H,w){const b=st("PageHeader"),u=st("PageFooter");return L(),X("div",{class:O(t.getClass),ref:"wrapperRef"},[t.getShowHeader?(L(),at(b,Pt({key:0,ghost:t.ghost,title:t.title},t.omit(t.$attrs,"class"),{ref:"headerRef"}),bt({default:A(()=>[t.content?(L(),X(xt,{key:0},[St(wt(t.content),1)],64)):v(t.$slots,"headerContent",{key:1})]),_:2},[Ft(t.getHeaderSlots,F=>({name:F,fn:A(E=>[v(t.$slots,F,$t(vt(E||{})))])}))]),1040,["ghost","title"])):rt("",!0),D("div",{class:O(["overflow-hidden",t.getContentClass]),style:et(t.getContentStyle),ref:"contentRef"},[v(t.$slots,"default")],6),t.getShowFooter?(L(),at(u,{key:1,ref:"footerRef"},{left:A(()=>[v(t.$slots,"leftFooter")]),right:A(()=>[v(t.$slots,"rightFooter")]),_:3},512)):rt("",!0)],2)}Y=tt(T,[["render",I]]),it=lt(Y),lt(n),M="PageWrapperFixedHeight"}));export{it as P,Tt as __tla,M as a,Y as b};
|