3362d17d03a29f6579f72c8a78953d36b44fc9a88de413e98cc408785687cb0fcc2d969011cef8226385edcc67065f8751261b5a6b0326a49c3dfbb180f08d 908 B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var types = require('../../../utils/types.js');
  5. function hColgroup(props) {
  6. const isAuto = props.tableLayout === "auto";
  7. let columns = props.columns || [];
  8. if (isAuto) {
  9. if (columns.every(({ width }) => types.isUndefined(width))) {
  10. columns = [];
  11. }
  12. }
  13. const getPropsData = (column) => {
  14. const propsData = {
  15. key: `${props.tableLayout}_${column.id}`,
  16. style: {},
  17. name: void 0
  18. };
  19. if (isAuto) {
  20. propsData.style = {
  21. width: `${column.width}px`
  22. };
  23. } else {
  24. propsData.name = column.id;
  25. }
  26. return propsData;
  27. };
  28. return vue.h("colgroup", {}, columns.map((column) => vue.h("col", getPropsData(column))));
  29. }
  30. hColgroup.props = ["columns", "tableLayout"];
  31. exports.hColgroup = hColgroup;
  32. //# sourceMappingURL=h-helper.js.map