<script>
export default {
  name: "BooleanValue",
  props: {
    id: {
      type: String,
      default: '',
    },
    value: Object
  },
  methods: {
    focus() {
      this.$refs.input.focus();
    }
  },
  computed: {
    inputValue: {
      set(value) {
        this.value.Boolean = !!value;
      },
      get() {
        return this.value.Boolean;
      }
    }
  }
};
</script>

<template>
  <label class="form-switch input-inline">
    <input ref="input" type="checkbox" :id="id" value="true" v-model="inputValue">
    <i class="form-icon"></i>
  </label>
</template>
