2 lines
8.8 KiB
Java
2 lines
8.8 KiB
Java
|
|
var le=Object.defineProperty,oe=Object.defineProperties;var ie=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var Q=(e,n,i)=>n in e?le(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,S=(e,n)=>{for(var i in n||(n={}))se.call(n,i)&&Q(e,i,n[i]);if(U)for(var i of U(n))re.call(n,i)&&Q(e,i,n[i]);return e},V=(e,n)=>oe(e,ie(n));var z=(e,n,i)=>new Promise((g,a)=>{var h=r=>{try{f(i.next(r))}catch(u){a(u)}},c=r=>{try{f(i.throw(r))}catch(u){a(u)}},f=r=>r.done?g(r.value):Promise.resolve(r.value).then(h,c);f((i=i.apply(e,n)).next())});import{d as x,w as E,h as I,f as H,o as ue,b as ce,n as y,u as l,e as F,ah as b,v as de,aC as ee,as as G,aF as m,q as fe,ar as ge,aB as me,aH as N,g as he,z as pe,aG as L,aE as X,k as M,aD as Y,aJ as Z,aK as _}from"./vue-vendor-C7Zq48Yl.js";import{b as He,M as ve,a as be,c as Ce,d as Se}from"./ModalHeader-keHdAHWH.js";import{useWindowSizeFn as Me}from"./useWindowSizeFn-PRZSD86C.js";import{S as Fe}from"./index-pxs5MULf.js";import{D as ye,E as Pe,aV as $e,d as te,n as ke,av as we,aA as Re,F as Be}from"./index-BI6CMai0.js";import{o as q}from"./antd-vue-vendor-BPnV8VqP.js";const ne=Symbol();function Ne(e){return ye(e,ne)}function Qe(){return Pe(ne)}const Ee={loading:{type:Boolean},useWrapper:{type:Boolean,default:!0},modalHeaderHeight:{type:Number,default:57},modalFooterHeight:{type:Number,default:74},minHeight:{type:Number,default:null},maxHeight:{type:Number,default:null},height:{type:Number},footerOffset:{type:Number,default:0},visible:{type:Boolean},fullScreen:{type:Boolean},loadingTip:{type:String}},We=x({name:"ModalWrapper",components:{ScrollContainer:Fe},inheritAttrs:!1,props:Ee,emits:["height-change","ext-height"],setup(e,{emit:n}){const i=H(null),g=H(null),a=H(0),h=H(0);let c=0,f=()=>{};Me(d.bind(null,!1));let r,u={};E(()=>e.visible,()=>{e.visible&&!r&&!(e.maxHeight||e.height)?(u={},r=$e(g,()=>{d({source:"muob",callBack:o=>{const s=u[o];s?(u[o]=++u[o],s>10&&(r.stop(),u={},r=null)):(u={},u[o]=1)}})},{attributes:!0,subtree:!0})):r&&(r.stop(),r=null)},{immediate:!0}),Ne({redoModalHeight:d});const v=F(()=>{if(e.fullScreen)return{height:`${l(a)}px`};if(e.height!=null){let s=e.height;return e.minHeight===null?{height:`${s}px`}:{height:`${e.minHeight>s?e.minHeight:s}px`}}else return{minHeight:`${e.minHeight===null?200:e.minHeight}px`,maxHeight:`${e.maxHeight?e.maxHeight:l(a)}px`}});I(()=>{e.useWrapper&&d()}),E(()=>e.fullScreen,o=>{d(),o?h.value=a.value:a.value=h.value}),ue(()=>{const{modalHeaderHeight:o,modalFooterHeight:s}=e;n("ext-height",o+s)}),ce(()=>{f&&f()});function C(){return z(this,null,function*(){y(()=>{var s;const o=l(i);o&&((s=o==null?void 0:o.scrollTo)==null||s.call(o,0))})})}function d(o){return z(this,null,function*(){var O,T;const s=o||{},W=s.source,p=s.callBack;if(!e.visible)return;const P=l(i);if(!P)return;const $=(T=(O=P.$el.parentElement)==null?void 0:O.parentElement)==null?void 0:T.parentElement;if($){yield y();try{const k=$.parentElement&&$.parentElement.parentElement;if(!k)return;const A=getComputedStyle(k).top,D=Number.parseInt(A);let w=window.innerHeight-D*2+(e.footerOffset||0)-e.modalFooterHeight-e.modalHeaderHeight;D<40&&(w-=26),yield y();const j=l(g);if(!j)return;yield y(),c=j.scrollHeight,e.fullScreen?a.value=window.innerHeight-e.modalFooterHeight-e.modalHeaderHeight-28:a.value=e.height?e.height:c>w?w:c,W=="muob"&&p(a.value),n("height-change",l(a))}catch(k){}}})}return{wrapperRef:i,spinRef:g,spinStyle:v,scrollTop:C,setModalHeight:d}}}),Oe=["loading-tip"];function Te(e,n,i,g,a,h){const c=b("ScrollContainer"),f=de("loading");return G(),ee(c,{ref:"wrapperRef"},{default:m(()=>[fe((G(),ge("div",{ref:"spinRef",style:me(e.spinStyle),"loading-tip":e.loadingTip},[N(e.$slots,"default")],12,Oe)),[[f,e.loading]])]),_:3},512)}const De=te(We,[["render",Te]]);function je(e){const n=H(!1),i=F(()=>{const a=l(e.wrapClassName)||"";return l(n)?`fullscreen-modal ${a} `:l(a)});function g(a){a&&a.stopPropagation(),n.value=!l(n)}return{getWrapClassName:i,handleFullScreen:g,fullScreenR
|