UNPKG

w-ui

Version:

A Vue.js 2.0 UI Toolkit for mobile

1 lines 12.8 kB
module.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=203)}({0:function(t,e){t.exports=function(t,e,n,r,o,i){var s,a=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(s=t,a=t.default);var c="function"==typeof a?a.options:a;e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId=o);var l;if(i?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=l):r&&(l=r),l){var f=c.functional,d=f?c.render:c.beforeCreate;f?(c._injectStyles=l,c.render=function(t,e){return l.call(e),d(t,e)}):c.beforeCreate=d?[].concat(d,l):[l]}return{esModule:s,exports:a,options:c}}},1:function(t,e,n){"use strict";function r(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=o(r);return[n].concat(r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"})).concat([i]).join("\n")}return[n].join("\n")}function o(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=r(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var s=t[o];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))}},e}},2:function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=l[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(i(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var s=[],o=0;o<n.parts.length;o++)s.push(i(n.parts[o]));l[n.id]={id:n.id,refs:1,parts:s}}}}function o(){var t=document.createElement("style");return t.type="text/css",f.appendChild(t),t}function i(t){var e,n,r=document.querySelector("style["+m+'~="'+t.id+'"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(y){var i=p++;r=d||(d=o()),e=s.bind(null,r,i,!1),n=s.bind(null,r,i,!0)}else r=o(),e=a.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function s(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(e,o);else{var i=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(i,s[e]):t.appendChild(i)}}function a(t,e){var n=e.css,r=e.media,o=e.sourceMap;if(r&&t.setAttribute("media",r),g.ssrId&&t.setAttribute(m,e.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var u="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!u)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c=n(3),l={},f=u&&(document.head||document.getElementsByTagName("head")[0]),d=null,p=0,h=!1,v=function(){},g=null,m="data-vue-ssr-id",y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,o){h=n,g=o||{};var i=c(t,e);return r(i),function(e){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=l[s.id];a.refs--,n.push(a)}e?(i=c(t,e),r(i)):i=[];for(var o=0;o<n.length;o++){var a=n[o];if(0===a.refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete l[a.id]}}}};var w=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},203:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Progressbar=void 0;var r=n(204),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.Progressbar=o.default},204:function(t,e,n){"use strict";function r(t){u||n(205)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(42),i=n.n(o);for(var s in o)"default"!==s&&function(t){n.d(e,t,function(){return o[t]})}(s);var a=n(207),u=!1,c=n(0),l=r,f=c(i.a,a.a,!1,l,null,null);f.options.__file="packages/progressbar/src/progressbar.vue",e.default=f.exports},205:function(t,e,n){var r=n(206);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(2)("13ddda30",r,!1,{})},206:function(t,e,n){e=t.exports=n(1)(!1),e.push([t.i,"\n.wui-progressbar {\n position: relative;\n color: #333;\n width: 100%;\n height: 100%;\n}\n.wui-progressbar > svg {\n width: 100%;\n}\n.wui-progressbar > svg > path {\n -webkit-transition: all 1s linear;\n transition: all 1s linear;\n}\n.wui-progressbar-content {\n position: absolute;\n top: 50%;\n left: 50%;\n font-size: .3rem;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n}\n",""])},207:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"wui-progressbar"},["line"!=t.type?n("div",{staticClass:"progressbar-content"},[t._t("default")],2):t._e(),t._v(" "),n("svg",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],attrs:{viewBox:t.viewBox,preserveAspectRatio:"line"==t.type?"none":""}},[n("path",{attrs:{"fill-opacity":"line"==t.type?1:0,d:t.getPathString,fill:t.bgColor,stroke:t.bgColor,"stroke-width":t.width}}),t._v(" "),n("path",{ref:"trailPath",style:{strokeDasharray:t.stroke.dasharray,strokeDashoffset:t.stroke.dashoffset},attrs:{"fill-opacity":"0",d:t.getPathString,stroke:t.barColor,"stroke-width":t.barWidth?t.barWidth:t.width}})])])},o=[];r._withStripped=!0;var i={render:r,staticRenderFns:o};e.a=i},3:function(t,e,n){"use strict";t.exports=function(t,e){for(var n=[],r={},o=0;o<e.length;o++){var i=e[o],s=i[0],a=i[1],u=i[2],c=i[3],l={id:t+":"+o,css:a,media:u,sourceMap:c};r[s]?r[s].parts.push(l):n.push(r[s]={id:s,parts:[l]})}return n}},4:function(t,e){t.exports=require("vue")},42:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5);e.default={name:"w-progressbar",data:function(){return{viewBox:"0 0 100 100",show:!1,stroke:{dasharray:"",dashoffset:""}}},props:{type:{validator:function(t){return["circle","line"].indexOf(t)>-1},default:"circle"},bgColor:{type:String,default:"#E5E5E5"},width:{validator:function(t){return/^\d*$/.test(t)},default:4},barWidth:{validator:function(t){return/^\d*$/.test(t)},default:0,require:!0},barColor:{default:"#20a0ff"},progress:{validator:function(t){return/^(0(.\d+)?|1(\.0+)?)$/.test(t)},default:0}},methods:{init:function(){var t=this,e=this.length=this.$refs.trailPath.getTotalLength();this.stroke.dashoffset=e,this.stroke.dasharray=e+","+e,this.scrollview=(0,r.getScrollview)(this.$el),this.show=!0,"line"==this.type&&(this.viewBox="0 0 100 "+(this.width?this.width:this.barWidth)),this.$nextTick(function(){t.scrollHandler()}),this.bindEvent()},scrollHandler:function(){(0,r.checkInview)(this.scrollview,this.$el)&&(this.stroke.dashoffset=this.length-this.progress*this.length)},bindEvent:function(){this.scrollview.addEventListener("scroll",this.scrollHandler),window.addEventListener("resize",this.scrollHandler)},unbindEvent:function(){this.scrollview.removeEventListener("scroll",this.scrollHandler),window.removeEventListener("resize",this.scrollHandler)}},watch:{progress:function(t){this.stroke.dashoffset=this.length-t*this.length}},computed:{getPathString:function(){if("line"==this.type)return"M 0,{R} L 100,{R}".replace(/\{R\}/g,this.width/2);var t=50-Math.max(this.width,this.barWidth)/2;return"M 50,50 m 0,-{R} a {R},{R} 0 1 1 0,{2R} a {R},{R} 0 1 1 0,-{2R}".replace(/\{R\}/g,t).replace(/\{2R\}/g,2*t)}},mounted:function(){this.init()},destoryed:function(){this.unbindEvent()}}},5:function(t,e,n){"use strict";function r(t,e){if(!t||!e)return!1;if(-1!==e.indexOf(" "))throw new Error("className should not contain space.");return t.classList?t.classList.contains(e):(" "+t.className+" ").indexOf(" "+e+" ")>-1}function o(t,e){if(t){for(var n=t.className,o=(e||"").split(" "),i=0,s=o.length;i<s;i++){var a=o[i];a&&(t.classList?t.classList.add(a):r(t,a)||(n+=" "+a))}t.classList||(t.className=n)}}function i(t,e){if(t&&e){for(var n=e.split(" "),o=" "+t.className+" ",i=0,s=n.length;i<s;i++){var a=n[i];a&&(t.classList?t.classList.remove(a):r(t,a)&&(o=o.replace(" "+a+" "," ")))}t.classList||(t.className=w(o))}}function s(t,e,n){if(t&&e)if("object"===(void 0===e?"undefined":f(e)))for(var r in e)e.hasOwnProperty(r)&&s(t,r,e[r]);else e=b(e),"opacity"===e&&m<9?t.style.filter=isNaN(n)?"":"alpha(opacity="+100*n+")":t.style[e]=n}function a(t){for(var e=t;e&&"HTML"!==e.tagName&&"BODY"!==e.tagName&&1===e.nodeType;){var n=document.defaultView.getComputedStyle(e).overflowY;if("scroll"===n||"auto"===n)return e;e=e.parentNode}return window}function u(t,e){var n=t==window?document.body.offsetHeight:t.offsetHeight,r=t===window?0:t.getBoundingClientRect().top,o=e.getBoundingClientRect().top-r,i=o+e.offsetHeight;return o>=0&&o<n||i>0&&i<=n}function c(t){function e(n,r,o){if(n!==r){var i=n+o>r?r:n+o;n>r&&(i=n-o<r?r:n-o),t===window?window.scrollTo(i,i):t.scrollTop=i,window.requestAnimationFrame(function(){return e(i,r,o)})}}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500;window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)});var i=Math.abs(n-r);e(n,r,Math.ceil(i/o*50))}function l(){return++y}Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=e.isArray=e.isDate=e.isFunction=e.isNumber=e.isString=e.isBoolean=e.pageScroll=e.isIOS=e.getStyle=e.once=e.off=e.on=void 0;var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.hasClass=r,e.addClass=o,e.removeClass=i,e.setStyle=s,e.getScrollview=a,e.checkInview=u,e.scrollTop=c,e.getZIndex=l;var d=n(4),p=function(t){return t&&t.__esModule?t:{default:t}}(d),h=p.default.prototype.$isServer,v=/([\:\-\_]+(.))/g,g=/^moz([A-Z])/,m=h?0:Number(document.documentMode),y=1e4,w=function(t){return(t||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},b=function(t){return t.replace(v,function(t,e,n,r){return r?n.toUpperCase():n}).replace(g,"Moz$1")},_=e.on=function(){return!h&&document.addEventListener?function(t,e,n){t&&e&&n&&t.addEventListener(e,n,!1)}:function(t,e,n){t&&e&&n&&t.attachEvent("on"+e,n)}}(),S=e.off=function(){return!h&&document.removeEventListener?function(t,e,n){t&&e&&t.removeEventListener(e,n,!1)}:function(t,e,n){t&&e&&t.detachEvent("on"+e,n)}}();e.once=function(t,e,n){_(t,e,function r(){n&&n.apply(this,arguments),S(t,e,r)})},e.getStyle=m<9?function(t,e){if(!h){if(!t||!e)return null;e=b(e),"float"===e&&(e="styleFloat");try{switch(e){case"opacity":try{return t.filters.item("alpha").opacity/100}catch(t){return 1}default:return t.style[e]||t.currentStyle?t.currentStyle[e]:null}}catch(n){return t.style[e]}}}:function(t,e){if(!h){if(!t||!e)return null;e=b(e),"float"===e&&(e="cssFloat");try{var n=document.defaultView.getComputedStyle(t,"");return t.style[e]||n?n[e]:null}catch(n){return t.style[e]}}},e.isIOS=!!(window.navigator&&window.navigator.userAgent||"").match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),e.pageScroll=function(){var t=function(t){t.preventDefault(),t.stopPropagation()},e=!1;return{lock:function(n){e||(e=!0,(n||document).addEventListener("touchmove",t))},unlock:function(n){e=!1,(n||document).removeEventListener("touchmove",t)}}}(),e.isBoolean=function(t){return"boolean"==typeof t},e.isString=function(t){return"string"==typeof t},e.isNumber=function(t){return"number"==typeof t},e.isFunction=function(t){return"function"==typeof t},e.isDate=function(t){return"date"===Object.prototype.toString.call(t).match(/^(\[object )(\w+)\]$/i)[2].toLowerCase()},e.isArray=Array.isArray,e.isObject=function(t){return"object"===(void 0===t?"undefined":f(t))}}});