index-C0mnMlct.js 5.3 KB

1
  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,x=(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 q=(s,t,a)=>new Promise((r,g)=>{var P=u=>{try{h(a.next(u))}catch(m){g(m)}},v=u=>{try{h(a.throw(u))}catch(m){g(m)}},h=u=>u.done?r(u.value):Promise.resolve(u.value).then(P,v);h((a=a.apply(s,t)).next())});import{h as U,l as ae,_ as se,bh as re,p as f,bb as ie,bc as ce,aD as X}from"./entry/index-CRWhxBeP.js";import{d as J,Z as T,_ as j,$ as A,ab as k,a1 as z,u as c,ad as D,f as E,y as N,w as V,H as le,K as ue,ae as fe,p as ge,c as p,a4 as G,aa as he,a7 as de,a5 as W,ag as pe,ah as me,F as He,G as ye,a0 as be,a9 as Fe,a8 as L}from"./vue-DM5HGU8Z.js";import{a as Se}from"./useContentViewHeight-D9So7_ch.js";import{j as ke,aq as ve,b1 as Ce,o as O,b4 as $e}from"./antd-BfqWtMX3.js";import{o as Re}from"./onMountedOrActivated-Ckq_czNf.js";import{u as _e}from"./useWindowSizeFn-CEueHQop.js";const Pe=J({name:"PageFooter",inheritAttrs:!1,__name:"PageFooter",setup(s){const{prefixCls:t}=U("page-footer"),{getCalcContentWidth:a}=ae();return(r,g)=>(T(),j("div",{class:z(c(t)),style:D({width:c(a)})},[A("div",{class:z(`${c(t)}__left`)},[k(r.$slots,"left",{},void 0,!0)],2),k(r.$slots,"default",{},void 0,!0),A("div",{class:z(`${c(t)}__right`)},[k(r.$slots,"right",{},void 0,!0)],2)],6))}}),Q=se(Pe,[["__scopeId","data-v-dafa78ce"]]);function we(s,t,a,r,g=0,P=E(0)){const v=E(null),{footerHeightRef:h}=Se();let u={useLayoutFooter:!0};const m=i=>{u=i};function I(){N(()=>{w()})}function C(i,B="all"){var b,F,S,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((S=o==null?void 0:o.paddingTop)!=null?S:d),_=y((R=o==null?void 0:o.paddingBottom)!=null?R:d);B==="all"?(l+=e,l+=n,l+=H,l+=_):B==="top"?(l+=e,l+=H):(l+=n,l+=_)}return l}function $(i){return i==null?null:i instanceof HTMLDivElement?i:i.$el}function w(){return q(this,null,function*(){var R;if(!s.value)return;yield N();const i=$(c(t));if(!i)return;const{bottomIncludeBody:B}=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&&(ke(e)?n.classList.contains(e)?d+=C(n,"bottom"):(d+=C(n,"bottom"),b(n,e)):ve(e)&&e>0&&(d+=C(n,"bottom"),b(n,--e)))}}le(g)?b(i,c(g)):b(i,g);let F=B-c(h)-c(P)-y-l-d;const S=()=>{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,S(),v.value=F})}return Re(()=>{N(()=>{w()})}),_e(()=>{w()},{wait:50,immediate:!0}),V(()=>[h.value],()=>{w()},{flush:"post",immediate:!0}),{redoHeight:I,setCompensation:m,contentHeight:v}}const Be=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),P=E(null),v=E(null),h=E(null),{height:u}=ie(g),{prefixCls:m}=U("page-wrapper");ge(ce,p(()=>t.fixedHeight));const I=p(()=>t.contentFullHeight),C=p(()=>t.upwardSpace),{redoHeight:$,setCompensation:w,contentHeight:i}=we(I,g,[P,h],[v],C),B=Ce($,50);w({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 x({},e&&n?{height:"100%"}:{})}),d=p(()=>{const{headerSticky:e}=t;return e?x({position:"sticky",top:0,zIndex:99},t.headerStyle):{}}),b=p(()=>t.content||(r==null?void 0:r.headerContent)||t.title||S.value.length),F=p(()=>(r==null?void 0:r.leftFooter)||(r==null?void 0:r.rightFooter)),S=p(()=>Object.keys(O(r,"default","leftFooter","rightFooter","headerContent"))),R=p(()=>{const{contentFullHeight:e,contentStyle:n,fixedHeight:H}=t;if(!e)return x({},n);const _=`${c(i)}px`;return x(Z(x({},n),{minHeight:_}),H?{height:_}:{})}),o=p(()=>{const{contentBackground:e,contentClass:n}=t;return[`${m}-content`,n,{[`${m}-content-bg`]:e}]});return V(()=>[F.value],()=>{$()},{flush:"post",immediate:!0}),V(u,()=>{const{contentFullHeight:e,fixedHeight:n}=t;e&&n&&B()}),(e,n)=>(T(),j("div",{class:z(y.value),style:D(l.value),ref_key:"wrapperRef",ref:g},[b.value?(T(),G(c($e),Fe({key:0,ghost:s.ghost,title:s.title},c(O)(e.$attrs,"class"),{style:d.value,ref_key:"headerRef",ref:P}),he({default:W(()=>[s.content?(T(),j(He,{key:0},[ye(be(s.content),1)],64)):k(e.$slots,"headerContent",{key:1})]),_:2},[de(S.value,H=>({name:H,fn:W(_=>[k(e.$slots,H,pe(me(_||{})))])}))]),1040,["ghost","title","style"])):L("",!0),A("div",{class:z(["overflow-hidden",o.value]),style:D(R.value),ref_key:"contentRef",ref:v},[k(e.$slots,"default")],6),F.value?(T(),G(Q,{key:1,ref_key:"footerRef",ref:h},{left:W(()=>[k(e.$slots,"leftFooter")]),right:W(()=>[k(e.$slots,"rightFooter")]),_:3},512)):L("",!0)],6))}});X(Q);const je=X(Be);export{je as P};