2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
import{aj as e,ak as t,al as o,b1 as i,o as n,j as a,w as s,m as r,y as l,e as d,F as u,k as c,z as p,I as m,l as y,B as f,A as h,a0 as g,G as b,H as v,h as _,Q as S}from"./index-90c12cc1.js";import{_ as C}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as k,a as I}from"./u-overlay.1411b0ae.js";import{_ as w}from"./u-icon.ec8b667f.js";const $=C({name:"u-loading-icon",mixins:[t,o,{props:{show:{type:Boolean,default:e.loadingIcon.show},color:{type:String,default:e.loadingIcon.color},textColor:{type:String,default:e.loadingIcon.textColor},vertical:{type:Boolean,default:e.loadingIcon.vertical},mode:{type:String,default:e.loadingIcon.mode},size:{type:[String,Number],default:e.loadingIcon.size},textSize:{type:[String,Number],default:e.loadingIcon.textSize},text:{type:[String,Number],default:e.loadingIcon.text},timingFunction:{type:String,default:e.loadingIcon.timingFunction},duration:{type:[String,Number],default:e.loadingIcon.duration},inactiveColor:{type:String,default:e.loadingIcon.inactiveColor}}}],data:()=>({array12:Array.from({length:12}),aniAngel:360,webviewHide:!1,loading:!1}),computed:{otherBorderColor(){const e=uni.$u.colorGradient(this.color,"#ffffff",100)[80];return"circle"===this.mode?this.inactiveColor?this.inactiveColor:e:"transparent"}},watch:{show(e){}},mounted(){this.init()},methods:{init(){setTimeout((()=>{}),20)},addEventListenerToWebview(){const e=i(),t=e[e.length-1].$getAppWebview();t.addEventListener("hide",(()=>{this.webviewHide=!0})),t.addEventListener("show",(()=>{this.webviewHide=!1}))}}},[["render",function(e,t,o,i,g,b){const v=f,_=h;return e.show?(n(),a(v,{key:0,class:r(["u-loading-icon",[e.vertical&&"u-loading-icon--vertical"]]),style:l([e.$u.addStyle(e.customStyle)])},{default:s((()=>[g.webviewHide?p("",!0):(n(),a(v,{key:0,class:r(["u-loading-icon__spinner",[`u-loading-icon__spinner--${e.mode}`]]),ref:"ani",style:l({color:e.color,width:e.$u.addUnit(e.size),height:e.$u.addUnit(e.size),borderTopColor:e.color,borderBottomColor:b.otherBorderColor,borderLeftColor:b.otherBorderColor,borderRightColor:b.otherBorderColor,"animation-duration":`${e.duration}ms`,"animation-timing-function":"semicircle"===e.mode||"circle"===e.mode?e.timingFunction:""})},{default:s((()=>["spinner"===e.mode?(n(!0),d(u,{key:0},c(g.array12,((e,t)=>(n(),a(v,{key:t,class:"u-loading-icon__dot"})))),128)):p("",!0)])),_:1},8,["class","style"])),e.text?(n(),a(_,{key:1,class:"u-loading-icon__text",style:l({fontSize:e.$u.addUnit(e.textSize),color:e.textColor})},{default:s((()=>[m(y(e.text),1)])),_:1},8,["style"])):p("",!0)])),_:1},8,["style","class"])):p("",!0)}],["__scopeId","data-v-7b85d6f1"]]);const x=C({name:"u-status-bar",mixins:[t,o,{props:{bgColor:{type:String,default:e.statusBar.bgColor}}}],data:()=>({}),computed:{style(){const e={};return e.height=uni.$u.addUnit(uni.$u.sys().statusBarHeight,"px"),e.backgroundColor=this.bgColor,uni.$u.deepMerge(e,uni.$u.addStyle(this.customStyle))}}},[["render",function(e,t,o,i,r,d){const u=f;return n(),a(u,{style:l([d.style]),class:"u-status-bar"},{default:s((()=>[g(e.$slots,"default",{},void 0,!0)])),_:3},8,["style"])}],["__scopeId","data-v-b45c8d4b"]]);const B=C({name:"u-safe-bottom",mixins:[t,o,{props:{}}],data:()=>({safeAreaBottomHeight:0,isNvue:!1}),computed:{style(){return uni.$u.deepMerge({},uni.$u.addStyle(this.customStyle))}},mounted(){}},[["render",function(e,t,o,i,s,d){const u=f;return n(),a(u,{class:r(["u-safe-bottom",[!s.isNvue&&"u-safe-area-inset-bottom"]]),style:l([d.style])},null,8,["style","class"])}],["__scopeId","data-v-a53a2a40"]]);const z=C({name:"u-popup",mixins:[t,o,{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(e,t){}},computed:{transitionStyle(){const e={zIndex:this.zIndex,position:"fixed",display:"flex"};return e[this.mode]=0,"left"===this.mode||"right"===this.mode?uni.$u.deepMerge(e,{bottom:0,top:0}):"top"===this.mode||"bottom"===this.mode?uni.$u.deepMerge(e,{left:0,right:0}):"center"===this.mode?uni.$u.deepMerge(e,{alignItems:"center","justify-content":"center",top:0,left:0,right:0,bottom:0}):void 0},contentStyle(){const e={};if(uni.$u.sys(),"center"!==this.mode&&(e.flex=1),this.bgColor&&(e.backgroundColor=this.bgColor),this.round){const t=uni.$u.addUnit(this.round);"top"===this.mode?(e.borderBottomLeftRadius=t,e.borderBottomRightRadius=t):"bottom"===this.mode?(e.borderTopLeftRadius=t,e.borderTopRightRadius=t):"center"===this.mode&&(e.borderRadius=t)}return uni.$u.deepMerge(e,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}},emits:["open","close","click"],methods:{overlayClick(){this.closeOnClickOverlay&&this.$emit("close")},close(e){this.$emit("close")},afterEnter(){this.$emit("open")},clickHandler(){"center"===this.mode&&this.overlayClick(),this.$emit("click")}}},[["render",function(e,t,o,i,d,u){const c=b(v("u-overlay"),k),m=b(v("u-status-bar"),x),y=b(v("u-icon"),w),h=f,C=b(v("u-safe-bottom"),B),$=b(v("u-transition"),I);return n(),a(h,{class:"u-popup"},{default:s((()=>[e.overlay?(n(),a(c,{key:0,show:e.show,onClick:u.overlayClick,duration:d.overlayDuration,customStyle:e.overlayStyle,opacity:e.overlayOpacity},null,8,["show","onClick","duration","customStyle","opacity"])):p("",!0),_($,{show:e.show,customStyle:u.transitionStyle,mode:u.position,duration:e.duration,onAfterEnter:u.afterEnter,onClick:u.clickHandler},{default:s((()=>[_(h,{class:"u-popup__content",style:l([u.contentStyle]),onClick:S(e.noop,["stop"])},{default:s((()=>[e.safeAreaInsetTop?(n(),a(m,{key:0})):p("",!0),g(e.$slots,"default",{},void 0,!0),e.closeable?(n(),a(h,{key:1,onClick:S(u.close,["stop"]),class:r(["u-popup__content__close",["u-popup__content__close--"+e.closeIconPos]]),"hover-class":"u-popup__content__close--hover","hover-stay-time":"150"},{default:s((()=>[_(y,{name:"close",color:"#909399",size:"18",bold:""})])),_:1},8,["onClick","class"])):p("",!0),e.safeAreaInsetBottom?(n(),a(C,{key:2})):p("",!0)])),_:3},8,["style","onClick"])])),_:3},8,["show","customStyle","mode","duration","onAfterEnter","onClick"])])),_:3})}],["__scopeId","data-v-8b543cb1"]]);export{$ as _,z as a};
|