index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. var _cell = _interopRequireDefault(require("../cell"));
  10. var _cellGroup = _interopRequireDefault(require("../cell-group"));
  11. // Utils
  12. // Components
  13. var _createNamespace = (0, _utils.createNamespace)('panel'),
  14. createComponent = _createNamespace[0],
  15. bem = _createNamespace[1];
  16. function Panel(h, props, slots, ctx) {
  17. var Content = function Content() {
  18. return [slots.header ? slots.header() : h(_cell.default, {
  19. "attrs": {
  20. "icon": props.icon,
  21. "label": props.desc,
  22. "title": props.title,
  23. "value": props.status,
  24. "valueClass": bem('header-value')
  25. },
  26. "class": bem('header')
  27. }), h("div", {
  28. "class": bem('content')
  29. }, [slots.default && slots.default()]), slots.footer && h("div", {
  30. "class": [bem('footer'), _constant.BORDER_TOP]
  31. }, [slots.footer()])];
  32. };
  33. return h(_cellGroup.default, (0, _babelHelperVueJsxMergeProps.default)([{
  34. "class": bem(),
  35. "scopedSlots": {
  36. default: Content
  37. }
  38. }, (0, _functional.inherit)(ctx, true)]));
  39. }
  40. Panel.props = {
  41. icon: String,
  42. desc: String,
  43. title: String,
  44. status: String
  45. };
  46. var _default = createComponent(Panel);
  47. exports.default = _default;