UNPKG

w-ui

Version:

A Vue.js 2.0 UI Toolkit for mobile

1 lines 11.6 kB
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=82)}({0:function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(s=e,a=e.default);var u="function"==typeof a?a.options:a;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var l;if(i?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=l):r&&(l=r),l){var f=u.functional,d=f?u.render:u.beforeCreate;f?(u._injectStyles=l,u.render=function(e,t){return l.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,l):[l]}return{esModule:s,exports:a,options:u}}},1:function(e,t,n){"use strict";function r(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=o(r);return[n].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).join("\n")}return[n].join("\n")}function o(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=r(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var s=e[o];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},12:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5);t.default={name:"w-backtop",data:function(){return{show:!1}},methods:{backtop:function(){var e=this.scrollView===window?document.documentElement.scrollTop:this.scrollView.scrollTop;(0,r.scrollTop)(this.scrollView,e,0)},scrollHandler:function(){var e=window.pageYOffset,t=window.innerHeight;this.scrollView!==window&&(e=this.scrollView.scrollTop,t=this.scrollView.offsetHeight),this.show=e>=t/2},throttle:function(e,t){clearTimeout(e.tId),e.tId=setTimeout(function(){e.call(t)},50)},throttledCheck:function(){this.throttle(this.scrollHandler)}},mounted:function(){this.scrollView=(0,r.getScrollview)(this.$el),this.scrollView.addEventListener("scroll",this.throttledCheck,!1),this.scrollView.addEventListener("resize",this.scrollHandler,!1)},destroyed:function(){this.scrollView.removeEventListener("scroll",this.throttledCheck,!1),this.scrollView.removeEventListener("resize",this.scrollHandler,!1)}}},2:function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],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 e=document.createElement("style");return e.type="text/css",f.appendChild(e),e}function i(e){var t,n,r=document.querySelector("style["+w+'~="'+e.id+'"]');if(r){if(v)return h;r.parentNode.removeChild(r)}if(y){var i=p++;r=d||(d=o()),t=s.bind(null,r,i,!1),n=s.bind(null,r,i,!0)}else r=o(),t=a.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}function s(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function a(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),m.ssrId&&e.setAttribute(w,t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)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 u=n(3),l={},f=c&&(document.head||document.getElementsByTagName("head")[0]),d=null,p=0,v=!1,h=function(){},m=null,w="data-vue-ssr-id",y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,o){v=n,m=o||{};var i=u(e,t);return r(i),function(t){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=l[s.id];a.refs--,n.push(a)}t?(i=u(e,t),r(i)):i=[];for(var o=0;o<n.length;o++){var a=n[o];if(0===a.refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete l[a.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},3:function(e,t,n){"use strict";e.exports=function(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],s=i[0],a=i[1],c=i[2],u=i[3],l={id:e+":"+o,css:a,media:c,sourceMap:u};r[s]?r[s].parts.push(l):n.push(r[s]={id:s,parts:[l]})}return n}},4:function(e,t){e.exports=require("vue")},5:function(e,t,n){"use strict";function r(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}function o(e,t){if(e){for(var n=e.className,o=(t||"").split(" "),i=0,s=o.length;i<s;i++){var a=o[i];a&&(e.classList?e.classList.add(a):r(e,a)||(n+=" "+a))}e.classList||(e.className=n)}}function i(e,t){if(e&&t){for(var n=t.split(" "),o=" "+e.className+" ",i=0,s=n.length;i<s;i++){var a=n[i];a&&(e.classList?e.classList.remove(a):r(e,a)&&(o=o.replace(" "+a+" "," ")))}e.classList||(e.className=g(o))}}function s(e,t,n){if(e&&t)if("object"===(void 0===t?"undefined":f(t)))for(var r in t)t.hasOwnProperty(r)&&s(e,r,t[r]);else t=b(t),"opacity"===t&&w<9?e.style.filter=isNaN(n)?"":"alpha(opacity="+100*n+")":e.style[t]=n}function a(e){for(var t=e;t&&"HTML"!==t.tagName&&"BODY"!==t.tagName&&1===t.nodeType;){var n=document.defaultView.getComputedStyle(t).overflowY;if("scroll"===n||"auto"===n)return t;t=t.parentNode}return window}function c(e,t){var n=e==window?document.body.offsetHeight:e.offsetHeight,r=e===window?0:e.getBoundingClientRect().top,o=t.getBoundingClientRect().top-r,i=o+t.offsetHeight;return o>=0&&o<n||i>0&&i<=n}function u(e){function t(n,r,o){if(n!==r){var i=n+o>r?r:n+o;n>r&&(i=n-o<r?r:n-o),e===window?window.scrollTo(i,i):e.scrollTop=i,window.requestAnimationFrame(function(){return t(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(e){return window.setTimeout(e,1e3/60)});var i=Math.abs(n-r);t(n,r,Math.ceil(i/o*50))}function l(){return++y}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=t.isArray=t.isDate=t.isFunction=t.isNumber=t.isString=t.isBoolean=t.pageScroll=t.isIOS=t.getStyle=t.once=t.off=t.on=void 0;var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.hasClass=r,t.addClass=o,t.removeClass=i,t.setStyle=s,t.getScrollview=a,t.checkInview=c,t.scrollTop=u,t.getZIndex=l;var d=n(4),p=function(e){return e&&e.__esModule?e:{default:e}}(d),v=p.default.prototype.$isServer,h=/([\:\-\_]+(.))/g,m=/^moz([A-Z])/,w=v?0:Number(document.documentMode),y=1e4,g=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},b=function(e){return e.replace(h,function(e,t,n,r){return r?n.toUpperCase():n}).replace(m,"Moz$1")},C=t.on=function(){return!v&&document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent("on"+t,n)}}(),_=t.off=function(){return!v&&document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent("on"+t,n)}}();t.once=function(e,t,n){C(e,t,function r(){n&&n.apply(this,arguments),_(e,t,r)})},t.getStyle=w<9?function(e,t){if(!v){if(!e||!t)return null;t=b(t),"float"===t&&(t="styleFloat");try{switch(t){case"opacity":try{return e.filters.item("alpha").opacity/100}catch(e){return 1}default:return e.style[t]||e.currentStyle?e.currentStyle[t]:null}}catch(n){return e.style[t]}}}:function(e,t){if(!v){if(!e||!t)return null;t=b(t),"float"===t&&(t="cssFloat");try{var n=document.defaultView.getComputedStyle(e,"");return e.style[t]||n?n[t]:null}catch(n){return e.style[t]}}},t.isIOS=!!(window.navigator&&window.navigator.userAgent||"").match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),t.pageScroll=function(){var e=function(e){e.preventDefault(),e.stopPropagation()},t=!1;return{lock:function(n){t||(t=!0,(n||document).addEventListener("touchmove",e))},unlock:function(n){t=!1,(n||document).removeEventListener("touchmove",e)}}}(),t.isBoolean=function(e){return"boolean"==typeof e},t.isString=function(e){return"string"==typeof e},t.isNumber=function(e){return"number"==typeof e},t.isFunction=function(e){return"function"==typeof e},t.isDate=function(e){return"date"===Object.prototype.toString.call(e).match(/^(\[object )(\w+)\]$/i)[2].toLowerCase()},t.isArray=Array.isArray,t.isObject=function(e){return"object"===(void 0===e?"undefined":f(e))}},82:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Backtop=void 0;var r=n(83),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.Backtop=o.default},83:function(e,t,n){"use strict";function r(e){c||n(84)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(12),i=n.n(o);for(var s in o)"default"!==s&&function(e){n.d(t,e,function(){return o[e]})}(s);var a=n(86),c=!1,u=n(0),l=r,f=u(i.a,a.a,!1,l,"data-v-41a14ace",null);f.options.__file="packages/backtop/src/backtop.vue",t.default=f.exports},84:function(e,t,n){var r=n(85);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(2)("302d730e",r,!1,{})},85:function(e,t,n){t=e.exports=n(1)(!1),t.push([e.i,"\n.wui-backtop[data-v-41a14ace] {\n border: 1px solid #C0C0C0;\n width: 1rem;\n height: 1rem;\n background-color: rgba(255, 255, 255, .85);\n position: fixed;\n border-radius: 50%;\n right: 5%;\n bottom: 5%;\n cursor: pointer;\n}\n",""])},86:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],on:{click:function(t){return t.stopPropagation(),e.backtop(t)}}},[e.$slots.default?e._t("default"):n("div",{staticClass:"wui-backtop"},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22"}},[n("polyline",{attrs:{stroke:"#C0C0C0",fill:"transparent","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",points:"5 14, 11 8, 17 14"}})])])],2)},o=[];r._withStripped=!0;var i={render:r,staticRenderFns:o};t.a=i}});