test_lgq/niucloud/public/wap/assets/u-popup.e01742d2.js

2 lines
5.1 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{_ as t}from"./u-transition.75065529.js";import{U as e,V as o,W as s,p as a,q as i,h as n,i as r,w as l,S as u,n as d,t as p,l as c,j as y,I as m,H as f}from"./index-849cf30e.js";import{_ as h}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as v}from"./u-icon.e3aa4770.js";import{_ as g}from"./u-safe-bottom.2f6af56c.js";const b=h({name:"u-overlay",mixins:[o,s,{props:{show:{type:Boolean,default:e.overlay.show},zIndex:{type:[String,Number],default:e.overlay.zIndex},duration:{type:[String,Number],default:e.overlay.duration},opacity:{type:[String,Number],default:e.overlay.opacity}}}],computed:{overlayStyle(){const t={position:"fixed",top:0,left:0,right:0,zIndex:this.zIndex,bottom:0,"background-color":`rgba(0, 0, 0, ${this.opacity})`};return uni.$u.deepMerge(t,uni.$u.addStyle(this.customStyle))}},methods:{clickHandler(){this.$emit("click")}}},[["render",function(e,o,s,d,p,c){const y=a(i("u-transition"),t);return n(),r(y,{show:e.show,"custom-class":"u-overlay",duration:e.duration,"custom-style":c.overlayStyle,onClick:c.clickHandler},{default:l((()=>[u(e.$slots,"default",{},void 0,!0)])),_:3},8,["show","duration","custom-style","onClick"])}],["__scopeId","data-v-1ce16a4a"]]);const _=h({name:"u-status-bar",mixins:[o,s,{props:{bgColor:{type:String,default:e.statusBar.bgColor}}}],data:()=>({}),computed:{style(){const t={};return t.height=uni.$u.addUnit(uni.$u.sys().statusBarHeight,"px"),t.backgroundColor=this.bgColor,uni.$u.deepMerge(t,uni.$u.addStyle(this.customStyle))}}},[["render",function(t,e,o,s,a,i){const c=p;return n(),r(c,{style:d([i.style]),class:"u-status-bar"},{default:l((()=>[u(t.$slots,"default",{},void 0,!0)])),_:3},8,["style"])}],["__scopeId","data-v-df170e56"]]);const S=h({name:"u-popup",mixins:[o,s,{props:{show:{type:Boolean,default:e.popup.show},overlay:{type:Boolean,default:e.popup.overlay},mode:{type:String,default:e.popup.mode},duration:{type:[String,Number],default:e.popup.duration},closeable:{type:Boolean,default:e.popup.closeable},overlayStyle:{type:[Object,String],default:e.popup.overlayStyle},closeOnClickOverlay:{type:Boolean,default:e.popup.closeOnClickOverlay},zIndex:{type:[String,Number],default:e.popup.zIndex},safeAreaInsetBottom:{type:Boolean,default:e.popup.safeAreaInsetBottom},safeAreaInsetTop:{type:Boolean,default:e.popup.safeAreaInsetTop},closeIconPos:{type:String,default:e.popup.closeIconPos},round:{type:[Boolean,String,Number],default:e.popup.round},zoom:{type:Boolean,default:e.popup.zoom},bgColor:{type:String,default:e.popup.bgColor},overlayOpacity:{type:[Number,String],default:e.popup.overlayOpacity}}}],data(){return{overlayDuration:this.duration+50}},watch:{show(t,e){}},computed:{transitionStyle(){const t={zIndex:this.zIndex,position:"fixed",display:"flex"};return t[this.mode]=0,"left"===this.mode||"right"===this.mode?uni.$u.deepMerge(t,{bottom:0,top:0}):"top"===this.mode||"bottom"===this.mode?uni.$u.deepMerge(t,{left:0,right:0}):"center"===this.mode?uni.$u.deepMerge(t,{alignItems:"center","justify-content":"center",top:0,left:0,right:0,bottom:0}):void 0},contentStyle(){const t={};if(uni.$u.sys(),"center"!==this.mode&&(t.flex=1),this.bgColor&&(t.backgroundColor=this.bgColor),this.round){const e=uni.$u.addUnit(this.round);"top"===this.mode?(t.borderBottomLeftRadius=e,t.borderBottomRightRadius=e):"bottom"===this.mode?(t.borderTopLeftRadius=e,t.borderTopRightRadius=e):"center"===this.mode&&(t.borderRadius=e)}return uni.$u.deepMerge(t,uni.$u.addStyle(this.customStyle))},position(){return"center"===this.mode?this.zoom?"fade-zoom":"fade":"left"===this.mode?"slide-left":"right"===this.mode?"slide-right":"bottom"===this.mode?"slide-up":"top"===this.mode?"slide-down":void 0}},methods:{overlayClick(){this.closeOnClickOverlay&&this.$emit("close")},close(t){this.$emit("close")},afterEnter(){this.$emit("open")},clickHandler(){"center"===this.mode&&this.overlayClick(),this.$emit("click")}}},[["render",function(e,o,s,h,S,k){const C=a(i("u-overlay"),b),I=a(i("u-status-bar"),_),$=a(i("u-icon"),v),x=p,w=a(i("u-safe-bottom"),g),B=a(i("u-transition"),t);return n(),r(x,{class:"u-popup"},{default:l((