UNPKG

vmui

Version:

A mobile components Library with Vue2.js.

2 lines 12.7 kB
/*! vmui v0.0.53 by Zhangling (c) 2017 */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):"object"==typeof exports?exports.vmui=e(require("vue")):t.vmui=e(t.vue)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var f=n[i]={exports:{},id:i,loaded:!1};return t[i].call(f.exports,f,f.exports,e),f.loaded=!0,f.exports}var n={};return e.m=t,e.c=n,e.p="/dist/",e(0)}({0:function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.PullRefresh=void 0;var f=n(142),r=i(f);e.PullRefresh=r.default},1:function(t,e){t.exports=function(t,e,n,i){var f,r=t=t||{},o=typeof t.default;"object"!==o&&"function"!==o||(f=t,r=t.default);var a="function"==typeof r?r.options:r;if(e&&(a.render=e.render,a.staticRenderFns=e.staticRenderFns),n&&(a._scopeId=n),i){var s=a.computed||(a.computed={});Object.keys(i).forEach(function(t){var e=i[t];s[t]=function(){return e}})}return{esModule:f,exports:r,options:a}}},2:function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},f=0;f<this.length;f++){var r=this[f][0];"number"==typeof r&&(i[r]=!0)}for(f=0;f<e.length;f++){var o=e[f];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},3:function(t,e,n){function i(t){for(var e=0;e<t.length;e++){var n=t[e],i=T[n.id];if(i){i.refs++;for(var f=0;f<i.parts.length;f++)i.parts[f](n.parts[f]);for(;f<n.parts.length;f++)i.parts.push(r(n.parts[f]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{for(var o=[],f=0;f<n.parts.length;f++)o.push(r(n.parts[f]));T[n.id]={id:n.id,refs:1,parts:o}}}}function f(){var t=document.createElement("style");return t.type="text/css",d.appendChild(t),t}function r(t){var e,n,i=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(i){if(u)return c;i.parentNode.removeChild(i)}if(p){var r=F++;i=l||(l=f()),e=o.bind(null,i,r,!1),n=o.bind(null,i,r,!0)}else i=f(),e=a.bind(null,i),n=function(){i.parentNode.removeChild(i)};return e(t),function(i){if(i){if(i.css===t.css&&i.media===t.media&&i.sourceMap===t.sourceMap)return;e(t=i)}else n()}}function o(t,e,n,i){var f=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=h(e,f);else{var r=document.createTextNode(f),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(r,o[e]):t.appendChild(r)}}function a(t,e){var n=e.css,i=e.media,f=e.sourceMap;if(i&&t.setAttribute("media",i),f&&(n+="\n/*# sourceURL="+f.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(f))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var s="undefined"!=typeof document,v=n(4),T={},d=s&&(document.head||document.getElementsByTagName("head")[0]),l=null,F=0,u=!1,c=function(){},p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n){u=n;var f=v(t,e);return i(f),function(e){for(var n=[],r=0;r<f.length;r++){var o=f[r],a=T[o.id];a.refs--,n.push(a)}e?(f=v(t,e),i(f)):f=[];for(var r=0;r<n.length;r++){var a=n[r];if(0===a.refs){for(var s=0;s<a.parts.length;s++)a.parts[s]();delete T[a.id]}}}};var h=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},4:function(t,e){t.exports=function(t,e){for(var n=[],i={},f=0;f<e.length;f++){var r=e[f],o=r[0],a=r[1],s=r[2],v=r[3],T={id:t+":"+f,css:a,media:s,sourceMap:v};i[o]?i[o].parts.push(T):n.push(i[o]={id:o,parts:[T]})}return n}},8:function(e,n){e.exports=t},54:function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var f=n(8),r=i(f);window.$vm=window.$vm||new r.default,e.default={name:"vm-pullrefresh",props:{onInfinite:{type:Function,required:!0}},data:function(){return{showHelpTag:!1,dragTip:{iconOpacity:.5,iconRotate:0,loadingIcon:"",animationTiming:"",scale:1,translate:0,distance:100},touches:{loading:!1,startClientY:0,moveOffset:0,isDraging:!1}}},mounted:function(){this.$nextTick(this.init)},methods:{init:function(){this.offsetTop=this.$refs.dragBox.getBoundingClientRect().top,this.bindEvents(),window.$vm.$on("ydui.pullrefresh.finishLoad",this.finishLoad),this.showHelp()},showHelp:function(){var t=this,e="vm-PULLREFRESH-TIP",n=window.localStorage;1!=n.getItem(e)&&(this.showHelpTag=!0,setTimeout(function(){t.showHelpTag=!1},5e3)),n.setItem(e,1)},bindEvents:function(){var t=this.$refs.dragBox;t.addEventListener("touchstart",this.touchStartHandler),t.addEventListener("touchmove",this.touchMoveHandler),t.addEventListener("touchend",this.touchEndHandler),document.body.addEventListener("touchmove",this.stopWeixinDrag)},unbindEvents:function(){var t=this.$refs.dragBox;t.removeEventListener("touchstart",this.touchStartHandler),t.removeEventListener("touchmove",this.touchMoveHandler),t.removeEventListener("touchend",this.touchEndHandler),document.body.removeEventListener("touchmove",this.stopWeixinDrag)},stopWeixinDrag:function(t){this.touches.isDraging&&t.preventDefault()},touchStartHandler:function(t){return this.touches.loading?void t.preventDefault():void(this.$refs.dragBox.getBoundingClientRect().top<this.offsetTop||(this.touches.startClientY=t.touches[0].clientY))},touchMoveHandler:function(t){var e=t.touches[0];if(this.touches.loading)return void t.preventDefault();if(!(this.touches.startClientY>e.clientY||this.$refs.dragBox.getBoundingClientRect().top<this.offsetTop||this.touches.loading)){this.touches.isDraging=!0;var n=e.clientY-this.touches.startClientY;this.dragTip.iconOpacity=n/100,n>=this.dragTip.distance&&(n=this.dragTip.distance),this.dragTip.iconRotate=n/.25,this.touches.moveOffset=this.dragTip.translate=n}},touchEndHandler:function(t){var e=this.touches;if(e.loading)return void t.preventDefault();if(!(this.$refs.dragBox.getBoundingClientRect().top<this.offsetTop)){if(this.dragTip.animationTiming="vm-pullrefresh-animation-timing",e.moveOffset>=this.dragTip.distance)return this.dragTip.translate=this.dragTip.distance/1.5,this.dragTip.loadingIcon="vm-pullrefresh-loading",void this.triggerLoad();this.dragTip.translate=0,this.resetParams()}},triggerLoad:function(){this.touches.loading=!0,this.onInfinite()},finishLoad:function(){var t=this;setTimeout(function(){t.dragTip.iconRotate=0,t.dragTip.scale=0,t.resetParams()},200)},resetParams:function(){var t=this;setTimeout(function(){var e=t.touches,n=t.dragTip;e.isDraging=!1,e.loading=!1,e.moveOffset=0,n.animationTiming="",n.iconOpacity=.5,n.translate=0,n.scale=1,n.loadingIcon=""},150)}},destroyed:function(){this.unbindEvents()}}},86:function(t,e,n){e=t.exports=n(2)(),e.push([t.id,'.vm-pullrefresh-animation-timing{-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s}@-webkit-keyframes backRotateAnimation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(-1turn);transform:rotate(-1turn)}}@keyframes backRotateAnimation{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(-1turn);transform:rotate(-1turn)}}.vm-pullrefresh-dragtip{position:absolute;top:-46px;left:50%;z-index:996;-webkit-transform:translateZ(0);transform:translateZ(0);width:42px;height:42px;line-height:42px;margin-left:-21px;border-radius:50%;text-align:center;background-color:#fff;box-shadow:0 1px 4px rgba(0,0,0,.25)}.vm-pullrefresh-dragtip>span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:inherit}.vm-pullrefresh-dragtip>span:after{content:"";display:block;width:20px;height:20px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAABa1BMVEVTfvH///9TfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFTfvFAPDq2AAAAeHRSTlMAAAECAwQGBwkLDQ8QERMUFRkiIyYnLS4vMjM1Njc4OTpAQUJDREVGTVJWXmBiZmdoaWpxc3V8f4GCg4SGiIyNj5aXmZqbnJ+go6SlpqmqrK+wub2/wMHCxMXJzM3P0tPU1djd3t/n6Orr7O7w8fP09fb3+Pn6/f5+D/4+AAABqklEQVQ4y43V+T8CQRQA8GklUeQmhESuHBHJUY5EIWeHECGrcpVV++eb2Z3Y2d22eT+9mfm2n880894AQIRpKnDxVCh/sanD+c7/aS8PdDoCOqPfvCRu3c1VKaOOFC+P3LJBlAQ1h3m1uB8UpJRan/FaOX3i39jaj5fw+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AAAAenRSTlMAAAECAwQGBwkKCw0PEBETFBUZIiMmJy0uLzIzNTY3ODk6QEFCQ0RFRktNUlZeYGJmZ2hpanFzdXyBgoOEhoiMjY+Wl5mam5yfoKOkpqmqrK+wuLm6vb/AwcLExcnMzc/S09TV2N3e3+fo6uvs7vDx8/T19vf4+fr9/naKfqcAAAGISURBVDjLjZVVW0JBEEBXDLC7FbsVuzDAwO7E7sAORDi/3od7/T72Ajrztjvn4c7dmTNKaZHV7t2+eQ5/BI4Xewq1TFKSdmxZ+yIqTvszEqCNx1jjcTAtDpq9RLy4qIpBK27NXPh81TM+OecPmufvNgva8mYk9ly55o2jafYdYMuuo40hAA5qtCrzPCF20vUPKH0BCPbalCXKfOl6WZnXAPcV6q8wUB/AQ7H6H3WGgc9qJUB3AfqVAHUCHNok6DxArRKg9ldgX0nQegCXCB0FwjkidAM4UyL0CliWoY/AmAz9AoZlaEiOPgFueVlLMnRT/rPc8idokD+s/RXwi1CjCeuUuLWP/mjtTneRNjADCcmCJyL+rqgxDDoTkGn7ANOC4U5ZAQhka8oIxFOGYx2ADquI+mJqKz8HwPuv3vI9hsSXU6Kl2WpK88CVZ96k1s+bdzPJuoorf1UcuVybmvAuHH7+qnnEFiv4SDzB3zVL18aQQ7aMroayEu4tY8XdPRMKnPi6Syzt8gMGxsBO8KgZSQAAAABJRU5ErkJggg==") no-repeat;background-size:20px 20px;-webkit-animation:backRotateAnimation .4s linear infinite;animation:backRotateAnimation .4s linear infinite}.vm-pullrefresh-draghelp{width:100%;height:100%;position:fixed;top:0;left:0;z-index:1000;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.vm-pullrefresh-draghelp>div{width:5.75rem;height:5.75rem;background-color:rgba(0,0,0,.8)}.vm-pullrefresh-draghelp>div:before{content:"\\E60D";font-family:VMUI-INLAY;font-size:2.2rem;text-align:center;color:#fff;display:block;padding-top:.9rem}.vm-pullrefresh-draghelp>div>span{text-align:center;color:#fff;font-size:.7rem;display:block;padding-top:.5rem}',""])},142:function(t,e,n){n(210);var i=n(1)(n(54),n(174),null,null);t.exports=i.exports},174:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{ref:"dragBox"},[t._t("default"),t._v(" "),n("div",{ref:"dragTip",staticClass:"vm-pullrefresh-dragtip",class:t.dragTip.animationTiming,style:{transform:"translate3d(0, "+t.dragTip.translate+"px, 0) scale("+t.dragTip.scale+")"}},[n("span",{class:t.dragTip.loadingIcon,style:{transform:"rotate("+t.dragTip.iconRotate+"deg)",opacity:t.dragTip.iconOpacity}})])],2),t._v(" "),t.showHelpTag?n("div",{staticClass:"vm-pullrefresh-draghelp",on:{click:function(e){t.showHelpTag=!1}}},[t._m(0)]):t._e()])},staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("span",[t._v("下拉更新")])])}]}},210:function(t,e,n){var i=n(86);"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);n(3)("69a93666",i,!0)}})});