UNPKG

w-ui

Version:

A Vue.js 2.0 UI Toolkit for mobile

1 lines 9.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=111)}({0:function(e,t){e.exports=function(e,t,n,r,o,i){var a,c=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(a=e,c=e.default);var u="function"==typeof c?c.options:c;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var d;if(i?(d=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=d):r&&(d=r),d){var l=u.functional,p=l?u.render:u.beforeCreate;l?(u._injectStyles=d,u.render=function(e,t){return d.call(t),p(e,t)}):u.beforeCreate=p?[].concat(p,d):[d]}return{esModule:a,exports:c,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 a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},111:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Checkbox=void 0;var r=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.Checkbox=o.default},112:function(e,t,n){"use strict";function r(e){s||n(113)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),i=n.n(o);for(var a in o)"default"!==a&&function(e){n.d(t,e,function(){return o[e]})}(a);var c=n(115),s=!1,u=n(0),d=r,l=u(i.a,c.a,!1,d,"data-v-d0387074",null);l.options.__file="packages/checkbox/src/checkbox.vue",t.default=l.exports},113:function(e,t,n){var r=n(114);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(2)("8978ba30",r,!1,{})},114:function(e,t,n){t=e.exports=n(1)(!1),t.push([e.i,'\n.wui-checkbox[data-v-d0387074] {\n display: inline-block;\n padding-right: 10px;\n}\n.wui-checkbox > input[type="checkbox"][data-v-d0387074] {\n position: absolute;\n left: -9999em;\n}\n.wui-checkbox > input[type="checkbox"]:checked + .wui-checkbox-icon[data-v-d0387074] {\n background-color: #20a0ff;\n border-color: #20a0ff;\n}\n.wui-checkbox > input[type="checkbox"]:checked + .wui-checkbox-icon > i[data-v-d0387074] {\n -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(1);\n transform: translate(-50%, -50%) rotate(45deg) scale(1);\n -webkit-transition: all 0.2s ease-in-out;\n transition: all 0.2s ease-in-out;\n}\n.wui-checkbox > input[type="checkbox"]:disabled ~ .wui-checkbox-text[data-v-d0387074] {\n color: #CCC;\n}\n.wui-checkbox > input[type="checkbox"]:disabled + .wui-checkbox-icon[data-v-d0387074] {\n border-color: #CCC;\n background-color: #F3F3F3;\n}\n.wui-checkbox > input[type="checkbox"]:disabled + .wui-checkbox-icon > i[data-v-d0387074] {\n border-color: #CCC;\n}\n.wui-checkbox-icon[data-v-d0387074] {\n border: 1px solid #CCC;\n border-radius: 2px;\n display: inline-block;\n position: relative;\n z-index: 10;\n vertical-align: bottom;\n pointer-events: none;\n}\n.wui-checkbox-icon > i[data-v-d0387074] {\n content: \'\';\n position: absolute;\n top: 45%;\n left: 50%;\n border: 2px solid #FFF;\n border-top: 0;\n border-left: 0;\n -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(0);\n transform: translate(-50%, -50%) rotate(45deg) scale(0);\n}\n.wui-checkbox-text[data-v-d0387074] {\n margin-left: 1px;\n font-size: 15px;\n color: #666;\n pointer-events: none;\n}\n.wui-checkbox-circle .wui-checkbox-icon[data-v-d0387074] {\n border-radius: 50%;\n}\n',""])},115:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"wui-checkbox",class:"circle"==e.shape?"wui-checkbox-circle":""},[e.group?[n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],attrs:{type:"checkbox",disabled:e.disabled},domProps:{value:e.val,checked:Array.isArray(e.model)?e._i(e.model,e.val)>-1:e.model},on:{change:[function(t){var n=e.model,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e.val,a=e._i(n,i);r.checked?a<0&&(e.model=n.concat([i])):a>-1&&(e.model=n.slice(0,a).concat(n.slice(a+1)))}else e.model=o},e.changeHandler]}})]:[n("input",{directives:[{name:"model",rawName:"v-model",value:e.checked,expression:"checked"}],attrs:{type:"checkbox",disabled:e.disabled},domProps:{checked:Array.isArray(e.checked)?e._i(e.checked,null)>-1:e.checked},on:{change:[function(t){var n=e.checked,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&(e.checked=n.concat([null])):i>-1&&(e.checked=n.slice(0,i).concat(n.slice(i+1)))}else e.checked=o},e.changeHandler]}})],e._v(" "),n("span",{staticClass:"wui-checkbox-icon",style:e.iconStyles()},[n("i",{style:e.checkIconStyles()})]),e._v(" "),e.$slots.default?[n("span",{staticClass:"wui-checkbox-text"},[e._t("default")],2)]:[n("span",{staticClass:"wui-checkbox-text"},[e._v(e._s(e.val))])]],2)},o=[];r._withStripped=!0;var i={render:r,staticRenderFns:o};t.a=i},17:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"w-checkbox",data:function(){return{model:[],group:!1,checked:this.value}},props:{value:{type:[Boolean,String,Number],default:!1},val:{type:[Boolean,String,Number]},disabled:{type:Boolean,default:!1},color:{default:"#4CD864"},size:{validator:function(e){return/^([1-9]\d*)$/.test(e)},default:20},shape:{validator:function(e){return["square","circle"].indexOf(e)>-1},default:"square"}},methods:{changeHandler:function(){this.disabled||this.$emit("change",this.model)},iconStyles:function(){var e=(this.group?this.$parent.size:this.size)+"px";return{width:e,height:e,color:this.group?this.$parent.color:this.color}},checkIconStyles:function(){var e=this.group?this.$parent.size:this.size;return{width:Math.round(e/3.2)+"px",height:Math.round(e/1.7)+"px"}}},watch:{checked:function(e){this.$emit("input",e)},value:function(e){this.checked=e}},created:function(){this.$parent.color&&(this.group=!0)}}},2:function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],r=d[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 a=[],o=0;o<n.parts.length;o++)a.push(i(n.parts[o]));d[n.id]={id:n.id,refs:1,parts:a}}}}function o(){var e=document.createElement("style");return e.type="text/css",l.appendChild(e),e}function i(e){var t,n,r=document.querySelector("style["+x+'~="'+e.id+'"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(m){var i=f++;r=p||(p=o()),t=a.bind(null,r,i,!1),n=a.bind(null,r,i,!0)}else r=o(),t=c.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 a(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function c(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),b.ssrId&&e.setAttribute(x,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 s="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!s)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),d={},l=s&&(document.head||document.getElementsByTagName("head")[0]),p=null,f=0,h=!1,v=function(){},b=null,x="data-vue-ssr-id",m="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,o){h=n,b=o||{};var i=u(e,t);return r(i),function(t){for(var n=[],o=0;o<i.length;o++){var a=i[o],c=d[a.id];c.refs--,n.push(c)}t?(i=u(e,t),r(i)):i=[];for(var o=0;o<n.length;o++){var c=n[o];if(0===c.refs){for(var s=0;s<c.parts.length;s++)c.parts[s]();delete d[c.id]}}}};var k=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],a=i[0],c=i[1],s=i[2],u=i[3],d={id:e+":"+o,css:c,media:s,sourceMap:u};r[a]?r[a].parts.push(d):n.push(r[a]={id:a,parts:[d]})}return n}}});