export default {
    name: 'SnFlexItem',
    props: {
        flex: Number,
        width: String
    },
    computed: {
        style: function style() {
            var styles = {};
            var marginName = this.$parent.direction === 'row' ? 'marginLeft' : 'marginTop';
            if (this.$parent.spacing) {
                styles[marginName] = this.$parent.spacing;
            }
            if (this.width) {
                styles['width'] = this.width;
            } else {
                styles['flex'] = 1;
                if (this.flex) {
                    styles['flex'] = '0 0 ' + this.flex * 100 + '%';
                }
            }
            return styles;
        }
    },
    render: function render() {
        var h = arguments[0];

        return h(
            'div',
            { 'class': 'sn-flex-item', style: this.style },
            [this.$slots['default']]
        );
    }
};