index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. exports.__esModule = true;
  4. exports.default = void 0;
  5. var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
  6. var _utils = require("../utils");
  7. var _functional = require("../utils/functional");
  8. var _constant = require("../utils/constant");
  9. // Utils
  10. var _createNamespace = (0, _utils.createNamespace)('cell-group'),
  11. createComponent = _createNamespace[0],
  12. bem = _createNamespace[1];
  13. function CellGroup(h, props, slots, ctx) {
  14. var _ref;
  15. var Group = h("div", (0, _babelHelperVueJsxMergeProps.default)([{
  16. "class": [bem({
  17. inset: props.inset
  18. }), (_ref = {}, _ref[_constant.BORDER_TOP_BOTTOM] = props.border, _ref)]
  19. }, (0, _functional.inherit)(ctx, true)]), [slots.default == null ? void 0 : slots.default()]);
  20. if (props.title || slots.title) {
  21. return h("div", {
  22. "key": ctx.data.key
  23. }, [h("div", {
  24. "class": bem('title', {
  25. inset: props.inset
  26. })
  27. }, [slots.title ? slots.title() : props.title]), Group]);
  28. }
  29. return Group;
  30. }
  31. CellGroup.props = {
  32. title: String,
  33. inset: Boolean,
  34. border: {
  35. type: Boolean,
  36. default: true
  37. }
  38. };
  39. var _default = createComponent(CellGroup);
  40. exports.default = _default;