UNPKG

w-ui

Version:

A Vue.js 2.0 UI Toolkit for mobile

1 lines 8.8 kB
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.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=198)}({0:function(e,t){e.exports=function(e,t,n,r,i,o){var s,a=e=e||{},u=typeof e.default;"object"!==u&&"function"!==u||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId=i);var l;if(o?(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(o)},c._ssrRegister=l):r&&(l=r),l){var d=c.functional,f=d?c.render:c.beforeCreate;d?(c._injectStyles=l,c.render=function(e,t){return l.call(t),f(e,t)}):c.beforeCreate=f?[].concat(f,l):[l]}return{esModule:s,exports:a,options:c}}},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 o=i(r);return[n].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([o]).join("\n")}return[n].join("\n")}function i(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={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var s=e[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},198:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Password=void 0;var r=n(199),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.Password=i.default},199:function(e,t,n){"use strict";function r(e){u||n(200)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=n.n(i);for(var s in i)"default"!==s&&function(e){n.d(t,e,function(){return i[e]})}(s);var a=n(202),u=!1,c=n(0),l=r,d=c(o.a,a.a,!1,l,null,null);d.options.__file="packages/password/src/password.vue",t.default=d.exports},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 i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var s=[],i=0;i<n.parts.length;i++)s.push(o(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:s}}}}function i(){var e=document.createElement("style");return e.type="text/css",d.appendChild(e),e}function o(e){var t,n,r=document.querySelector("style["+v+'~="'+e.id+'"]');if(r){if(g)return h;r.parentNode.removeChild(r)}if(b){var o=p++;r=f||(f=i()),t=s.bind(null,r,o,!1),n=s.bind(null,r,o,!0)}else r=i(),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 i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,i);else{var o=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(o,s[t]):e.appendChild(o)}}function a(e,t){var n=t.css,r=t.media,i=t.sourceMap;if(r&&e.setAttribute("media",r),m.ssrId&&e.setAttribute(v,t.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.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={},d=u&&(document.head||document.getElementsByTagName("head")[0]),f=null,p=0,g=!1,h=function(){},m=null,v="data-vue-ssr-id",b="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,i){g=n,m=i||{};var o=c(e,t);return r(o),function(t){for(var n=[],i=0;i<o.length;i++){var s=o[i],a=l[s.id];a.refs--,n.push(a)}t?(o=c(e,t),r(o)):o=[];for(var i=0;i<n.length;i++){var a=n[i];if(0===a.refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete l[a.id]}}}};var x=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},200:function(e,t,n){var r=n(201);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(2)("0151e5e2",r,!1,{})},201:function(e,t,n){t=e.exports=n(1)(!1),t.push([e.i,"\n.wui-password-input {\n display: inline-block;\n height: 1rem;\n line-height: normal;\n border: 1px solid #ccc;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background-color: #fff;\n}\n.num-segment {\n display: inline-block;\n height: 1rem;\n line-height: normal;\n}\n.num-segment input {\n width: 1rem;\n height: 1rem;\n line-height: normal;\n border: none;\n outline: none;\n text-align: center;\n text-indent: 0px;\n margin: 0px;\n padding: 0px;\n background-color: transparent;\n vertical-align: middle;\n}\n.num-segment i {\n display: inline-block;\n width: 0px;\n height: 100%;\n border-right: 1px #d9d9d9 solid;\n vertical-align: middle;\n}\n",""])},202:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"wui-password-input"},e._l(e.segments,function(t,r){return n("div",{staticClass:"num-segment"},[n("input",{staticClass:"num-segment-input",attrs:{type:"password",maxlength:"1"},domProps:{value:t},on:{keydown:function(t){e.onInputKeydown(t,r)},input:function(t){e.onInput(t,r)},blur:function(t){e.onInputBlur()},paste:function(t){e.onPaste(t,r)}}}),e._v(" "),n("i",{directives:[{name:"show",rawName:"v-show",value:r!=e.segments.length-1,expression:"index != segments.length - 1"}]})])}))},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};t.a=o},3:function(e,t,n){"use strict";e.exports=function(e,t){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],s=o[0],a=o[1],u=o[2],c=o[3],l={id:e+":"+i,css:a,media:u,sourceMap:c};r[s]?r[s].parts.push(l):n.push(r[s]={id:s,parts:[l]})}return n}},36:function(e,t,n){"use strict";function r(e){var t,n,r,i,o,s={};return e.setSelectionRange?(s.begin=e.selectionStart,s.end=e.selectionEnd,s.result=e.value.substring(s.begin,s.end)):document.selection&&("input"===e.tagName.toLowerCase()?(t=document.selection.createRange(),n=e.createTextRange(),n.collapse(!0),n.select(),r=document.selection.createRange(),r.setEndPoint("EndToEnd",t),s.begin=r.text.length-t.text.length,s.end=r.text.length,s.result=t.text,t.select()):"textarea"===e.tagName.toLowerCase()&&(i=document.selection.createRange(),o=i.duplicate(),o.moveToElementText(e),o.setEndPoint("EndToEnd",i),s.begin=o.text.length-i.text.length,s.end=o.text.length,s.result=i.text)),e.focus(),s}Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{value:{type:String,required:!0}},data:function(){return{len:6,segments:["","","","","",""]}},watch:{value:function(e){this.syncValue(e)}},methods:{onInputKeydown:function(e,t){var n=e.keyCode||e.which,i=e.target.value;8===n||37===n?(0===i.length||0===r(e.target).end)&&t>0&&this.$el.getElementsByTagName("input")[t-1].focus():39===n&&r(e.target).end===i.length&&t<this.len-1&&this.$el.getElementsByTagName("input")[t+1].focus()},onInput:function(e,t){var n=e.target.value;if(e.target.value=this.segments[t],/^\d+$/.test(n))this.segments.splice(t,1,Number(n));else{if(""!==n)return;this.segments.splice(t,1,"")}1===n.length&&t<this.len-1&&this.$el.getElementsByTagName("input")[t+1].focus()},onInputBlur:function(){},onPaste:function(e,t){var n=this;e.clipboardData.getData("text/plain").split(".").forEach(function(e,r){var i=Number(e);t+r<4&&!isNaN(i)&&i>=0&&i<=255&&n.segments.splice(t+r,1,i)}),e.preventDefault()},syncValue:function(e){var t=this;/^\d+$/.test(e)&&(this.segments=["","","","","",""],e.split("").map(function(e,n){return e=Number(e),t.segments.splice(n,1,e),e}))}},mounted:function(){var e=this;this.syncValue(this.value),this.$watch(function(){return e.segments.join("")},function(t,n){t!==n&&e.$emit("input",t),6===t.length&&e.$emit("finish",t)})}}}});