'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var legacyUtil = require('./utils/legacyUtil.cjs');

function ColGroup({
  colWidths,
  columns,
  columCount
}) {
  const cols = [];
  const len = columCount || columns.length;
  let mustInsert = false;
  for (let i = len - 1; i >= 0; i -= 1) {
    const width = colWidths[i];
    const column = columns && columns[i];
    const additionalProps = column && column[legacyUtil.INTERNAL_COL_DEFINE];
    if (width || additionalProps || mustInsert) {
      const {
        columnType,
        ...restAdditionalProps
      } = additionalProps || {};
      cols.unshift(vue.createVNode("col", {
        "key": i,
        "style": {
          width: typeof width === "number" ? `${width}px` : width
        },
        ...restAdditionalProps
      }, null));
      mustInsert = true;
    }
  }
  return vue.createVNode("colgroup", null, [cols]);
}

exports.default = ColGroup;
//# sourceMappingURL=ColGroup.cjs.map
