/
home
/
maktab
/
pwa
/
assets
/
File Upload :
llllll
Current File: /home/maktab/pwa/assets/index-CycbWN32.js
import{X as E,Y as q,l as z,r as k,d as T,e as d,ad as D,p as L,a0 as _,C as W,m as X,Z as J,$ as Q,ae as ee,F as oe,B as te,E as ne}from"./index-CGBJY8Ax.js";import{H as ae,g as se,t as y,h as R,n as C,q as le,I as ce,p as N,c as $,x as K,e as H,A as re,B as j,w as F,m as g}from"./with-install-DZ6aHOzn.js";import{a as ie,u as ue,P as de}from"./use-touch-C-8vv2Zp.js";import{u as fe,H as ve,I as ye}from"./index-0qljv4Yq.js";function me(e,{args:o=[],done:t,canceled:s}){if(e){const a=e.apply(null,o);ae(a)?a.then(l=>{l?t():s&&s()}).catch(se):a?t():s&&s()}else t()}const M={show:Boolean,zIndex:C,overlay:y,duration:C,teleport:[String,Object],lockScroll:y,lazyRender:y,beforeClose:Function,overlayStyle:Object,overlayClass:R,transitionAppear:Boolean,closeOnClickOverlay:y},Be=Object.keys(M);let h=0;const B="van-overflow-hidden";function he(e,o){const t=ie(),s="01",a="10",l=i=>{t.move(i);const f=t.deltaY.value>0?a:s,S=ce(i.target,e.value),{scrollHeight:m,offsetHeight:O,scrollTop:P}=S;let v="11";P===0?v=O>=m?"00":"01":P+O>=m&&(v="10"),v!=="11"&&t.isVertical()&&!(parseInt(v,2)&parseInt(f,2))&&N(i,!0)},c=()=>{document.addEventListener("touchstart",t.start),document.addEventListener("touchmove",l,{passive:!1}),h||document.body.classList.add(B),h++},r=()=>{h&&(document.removeEventListener("touchstart",t.start),document.removeEventListener("touchmove",l),h--,h||document.body.classList.remove(B))},x=()=>o()&&c(),I=()=>o()&&r();le(x),E(I),q(I),z(o,i=>{i?c():r()})}function Y(e){const o=k(!1);return z(e,t=>{t&&(o.value=t)},{immediate:!0}),t=>()=>o.value?t():null}const[Ie,Oe]=$("overlay"),Pe={show:Boolean,zIndex:C,duration:C,className:R,lockScroll:y,lazyRender:y,customStyle:Object};var we=T({name:Ie,props:Pe,setup(e,{slots:o}){const t=k(),s=Y(()=>e.show||!e.lazyRender),a=c=>{e.lockScroll&&N(c,!0)},l=s(()=>{var c;const r=H(re(e.zIndex),e.customStyle);return j(e.duration)&&(r.animationDuration=`${e.duration}s`),L(d("div",{ref:t,style:r,class:[Oe(),e.className]},[(c=o.default)==null?void 0:c.call(o)]),[[_,e.show]])});return K("touchmove",a,{target:t}),()=>d(D,{name:"van-fade",appear:!0},{default:l})}});const ke=F(we),Ce=H({},M,{round:Boolean,position:g("center"),closeIcon:g("cross"),closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,closeIconPosition:g("top-right"),safeAreaInsetTop:Boolean,safeAreaInsetBottom:Boolean}),[xe,p]=$("popup");var Se=T({name:xe,inheritAttrs:!1,props:Ce,emits:["open","close","opened","closed","keydown","update:show","click-overlay","click-close-icon"],setup(e,{emit:o,attrs:t,slots:s}){let a,l;const c=k(),r=k(),x=Y(()=>e.show||!e.lazyRender),I=W(()=>{const n={zIndex:c.value};if(j(e.duration)){const u=e.position==="center"?"animationDuration":"transitionDuration";n[u]=`${e.duration}s`}return n}),i=()=>{a||(a=!0,c.value=e.zIndex!==void 0?+e.zIndex:fe(),o("open"))},f=()=>{a&&me(e.beforeClose,{done(){a=!1,o("close"),o("update:show",!1)}})},S=n=>{o("click-overlay",n),e.closeOnClickOverlay&&f()},m=()=>{if(e.overlay)return d(ke,{show:e.show,class:e.overlayClass,zIndex:c.value,duration:e.duration,customStyle:e.overlayStyle,role:e.closeOnClickOverlay?"button":void 0,tabindex:e.closeOnClickOverlay?0:void 0,onClick:S},{default:s["overlay-content"]})},O=n=>{o("click-close-icon",n),f()},P=()=>{if(e.closeable)return d(ye,{role:"button",tabindex:0,name:e.closeIcon,class:[p("close-icon",e.closeIconPosition),ve],classPrefix:e.iconPrefix,onClick:O},null)},v=()=>o("opened"),G=()=>o("closed"),U=n=>o("keydown",n),V=x(()=>{var n;const{round:u,position:w,safeAreaInsetTop:b,safeAreaInsetBottom:Z}=e;return L(d("div",ne({ref:r,style:I.value,role:"dialog",tabindex:0,class:[p({round:u,[w]:w}),{"van-safe-area-top":b,"van-safe-area-bottom":Z}],onKeydown:U},t),[(n=s.default)==null?void 0:n.call(s),P()]),[[_,e.show]])}),A=()=>{const{position:n,transition:u,transitionAppear:w}=e,b=n==="center"?"van-fade":`van-popup-slide-${n}`;return d(D,{name:u||b,appear:w,onAfterEnter:v,onAfterLeave:G},{default:V})};return z(()=>e.show,n=>{n&&!a&&(i(),t.tabindex===0&&te(()=>{var u;(u=r.value)==null||u.focus()})),!n&&a&&(a=!1,o("close"))}),ue({popupRef:r}),he(r,()=>e.show&&e.lockScroll),K("popstate",()=>{e.closeOnPopstate&&(f(),l=!1)}),X(()=>{e.show&&i()}),J(()=>{l&&(o("update:show",!0),l=!1)}),E(()=>{e.show&&e.teleport&&(f(),l=!0)}),Q(de,()=>e.show),()=>e.teleport?d(ee,{to:e.teleport},{default:()=>[m(),A()]}):d(oe,null,[m(),A()])}});const pe=F(Se);export{pe as P,M as a,me as c,Be as p};
Copyright ©2k19 -
Hexid
|
Tex7ure