Cell.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _vue = require("vue");
  7. function notEmpty(val) {
  8. return val !== undefined && val !== null;
  9. }
  10. const Cell = props => {
  11. const {
  12. itemPrefixCls,
  13. component,
  14. span,
  15. labelStyle,
  16. contentStyle,
  17. bordered,
  18. label,
  19. content,
  20. colon
  21. } = props;
  22. const Component = component;
  23. if (bordered) {
  24. return (0, _vue.createVNode)(Component, {
  25. "class": [{
  26. [`${itemPrefixCls}-item-label`]: notEmpty(label),
  27. [`${itemPrefixCls}-item-content`]: notEmpty(content)
  28. }],
  29. "colSpan": span
  30. }, {
  31. default: () => [notEmpty(label) && (0, _vue.createVNode)("span", {
  32. "style": labelStyle
  33. }, [label]), notEmpty(content) && (0, _vue.createVNode)("span", {
  34. "style": contentStyle
  35. }, [content])]
  36. });
  37. }
  38. return (0, _vue.createVNode)(Component, {
  39. "class": [`${itemPrefixCls}-item`],
  40. "colSpan": span
  41. }, {
  42. default: () => [(0, _vue.createVNode)("div", {
  43. "class": `${itemPrefixCls}-item-container`
  44. }, [(label || label === 0) && (0, _vue.createVNode)("span", {
  45. "class": [`${itemPrefixCls}-item-label`, {
  46. [`${itemPrefixCls}-item-no-colon`]: !colon
  47. }],
  48. "style": labelStyle
  49. }, [label]), (content || content === 0) && (0, _vue.createVNode)("span", {
  50. "class": `${itemPrefixCls}-item-content`,
  51. "style": contentStyle
  52. }, [content])])]
  53. });
  54. };
  55. var _default = exports.default = Cell;