h-helper.mjs 803 B

1234567891011121314151617181920212223242526
  1. import { isUndefined } from "../../../utils/types.mjs";
  2. import { h } from "vue";
  3. //#region ../../packages/components/table/src/h-helper.ts
  4. function hColgroup(props) {
  5. const isAuto = props.tableLayout === "auto";
  6. let columns = props.columns || [];
  7. if (isAuto) {
  8. if (columns.every(({ width }) => isUndefined(width))) columns = [];
  9. }
  10. const getPropsData = (column) => {
  11. const propsData = {
  12. key: `${props.tableLayout}_${column.id}`,
  13. style: {},
  14. name: void 0
  15. };
  16. if (isAuto) propsData.style = { width: `${column.width}px` };
  17. else propsData.name = column.id;
  18. return propsData;
  19. };
  20. return h("colgroup", {}, columns.map((column) => h("col", getPropsData(column))));
  21. }
  22. hColgroup.props = ["columns", "tableLayout"];
  23. //#endregion
  24. export { hColgroup };
  25. //# sourceMappingURL=h-helper.mjs.map