<script>
  import Emitter from 'flames-ui/src/mixins/emitter';

  export default {
    name: 'FlCheckboxGroup',

    componentName: 'FlCheckboxGroup',

    mixins: [Emitter],

    inject: {
      flFormItem: {
        default: ''
      }
    },

    props: {
      value: {},
      disabled: Boolean,
      min: Number,
      max: Number,
      size: String,
      fill: String,
      textColor: String
    },

    computed: {
      _flFormItemSize() {
        return (this.flFormItem || {}).flFormItemSize;
      },
      checkboxGroupSize() {
        return this.size || this._flFormItemSize || (this.$ELEMENT || {}).size;
      }
    },

    watch: {
      value(value) {
        this.dispatch('flFormItem', 'el.form.change', [value]);
      }
    }
  };
</script>

<template>
  <div class="fl-checkbox-group" role="group" aria-label="checkbox-group">
    <slot></slot>
  </div>
</template>
