2 lines
8.8 KiB
Java
2 lines
8.8 KiB
Java
|
|
var oe=Object.defineProperty,ae=Object.defineProperties;var ie=Object.getOwnPropertyDescriptors;var X=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var q=(e,n,i)=>n in e?oe(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,C=(e,n)=>{for(var i in n||(n={}))se.call(n,i)&&q(e,i,n[i]);if(X)for(var i of X(n))re.call(n,i)&&q(e,i,n[i]);return e},D=(e,n)=>ae(e,ie(n));var I=(e,n,i)=>new Promise((g,l)=>{var p=r=>{try{u(i.next(r))}catch(d){l(d)}},c=r=>{try{u(i.throw(r))}catch(d){l(d)}},u=r=>r.done?g(r.value):Promise.resolve(r.value).then(p,c);u((i=i.apply(e,n)).next())});import{b as ue,M as ce,c as de,d as fe,e as ge}from"./ModalHeader-Sr8KwhJJ.js";import{useWindowSizeFn as me}from"./useWindowSizeFn-C-0M9_Ul.js";import{S as he}from"./index-ByCwbQDV.js";import{G as pe,H as He,gB as ve,au as _,bo as be,b2 as z,c as Ce,gC as Me}from"./index-X7Y8jykP.js";import{e as x,h as N,w as A,o as Se,d as Fe,u as o,n as P,r as H,c as S,y as ee,z as G,A as h,O as ye,X as Pe,C as $e,L as B,T as ke,K as y,ag as we,g as Re,I as J,D as Q,B as L,f as M,M as Y,N as Z}from"./vue-vendor-DNhG1Cve.js";import{useAppInject as Be}from"./useAppInject-DPZGPcR3.js";import{O as Ne}from"./index-CuWaQdlK.js";import{A as Oe}from"./index-DO7ZhK45.js";const te=Symbol();function We(e){return pe(e,te)}function _e(){return He(te)}const Te={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}},Ee=x({name:"ModalWrapper",components:{ScrollContainer:he},inheritAttrs:!1,props:Te,emits:["height-change","ext-height"],setup(e,{emit:n}){const i=H(null),g=H(null),l=H(0),p=H(0);let c=0;me(f.bind(null,!1));let u,r={};N(()=>e.visible,()=>{e.visible&&!u&&!(e.maxHeight||e.height)?(r={},u=ve(g,()=>{f({source:"muob",callBack:a=>{const s=r[a];s?(r[a]=++r[a],s>10&&(u.stop(),r={},u=null)):(r={},r[a]=1)}})},{attributes:!0,subtree:!0})):u&&(u.stop(),u=null)},{immediate:!0}),We({redoModalHeight:f});const d=S(()=>{if(e.fullScreen)return{height:`${o(l)}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:o(l)}px`}});A(()=>{e.useWrapper&&f()}),N(()=>e.fullScreen,a=>{f(),a?p.value=l.value:l.value=p.value}),Se(()=>{const{modalHeaderHeight:a,modalFooterHeight:s}=e;n("ext-height",a+s)}),Fe(()=>{});function v(){return I(this,null,function*(){P(()=>{var s;const a=o(i);a&&((s=a==null?void 0:a.scrollTo)==null||s.call(a,0))})})}function f(a){return I(this,null,function*(){var W,T;const s=a||{},b=s.source,O=s.callBack;if(!e.visible)return;const m=o(i);if(!m)return;const F=(T=(W=m.$el.parentElement)==null?void 0:W.parentElement)==null?void 0:T.parentElement;if(F){yield P();try{const $=F.parentElement&&F.parentElement.parentElement;if(!$)return;const V=getComputedStyle($).top,E=Number.parseInt(V);let k=window.innerHeight-E*2+(e.footerOffset||0)-e.modalFooterHeight-e.modalHeaderHeight;E<40&&(k-=26),yield P();const j=o(g);if(!j)return;yield P(),c=j.scrollHeight,e.fullScreen?l.value=window.innerHeight-e.modalFooterHeight-e.modalHeaderHeight-28:l.value=e.height?e.height:c>k?k:c,b=="muob"&&O(l.value),n("height-change",o(l))}catch($){}}})}return{wrapperRef:i,spinRef:g,spinStyle:d,scrollTop:v,setModalHeight:f}}}),je=["loading-tip"];function De(e,n,i,g,l,p){const c=y("ScrollContainer"),u=Pe("loading");return G(),ee(c,{ref:"wrapperRef"},{default:h(()=>[ye((G(),$e("div",{ref:"spinRef",style:ke(e.spinStyle),"loading-tip":e.loadingTip},[B(e.$slots,"default")],12,je)),[[u,e.loading]])]),_:3},512)}const Ie=_(Ee,[["render",De]]);function Ae(e){const n=H(!1),i=S(()=>{const l=o(e.wrapClassName)||"";return o(n)?`fullscreen-modal ${l} `:o(l)});function g(l){l&&l.stopPropagation(),n.valu
|