var z=Object.defineProperty;var v=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var g=(e,o,t)=>o in e?z(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,h=(e,o)=>{for(var t in o||(o={}))T.call(o,t)&&g(e,t,o[t]);if(v)for(var t of v(o))O.call(o,t)&&g(e,t,o[t]);return e};import{_ as I,z as N,A as H,C as _,F as A,E as f,G as D,H as P,c as a,o as l,w as n,k as u,j as R,B as s,i,J as C,q as V,p as c,t as m,a1 as w}from"./index-CZJgrp0v.js";var B,S;const j={props:h({title:{type:[String],default:""},content:{type:String,default:""},confirmText:{type:String,default:"确认"},cancelText:{type:String,default:"取消"},showConfirmButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!1},confirmColor:{type:String,default:"#2979ff"},cancelColor:{type:String,default:"#606266"},buttonReverse:{type:Boolean,default:!1},zoom:{type:Boolean,default:!0},zIndex:{type:[String,Number],default:10075},asyncClose:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},negativeTop:{type:[String,Number],default:0},width:{type:[String,Number],default:"650rpx"},align:{type:String,default:"left"},textStyle:{type:[Object,String],default:""}},(S=(B=uni.$uv)==null?void 0:B.props)==null?void 0:S.modal)},E={name:"uv-modal",mixins:[N,H,j],data(){return{loading:!1}},computed:{nvueStyle(){return{}}},methods:{open(){this.$refs.modalPopup.open(),this.loading&&(this.loading=!1)},close(){this.$refs.modalPopup.close()},popupChange(e){e.show||this.$emit("close")},confirmHandler(){this.loading||this.$emit("confirm"),this.asyncClose?this.loading=!0:this.close()},cancelHandler(){this.$emit("cancel"),this.close()},closeLoading(){this.$nextTick(()=>{this.loading=!1})}}};function U(e,o,t,q,b,d){const p=V,r=R,y=_(f("uv-line"),A),k=_(f("uv-loading-icon"),D),$=_(f("uv-popup"),P);return l(),a($,{ref:"modalPopup",mode:"center",zoom:e.zoom,zIndex:e.zIndex,customStyle:{borderRadius:"6px",overflow:"hidden",marginTop:`-${e.$uv.addUnit(e.negativeTop)}`},closeOnClickOverlay:e.closeOnClickOverlay,safeAreaInsetBottom:!1,duration:400,onChange:d.popupChange},{default:n(()=>[u(r,{class:"uv-modal",style:s({width:e.$uv.addUnit(e.width)})},{default:n(()=>[e.title?(l(),a(p,{key:0,class:"uv-modal__title"},{default:n(()=>[c(m(e.title),1)]),_:1})):i("",!0),u(r,{class:"uv-modal__content",style:s({paddingTop:`${e.title?12:25}px`})},{default:n(()=>[C(e.$slots,"default",{},()=>[u(p,{class:"uv-modal__content__text",style:s([{textAlign:e.align},d.nvueStyle,e.$uv.addStyle(e.textStyle)])},{default:n(()=>[c(m(e.content),1)]),_:1},8,["style"])],!0)]),_:3},8,["style"]),C(e.$slots,"confirmButton",{},()=>[u(y),e.showConfirmButton||e.showCancelButton?(l(),a(r,{key:0,class:"uv-modal__button-group",style:s({flexDirection:e.buttonReverse?"row-reverse":"row"})},{default:n(()=>[e.showCancelButton?(l(),a(r,{key:0,class:w(["uv-modal__button-group__wrapper uv-modal__button-group__wrapper--cancel",[e.showCancelButton&&!e.showConfirmButton&&"uv-modal__button-group__wrapper--only-cancel"]]),"hover-stay-time":150,"hover-class":"uv-modal__button-group__wrapper--hover",onClick:d.cancelHandler},{default:n(()=>[u(p,{class:"uv-modal__button-group__wrapper__text",style:s({color:e.cancelColor})},{default:n(()=>[c(m(e.cancelText),1)]),_:1},8,["style"])]),_:1},8,["class","onClick"])):i("",!0),e.showConfirmButton&&e.showCancelButton?(l(),a(y,{key:1,direction:"column"})):i("",!0),e.showConfirmButton?(l(),a(r,{key:2,class:w(["uv-modal__button-group__wrapper uv-modal__button-group__wrapper--confirm",[!e.showCancelButton&&e.showConfirmButton&&"uv-modal__button-group__wrapper--only-confirm"]]),"hover-stay-time":150,"hover-class":"uv-modal__button-group__wrapper--hover",onClick:d.confirmHandler},{default:n(()=>[b.loading?(l(),a(k,{key:0})):(l(),a(p,{key:1,class:"uv-modal__button-group__wrapper__text",style:s({color:e.confirmColor})},{default:n(()=>[c(m(e.confirmText),1)]),_:1},8,["style"]))]),_:1},8,["class","onClick"])):i("",!0)]),_:1},8,["style"])):i("",!0)],!0)]),_:3},8,["style"])]),_:3},8,["zoom","zIndex","customStyle","closeOnClickOverlay","onChange"])}const J=I(E,[["render",U],["__scopeId","data-v-a841b530"]]);export{J as _};
