index.334036fa.js 9.4 KB

1
  1. var me=Object.defineProperty,be=Object.defineProperties;var $e=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var te=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&te(e,r,t[r]);if(ee)for(var r of ee(t))_e.call(t,r)&&te(e,r,t[r]);return e},ae=(e,t)=>be(e,$e(t));var ne=(e,t,r)=>new Promise((h,n)=>{var $=v=>{try{g(r.next(v))}catch(H){n(H)}},d=v=>{try{g(r.throw(v))}catch(H){n(H)}},g=v=>v.done?h(v.value):Promise.resolve(v.value).then($,d);g((r=r.apply(e,t)).next())});import{n as p,aS as ye,au as Ce,a as X,J as Pe,s as A,cu as Fe,f as P,Q as ke,S as we,T as J,cj as Be,G as S,aj as Re,cv as Se,cw as Te,b as ce,b3 as Ae,aw as ue,o as N,h as Q,m as U,bh as T,q as z,bk as de,N as Oe,al as L,cx as Ie,a7 as fe,i as w,cy as je,cz as xe,av as Ee,cA as Ne,aW as y,a4 as ze,ap as re,w as oe,j as ie,bS as We,b2 as De,z as D,b1 as Le,bq as Me,F as Ve,B as qe,t as Ge,b0 as Je,k as le,ay as ge}from"./index.7e08ba81.js";import{B as Qe}from"./index.ea1692d3.js";import{A as Ue}from"./index.3132743a.js";import{u as Xe}from"./useWindowSizeFn.9cd1b73f.js";import{a as Ze}from"./useContentViewHeight.eee5bfce.js";import{A as Ye}from"./ArrowLeftOutlined.8453d1a8.js";import"./index.492f2ae6.js";import{T as Ke}from"./transButton.38e068f8.js";var et={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"},tt=et;function se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},h=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(h=h.concat(Object.getOwnPropertySymbols(r).filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable}))),h.forEach(function(n){at(e,n,r[n])})}return e}function at(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Z=function(t,r){var h=se({},t,r.attrs);return p(ye,se({},h,{icon:tt}),null)};Z.displayName="ArrowRightOutlined";Z.inheritAttrs=!1;var nt=Z,rt=function(){return{backIcon:S.any,prefixCls:String,title:S.any,subTitle:S.any,breadcrumb:S.object,tags:S.any,footer:S.any,extra:S.any,avatar:S.object,ghost:{type:Boolean,default:void 0},onBack:Function}},ot=X({compatConfig:{MODE:3},name:"APageHeader",props:rt(),slots:["backIcon","avatar","breadcrumb","title","subTitle","tags","extra","footer"],setup:function(t,r){var h=r.emit,n=r.slots,$=Pe("page-header",t),d=$.prefixCls,g=$.direction,v=$.pageHeader,H=A(!1),j=Fe(),F=function(a){var o=a.width;j.value||(H.value=o<768)},B=P(function(){var l,a,o;return(l=(a=t.ghost)!==null&&a!==void 0?a:(o=v.value)===null||o===void 0?void 0:o.ghost)!==null&&l!==void 0?l:!0}),R=function(){var a,o,u;return(a=(o=t.backIcon)!==null&&o!==void 0?o:(u=n.backIcon)===null||u===void 0?void 0:u.call(n))!==null&&a!==void 0?a:g.value==="rtl"?p(nt,null,null):p(Ye,null,null)},f=function(a){return!a||!t.onBack?null:p(Te,{componentName:"PageHeader",children:function(u){var i=u.back;return p("div",{class:"".concat(d.value,"-back")},[p(Ke,{onClick:function(c){h("back",c)},class:"".concat(d.value,"-back-button"),"aria-label":i},{default:function(){return[a]}})])}},null)},k=function(){var a;return t.breadcrumb?p(Qe,t.breadcrumb,null):(a=n.breadcrumb)===null||a===void 0?void 0:a.call(n)},_=function(){var a,o,u,i,s,c,C,O,M,V=t.avatar,x=(a=t.title)!==null&&a!==void 0?a:(o=n.title)===null||o===void 0?void 0:o.call(n),E=(u=t.subTitle)!==null&&u!==void 0?u:(i=n.subTitle)===null||i===void 0?void 0:i.call(n),q=(s=t.tags)!==null&&s!==void 0?s:(c=n.tags)===null||c===void 0?void 0:c.call(n),G=(C=t.extra)!==null&&C!==void 0?C:(O=n.extra)===null||O===void 0?void 0:O.call(n),I="".concat(d.value,"-heading"),Y=x||E||q||G;if(!Y)return null;var pe=R(),K=f(pe),he=K||V||Y;return p("div",{class:I},[he&&p("div",{class:"".concat(I,"-left")},[K,V?p(Ue,V,null):(M=n.avatar)===null||M===void 0?void 0:M.call(n),x&&p("span",{class:"".concat(I,"-title"),title:typeof x=="string"?x:void 0},[x]),E&&p("span",{class:"".concat(I,"-sub-title"),title:typeof E=="string"?E:void 0},[E]),q&&p("span",{class:"".concat(I,"-tags")},[q])]),G&&p("span",{class:"".concat(I,"-extra")},[G])])},m=function(){var a,o,u=(a=t.footer)!==null&&a!==void 0?a:Re((o=n.footer)===null||o===void 0?void 0:o.call(n));return Se(u)?null:p("div",{class:"".concat(d.value,"-footer")},[u])},b=function(a){return p("div",{class:"".concat(d.value,"-content")},[a])};return function(){var l,a,o,u=((l=t.breadcrumb)===null||l===void 0?void 0:l.routes)||n.breadcrumb,i=t.footer||n.footer,s=ke((a=n.default)===null||a===void 0?void 0:a.call(n)),c=we(d.value,(o={"has-breadcrumb":u,"has-footer":i},J(o,"".concat(d.value,"-ghost"),B.value),J(o,"".concat(d.value,"-rtl"),g.value==="rtl"),J(o,"".concat(d.value,"-compact"),H.value),o));return p(Be,{onResize:F},{default:function(){return[p("div",{class:c},[k(),_(),s.length?b(s):null,m()])]}})}}}),it=Ce(ot);const lt=X({name:"PageFooter",inheritAttrs:!1,setup(){const{prefixCls:e}=ce("page-footer"),{getCalcContentWidth:t}=Ae();return{prefixCls:e,getCalcContentWidth:t}}});function st(e,t,r,h,n,$){return N(),Q("div",{class:z(e.prefixCls),style:de({width:e.getCalcContentWidth})},[U("div",{class:z(`${e.prefixCls}__left`)},[T(e.$slots,"left",{},void 0,!0)],2),T(e.$slots,"default",{},void 0,!0),U("div",{class:z(`${e.prefixCls}__right`)},[T(e.$slots,"right",{},void 0,!0)],2)],6)}var ve=ue(lt,[["render",st],["__scopeId","data-v-7984b8f2"]]);function ct(e){let t;Oe(()=>{e(),L(()=>{t=!0})}),Ie(()=>{t&&e()})}function ut(e,t,r,h,n=0,$=A(0)){const d=A(null),{footerHeightRef:g}=Ze();let v={useLayoutFooter:!0};const H=f=>{v=f};function j(){L(()=>{R()})}function F(f,k="all"){var l,a,o,u;function _(i){return Number(i.replace(/[^\d]/g,""))}let m=0;const b="0px";if(f){const i=getComputedStyle(f),s=_((l=i==null?void 0:i.marginTop)!=null?l:b),c=_((a=i==null?void 0:i.marginBottom)!=null?a:b),C=_((o=i==null?void 0:i.paddingTop)!=null?o:b),O=_((u=i==null?void 0:i.paddingBottom)!=null?u:b);k==="all"?(m+=s,m+=c,m+=C,m+=O):k==="top"?(m+=s,m+=C):(m+=c,m+=O)}return m}function B(f){return f==null?null:f instanceof HTMLDivElement?f:f.$el}function R(){return ne(this,null,function*(){var u;if(!e.value)return;yield L();const f=B(w(t));if(!f)return;const{bottomIncludeBody:k}=je(f);let _=0;r.forEach(i=>{var s,c;_+=(c=(s=B(w(i)))==null?void 0:s.offsetHeight)!=null?c:0});let m=(u=F(f))!=null?u:0;h.forEach(i=>{m+=F(B(w(i)))});let b=0;function l(i,s){if(i&&s){const c=i.parentElement;c&&(Ee(s)?c.classList.contains(s)?b+=F(c,"bottom"):(b+=F(c,"bottom"),l(c,s)):Ne(s)&&s>0&&(b+=F(c,"bottom"),l(c,--s)))}}xe(n)?l(f,w(n)):l(f,n);let a=k-w(g)-w($)-_-m-b;const o=()=>{var i;(i=v.elements)==null||i.forEach(s=>{var c,C;a+=(C=(c=B(w(s)))==null?void 0:c.offsetHeight)!=null?C:0})};v.useLayoutFooter&&w(g)>0,o(),d.value=a})}return ct(()=>{L(()=>{R()})}),Xe(()=>{R()},50,{immediate:!0}),fe(()=>[g.value],()=>{R()},{flush:"post",immediate:!0}),{redoHeight:j,setCompensation:H,contentHeight:d}}const dt=X({name:"PageWrapper",components:{PageFooter:ve,PageHeader:it},inheritAttrs:!1,props:{title:y.string,dense:y.bool,ghost:y.bool,content:y.string,contentStyle:{type:Object},contentBackground:y.bool,contentFullHeight:y.bool,contentClass:y.string,fixedHeight:y.bool,upwardSpace:y.oneOfType([y.number,y.string]).def(0)},setup(e,{slots:t,attrs:r}){const h=A(null),n=A(null),$=A(null),d=A(null),{prefixCls:g}=ce("page-wrapper");ze(vt,P(()=>e.fixedHeight));const v=P(()=>e.contentFullHeight),H=P(()=>e.upwardSpace),{redoHeight:j,setCompensation:F,contentHeight:B}=ut(v,h,[n,d],[$],H);F({useLayoutFooter:!0,elements:[d]});const R=P(()=>{var l;return[g,{[`${g}--dense`]:e.dense},(l=r.class)!=null?l:{}]}),f=P(()=>e.content||(t==null?void 0:t.headerContent)||e.title||_.value.length),k=P(()=>(t==null?void 0:t.leftFooter)||(t==null?void 0:t.rightFooter)),_=P(()=>Object.keys(re(t,"default","leftFooter","rightFooter","headerContent"))),m=P(()=>{const{contentFullHeight:l,contentStyle:a,fixedHeight:o}=e;if(!l)return W({},a);const u=`${w(B)}px`;return W(ae(W({},a),{minHeight:u}),o?{height:u}:{})}),b=P(()=>{const{contentBackground:l,contentClass:a}=e;return[`${g}-content`,a,{[`${g}-content-bg`]:l}]});return fe(()=>[k.value],()=>{j()},{flush:"post",immediate:!0}),{getContentStyle:m,wrapperRef:h,headerRef:n,contentRef:$,footerRef:d,getClass:R,getHeaderSlots:_,prefixCls:g,getShowHeader:f,getShowFooter:k,omit:re,getContentClass:b}}});function ft(e,t,r,h,n,$){const d=oe("PageHeader"),g=oe("PageFooter");return N(),Q("div",{class:z(e.getClass),ref:"wrapperRef"},[e.getShowHeader?(N(),ie(d,Je({key:0,ghost:e.ghost,title:e.title},e.omit(e.$attrs,"class"),{ref:"headerRef"}),We({default:D(()=>[e.content?(N(),Q(Ve,{key:0},[qe(Ge(e.content),1)],64)):T(e.$slots,"headerContent",{key:1})]),_:2},[De(e.getHeaderSlots,v=>({name:v,fn:D(H=>[T(e.$slots,v,Le(Me(H||{})))])}))]),1040,["ghost","title"])):le("",!0),U("div",{class:z(["overflow-hidden",e.getContentClass]),style:de(e.getContentStyle),ref:"contentRef"},[T(e.$slots,"default")],6),e.getShowFooter?(N(),ie(g,{key:1,ref:"footerRef"},{left:D(()=>[T(e.$slots,"leftFooter")]),right:D(()=>[T(e.$slots,"rightFooter")]),_:3},512)):le("",!0)],2)}var gt=ue(dt,[["render",ft]]);ge(ve);const Pt=ge(gt),vt="PageWrapperFixedHeight";export{Pt as P,vt as a,ct as o};