import { ParentMixin } from '../mixins/relation';

export default {
    name: 'SnRadioGroup',

    mixins: [ParentMixin('snRadio')],

    props: {
        value: null,
        disabled: Boolean,
        checkedColor: String,
        iconSize: [Number, String],
        justify: {
            type: String,
            validator: function validator(value) {
                return ['between', 'around'].indexOf(value) > -1;
            }
        }
    },

    watch: {
        value: function value(_value) {
            this.$emit('change', _value);
        }
    },

    render: function render() {
        var h = arguments[0];
        var justify = this.justify,
            $slots = this.$slots;

        return h(
            'div',
            {
                'class': ['sn-radio-group', justify ? 'sn-radio-group-justify-' + justify : '']
            },
            [$slots['default']]
        );
    }
};