<script>
export default {
  props: {
    state: {default: ''},
    form: {default: false},
    size: {default: 'md'},
    options: {default: []},
    is_error: {default: false},
    is_disabled: {default: false},
    default_value: {default: () => []},
    additional_class: {default: ''}
  },
  computed: {
    local_value: {
      get: function () {
        return this.value
      },
      set: function (value) {
        this.$emit('input', value)
      }
    },
  },
  methods: {
    updateValue(value) {
      this.$emit('input', (value) ? value : '')
    },
  }
}
</script>
<template>
    <b-form-checkbox-group :class="additional_class" v-model="local_value" :size="size" :disabled="is_disabled">
      <b-form-checkbox v-for="(option, index) in options" :key="index" :value="option.value"
                       :disabled="option.is_disabled" :unchecked-value="(option.unchecked_value) ? option.unchecked_value : false">
        {{ option.text }}
      </b-form-checkbox>
    </b-form-checkbox-group>
</template>
