weex-flymeui
Version:
A Flyme Style UI library based on Weex for Creator.
3 lines (2 loc) • 3.71 kB
JavaScript
// { "framework": "Vue" }
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["npm/weex-flymeui/components/fm-loading/index"]=t():e["npm/weex-flymeui/components/fm-loading/index"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=113)}({113:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(114);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(o).default}})},114:function(e,t,n){var o,i,r=[];r.push(n(115)),o=n(116);var a=n(117);i=o=o||{},"object"!=typeof o.default&&"function"!=typeof o.default||(Object.keys(o).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),i=o=o.default),"function"==typeof i&&(i=i.options),i.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-loading/index.vue",i.render=a.render,i.staticRenderFns=a.staticRenderFns,i._scopeId="data-v-60230d06",i.style=i.style||{},r.forEach(function(e){for(var t in e)i.style[t]=e[t]}),"function"==typeof __register_static_styles__&&__register_static_styles__(i._scopeId,r),e.exports=o},115:function(e,t){e.exports={"fm-loading":{position:"fixed",top:0,right:0,bottom:0,left:0,flexDirection:"row",alignItems:"center",justifyContent:"center",zIndex:999},"loading-wrapper":{alignItems:"center"},"loading--text":{fontSize:"42",fontFamily:"sans-serif-medium",fontWeight:"500",textAlign:"center"}}},116:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=weex.requireModule("animation");t.default={name:"FmLoading",props:{title:{type:String,default:""},backgroundColor:{type:String,default:"#FFFFFF"},canAutoClose:{type:Boolean,default:!0}},data:function(){return{show:!1,showIn:!1,loadingStart:0,animating:!1}},computed:{wrapperStyle:function(){var e=this.showIn;return{backgroundColor:this.backgroundColor,opacity:e?1:0}}},methods:{handleTouchEnd:function(e){e.preventDefault&&e.preventDefault()},appear:function(e){var t=this;if(!this.animating){var n=this.$refs["fm-loading"];n?(this.animating=!0,o.transition(n,{styles:{opacity:e?1:0},duration:320,timingFunction:"cubic-bezier(0.33, 0, 0.66, 1)"},function(){t.showIn=e,e?t.$emit("fmLoadingAppeared",!1):t.$emit("fmLoadingDisappeared",!1),t.animating=!1})):this.showIn=e}},warpperClicked:function(){this.animating||this.canAutoClose&&this.hide()},active:function(){var e=this;this.show||(this.show=!0,this.loadingStart=(new Date).getTime(),setTimeout(function(){e.appear(!0)},20))},hide:function(){var e=this;if(this.show){this.show=!1;var t=20;(new Date).getTime()-this.loadingStart<=500&&(t=500),setTimeout(function(){e.appear(!1)},t)}}}}},117:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.show||e.showIn?n("div",{ref:"fm-loading",staticClass:["fm-loading"],style:e.wrapperStyle,on:{click:e.warpperClicked,touchend:e.handleTouchEnd}},[e.show||e.showIn?n("div",{staticClass:["loading-wrapper"]},[n("FmLoading",{attrs:{text:e.title}})],1):e._e()]):e._e()])},staticRenderFns:[]},e.exports.render._withStripped=!0}})});