You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.5 KiB

var I=Object.defineProperty,J=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var S=(e,s,o)=>s in e?I(e,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[s]=o,m=(e,s)=>{for(var o in s||(s={}))Q.call(s,o)&&S(e,o,s[o]);if(P)for(var o of P(s))U.call(s,o)&&S(e,o,s[o]);return e},_=(e,s)=>J(e,K(s));var B=(e,s,o)=>new Promise((g,u)=>{var h=a=>{try{l(o.next(a))}catch(n){u(n)}},f=a=>{try{l(o.throw(a))}catch(n){u(n)}},l=a=>a.done?g(a.value):Promise.resolve(a.value).then(h,f);l((o=o.apply(e,s)).next())});import{d as Z,bQ as E,r as F,dk as G,m as X,D as Y,f as p,b1 as H,u as i,K as x,aZ as ee,O,e as te,J as oe,aj as se,aT as ae,aU as w,ds as re,o as T,a as V,bq as R,w as d,b as L,aV as D,s as ne,a9 as ie,aP as M,bt as le,aW as ce,bW as ue}from"./index-f4658ae7.js";import{D as pe}from"./index-eb3034da.js";import de from"./DrawerFooter-7408f1e2.js";import ge from"./DrawerHeader-981d4000.js";import{basicProps as fe}from"./props-34b32f69.js";import"./ArrowLeftOutlined-f214e093.js";const me=Z({components:{Drawer:pe,ScrollContainer:E,DrawerFooter:de,DrawerHeader:ge},inheritAttrs:!1,props:fe,emits:["visible-change","ok","close","register"],setup(e,{emit:s}){const o=F(!1),g=G(),u=F(null),{t:h}=te(),{prefixVar:f,prefixCls:l}=X("basic-drawer"),a={setDrawerProps:A,emitVisible:void 0},n=Y();n&&s("register",a,n.uid);const C=p(()=>H(x(e),i(u))),c=p(()=>{const t=_(m(m({placement:"right"},i(g)),i(C)),{visible:i(o)});t.title=void 0;const{isDetail:r,width:b,wrapClassName:k,getContainer:q}=t;if(r){b||(t.width="100%");const y=`${l}__detail`;t.class=k?`${k} ${y}`:y,q||(t.getContainer=`.${f}-layout-content`)}return t}),v=p(()=>m(m({},g),i(c))),$=p(()=>{const{footerHeight:t,showFooter:r}=i(c);return r&&t?ee(t)?`${t}px`:`${t.replace("px","")}px`:"0px"}),N=p(()=>({position:"relative",height:`calc(100% - ${i($)})`})),j=p(()=>{var t;return!!((t=i(c))!=null&&t.loading)});O(()=>e.visible,(t,r)=>{t!==r&&(o.value=t)},{deep:!0}),O(()=>o.value,t=>{oe(()=>{var r;s("visible-change",t),n&&((r=a.emitVisible)==null||r.call(a,t,n.uid))})});function z(t){return B(this,null,function*(){const{closeFunc:r}=i(c);if(s("close",t),r&&se(r)){const b=yield r();o.value=!b;return}o.value=!1})}function A(t){u.value=H(i(u)||{},t),Reflect.has(t,"visible")&&(o.value=!!t.visible)}function W(){s("ok")}return{onClose:z,t:h,prefixCls:l,getMergeProps:C,getScrollContentStyle:N,getProps:c,getLoading:j,getBindValues:v,getFooterHeight:$,handleOk:W}}});function he(e,s,o,g,u,h){const f=w("DrawerHeader"),l=w("ScrollContainer"),a=w("DrawerFooter"),n=w("Drawer"),C=re("loading");return T(),V(n,M({class:e.prefixCls,onClose:e.onClose},e.getBindValues),R({default:d(()=>[ne((T(),V(l,{style:ie(e.getScrollContentStyle),"loading-tip":e.loadingText||e.t("common.loadingText")},{default:d(()=>[D(e.$slots,"default")]),_:3},8,["style","loading-tip"])),[[C,e.getLoading]]),L(a,M(e.getProps,{onClose:e.onClose,onOk:e.handleOk,height:e.getFooterHeight}),R({_:2},[le(Object.keys(e.$slots),c=>({name:c,fn:d(v=>[D(e.$slots,c,ce(ue(v||{})))])}))]),1040,["onClose","onOk","height"])]),_:2},[e.$slots.title?{name:"title",fn:d(()=>[D(e.$slots,"title")]),key:"1"}:{name:"title",fn:d(()=>[L(f,{title:e.getMergeProps.title,isDetail:e.isDetail,showDetailBack:e.showDetailBack,onClose:e.onClose},{titleToolbar:d(()=>[D(e.$slots,"titleToolbar")]),_:3},8,["title","isDetail","showDetailBack","onClose"])]),key:"0"}]),1040,["class","onClose"])}const ye=ae(me,[["render",he]]);export{ye as default};