2 lines
8.5 KiB
Java
2 lines
8.5 KiB
Java
var ue=Object.defineProperty,fe=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable;var Z=(e,t,o)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,z=(e,t)=>{for(var o in t||(t={}))me.call(t,o)&&Z(e,o,t[o]);if(q)for(var o of q(t))he.call(t,o)&&Z(e,o,t[o]);return e},k=(e,t)=>fe(e,pe(t));import{l as ve,m as be,a as C,n as $e,fm as ee,a5 as He,fT as Ce,fQ as S,P as Se,f as ye,gW as Pe,cd as Te,k as Be,fK as Fe,h as te,aE as we,fb as _e,gX as Re,gY as ze,bo as se,au as le,as as c,b2 as ae,y as ie}from"./index-X7Y8jykP.js";import{useMenuSetting as Ie}from"./useMenuSetting-BwQ9LkAm.js";import{e as U,s as Me,c as g,f as l,C as K,z as F,Q,L as p,J as w,T as de,h as xe,r as I,u as Ae,a2 as De,y as ne,H as re,I as Le,D as je,A as M,M as Ne,N as We,F as Oe,E as Ve,G as Ee,B as Ge,K as oe}from"./vue-vendor-DNhG1Cve.js";import{useContentHeight as Xe}from"./useContentHeight-vWUZcXk1.js";import{P as Ke}from"./injectionKey-DPVn4AgL.js";import{A as Qe}from"./ArrowLeftOutlined-B3JgaWh-.js";import{A as Ue}from"./ArrowRightOutlined-CZG1QCpB.js";import{B as Je}from"./index-lcIOKfa7.js";import{A as Ye}from"./index-B4gPlWQt.js";import{T as qe}from"./transButton-B2CWzlQO.js";import{o as Ze}from"./operationUnit-vCu2co3e.js";const ke=e=>{const{componentCls:t,antCls:o}=e;return{[t]:C(C({},$e(e)),{position:"relative",padding:`${e.pageHeaderPaddingVertical}px ${e.pageHeaderPadding}px`,backgroundColor:e.colorBgContainer,[`&${t}-ghost`]:{backgroundColor:e.pageHeaderGhostBg},"&.has-footer":{paddingBottom:0},[`${t}-back`]:{marginRight:e.marginMD,fontSize:e.fontSizeLG,lineHeight:1,"&-button":C(C({},Ze(e)),{color:e.pageHeaderBackColor,cursor:"pointer"})},[`${o}-divider-vertical`]:{height:"14px",margin:`0 ${e.marginSM}`,verticalAlign:"middle"},[`${o}-breadcrumb + &-heading`]:{marginTop:e.marginXS},[`${t}-heading`]:{display:"flex",justifyContent:"space-between","&-left":{display:"flex",alignItems:"center",margin:`${e.marginXS/2}px 0`,overflow:"hidden"},"&-title":C({marginRight:e.marginSM,marginBottom:0,color:e.colorTextHeading,fontWeight:600,fontSize:e.pageHeaderHeadingTitle,lineHeight:`${e.controlHeight}px`},ee),[`${o}-avatar`]:{marginRight:e.marginSM},"&-sub-title":C({marginRight:e.marginSM,color:e.colorTextDescription,fontSize:e.pageHeaderHeadingSubTitle,lineHeight:e.lineHeight},ee),"&-extra":{margin:`${e.marginXS/2}px 0`,whiteSpace:"nowrap","> *":{marginLeft:e.marginSM,whiteSpace:"unset"},"> *:first-child":{marginLeft:0}}},[`${t}-content`]:{paddingTop:e.pageHeaderContentPaddingVertical},[`${t}-footer`]:{marginTop:e.marginMD,[`${o}-tabs`]:{[`> ${o}-tabs-nav`]:{margin:0,"&::before":{border:"none"}},[`${o}-tabs-tab`]:{paddingTop:e.paddingXS,paddingBottom:e.paddingXS,fontSize:e.pageHeaderTabFontSize}}},[`${t}-compact ${t}-heading`]:{flexWrap:"wrap"},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}},et=ve("PageHeader",e=>{const t=be(e,{pageHeaderPadding:e.paddingLG,pageHeaderPaddingVertical:e.paddingMD,pageHeaderPaddingBreadcrumb:e.paddingSM,pageHeaderContentPaddingVertical:e.paddingSM,pageHeaderBackColor:e.colorTextBase,pageHeaderGhostBg:"transparent",pageHeaderHeadingTitle:e.fontSizeHeading4,pageHeaderHeadingSubTitle:e.fontSize,pageHeaderTabFontSize:e.fontSizeLG});return[ke(t)]}),tt=()=>({backIcon:S(),prefixCls:String,title:S(),subTitle:S(),breadcrumb:Se.object,tags:S(),footer:S(),extra:S(),avatar:Ce(),ghost:{type:Boolean,default:void 0},onBack:Function}),at=U({compatConfig:{MODE:3},name:"APageHeader",inheritAttrs:!1,props:tt(),slots:Object,setup(e,t){let{emit:o,slots:r,attrs:m}=t;const{prefixCls:i,direction:u,pageHeader:d}=ye("page-header",e),[v,y]=et(i),_=Me(!1),x=Pe(),A=a=>{let{width:n}=a;x.value||(_.value=n<768)},D=g(()=>{var a,n,s;return(s=(a=e.ghost)!==null&&a!==void 0?a:(n=d==null?void 0:d.value)===null||n===void 0?void 0:n.ghost)!==null&&s!==void 0?s:!0}),R=()=>{var a,n,s;return(s=(a=e.backIcon)!==null&&a!==void 0?a:(n=r.backIcon)===null||n===void 0?void 0:n.call(r))!==null&&s!==void 0?s:u.value==="rtl"?l(Ue,null,null):l(Qe,null,null)},L=a=>!a||!e.onBack?null:l(ze,{componentName:"PageHeader",children:n=>{let{back:s}=n;return l("div",{class:`${i.value}-back`},[l(qe,{onClick:h=>{o("back",h)},class:`${i.value}-back-button`,"aria-label":s},{default:()=>[a]})])}},null),j=()=>{var a;return e.breadcrumb?l(Je,e.breadcrumb,null):(a=r.breadcrumb)===null||a===void 0?void 0:a.call(r)},N=()=>{var a,n,s,h,$,P,W,O,V;const{avatar:E}=e,T=(a=e.title)!==null&&a!==void 0?a:(n=r.title)===null||n===void 0?void 0:n.call(r),B=(s=e.subTitle)!==null&&s!==void 0?s:(h=r.subTitle)===null||h===void 0?void 0:h.call(r),G=($=e.tags)!==null&&$!==void 0?$:(P=r.tags)===null||P===void 0?void 0:P.call(r),X=(W=e.extra)!==null&&W!==void 0?W:(O=r.extra)===null||O===void 0?void 0:O.call(r),H=`${i.value}-heading`,J=T||B||G||X;if(!J)return null;const ge=R(),Y=L(ge);return l("div",{class:H},[(Y||E||J)&&l("div",{class:`${H}-left`},[Y,E?l(Ye,E,null):(V=r.avatar)===null||V===void 0?void 0:V.call(r),T&&l("span",{class:`${H}-title`,title:typeof T=="string"?T:void 0},[T]),B&&l("span",{class:`${H}-sub-title`,title:typeof B=="string"?B:void 0},[B]),G&&l("span",{class:`${H}-tags`},[G])]),X&&l("span",{class:`${H}-extra`},[l(we,null,{default:()=>[X]})])])},f=()=>{var a,n;const s=(a=e.footer)!==null&&a!==void 0?a:_e((n=r.footer)===null||n===void 0?void 0:n.call(r));return Re(s)?null:l("div",{class:`${i.value}-footer`},[s])},b=a=>l("div",{class:`${i.value}-content`},[a]);return()=>{var a,n;const s=((a=e.breadcrumb)===null||a===void 0?void 0:a.routes)||r.breadcrumb,h=e.footer||r.footer,$=Te((n=r.default)===null||n===void 0?void 0:n.call(r)),P=Be(i.value,{"has-breadcrumb":s,"has-footer":h,[`${i.value}-ghost`]:D.value,[`${i.value}-rtl`]:u.value==="rtl",[`${i.value}-compact`]:_.value},m.class,y.value);return v(l(Fe,{onResize:A},{default:()=>[l("div",te(te({},m),{},{class:P}),[j(),N(),$.length?b($):null,f()])]}))}}}),nt=He(at),rt=U({name:"PageFooter",inheritAttrs:!1,setup(){const{prefixCls:e}=se("page-footer"),{getCalcContentWidth:t}=Ie();return{prefixCls:e,getCalcContentWidth:t}}});function ot(e,t,o,r,m,i){return F(),K("div",{class:w(e.prefixCls),style:de({width:e.getCalcContentWidth})},[Q("div",{class:w(`${e.prefixCls}__left`)},[p(e.$slots,"left",{},void 0,!0)],2),p(e.$slots,"default",{},void 0,!0),Q("div",{class:w(`${e.prefixCls}__right`)},[p(e.$slots,"right",{},void 0,!0)],2)],6)}const ce=le(rt,[["render",ot],["__scopeId","data-v-fe353944"]]),st=U({name:"PageWrapper",components:{PageFooter:ce,PageHeader:nt},inheritAttrs:!1,props:{title:c.string,dense:c.bool,ghost:c.bool,content:c.string,contentStyle:{type:Object},contentBackground:c.bool,contentFullHeight:c.bool,contentClass:c.string,fixedHeight:c.bool,upwardSpace:c.oneOfType([c.number,c.string]).def(0)},setup(e,{slots:t,attrs:o}){const r=I(null),m=I(null),i=I(null),u=I(null),{prefixCls:d}=se("page-wrapper");De(Ke,g(()=>e.fixedHeight));const v=g(()=>e.contentFullHeight),y=g(()=>e.upwardSpace),{redoHeight:_,setCompensation:x,contentHeight:A}=Xe(v,r,[m,u],[i],y);x({useLayoutFooter:!0,elements:[u]});const D=g(()=>{var f;return[d,{[`${d}--dense`]:e.dense},(f=o.class)!=null?f:{}]}),R=g(()=>(t==null?void 0:t.leftFooter)||(t==null?void 0:t.rightFooter)),L=g(()=>Object.keys(ae(t,"default","leftFooter","rightFooter","headerContent"))),j=g(()=>{const{contentFullHeight:f,contentStyle:b,fixedHeight:a}=e;if(!f)return z({},b);const n=`${Ae(A)}px`;return z(k(z({},b),{minHeight:n}),a?{height:n}:{})}),N=g(()=>{const{contentBackground:f,contentClass:b}=e;return[`${d}-content`,b,{[`${d}-content-bg`]:f}]});return xe(()=>[R.value],()=>{_()},{flush:"post",immediate:!0}),{getContentStyle:j,wrapperRef:r,headerRef:m,contentRef:i,footerRef:u,getClass:D,getHeaderSlots:L,prefixCls:d,getShowFooter:R,omit:ae,getContentClass:N}}});function lt(e,t,o,r,m,i){const u=oe("PageHeader"),d=oe("PageFooter");return F(),K("div",{class:w(e.getClass),ref:"wrapperRef"},[e.content||e.$slots.headerContent||e.title||e.getHeaderSlots.length?(F(),ne(u,Ge({key:0,ghost:e.ghost,title:e.title},e.omit(e.$attrs,"class"),{ref:"headerRef"}),Le({default:M(()=>[e.content?(F(),K(Oe,{key:0},[Ve(Ee(e.content),1)],64)):p(e.$slots,"headerContent",{key:1})]),_:2},[je(e.getHeaderSlots,v=>({name:v,fn:M(y=>[p(e.$slots,v,Ne(We(y||{})))])}))]),1040,["ghost","title"])):re("",!0),Q("div",{class:w(["overflow-hidden",e.getContentClass]),style:de(e.getContentStyle),ref:"contentRef"},[p(e.$slots,"default")],6),e.getShowFooter?(F(),ne(d,{key:1,ref:"footerRef"},{left:M(()=>[p(e.$slots,"leftFooter")]),right:M(()=>[p(e.$slots,"rightFooter")]),_:3},512)):re("",!0)],2)}const it=le(st,[["render",lt]]);ie(ce);const St=ie(it);export{St as P};
|