index-60572501.js 5.1 KB

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