import { defineVxeComponent } from '../../ui/src/comp';
import { assembleColumn, destroyColumn } from './util';
import { columnProps, columnWatch } from './column';
import Cell from './cell';
export default {
    name: 'VxeColgroup',
    props: columnProps,
    provide() {
        const $xeColgroup = this;
        return {
            $xeColumn: $xeColgroup,
            $xeGrid: null,
            $xeGantt: null
        };
    },
    inject: {
        $xeTable: {
            default: null
        },
        $xeColumn: {
            default: null
        }
    },
    watch: columnWatch,
    created() {
        const $xeColgroup = this;
        const props = $xeColgroup;
        const $xeTable = this.$xeTable;
        this.columnConfig = Cell.createColumn($xeTable, props);
    },
    mounted() {
        const $xeColgroup = this;
        const { $scopedSlots } = this;
        const columnSlots = {};
        if ($scopedSlots.header) {
            columnSlots.header = $scopedSlots.header;
        }
        if ($scopedSlots.title) {
            columnSlots.title = $scopedSlots.title;
        }
        this.columnConfig.slots = columnSlots;
        assembleColumn($xeColgroup);
    },
    destroyed() {
        const $xeColgroup = this;
        destroyColumn($xeColgroup);
    },
    render(h) {
        return h('div', this.$slots.default);
    },
    methods: Cell
};
