UNPKG

w-ui

Version:

A Vue.js 2.0 UI Toolkit for mobile

1 lines 13.2 kB
module.exports=function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},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=71)}({0:function(t,e){t.exports=function(t,e,n,o,i,r){var a,s=t=t||{},c=typeof t.default;"object"!==c&&"function"!==c||(a=t,s=t.default);var u="function"==typeof s?s.options:s;e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),i&&(u._scopeId=i);var l;if(r?(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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=l):o&&(l=o),l){var f=u.functional,d=f?u.render:u.beforeCreate;f?(u._injectStyles=l,u.render=function(t,e){return l.call(e),d(t,e)}):u.beforeCreate=d?[].concat(d,l):[l]}return{esModule:a,exports:s,options:u}}},1:function(t,e,n){"use strict";function o(t,e){var n=t[1]||"",o=t[3];if(!o)return n;if(e&&"function"==typeof btoa){var r=i(o);return[n].concat(o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"})).concat([r]).join("\n")}return[n].join("\n")}function i(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=o(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},i=0;i<this.length;i++){var r=this[i][0];"number"==typeof r&&(o[r]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&o[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},10:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(5);e.default={name:"w-actionsheet",props:{value:{type:Boolean,default:!1},items:{type:Array,require:!0},cancel:String},watch:{value:function(t){t&&this.isIOS&&(0,o.addClass)(this.scrollView,"g-fix-ios-overflow-scrolling-bug"),this.show=t}},methods:{itemClick:function(t){t&&("function"==typeof t.method&&t.method(),!t.stay&&this.close())},close:function(){this.isIOS&&(0,o.removeClass)(this.scrollView,"g-fix-ios-overflow-scrolling-bug"),this.$emit("input",!1)}},destroyed:function(){this.close()},mounted:function(){this.scrollView=(0,o.getScrollview)(this.$el),this.isIOS=!!(window.navigator&&window.navigator.userAgent||"").match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)}}},2:function(t,e,n){function o(t){for(var e=0;e<t.length;e++){var n=t[e],o=l[n.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](n.parts[i]);for(;i<n.parts.length;i++)o.parts.push(r(n.parts[i]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(r(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var t=document.createElement("style");return t.type="text/css",f.appendChild(t),t}function r(t){var e,n,o=document.querySelector("style["+g+'~="'+t.id+'"]');if(o){if(h)return m;o.parentNode.removeChild(o)}if(y){var r=p++;o=d||(d=i()),e=a.bind(null,o,r,!1),n=a.bind(null,o,r,!0)}else o=i(),e=s.bind(null,o),n=function(){o.parentNode.removeChild(o)};return e(t),function(o){if(o){if(o.css===t.css&&o.media===t.media&&o.sourceMap===t.sourceMap)return;e(t=o)}else n()}}function a(t,e,n,o){var i=n?"":o.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var r=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function s(t,e){var n=e.css,o=e.media,i=e.sourceMap;if(o&&t.setAttribute("media",o),v.ssrId&&t.setAttribute(g,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.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,h=!1,m=function(){},v=null,g="data-vue-ssr-id",y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,i){h=n,v=i||{};var r=u(t,e);return o(r),function(e){for(var n=[],i=0;i<r.length;i++){var a=r[i],s=l[a.id];s.refs--,n.push(s)}e?(r=u(t,e),o(r)):r=[];for(var i=0;i<n.length;i++){var s=n[i];if(0===s.refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete l[s.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},3:function(t,e,n){"use strict";t.exports=function(t,e){for(var n=[],o={},i=0;i<e.length;i++){var r=e[i],a=r[0],s=r[1],c=r[2],u=r[3],l={id:t+":"+i,css:s,media:c,sourceMap:u};o[a]?o[a].parts.push(l):n.push(o[a]={id:a,parts:[l]})}return n}},4:function(t,e){t.exports=require("vue")},5:function(t,e,n){"use strict";function o(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 i(t,e){if(t){for(var n=t.className,i=(e||"").split(" "),r=0,a=i.length;r<a;r++){var s=i[r];s&&(t.classList?t.classList.add(s):o(t,s)||(n+=" "+s))}t.classList||(t.className=n)}}function r(t,e){if(t&&e){for(var n=e.split(" "),i=" "+t.className+" ",r=0,a=n.length;r<a;r++){var s=n[r];s&&(t.classList?t.classList.remove(s):o(t,s)&&(i=i.replace(" "+s+" "," ")))}t.classList||(t.className=b(i))}}function a(t,e,n){if(t&&e)if("object"===(void 0===e?"undefined":f(e)))for(var o in e)e.hasOwnProperty(o)&&a(t,o,e[o]);else e=w(e),"opacity"===e&&g<9?t.style.filter=isNaN(n)?"":"alpha(opacity="+100*n+")":t.style[e]=n}function s(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 c(t,e){var n=t==window?document.body.offsetHeight:t.offsetHeight,o=t===window?0:t.getBoundingClientRect().top,i=e.getBoundingClientRect().top-o,r=i+e.offsetHeight;return i>=0&&i<n||r>0&&r<=n}function u(t){function e(n,o,i){if(n!==o){var r=n+i>o?o:n+i;n>o&&(r=n-i<o?o:n-i),t===window?window.scrollTo(r,r):t.scrollTop=r,window.requestAnimationFrame(function(){return e(r,o,i)})}}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments[2],i=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 r=Math.abs(n-o);e(n,o,Math.ceil(r/i*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=o,e.addClass=i,e.removeClass=r,e.setStyle=a,e.getScrollview=s,e.checkInview=c,e.scrollTop=u,e.getZIndex=l;var d=n(4),p=function(t){return t&&t.__esModule?t:{default:t}}(d),h=p.default.prototype.$isServer,m=/([\:\-\_]+(.))/g,v=/^moz([A-Z])/,g=h?0:Number(document.documentMode),y=1e4,b=function(t){return(t||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},w=function(t){return t.replace(m,function(t,e,n,o){return o?n.toUpperCase():n}).replace(v,"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)}}(),x=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 o(){n&&n.apply(this,arguments),x(t,e,o)})},e.getStyle=g<9?function(t,e){if(!h){if(!t||!e)return null;e=w(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=w(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))}},71:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Actionsheet=void 0;var o=n(72),i=function(t){return t&&t.__esModule?t:{default:t}}(o);e.Actionsheet=i.default},72:function(t,e,n){"use strict";function o(t){c||n(73)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),r=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,function(){return i[t]})}(a);var s=n(75),c=!1,u=n(0),l=o,f=u(r.a,s.a,!1,l,"data-v-ba76a0f8",null);f.options.__file="packages/actionsheet/src/actionsheet.vue",e.default=f.exports},73:function(t,e,n){var o=n(74);"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);n(2)("7ab987f4",o,!1,{})},74:function(t,e,n){e=t.exports=n(1)(!1),e.push([t.i,"\n.wui-actionsheet[data-v-ba76a0f8] {\n position: fixed;\n z-index: 998;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n.wui-actionsheet .mask-actionsheet[data-v-ba76a0f8] {\n background-color: rgba(0, 0, 0, .4);\n position: fixed;\n z-index: 999;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -webkit-align-items: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.wui-actionsheet .actionsheet[data-v-ba76a0f8] {\n text-align: center;\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100%;\n z-index: 1000;\n background-color: #EFEFF4;\n -webkit-transition: -webkit-transform .3s;\n transition: -webkit-transform .3s;\n transition: transform .3s;\n transition: transform .3s, -webkit-transform .3s;\n}\n.wui-actionsheet .actionsheet .actionsheet-item[data-v-ba76a0f8] {\n display: block;\n position: relative;\n font-size: .28rem;\n color: #555;\n height: 1rem;\n line-height: 1rem;\n background-color: #FFF;\n}\n.wui-actionsheet .actionsheet .actionsheet-item[data-v-ba76a0f8]:after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n border-bottom: 1px solid #D9D9D9;\n -webkit-transform: scaleY(0.5);\n transform: scaleY(0.5);\n -webkit-transform-origin: 0 0;\n transform-origin: 0 0;\n}\n.wui-actionsheet .actionsheet .actionsheet-action[data-v-ba76a0f8] {\n display: block;\n margin-top: .15rem;\n font-size: .28rem;\n color: #555;\n height: 1rem;\n line-height: 1rem;\n background-color: #fff;\n}\n.wui-actionsheet .actionsheet .actionsheet-active[data-v-ba76a0f8] {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n",""])},75:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.value?n("div",{staticClass:"wui-actionsheet"},[n("div",{staticClass:"mask-actionsheet",on:{click:function(e){return e.stopPropagation(),t.close(e)}}}),t._v(" "),n("div",{staticClass:"actionsheet"},[t._l(t.items,function(e,o){return n("a",{key:"__as__"+o,staticClass:"actionsheet-item",on:{click:function(n){n.stopPropagation(),t.itemClick(e)}}},[t._v(t._s(e.label))])}),t._v(" "),t.cancel?n("a",{staticClass:"actionsheet-action",on:{click:function(e){return e.stopPropagation(),t.close(e)}}},[t._v(t._s(t.cancel))]):t._e()],2)]):t._e()},i=[];o._withStripped=!0;var r={render:o,staticRenderFns:i};e.a=r}});