| 1 |
- var ee=Object.defineProperty,te=Object.defineProperties;var oe=Object.getOwnPropertyDescriptors;var V=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,x=(s,e)=>{for(var o in e||(e={}))ne.call(e,o)&&D(s,o,e[o]);if(V)for(var o of V(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(b){h(b)}},v=l=>{try{p(o.throw(l))}catch(b){h(b)}},p=l=>l.done?i(l.value):Promise.resolve(l.value).then(C,v);p((o=o.apply(s,e)).next())});import{f as O,j as se,_ as re,aB as ie,p as d,aI as ce,aT as U}from"./index.js";import{d as X,Y as E,Z as j,_ as z,N as _,a0 as T,u,ad as Y,f as w,x as I,w as q,k as le,J as ue,ae as fe,p as ge,c as y,a6 as J,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 K}from"./vue-8fccce23.js";import{a as G}from"./useContentViewHeight-62fb8ef5.js";import{o as be}from"./onMountedOrActivated-cb072c10.js";import{k as Fe,ah as ke,o as L,a_ as $e}from"./antd-49db3de3.js";import{u as Ce}from"./useWindowSizeFn-e2b93e2a.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(),j("div",{class:T(u(e)),style:Y({width:u(o)})},[z("div",{class:T(`${u(e)}__left`)},[_(i.$slots,"left",{},void 0,!0)],2),_(i.$slots,"default",{},void 0,!0),z("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 b=c=>{l=c};function N(){I(()=>{P()})}function F(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),B=H(($=t==null?void 0:t.paddingTop)!=null?$:g),A=H((n=t==null?void 0:t.paddingBottom)!=null?n:g);R==="all"?(f+=r,f+=a,f+=B,f+=A):R==="top"?(f+=r,f+=B):(f+=a,f+=A)}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 I();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=F(c))!=null?n:0;i.forEach(t=>{f+=F(S(u(t)))});let g=0;function m(t,r){if(t&&r){const a=t.parentElement;a&&(Fe(r)?a.classList.contains(r)?g+=F(a,"bottom"):(g+=F(a,"bottom"),m(a,r)):ke(r)&&r>0&&(g+=F(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,B;k+=(B=(a=S(u(r)))==null?void 0:a.offsetHeight)!=null?B:0})};l.useLayoutFooter&&u(p)>0,$(),v.value=k})}return be(()=>{I(()=>{P()})}),Ce(()=>{P()},{wait:50,immediate:!0}),q(()=>[p.value],()=>{P()},{flush:"post",immediate:!0}),{redoHeight:N,setCompensation:b,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 b=y(()=>e.contentFullHeight),N=y(()=>e.upwardSpace),{redoHeight:F,setCompensation:S,contentHeight:P}=Pe(b,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?x({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(L(i,"default","leftFooter","rightFooter","headerContent"))),k=y(()=>{const{contentFullHeight:n,contentStyle:t,fixedHeight:r}=e;if(!n)return x({},t);const a=`${u(P)}px`;return x(M(x({},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],()=>{F()},{flush:"post",immediate:!0}),(n,t)=>(E(),j("div",{class:T(c.value),ref_key:"wrapperRef",ref:h},[f.value?(E(),J(u($e),ve({key:0,ghost:s.ghost,title:s.title},u(L)(n.$attrs,"class"),{style:H.value,ref_key:"headerRef",ref:C}),de({default:W(()=>[s.content?(E(),j(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"])):K("",!0),z("div",{class:T(["overflow-hidden",$.value]),style:Y(k.value),ref_key:"contentRef",ref:v},[_(n.$slots,"default")],6),g.value?(E(),J(Q,{key:1,ref_key:"footerRef",ref:p},{left:W(()=>[_(n.$slots,"leftFooter")]),right:W(()=>[_(n.$slots,"rightFooter")]),_:3},512)):K("",!0)],2))}});U(Q);const Ie=U(Re);export{Ie as P};
|