index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  2. // Utils
  3. import { createNamespace } from '../utils';
  4. import { inherit } from '../utils/functional';
  5. import { BORDER_TOP_BOTTOM } from '../utils/constant'; // Types
  6. var _createNamespace = createNamespace('cell-group'),
  7. createComponent = _createNamespace[0],
  8. bem = _createNamespace[1];
  9. function CellGroup(h, props, slots, ctx) {
  10. var _ref;
  11. var Group = h("div", _mergeJSXProps([{
  12. "class": [bem({
  13. inset: props.inset
  14. }), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = props.border, _ref)]
  15. }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default()]);
  16. if (props.title || slots.title) {
  17. return h("div", {
  18. "key": ctx.data.key
  19. }, [h("div", {
  20. "class": bem('title', {
  21. inset: props.inset
  22. })
  23. }, [slots.title ? slots.title() : props.title]), Group]);
  24. }
  25. return Group;
  26. }
  27. CellGroup.props = {
  28. title: String,
  29. inset: Boolean,
  30. border: {
  31. type: Boolean,
  32. default: true
  33. }
  34. };
  35. export default createComponent(CellGroup);