2 lines
7.8 KiB
JavaScript
2 lines
7.8 KiB
JavaScript
![]() |
var t,e;import{_ as o}from"./uv-loading-icon.ad70964c.js";import{Y as s,Z as i,G as a,H as n,o as r,j as l,w as p,a0 as u,Q as h,m as d,y as c,B as m,E as f,h as y,z as g}from"./index-90c12cc1.js";import{_ as b}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as v}from"./uv-status-bar.acda7a2c.js";import{_ as k}from"./uv-icon.c815b875.js";const w=b({name:"uv-overlay",emits:["click"],mixins:[s,i,{props:{show:{type:Boolean,default:!1},zIndex:{type:[String,Number],default:10070},duration:{type:[String,Number],default:300},opacity:{type:[String,Number],default:.5},...null==(e=null==(t=uni.$uv)?void 0:t.props)?void 0:e.overlay}}],watch:{show(t){document.querySelector("body").style.overflow=t?"hidden":""}},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 this.$uv.deepMerge(t,this.$uv.addStyle(this.customStyle))}},methods:{clickHandler(){this.$emit("click")},clear(){}}},[["render",function(t,e,s,i,d,c){const m=a(n("uv-transition"),o);return r(),l(m,{show:t.show,mode:"fade","custom-class":"uv-overlay",duration:t.duration,"custom-style":c.overlayStyle,onClick:c.clickHandler,onTouchmove:h(c.clear,["stop","prevent"])},{default:p((()=>[u(t.$slots,"default",{},void 0,!0)])),_:3},8,["show","duration","custom-style","onClick","onTouchmove"])}],["__scopeId","data-v-0c47b2a6"]]);const x=b({name:"uv-safe-bottom",mixins:[s,i],data:()=>({safeAreaBottomHeight:0,isNvue:!1}),computed:{style(){return this.$uv.deepMerge({},this.$uv.addStyle(this.customStyle))}},mounted(){}},[["render",function(t,e,o,s,i,a){const n=m;return r(),l(n,{class:d(["uv-safe-bottom",[!i.isNvue&&"uv-safe-area-inset-bottom"]]),style:c([a.style])},null,8,["style","class"])}],["__scopeId","data-v-e97e85dd"]]);const C=b({name:"uv-popup",components:{keypress:{name:"Keypress",props:{disable:{type:Boolean,default:!1}},mounted(){const t={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]};document.addEventListener("keyup",(e=>{if(this.disable)return;const o=Object.keys(t).find((o=>{const s=e.key,i=t[o];return i===s||Array.isArray(i)&&i.includes(s)}));o&&setTimeout((()=>{this.$emit(o,{})}),0)}))},render:()=>{}}},mixins:[s,i],emits:["change","maskClick"],props:{mode:{type:String,default:"center"},duration:{type:[String,Number],default:300},zIndex:{type:[String,Number],default:10075},bgColor:{type:String,default:"#ffffff"},safeArea:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},overlayOpacity:{type:[Number,String],default:.4},overlayStyle:{type:[Object,String],default:""},safeAreaInsetBottom:{type:Boolean,default:!0},safeAreaInsetTop:{type:Boolean,default:!1},closeable:{type:Boolean,default:!1},closeIconPos:{type:String,default:"top-right"},zoom:{type:Boolean,default:!0},round:{type:[Number,String],default:0}},watch:{type:{handler:function(t){this.config[t]&&this[this.config[t]](!0)},immediate:!0},isDesktop:{handler:function(t){this.config[t]&&this[this.config[this.mode]](!0)},immediate:!0},showPopup(t){document.getElementsByTagName("body")[0].style.overflow=t?"hidden":"visible"}},data(){return{ani:[],showPopup:!1,showTrans:!1,popupWidth:0,popupHeight:0,config:{top:"top",bottom:"bottom",center:"center",left:"left",right:"right",message:"top",dialog:"center",share:"bottom"},transitionStyle:{position:"fixed",left:0,right:0},maskShow:!0,mkclick:!0,popupClass:this.isDesktop?"fixforpc-top":"top"}},computed:{isDesktop(){return this.popupWidth>=500&&this.popupHeight>=500},bg(){return""===this.bgColor||"none"===this.bgColor||this.$uv.getPx(this.round)>0?"transparent":this.bgColor},contentStyle(){const t={};if(this.bgColor&&(t.backgroundColor=this.bg),this.round){const e=this.$uv.addUnit(this.round);t.backgroundColor=this.bgColor,"top"===this.mode?(t.borderBottomLeftRadius=e,t.borderBottomRightRadius=e):"bottom"===this.mode?(t.borderTopLeftRadius=e,t.borderTopRightRa
|