vc-checkbox
Advanced tools
Comparing version 0.0.1 to 0.1.0
<h1 align="center">vc-checkbox - @changelog</h1> | ||
## 0.1.0 | ||
`2016-09-01` | ||
- rename `status` to `type` | ||
## 0.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -455,3 +455,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = "<div class=\"vc-checkbox-component\">\n <label \n v-show=\"buttonStyle\"\n :class=\"['btn btn-' + color, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]\"\n @click.prevent=\"toggle\"\n :title=\"title\"\n >\n <input type=\"checkbox\" autocomplete=\"off\"\n v-el:input\n v-show=\"!readonly\"\n :name=\"name\"\n :value=\"value\"\n :checked=\"active\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n />\n <slot>{{ label }}</slot>\n </label>\n <div v-else\n :class=\"['checkbox', color, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]\"\n @click.prevent=\"toggle\"\n >\n <label class=\"open\" :title=\"title\">\n <input type=\"checkbox\" autocomplete=\"off\"\n v-el:input\n :name=\"name\"\n :value=\"value\"\n :checked=\"active\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n />\n <span class=\"icon dropdown-toggle\" :class=\"[active ? 'btn-' + color : '', { 'bg': color === 'default' }]\"></span>\n <span v-if=\"active && color === 'default'\" class=\"icon\"></span>\n <slot>{{ label }}</slot>\n </label>\n </div>\n </div>"; | ||
module.exports = "<div class=\"vc-checkbox-component\">\n <label \n v-show=\"buttonStyle\"\n :class=\"['btn btn-' + typeColor, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]\"\n @click.prevent=\"toggle\"\n :title=\"title\"\n >\n <input type=\"checkbox\" autocomplete=\"off\"\n v-el:input\n v-show=\"!readonly\"\n :name=\"name\"\n :value=\"value\"\n :checked=\"active\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n />\n <slot>{{ label }}</slot>\n </label>\n <div v-else\n :class=\"['checkbox', typetypeColor, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]\"\n @click.prevent=\"toggle\"\n >\n <label class=\"open\" :title=\"title\">\n <input type=\"checkbox\" autocomplete=\"off\"\n v-el:input\n :name=\"name\"\n :value=\"value\"\n :checked=\"active\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n />\n <span class=\"icon dropdown-toggle\" :class=\"[active ? 'btn-' + typeColor : '', { 'bg': typeColor === 'default' }]\"></span>\n <span v-if=\"active && typeColor === 'default'\" class=\"icon\"></span>\n <slot>{{ label }}</slot>\n </label>\n </div>\n </div>"; | ||
@@ -472,3 +472,3 @@ /***/ }, | ||
// v-show="buttonStyle" | ||
// :class="['btn btn-' + color, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]" | ||
// :class="['btn btn-' + typeColor, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]" | ||
// @click.prevent="toggle" | ||
@@ -489,3 +489,3 @@ // :title="title" | ||
// <div v-else | ||
// :class="['checkbox', color, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]" | ||
// :class="['checkbox', typetypeColor, { 'active': checked, 'disabled': disabled, 'readonly': readonly }]" | ||
// @click.prevent="toggle" | ||
@@ -502,4 +502,4 @@ // > | ||
// /> | ||
// <span class="icon dropdown-toggle" :class="[active ? 'btn-' + color : '', { 'bg': color === 'default' }]"></span> | ||
// <span v-if="active && color === 'default'" class="icon"></span> | ||
// <span class="icon dropdown-toggle" :class="[active ? 'btn-' + typeColor : '', { 'bg': typeColor === 'default' }]"></span> | ||
// <span v-if="active && typeColor === 'default'" class="icon"></span> | ||
// <slot>{{ label }}</slot> | ||
@@ -537,3 +537,3 @@ // </label> | ||
}, | ||
status: { | ||
type: { | ||
type: String, | ||
@@ -559,4 +559,4 @@ default: null | ||
}, | ||
color: function color() { | ||
return this.status || this.$parent && this.$parent.status || 'default'; | ||
typeColor: function typeColor() { | ||
return this.type || this.$parent && this.$parent.type || 'default'; | ||
} | ||
@@ -563,0 +563,0 @@ }, |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vcCheckbox=t():e.vcCheckbox=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},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=8)}([,function(e,t,n){n(3),e.exports=n(7),e.exports.__esModule&&(e.exports=e.exports["default"]),("function"==typeof e.exports?e.exports.options:e.exports).template=n(6)},function(e,t){function n(e,t){for(var n=0;n<e.length;n++){var o=e[n],i=d[o.id];if(i){i.refs++;for(var r=0;r<i.parts.length;r++)i.parts[r](o.parts[r]);for(;r<o.parts.length;r++)i.parts.push(l(o.parts[r],t))}else{for(var a=[],r=0;r<o.parts.length;r++)a.push(l(o.parts[r],t));d[o.id]={id:o.id,refs:1,parts:a}}}}function o(e){for(var t=[],n={},o=0;o<e.length;o++){var i=e[o],r=i[0],a=i[1],s=i[2],l=i[3],c={css:a,media:s,sourceMap:l};n[r]?n[r].parts.push(c):t.push(n[r]={id:r,parts:[c]})}return t}function i(e,t){var n=b(),o=x[x.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),x.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=x.indexOf(e);t>=0&&x.splice(t,1)}function a(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function s(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function l(e,t){var n,o,i;if(t.singleton){var l=y++;n=v||(v=a(t)),o=c.bind(null,n,l,!1),i=c.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(t),o=p.bind(null,n),i=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(t),o=u.bind(null,n),i=function(){r(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}function c(e,t,n,o){var i=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=m(t,i);else{var r=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function u(e,t){var n=t.css,o=t.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function p(e,t){var n=t.css,o=t.sourceMap;o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([n],{type:"text/css"}),r=e.href;e.href=URL.createObjectURL(i),r&&URL.revokeObjectURL(r)}var d={},f=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},h=f(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),b=f(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,y=0,x=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},"undefined"==typeof t.singleton&&(t.singleton=h()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var i=o(e);return n(i,t),function(e){for(var r=[],a=0;a<i.length;a++){var s=i[a],l=d[s.id];l.refs--,r.push(l)}if(e){var c=o(e);n(c,t)}for(var a=0;a<r.length;a++){var l=r[a];if(0===l.refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete d[l.id]}}}};var m=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){var o=n(4);"string"==typeof o&&(o=[[e.i,o,""]]);n(2)(o,{});o.locals&&(e.exports=o.locals)},function(e,t,n){t=e.exports=n(5)(),t.push([e.i,".vc-checkbox-component {\n display: inline-block;\n}\n.checkbox {\n position: relative;\n}\n.checkbox > label > input {\n box-sizing: border-box;\n position: absolute;\n z-index: -1;\n padding: 0;\n opacity: 0;\n margin: 0;\n}\n.checkbox > label > .icon {\n position: absolute;\n top: .2rem;\n left: 0;\n display: block;\n width: 1.4rem;\n height: 1.4rem;\n line-height: 1rem;\n text-align: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n border-radius: .35rem;\n background-repeat: no-repeat;\n background-position: center center;\n background-size: 50% 50%;\n}\n.checkbox:not(.active) > label > .icon {\n background-color: #ddd;\n border: 1px solid #bbb;\n}\n.checkbox > label > input:focus ~ .icon {\n outline: 0;\n border: 1px solid #66afe9;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);\n}\n.checkbox.active > label > .icon {\n background-size: 1rem 1rem;\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJtNS43MywwLjUybC0zLjEyNDIyLDMuMzQxNjFsLTEuMzM4OTUsLTEuNDMyMTJsLTEuMjQ5NjksMS4zMzY2NWwyLjU4ODYzLDIuNzY4NzZsNC4zNzM5LC00LjY3ODI2bC0xLjI0OTY5LC0xLjMzNjY1bDAsMGwwLjAwMDAyLDAuMDAwMDF6Ii8+PC9zdmc+);\n}\n.checkbox.active .btn-default {\n -webkit-filter: brightness(75%);\n filter: brightness(75%);\n}\n.checkbox.disabled > label > .icon,\n.checkbox.readonly > label > .icon,\n.btn.readonly {\n filter: alpha(opacity=65);\n box-shadow: none;\n opacity: .65;\n}\nlabel.btn > input[type=checkbox] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n}\n",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.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}},function(e,t){e.exports='<div class="vc-checkbox-component">\n <label \n v-show="buttonStyle"\n :class="[\'btn btn-\' + color, { \'active\': checked, \'disabled\': disabled, \'readonly\': readonly }]"\n @click.prevent="toggle"\n :title="title"\n >\n <input type="checkbox" autocomplete="off"\n v-el:input\n v-show="!readonly"\n :name="name"\n :value="value"\n :checked="active"\n :disabled="disabled"\n :readonly="readonly"\n />\n <slot>{{ label }}</slot>\n </label>\n <div v-else\n :class="[\'checkbox\', color, { \'active\': checked, \'disabled\': disabled, \'readonly\': readonly }]"\n @click.prevent="toggle"\n >\n <label class="open" :title="title">\n <input type="checkbox" autocomplete="off"\n v-el:input\n :name="name"\n :value="value"\n :checked="active"\n :disabled="disabled"\n :readonly="readonly"\n />\n <span class="icon dropdown-toggle" :class="[active ? \'btn-\' + color : \'\', { \'bg\': color === \'default\' }]"></span>\n <span v-if="active && color === \'default\'" class="icon"></span>\n <slot>{{ label }}</slot>\n </label>\n </div>\n </div>'},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={props:{name:{type:String,"default":null},label:[String,Number],value:{"default":!0},checked:{twoWay:!0},button:{type:Boolean,"default":!1},disabled:{type:Boolean,"default":!1},readonly:{type:Boolean,"default":!1},status:{type:String,"default":null}},data:function(){return{title:""}},computed:{active:function(){return"boolean"!=typeof this.value&&this.group?~this.$parent.value.indexOf(this.value):this.checked===this.value},buttonStyle:function(){return this.button||this.group&&this.$parent.buttons},group:function(){return this.$parent&&this.$parent._checkboxGroup},color:function(){return this.status||this.$parent&&this.$parent.status||"default"}},watch:{checked:function(e){"boolean"!=typeof this.value&&this.group&&(this.checked&&!~this.$parent.value.indexOf(this.value)&&this.$parent.value.push(this.value),!this.checked&&~this.$parent.value.indexOf(this.value)&&this.$parent.value.$remove(this.value))}},created:function(){if("boolean"!=typeof this.value){var e=this.$parent;e&&e._btnGroup&&!e._radioGroup&&(e._checkboxGroup=!0,e.value instanceof Array||(e.value=[]))}},ready:function(){this.setTitleAttr(),this.$parent._checkboxGroup&&"boolean"!=typeof this.value&&(this.$parent.value.length?this.checked=~this.$parent.value.indexOf(this.value):this.checked&&this.$parent.value.push(this.value))},methods:{setTitleAttr:function(){try{this.title=this._slotContents["default"].textContent.trim()||this.label}catch(e){this.label&&""!==this.label&&(this.title=this.label)}},eval:function(){"boolean"!=typeof this.value&&this.group&&(this.checked=~this.$parent.value.indexOf(this.value))},focus:function(){this.$els.input.focus()},toggle:function(){if(!this.disabled&&(this.focus(),!this.readonly&&(this.checked=this.checked?null:this.value,this.group&&"boolean"!=typeof this.value))){var e=this.$parent.value.indexOf(this.value);this.$parent.value[~e?"$remove":"push"](this.value)}return!1}}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=o(i);e.exports=r["default"]}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vcCheckbox=t():e.vcCheckbox=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},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=8)}([,function(e,t,n){n(3),e.exports=n(7),e.exports.__esModule&&(e.exports=e.exports["default"]),("function"==typeof e.exports?e.exports.options:e.exports).template=n(6)},function(e,t){function n(e,t){for(var n=0;n<e.length;n++){var o=e[n],i=d[o.id];if(i){i.refs++;for(var r=0;r<i.parts.length;r++)i.parts[r](o.parts[r]);for(;r<o.parts.length;r++)i.parts.push(l(o.parts[r],t))}else{for(var a=[],r=0;r<o.parts.length;r++)a.push(l(o.parts[r],t));d[o.id]={id:o.id,refs:1,parts:a}}}}function o(e){for(var t=[],n={},o=0;o<e.length;o++){var i=e[o],r=i[0],a=i[1],s=i[2],l=i[3],u={css:a,media:s,sourceMap:l};n[r]?n[r].parts.push(u):t.push(n[r]={id:r,parts:[u]})}return t}function i(e,t){var n=b(),o=x[x.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),x.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=x.indexOf(e);t>=0&&x.splice(t,1)}function a(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function s(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function l(e,t){var n,o,i;if(t.singleton){var l=y++;n=v||(v=a(t)),o=u.bind(null,n,l,!1),i=u.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(t),o=p.bind(null,n),i=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(t),o=c.bind(null,n),i=function(){r(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}function u(e,t,n,o){var i=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=m(t,i);else{var r=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function c(e,t){var n=t.css,o=t.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function p(e,t){var n=t.css,o=t.sourceMap;o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([n],{type:"text/css"}),r=e.href;e.href=URL.createObjectURL(i),r&&URL.revokeObjectURL(r)}var d={},f=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},h=f(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),b=f(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,y=0,x=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},"undefined"==typeof t.singleton&&(t.singleton=h()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var i=o(e);return n(i,t),function(e){for(var r=[],a=0;a<i.length;a++){var s=i[a],l=d[s.id];l.refs--,r.push(l)}if(e){var u=o(e);n(u,t)}for(var a=0;a<r.length;a++){var l=r[a];if(0===l.refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete d[l.id]}}}};var m=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){var o=n(4);"string"==typeof o&&(o=[[e.i,o,""]]);n(2)(o,{});o.locals&&(e.exports=o.locals)},function(e,t,n){t=e.exports=n(5)(),t.push([e.i,".vc-checkbox-component {\n display: inline-block;\n}\n.checkbox {\n position: relative;\n}\n.checkbox > label > input {\n box-sizing: border-box;\n position: absolute;\n z-index: -1;\n padding: 0;\n opacity: 0;\n margin: 0;\n}\n.checkbox > label > .icon {\n position: absolute;\n top: .2rem;\n left: 0;\n display: block;\n width: 1.4rem;\n height: 1.4rem;\n line-height: 1rem;\n text-align: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n border-radius: .35rem;\n background-repeat: no-repeat;\n background-position: center center;\n background-size: 50% 50%;\n}\n.checkbox:not(.active) > label > .icon {\n background-color: #ddd;\n border: 1px solid #bbb;\n}\n.checkbox > label > input:focus ~ .icon {\n outline: 0;\n border: 1px solid #66afe9;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);\n}\n.checkbox.active > label > .icon {\n background-size: 1rem 1rem;\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJtNS43MywwLjUybC0zLjEyNDIyLDMuMzQxNjFsLTEuMzM4OTUsLTEuNDMyMTJsLTEuMjQ5NjksMS4zMzY2NWwyLjU4ODYzLDIuNzY4NzZsNC4zNzM5LC00LjY3ODI2bC0xLjI0OTY5LC0xLjMzNjY1bDAsMGwwLjAwMDAyLDAuMDAwMDF6Ii8+PC9zdmc+);\n}\n.checkbox.active .btn-default {\n -webkit-filter: brightness(75%);\n filter: brightness(75%);\n}\n.checkbox.disabled > label > .icon,\n.checkbox.readonly > label > .icon,\n.btn.readonly {\n filter: alpha(opacity=65);\n box-shadow: none;\n opacity: .65;\n}\nlabel.btn > input[type=checkbox] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n}\n",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.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}},function(e,t){e.exports='<div class="vc-checkbox-component">\n <label \n v-show="buttonStyle"\n :class="[\'btn btn-\' + typeColor, { \'active\': checked, \'disabled\': disabled, \'readonly\': readonly }]"\n @click.prevent="toggle"\n :title="title"\n >\n <input type="checkbox" autocomplete="off"\n v-el:input\n v-show="!readonly"\n :name="name"\n :value="value"\n :checked="active"\n :disabled="disabled"\n :readonly="readonly"\n />\n <slot>{{ label }}</slot>\n </label>\n <div v-else\n :class="[\'checkbox\', typetypeColor, { \'active\': checked, \'disabled\': disabled, \'readonly\': readonly }]"\n @click.prevent="toggle"\n >\n <label class="open" :title="title">\n <input type="checkbox" autocomplete="off"\n v-el:input\n :name="name"\n :value="value"\n :checked="active"\n :disabled="disabled"\n :readonly="readonly"\n />\n <span class="icon dropdown-toggle" :class="[active ? \'btn-\' + typeColor : \'\', { \'bg\': typeColor === \'default\' }]"></span>\n <span v-if="active && typeColor === \'default\'" class="icon"></span>\n <slot>{{ label }}</slot>\n </label>\n </div>\n </div>'},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={props:{name:{type:String,"default":null},label:[String,Number],value:{"default":!0},checked:{twoWay:!0},button:{type:Boolean,"default":!1},disabled:{type:Boolean,"default":!1},readonly:{type:Boolean,"default":!1},type:{type:String,"default":null}},data:function(){return{title:""}},computed:{active:function(){return"boolean"!=typeof this.value&&this.group?~this.$parent.value.indexOf(this.value):this.checked===this.value},buttonStyle:function(){return this.button||this.group&&this.$parent.buttons},group:function(){return this.$parent&&this.$parent._checkboxGroup},typeColor:function(){return this.type||this.$parent&&this.$parent.type||"default"}},watch:{checked:function(e){"boolean"!=typeof this.value&&this.group&&(this.checked&&!~this.$parent.value.indexOf(this.value)&&this.$parent.value.push(this.value),!this.checked&&~this.$parent.value.indexOf(this.value)&&this.$parent.value.$remove(this.value))}},created:function(){if("boolean"!=typeof this.value){var e=this.$parent;e&&e._btnGroup&&!e._radioGroup&&(e._checkboxGroup=!0,e.value instanceof Array||(e.value=[]))}},ready:function(){this.setTitleAttr(),this.$parent._checkboxGroup&&"boolean"!=typeof this.value&&(this.$parent.value.length?this.checked=~this.$parent.value.indexOf(this.value):this.checked&&this.$parent.value.push(this.value))},methods:{setTitleAttr:function(){try{this.title=this._slotContents["default"].textContent.trim()||this.label}catch(e){this.label&&""!==this.label&&(this.title=this.label)}},eval:function(){"boolean"!=typeof this.value&&this.group&&(this.checked=~this.$parent.value.indexOf(this.value))},focus:function(){this.$els.input.focus()},toggle:function(){if(!this.disabled&&(this.focus(),!this.readonly&&(this.checked=this.checked?null:this.value,this.group&&"boolean"!=typeof this.value))){var e=this.$parent.value.indexOf(this.value);this.$parent.value[~e?"$remove":"push"](this.value)}return!1}}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),r=o(i);e.exports=r["default"]}])}); |
{ | ||
"author": "indexxuan@gmail.com", | ||
"name": "vc-checkbox", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "native checkbox component based on vue.js & bootstrap", | ||
@@ -6,0 +6,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
81239