import { createVNode } from 'vue';
import { INTERNAL_COL_DEFINE } from './utils/legacyUtil.mjs';

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[INTERNAL_COL_DEFINE];
    if (width || additionalProps || mustInsert) {
      const {
        columnType,
        ...restAdditionalProps
      } = additionalProps || {};
      cols.unshift(createVNode("col", {
        "key": i,
        "style": {
          width: typeof width === "number" ? `${width}px` : width
        },
        ...restAdditionalProps
      }, null));
      mustInsert = true;
    }
  }
  return createVNode("colgroup", null, [cols]);
}

export { ColGroup as default };
//# sourceMappingURL=ColGroup.mjs.map
