1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
| // Utils
| import { createNamespace } from '../utils';
| import { inherit } from '../utils/functional';
| import { BORDER_TOP } from '../utils/constant'; // Components
|
| import Cell from '../cell';
| import CellGroup from '../cell-group'; // Types
|
| var _createNamespace = createNamespace('panel'),
| createComponent = _createNamespace[0],
| bem = _createNamespace[1];
|
| function Panel(h, props, slots, ctx) {
| var Content = function Content() {
| return [slots.header ? slots.header() : h(Cell, {
| "attrs": {
| "icon": props.icon,
| "label": props.desc,
| "title": props.title,
| "value": props.status,
| "valueClass": bem('header-value')
| },
| "class": bem('header')
| }), h("div", {
| "class": bem('content')
| }, [slots.default && slots.default()]), slots.footer && h("div", {
| "class": [bem('footer'), BORDER_TOP]
| }, [slots.footer()])];
| };
|
| return h(CellGroup, _mergeJSXProps([{
| "class": bem(),
| "scopedSlots": {
| default: Content
| }
| }, inherit(ctx, true)]));
| }
|
| Panel.props = {
| icon: String,
| desc: String,
| title: String,
| status: String
| };
| export default createComponent(Panel);
|
|