/**
 * tdesign v0.32.0
 * (c) 2021 tdesign
 * @license MIT
 */

import Vue from 'vue';
import { prefix } from '../../config.js';

var TableColGroup = Vue.extend({
  name: "".concat(prefix, "-table-col-group"),
  props: {
    columns: {
      type: Array,
      "default": function _default() {
        return [];
      }
    }
  },
  methods: {
    renderColgroup: function renderColgroup() {
      var h = this.$createElement;
      var columns = this.columns;
      var colgroup = [];
      columns.forEach(function (column) {
        var width = column.width,
            minWidth = column.minWidth,
            colKey = column.colKey;
        var style = {};

        if (width) {
          style.width = isNaN(width) ? width : "".concat(width, "px");
        }

        if (minWidth) {
          if (!width) {
            style.width = "".concat(minWidth, "px");
          }

          style.minWidth = "".concat(minWidth, "px");
        }

        colgroup.push(h("col", {
          "key": colKey,
          "style": style
        }));
      });
      return colgroup;
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("colgroup", [this.renderColgroup()]);
  }
});

export { TableColGroup as default };
//# sourceMappingURL=col-group.js.map
