2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
![]() |
import{v as t,aR as s,b1 as e,b4 as i,b5 as o,aH as a,o as n,j as l,w as r,a0 as h,B as p,aX as c,C as u,D as d,m,y as f,E as g,h as y,z as k,aY as b,t as w,a as C,O as x,b6 as S,e as T,i as $,I as _,l as P,F as v,a2 as B,G as A,H as D}from"./index-90c12cc1.js";import{_ as z}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as M}from"./u-icon.ec8b667f.js";const R=z({name:"PageMeta",setup(e,{emit:i}){t((()=>{s((t=>{i("resize",t)}))}))},props:{backgroundTextStyle:{type:String,default:"dark",validator:t=>-1!==["dark","light"].indexOf(t)},backgroundColor:{type:String,default:"#ffffff"},backgroundColorTop:{type:String,default:"#ffffff"},backgroundColorBottom:{type:String,default:"#ffffff"},scrollTop:{type:String,default:""},scrollDuration:{type:Number,default:300},pageStyle:{type:String,default:""},enablePullDownRefresh:{type:[Boolean,String],default:!1},rootFontSize:{type:String,default:""}},created(){const t=e()[0];this.$pageVm=t.$vm||t,this.$watch("backgroundTextStyle",(()=>{this.setBackgroundTextStyle()})),this.$watch((()=>[this.rootFontSize,this.pageStyle]),(()=>{this.setPageMeta()})),this.$watch((()=>[this.backgroundColor,this.backgroundColorTop,this.backgroundColorBottom]),(()=>{this.setBackgroundColor()})),this.$watch((()=>[this.scrollTop,this.scrollDuration]),(()=>{this.pageScrollTo()}))},beforeMount(){this.setBackgroundColor(),(this.rootFontSize||this.pageStyle)&&this.setPageMeta(),this.backgroundTextStyle&&this.setBackgroundTextStyle()},mounted(){this.scrollTop&&this.pageScrollTo()},methods:{setPullDownRefresh(t,s){t.setStyle({pullToRefresh:{support:s,style:"Android"===plus.os.name?"circle":"default"}})},setPageMeta(){i({pageStyle:this.pageStyle,rootFontSize:this.rootFontSize})},setBackgroundTextStyle(){},setBackgroundColor(){},pageScrollTo(){let t=String(this.scrollTop);-1!==t.indexOf("rpx")&&(t=o(t.replace("rpx",""))),t=parseFloat(t),isNaN(t)||a({scrollTop:t,duration:this.scrollDuration,success:()=>{}})}}},[["render",function(t,s,e,i,o,a){const c=p;return n(),l(c,{style:{display:"none"}},{default:r((()=>[h(t.$slots,"default")])),_:3})}]]),E={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",(s=>{if(this.disable)return;const e=Object.keys(t).find((e=>{const i=s.key,o=t[e];return o===i||Array.isArray(o)&&o.includes(i)}));e&&setTimeout((()=>{this.$emit(e,{})}),0)}))},render:()=>{}};class I{constructor(t,s){this.options=t,this.animation=c({...t}),this.currentStepAnimates={},this.next=0,this.$=s}_nvuePushAnimates(t,s){let e=this.currentStepAnimates[this.next],i={};if(i=e||{styles:{},config:{}},O.includes(t)){i.styles.transform||(i.styles.transform="");let e="";"rotate"===t&&(e="deg"),i.styles.transform+=`${t}(${s+e}) `}else i.styles[t]=`${s}`;this.currentStepAnimates[this.next]=i}_animateRun(t={},s={}){let e=this.$.$refs.ani.ref;if(e)return new Promise(((i,o)=>{nvueAnimation.transition(e,{styles:t,...s},(t=>{i()}))}))}_nvueNextAnimate(t,s=0,e){let i=t[s];if(i){let{styles:o,config:a}=i;this._animateRun(o,a).then((()=>{s+=1,this._nvueNextAnimate(t,s,e)}))}else this.currentStepAnimates={},"function"==typeof e&&e(),this.isEnd=!0}step(t={}){return this.animation.step(t),this}run(t){this.$.animationData=this.animation.export(),this.$.timer=setTimeout((()=>{"function"==typeof t&&t()}),this.$.durationTime)}}const O=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function j(t,s){if(s)return clearTimeout(s.timer),new I(t,s)}O.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((t=>{I.prototype[t]=function(...s){return this.animation[t](...s),this}}));const X=z({name:"uniPopup",components:{UTransition:z({name:"uniTransition",emits:["click","change"],props:{show:{ty
|