import { defineComponent, inject, createVNode } from 'vue';
import { provideKey } from '../const';

var expandTr = defineComponent({
  name: 'FTableExpand',
  props: {
    row: {
      type: Object,
      required: true
    },
    column: {
      type: Object,
      required: true
    },
    rowIndex: Number,
    length: Number
  },
  setup(props) {
    const {
      prefixCls
    } = inject(provideKey);
    return () => {
      var _column$slots;
      const {
        row,
        rowIndex,
        column,
        length
      } = props;
      if (column !== null && column !== void 0 && (_column$slots = column.slots) !== null && _column$slots !== void 0 && _column$slots.default) {
        return createVNode("tr", {
          "class": `${prefixCls}-row`
        }, [createVNode("td", {
          "colspan": length,
          "class": `${prefixCls}-td ${prefixCls}-cell ${prefixCls}-expanded-cell`
        }, [column.slots.default({
          row,
          rowIndex,
          column
        })])]);
      }
      return null;
    };
  }
});

export { expandTr as default };
