Skip to content

Commit

Permalink
Merge branch 'release/0.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamindavid committed Feb 28, 2019
2 parents c0a7fab + 091a348 commit fb6791b
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 10 deletions.
10 changes: 8 additions & 2 deletions dist/craftui.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,13 @@ var __vue_staticRenderFns__$5 = [];
//
//
var script$6 = {
props: ['id', 'checked', 'disabled']
props: ['id', 'checked', 'disabled'],
methods: {
onChange: function onChange($event) {
this.$emit('update:checked', $event.target.checked);
this.$emit('change', $event.target.checked);
}
}
};

/* script */
Expand All @@ -410,7 +416,7 @@ const __vue_script__$6 = script$6;
script$6.__file = "LightswitchInput.vue";

/* template */
var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('label',{staticClass:"lightswitch",class:{disabled: _vm.disabled},attrs:{"for":_vm.id}},[_c('input',{attrs:{"id":_vm.id,"type":"checkbox","disabled":_vm.disabled},domProps:{"checked":_vm.checked},on:{"input":function($event){_vm.$emit('update:checked', $event.target.checked);},"change":function($event){_vm.$emit('change', $event);}}}),_vm._v(" "),_c('div',{staticClass:"slider round"})])])};
var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('label',{staticClass:"lightswitch",class:{disabled: _vm.disabled},attrs:{"for":_vm.id}},[_c('input',{attrs:{"id":_vm.id,"type":"checkbox","disabled":_vm.disabled},domProps:{"checked":_vm.checked},on:{"change":_vm.onChange}}),_vm._v(" "),_c('div',{staticClass:"slider round"})])])};
var __vue_staticRenderFns__$6 = [];

/* style */
Expand Down
10 changes: 8 additions & 2 deletions dist/craftui.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,13 @@ var __vue_staticRenderFns__$5 = [];
//
//
var script$6 = {
props: ['id', 'checked', 'disabled']
props: ['id', 'checked', 'disabled'],
methods: {
onChange: function onChange($event) {
this.$emit('update:checked', $event.target.checked);
this.$emit('change', $event.target.checked);
}
}
};

/* script */
Expand All @@ -406,7 +412,7 @@ const __vue_script__$6 = script$6;
script$6.__file = "LightswitchInput.vue";

/* template */
var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('label',{staticClass:"lightswitch",class:{disabled: _vm.disabled},attrs:{"for":_vm.id}},[_c('input',{attrs:{"id":_vm.id,"type":"checkbox","disabled":_vm.disabled},domProps:{"checked":_vm.checked},on:{"input":function($event){_vm.$emit('update:checked', $event.target.checked);},"change":function($event){_vm.$emit('change', $event);}}}),_vm._v(" "),_c('div',{staticClass:"slider round"})])])};
var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('label',{staticClass:"lightswitch",class:{disabled: _vm.disabled},attrs:{"for":_vm.id}},[_c('input',{attrs:{"id":_vm.id,"type":"checkbox","disabled":_vm.disabled},domProps:{"checked":_vm.checked},on:{"change":_vm.onChange}}),_vm._v(" "),_c('div',{staticClass:"slider round"})])])};
var __vue_staticRenderFns__$6 = [];

/* style */
Expand Down
10 changes: 8 additions & 2 deletions dist/craftui.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,13 @@
//
//
var script$6 = {
props: ['id', 'checked', 'disabled']
props: ['id', 'checked', 'disabled'],
methods: {
onChange: function onChange($event) {
this.$emit('update:checked', $event.target.checked);
this.$emit('change', $event.target.checked);
}
}
};

/* script */
Expand All @@ -408,7 +414,7 @@
script$6.__file = "LightswitchInput.vue";

/* template */
var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('label',{staticClass:"lightswitch",class:{disabled: _vm.disabled},attrs:{"for":_vm.id}},[_c('input',{attrs:{"id":_vm.id,"type":"checkbox","disabled":_vm.disabled},domProps:{"checked":_vm.checked},on:{"input":function($event){_vm.$emit('update:checked', $event.target.checked);},"change":function($event){_vm.$emit('change', $event);}}}),_vm._v(" "),_c('div',{staticClass:"slider round"})])])};
var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('label',{staticClass:"lightswitch",class:{disabled: _vm.disabled},attrs:{"for":_vm.id}},[_c('input',{attrs:{"id":_vm.id,"type":"checkbox","disabled":_vm.disabled},domProps:{"checked":_vm.checked},on:{"change":_vm.onChange}}),_vm._v(" "),_c('div',{staticClass:"slider round"})])])};
var __vue_staticRenderFns__$6 = [];

/* style */
Expand Down
2 changes: 1 addition & 1 deletion dist/craftui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/craftui.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pixelandtonic/craftui",
"version": "0.2.1",
"version": "0.2.2",
"main": "dist/craftui.js",
"unpkg": "dist/craftui.min.js",
"module": "dist/craftui.es.js",
Expand Down
9 changes: 8 additions & 1 deletion src/components/inputs/LightswitchInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<label :for="id" class="lightswitch" :class="{disabled: disabled}">
<input :id="id" type="checkbox" :checked="checked" :disabled="disabled" @input="$emit('update:checked', $event.target.checked)" @change="$emit('change', $event)" />
<input :id="id" type="checkbox" :checked="checked" :disabled="disabled" @change="onChange" />
<div class="slider round"></div>
</label>
</div>
Expand All @@ -12,6 +12,13 @@
props: ['id', 'checked', 'disabled'],
methods: {
onChange($event) {
this.$emit('update:checked', $event.target.checked)
this.$emit('change', $event.target.checked)
},
}
}
</script>

0 comments on commit fb6791b

Please sign in to comment.