1 |
- var Y=Object.defineProperty,ee=Object.defineProperties;var te=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var K=(s,t,a)=>t in s?Y(s,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[t]=a,B=(s,t)=>{for(var a in t||(t={}))oe.call(t,a)&&K(s,a,t[a]);if(M)for(var a of M(t))ne.call(t,a)&&K(s,a,t[a]);return s},Z=(s,t)=>ee(s,te(t));var G=(s,t,a)=>new Promise((r,g)=>{var w=u=>{try{h(a.next(u))}catch(m){g(m)}},k=u=>{try{h(a.throw(u))}catch(m){g(m)}},h=u=>u.done?r(u.value):Promise.resolve(u.value).then(w,k);h((a=a.apply(s,t)).next())});import{j as X,s as ae,_ as se,v as re,p as f,x as ie,y as ce,w as q}from"./entry/index-CfskT3Lu.js";import{d as J,Z as T,_ as N,$ as A,ae as S,a1 as z,u as c,ag as V,f as E,y as I,w as D,H as le,K as ue,ah as fe,p as ge,c as p,a7 as L,ad as he,aa as de,a8 as W,aj as pe,ak as me,F as He,G as ye,a0 as be,ac as Fe,ab as O}from"./vue-ByATgq5d.js";import{u as ve}from"./useContentViewHeight-B_d6Wvsk.js";import{l as Se,ab as ke,ac as Ce,o as U,ad as $e}from"./antd-FjOLgRLC.js";import{o as Re}from"./onMountedOrActivated-BDlj7Upy.js";import{u as _e}from"./useWindowSizeFn-CoP3yonw.js";const we=J({name:"PageFooter",inheritAttrs:!1,__name:"PageFooter",setup(s){const{prefixCls:t}=X("page-footer"),{getCalcContentWidth:a}=ae();return(r,g)=>(T(),N("div",{class:z(c(t)),style:V({width:c(a)})},[A("div",{class:z(`${c(t)}__left`)},[S(r.$slots,"left",{},void 0,!0)],2),S(r.$slots,"default",{},void 0,!0),A("div",{class:z(`${c(t)}__right`)},[S(r.$slots,"right",{},void 0,!0)],2)],6))}}),Q=se(we,[["__scopeId","data-v-dafa78ce"]]);function Pe(s,t,a,r,g=0,w=E(0)){const k=E(null),{footerHeightRef:h}=ve();let u={useLayoutFooter:!0};const m=i=>{u=i};function j(){I(()=>{P()})}function C(i,x="all"){var b,F,v,R;function y(o){return Number(o.replace(/[^\d]/g,""))}let l=0;const d="0px";if(i){const o=getComputedStyle(i),e=y((b=o==null?void 0:o.marginTop)!=null?b:d),n=y((F=o==null?void 0:o.marginBottom)!=null?F:d),H=y((v=o==null?void 0:o.paddingTop)!=null?v:d),_=y((R=o==null?void 0:o.paddingBottom)!=null?R:d);x==="all"?(l+=e,l+=n,l+=H,l+=_):x==="top"?(l+=e,l+=H):(l+=n,l+=_)}return l}function $(i){return i==null?null:i instanceof HTMLDivElement?i:i.$el}function P(){return G(this,null,function*(){var R;if(!s.value)return;yield I();const i=$(c(t));if(!i)return;const{bottomIncludeBody:x}=re(i);let y=0;a.forEach(o=>{var e,n;y+=(n=(e=$(c(o)))==null?void 0:e.offsetHeight)!=null?n:0});let l=(R=C(i))!=null?R:0;r.forEach(o=>{l+=C($(c(o)))});let d=0;function b(o,e){if(o&&e){const n=o.parentElement;n&&(Se(e)?n.classList.contains(e)?d+=C(n,"bottom"):(d+=C(n,"bottom"),b(n,e)):ke(e)&&e>0&&(d+=C(n,"bottom"),b(n,--e)))}}le(g)?b(i,c(g)):b(i,g);let F=x-c(h)-c(w)-y-l-d;const v=()=>{var o;(o=u.elements)==null||o.forEach(e=>{var n,H;F+=(H=(n=$(c(e)))==null?void 0:n.offsetHeight)!=null?H:0})};u.useLayoutFooter&&c(h)>0,v(),k.value=F})}return Re(()=>{I(()=>{P()})}),_e(()=>{P()},{wait:50,immediate:!0}),D(()=>[h.value],()=>{P()},{flush:"post",immediate:!0}),{redoHeight:j,setCompensation:m,contentHeight:k}}const xe=J({name:"PageWrapper",inheritAttrs:!1,__name:"PageWrapper",props:{title:f.string,dense:f.bool,ghost:f.bool,headerSticky:f.bool,headerStyle:Object,content:f.string,contentStyle:{type:Object},contentBackground:f.bool,contentFullHeight:f.bool.def(!1),contentClass:f.string,fixedHeight:f.bool,upwardSpace:f.oneOfType([f.number,f.string]).def(0)},setup(s){const t=s,a=ue(),r=fe(),g=E(null),w=E(null),k=E(null),h=E(null),{height:u}=ie(g),{prefixCls:m}=X("page-wrapper");ge(ce,p(()=>t.fixedHeight));const j=p(()=>t.contentFullHeight),C=p(()=>t.upwardSpace),{redoHeight:$,setCompensation:P,contentHeight:i}=Pe(j,g,[w,h],[k],C),x=Ce($,50);P({useLayoutFooter:!0,elements:[h]});const y=p(()=>{var e;return[m,{[`${m}--dense`]:t.dense},(e=a.class)!=null?e:{}]}),l=p(()=>{const{contentFullHeight:e,fixedHeight:n}=t;return B({},e&&n?{height:"100%"}:{})}),d=p(()=>{const{headerSticky:e}=t;return e?B({position:"sticky",top:0,zIndex:99},t.headerStyle):{}}),b=p(()=>t.content||(r==null?void 0:r.headerContent)||t.title||v.value.length),F=p(()=>(r==null?void 0:r.leftFooter)||(r==null?void 0:r.rightFooter)),v=p(()=>Object.keys(U(r,"default","leftFooter","rightFooter","headerContent"))),R=p(()=>{const{contentFullHeight:e,contentStyle:n,fixedHeight:H}=t;if(!e)return B({},n);const _=`${c(i)}px`;return B(Z(B({},n),{minHeight:_}),H?{height:_}:{})}),o=p(()=>{const{contentBackground:e,contentClass:n}=t;return[`${m}-content`,n,{[`${m}-content-bg`]:e}]});return D(()=>[F.value],()=>{$()},{flush:"post",immediate:!0}),D(u,()=>{const{contentFullHeight:e,fixedHeight:n}=t;e&&n&&x()}),(e,n)=>(T(),N("div",{class:z(y.value),style:V(l.value),ref_key:"wrapperRef",ref:g},[b.value?(T(),L(c($e),Fe({key:0,ghost:s.ghost,title:s.title},c(U)(e.$attrs,"class"),{style:d.value,ref_key:"headerRef",ref:w}),he({default:W(()=>[s.content?(T(),N(He,{key:0},[ye(be(s.content),1)],64)):S(e.$slots,"headerContent",{key:1})]),_:2},[de(v.value,H=>({name:H,fn:W(_=>[S(e.$slots,H,pe(me(_||{})))])}))]),1040,["ghost","title","style"])):O("",!0),A("div",{class:z(["overflow-hidden",o.value]),style:V(R.value),ref_key:"contentRef",ref:k},[S(e.$slots,"default")],6),F.value?(T(),L(Q,{key:1,ref_key:"footerRef",ref:h},{left:W(()=>[S(e.$slots,"leftFooter")]),right:W(()=>[S(e.$slots,"rightFooter")]),_:3},512)):O("",!0)],6))}});q(Q);const Ne=q(xe);export{Ne as P};
|