u
This commit is contained in:
1 parent
bcc4722efc
commit
f48536774f
403 files changed
+34776
No files matched your search
@@ -0,0 +1 @@
|
||||
import{_ as ge,d as te,e as x,h as T,o as u,A as f,aS as we,at as z,C as O,c as v,m as Q,q as i,as as ne,n as P,au as X,f as C,a as ke,u as N,D as I,G as F,aI as Oe,aJ as Pe,a8 as be,aY as Ve,t as Be,g as $e,af as Se,i as V,b as R,aZ as Te,aP as Ie,H as Ce,p as Ee,Z as Fe,k as se,V as De,ag as D,ah as re,ai as ie,W as Ae,y as Ue,z as Le,a_ as xe,a$ as j,ap as Ne,b0 as ue,a4 as Re,B as _e,K as je,S as ze,b1 as Ke,F as de,Q as fe,R as Me,r as qe,O as S}from"./index-C4UKuwCQ.js";import{a as Ge,F as We}from"./index-TIPHP1f2.js";import"./index-BAOCFoRq.js";import"./index-h336NyeA.js";import"./index-CxeVpmmJ.js";import{S as He,O as Ye}from"./index-BsQR6Pa8.js";import{u as Ze,a as Je,_ as Qe}from"./index-GMqurEao.js";import{C as Xe}from"./index-wLs9s41q.js";import{T as eo}from"./index-DxZcXRfJ.js";import{_ as oo}from"./index-x1lD9bO6.js";import{S as to}from"./index-DVb3VLcj.js";import{d as ao,e as lo,u as no}from"./index-DMocdcUs.js";import{F as so,a as ro}from"./index-BFy-ZR_w.js";import{u as io}from"./index-QwxSwrho.js";import{K as uo}from"./keyboard-b0R5wflF.js";import"./index-ETHic_Vr.js";import"./index-B3Ic4ZHL.js";import"./resize-observer-DsiuURlg.js";import"./index-BMrux7Sq.js";import"./index-Y5pyQQ_e.js";/* empty css */import"./index.es-BW_FzNZC.js";import"./index-Dv5Lj9Gr.js";var fo=Object.defineProperty,me=Object.getOwnPropertySymbols,mo=Object.prototype.hasOwnProperty,co=Object.prototype.propertyIsEnumerable,ce=(e,o,a)=>o in e?fo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,po=(e,o)=>{for(var a in o||(o={}))mo.call(o,a)&&ce(e,a,o[a]);if(me)for(var a of me(o))co.call(o,a)&&ce(e,a,o[a]);return e};const vo=["top","right","bottom","left"],yo=te({name:"Drawer",components:{ClientOnly:Ve,ArcoButton:be,IconHover:Pe,IconClose:Oe},inheritAttrs:!1,props:{visible:{type:Boolean,default:!1},defaultVisible:{type:Boolean,default:!1},placement:{type:String,default:"right",validator:e=>vo.includes(e)},title:String,mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:String,cancelText:String,okLoading:{type:Boolean,default:!1},okButtonProps:{type:Object},cancelButtonProps:{type:Object},unmountOnClose:Boolean,width:{type:[Number,String],default:250},height:{type:[Number,String],default:250},popupContainer:{type:[String,Object],default:"body"},drawerStyle:{type:Object},onBeforeOk:{type:Function},onBeforeCancel:{type:Function},escToClose:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!0},hideCancel:{type:Boolean,default:!1}},emits:{"update:visible":e=>!0,ok:e=>!0,cancel:e=>!0,open:()=>!0,close:()=>!0,beforeOpen:()=>!0,beforeClose:()=>!0},setup(e,{emit:o}){const{popupContainer:a}=Be(e),c=$e("drawer"),{t:y}=Se(),l=V(e.defaultVisible),s=R(()=>{var d;return(d=e.visible)!=null?d:l.value}),t=V(!1),B=R(()=>e.okLoading||t.value),{teleportContainer:m,containerRef:b}=Te({popupContainer:a,visible:s}),_=V(s.value);let h=!1;const p=d=>{e.escToClose&&d.key===uo.ESC&&q()&&E(d)},n=()=>{e.escToClose&&!h&&(h=!0,De(document.documentElement,"keydown",p))},A=()=>{h&&(h=!1,Ae(document.documentElement,"keydown",p))},{zIndex:M,isLastDialog:q}=Ie("dialog",{visible:s}),G=R(()=>(b==null?void 0:b.value)===document.body);let $=0;const g=()=>{$++,t.value&&(t.value=!1),l.value=!1,o("update:visible",!1)},W=async d=>{const w=$,L=await new Promise(async J=>{var ae;if(D(e.onBeforeOk)){let k=e.onBeforeOk((le=!0)=>J(le));if((re(k)||!ie(k))&&(t.value=!0),re(k))try{k=(ae=await k)!=null?ae:!0}catch{k=!1}ie(k)&&J(k)}else J(!0)});w===$&&(L?(o("ok",d),g()):t.value&&(t.value=!1))},E=d=>{var w;let L=!0;D(e.onBeforeCancel)&&(L=(w=e.onBeforeCancel())!=null?w:!1),L&&(o("cancel",d),g())},H=d=>{e.maskClosable&&E(d)},Y=()=>{s.value&&o("open")},Z=()=>{s.value||(_.value=!1,r(),o("close"))},{setOverflowHidden:U,resetOverflow:r}=io(b);Ce(()=>{s.value&&(_.value=!0,U(),n())}),Ee(()=>{r(),A()}),Fe(s,d=>{l.value!==d&&(l.value=d),d?(o("beforeOpen"),_.value=!0,U(),n()):(o("beforeClose"),A())});const he=R(()=>{var d;const w=po({[e.placement]:0},(d=e.drawerStyle)!=null?d:{});return["right","left"].includes(e.placement)?w.width=se(e.width)?`${e.width}px`:e.width:w.height=se(e.height)?`${e.height}px`:e.height,w});return{prefixCls:c,style:he,t:y,mounted:_,computedVisible:s,mergedOkLoading:B,zIndex:M,handleOk:W,handleCancel:E,handleOpen:Y,handleClose:Z,handleMask:H,isFixed:G,teleportContainer:m}}});function bo(e,o,a,c,y,l){const s=x("icon-close"),t=x("icon-hover"),B=x("arco-button"),m=x("client-only");return u(),T(m,null,{default:f(()=>[(u(),T(we,{to:e.teleportContainer,disabled:!e.renderToBody},[!e.unmountOnClose||e.computedVisible||e.mounted?z((u(),v("div",Q({key:0,class:`${e.prefixCls}-container`,style:e.isFixed?{zIndex:e.zIndex}:{zIndex:"inherit",position:"absolute"}},e.$attrs),[i(ne,{name:"fade-drawer",appear:""},{default:f(()=>[e.mask?z((u(),v("div",{key:0,class:P(`${e.prefixCls}-mask`),onClick:o[0]||(o[0]=(...b)=>eLine truncated
|
||||
Reference in new issue
Block a user