index-DWHLA6Wz.js 5.1 KB

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