@antdv-next1/pro-card 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProCard.js +14 -19
- package/dist/components/Statistic/index.d.ts +4 -2
- package/dist/components/StatisticCard/index.d.ts +5 -8
- package/dist/components/StatisticCard/index.js +131 -30
- package/dist/components/StatisticCard/style/index.js +1 -1
- package/dist/pro-card.esm.js +3630 -3436
- package/dist/pro-card.js +27 -27
- package/package.json +1 -1
package/dist/ProCard.js
CHANGED
|
@@ -117,6 +117,7 @@ const ProCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
117
117
|
"xl",
|
|
118
118
|
"xxl"
|
|
119
119
|
].reduce((prev, key) => {
|
|
120
|
+
console.log(key, prev, element.props?.[`col-${key}`], element, "asdas");
|
|
120
121
|
if (element.props?.[`col-${key}`] !== void 0) prev[key] = element.props?.[`col-${key}`];
|
|
121
122
|
return prev;
|
|
122
123
|
}, {});
|
|
@@ -129,15 +130,12 @@ const ProCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
129
130
|
return wrapSSR(createVNode(Fragment, null, [collapsible ? createVNode(Collapse, mergeProps({ "bordered": rest.variant !== "borderless" }, defaultCollapsed ? {} : { activeKey: activeKey.value }, {
|
|
130
131
|
"class": classNames(baseClassName.value, attrs.class, hashId.value),
|
|
131
132
|
"ghost": !ghost
|
|
132
|
-
}), { default: () => [createTextVNode("asdsa")] }) : createVNode(Fragment, null, [rest.variant !== "borderless" && borderBeam && !disabled ? createVNode(BorderBeam, typeof borderBeam === "boolean" ? {} : borderBeam, { default: () => [createVNode(Card, mergeProps(attrs, rest, {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
-
"title": title
|
|
140
|
-
}, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
133
|
+
}), { default: () => [createTextVNode("asdsa")] }) : createVNode(Fragment, null, [rest.variant !== "borderless" && borderBeam && !disabled ? createVNode(BorderBeam, typeof borderBeam === "boolean" ? {} : borderBeam, { default: () => [createVNode(Card, mergeProps(attrs, rest, { "class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
134
|
+
[`${baseClassName.value}-direction-column`]: split === "horizontal" || direction === "column",
|
|
135
|
+
[`${baseClassName.value}-ghost`]: ghost,
|
|
136
|
+
[`${baseClassName.value}-box-shadow`]: boxShadow,
|
|
137
|
+
[`${baseClassName.value}-contain-card`]: containProCard
|
|
138
|
+
}) }, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
141
139
|
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
142
140
|
...rest.styles
|
|
143
141
|
} }), {
|
|
@@ -156,16 +154,13 @@ const ProCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
156
154
|
}, [childrenDom]) : childrenDom],
|
|
157
155
|
...restSlots,
|
|
158
156
|
...slotTitleProps.value
|
|
159
|
-
})] }) : createVNode(Card, mergeProps(attrs, rest, {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}),
|
|
167
|
-
"title": title
|
|
168
|
-
}, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
157
|
+
})] }) : createVNode(Card, mergeProps(attrs, rest, { "class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
158
|
+
[`${baseClassName.value}-direction-column`]: split === "horizontal" || direction === "column",
|
|
159
|
+
[`${baseClassName.value}-ghost`]: ghost,
|
|
160
|
+
[`${baseClassName.value}-disabled`]: disabled,
|
|
161
|
+
[`${baseClassName.value}-box-shadow`]: boxShadow,
|
|
162
|
+
[`${baseClassName.value}-contain-card`]: containProCard
|
|
163
|
+
}) }, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
169
164
|
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
170
165
|
...rest.styles
|
|
171
166
|
} }), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _$vue from "vue";
|
|
2
2
|
import { VNode } from "vue";
|
|
3
3
|
import { VueNode } from "@v-c/util";
|
|
4
|
-
import { BadgeProps, StatisticProps as StatisticProps$1 } from "antdv-next";
|
|
4
|
+
import { BadgeProps, StatisticProps as StatisticProps$1, TooltipProps } from "antdv-next";
|
|
5
5
|
import { CustomSlotsType } from "@v-c/util/dist/type";
|
|
6
6
|
|
|
7
7
|
//#region src/components/Statistic/index.d.ts
|
|
@@ -9,7 +9,9 @@ interface StatisticProps extends StatisticProps$1 {
|
|
|
9
9
|
/** 描述性标签 */
|
|
10
10
|
description?: VueNode;
|
|
11
11
|
/** 标题提示 */
|
|
12
|
-
tooltip?:
|
|
12
|
+
tooltip?: TooltipProps & {
|
|
13
|
+
icon?: VueNode;
|
|
14
|
+
} | VueNode;
|
|
13
15
|
/** 当前项显示的状态 */
|
|
14
16
|
status?: BadgeProps['status'];
|
|
15
17
|
/** Icon 图标 */
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ProCardProps } from "../../ProCard.js";
|
|
2
|
+
import Statistic, { StatisticProps } from "../Statistic/index.js";
|
|
2
3
|
import * as _$vue from "vue";
|
|
3
4
|
import { VNode } from "vue";
|
|
4
5
|
import { VueNode } from "@v-c/util";
|
|
5
|
-
import { BorderBeamProps, CardProps } from "antdv-next";
|
|
6
6
|
import { CustomSlotsType } from "@v-c/util/dist/type";
|
|
7
7
|
|
|
8
8
|
//#region src/components/StatisticCard/index.d.ts
|
|
9
|
-
interface StatisticCardProps extends
|
|
9
|
+
interface StatisticCardProps extends ProCardProps {
|
|
10
10
|
/** 图表配置 */
|
|
11
11
|
chart?: VueNode;
|
|
12
|
-
headerBordered?: boolean;
|
|
13
|
-
/** 边框流光 */
|
|
14
|
-
borderBeam?: BorderBeamProps | boolean;
|
|
15
12
|
/** 数值统计配置 */
|
|
16
|
-
statistic?: StatisticProps
|
|
13
|
+
statistic?: StatisticProps;
|
|
17
14
|
/** Chart 相对于 statistic 的位置 */
|
|
18
15
|
chartPlacement?: 'right' | 'bottom' | 'left';
|
|
19
16
|
/** 底部额外展示区域 */
|
|
@@ -24,7 +21,7 @@ declare const _StatisticCard: _$vue.DefineSetupFnComponent<StatisticCardProps, {
|
|
|
24
21
|
}>, StatisticCardProps & {}, _$vue.PublicProps>;
|
|
25
22
|
declare const StatisticCard: typeof _StatisticCard & {
|
|
26
23
|
isProCard?: boolean;
|
|
27
|
-
Statistic?: typeof Statistic
|
|
24
|
+
Statistic?: typeof Statistic;
|
|
28
25
|
};
|
|
29
26
|
//#endregion
|
|
30
27
|
export { StatisticCardProps, StatisticCard as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ProCard from "../../ProCard.js";
|
|
2
|
+
import Statistic from "../Statistic/index.js";
|
|
2
3
|
import { useStyle } from "./style/index.js";
|
|
3
4
|
import { Fragment, computed, createVNode, defineComponent, mergeProps } from "vue";
|
|
4
5
|
import { classNames } from "@v-c/util";
|
|
5
|
-
import { BorderBeam, Card } from "antdv-next";
|
|
6
6
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
7
7
|
//#region src/components/StatisticCard/index.tsx
|
|
8
8
|
const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
|
|
@@ -11,31 +11,18 @@ const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots })
|
|
|
11
11
|
const baseClassName = computed(() => `${prefixCls.value}-statistic-card`);
|
|
12
12
|
const { wrapSSR, hashId } = useStyle(baseClassName);
|
|
13
13
|
return () => {
|
|
14
|
-
const { statistic, chart,
|
|
15
|
-
const statisticDom = statistic && createVNode(Statistic
|
|
14
|
+
const { statistic, chart, chartPlacement, footer, ...restProps } = props;
|
|
15
|
+
const statisticDom = statistic && createVNode(Statistic, mergeProps({ "layout": "vertical" }, statistic), null);
|
|
16
16
|
const chartDom = chart && createVNode("div", { "class": classNames(`${baseClassName.value}-chart`, hashId.value, {
|
|
17
17
|
[`${baseClassName.value}-chart-left`]: chartPlacement === "left" && chart && statistic,
|
|
18
18
|
[`${baseClassName.value}-chart-right`]: chartPlacement === "right" && chart && statistic
|
|
19
19
|
}) }, [chart]);
|
|
20
20
|
const contentCls = classNames(`${baseClassName.value}-content `, hashId.value, { [`${baseClassName.value}-content-horizontal`]: chartPlacement === "left" || chartPlacement === "right" });
|
|
21
21
|
const contentDom = (chartDom || statisticDom) && (chartPlacement === "left" ? createVNode("div", { "class": contentCls }, [chartDom, statisticDom]) : createVNode("div", { "class": contentCls }, [statisticDom, chartDom]));
|
|
22
|
-
return wrapSSR(createVNode(Fragment, null, [
|
|
22
|
+
return wrapSSR(createVNode(Fragment, null, [createVNode(ProCard, mergeProps({
|
|
23
23
|
"style": attrs.style,
|
|
24
24
|
"class": classNames(baseClassName.value, attrs.class, hashId.value)
|
|
25
|
-
}, restProps, {
|
|
26
|
-
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
27
|
-
...restProps.styles
|
|
28
|
-
} }), { default: () => [
|
|
29
|
-
contentDom,
|
|
30
|
-
slots.default?.(),
|
|
31
|
-
footer && createVNode("div", { "class": classNames(`${baseClassName.value}-footer`, hashId.value) }, [footer])
|
|
32
|
-
] })] }) : createVNode(Card, mergeProps({
|
|
33
|
-
"style": attrs.style,
|
|
34
|
-
"class": classNames(baseClassName.value, attrs.class, hashId.value)
|
|
35
|
-
}, restProps, { "styles": {
|
|
36
|
-
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
37
|
-
...restProps.styles
|
|
38
|
-
} }), { default: () => [
|
|
25
|
+
}, restProps), { default: () => [
|
|
39
26
|
contentDom,
|
|
40
27
|
slots.default?.(),
|
|
41
28
|
footer && createVNode("div", { "class": classNames(`${baseClassName.value}-footer`, hashId.value) }, [footer])
|
|
@@ -56,16 +43,6 @@ const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots })
|
|
|
56
43
|
required: false,
|
|
57
44
|
default: void 0
|
|
58
45
|
},
|
|
59
|
-
headerBordered: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
required: false,
|
|
62
|
-
default: void 0
|
|
63
|
-
},
|
|
64
|
-
borderBeam: {
|
|
65
|
-
type: [Object, Boolean],
|
|
66
|
-
required: false,
|
|
67
|
-
default: void 0
|
|
68
|
-
},
|
|
69
46
|
statistic: {
|
|
70
47
|
type: Object,
|
|
71
48
|
required: false
|
|
@@ -87,6 +64,117 @@ const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots })
|
|
|
87
64
|
required: false,
|
|
88
65
|
default: void 0
|
|
89
66
|
},
|
|
67
|
+
tooltip: {
|
|
68
|
+
type: [
|
|
69
|
+
Object,
|
|
70
|
+
Function,
|
|
71
|
+
String,
|
|
72
|
+
Number,
|
|
73
|
+
null,
|
|
74
|
+
Boolean,
|
|
75
|
+
Array
|
|
76
|
+
],
|
|
77
|
+
required: false,
|
|
78
|
+
default: void 0
|
|
79
|
+
},
|
|
80
|
+
split: {
|
|
81
|
+
type: String,
|
|
82
|
+
required: false
|
|
83
|
+
},
|
|
84
|
+
direction: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
gutter: {
|
|
89
|
+
type: [
|
|
90
|
+
Number,
|
|
91
|
+
null,
|
|
92
|
+
Object,
|
|
93
|
+
Array
|
|
94
|
+
],
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
colStyle: {
|
|
98
|
+
type: Object,
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
borderBeam: {
|
|
102
|
+
type: [Object, Boolean],
|
|
103
|
+
required: false,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
layout: {
|
|
107
|
+
type: String,
|
|
108
|
+
required: false
|
|
109
|
+
},
|
|
110
|
+
boxShadow: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
required: false,
|
|
113
|
+
default: void 0
|
|
114
|
+
},
|
|
115
|
+
disabled: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
required: false,
|
|
118
|
+
default: void 0
|
|
119
|
+
},
|
|
120
|
+
headerBordered: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
required: false,
|
|
123
|
+
default: void 0
|
|
124
|
+
},
|
|
125
|
+
ghost: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
required: false,
|
|
128
|
+
default: void 0
|
|
129
|
+
},
|
|
130
|
+
collapsible: {
|
|
131
|
+
type: [String, Boolean],
|
|
132
|
+
required: false,
|
|
133
|
+
default: void 0
|
|
134
|
+
},
|
|
135
|
+
collapsed: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
required: false,
|
|
138
|
+
default: void 0
|
|
139
|
+
},
|
|
140
|
+
collapsibleIconRender: {
|
|
141
|
+
type: Function,
|
|
142
|
+
required: false
|
|
143
|
+
},
|
|
144
|
+
defaultCollapsed: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
required: false,
|
|
147
|
+
default: void 0
|
|
148
|
+
},
|
|
149
|
+
onCollapse: {
|
|
150
|
+
type: Function,
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
checked: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
required: false,
|
|
156
|
+
default: void 0
|
|
157
|
+
},
|
|
158
|
+
onChecked: {
|
|
159
|
+
type: Function,
|
|
160
|
+
required: false
|
|
161
|
+
},
|
|
162
|
+
colSpan: { required: false },
|
|
163
|
+
colOffset: { required: false },
|
|
164
|
+
colFlex: { required: false },
|
|
165
|
+
colOrder: { required: false },
|
|
166
|
+
colPull: { required: false },
|
|
167
|
+
colPush: { required: false },
|
|
168
|
+
colXs: { required: false },
|
|
169
|
+
colSm: { required: false },
|
|
170
|
+
colMd: { required: false },
|
|
171
|
+
colLg: { required: false },
|
|
172
|
+
colXl: { required: false },
|
|
173
|
+
colXxl: { required: false },
|
|
174
|
+
onClick: {
|
|
175
|
+
type: Function,
|
|
176
|
+
required: false
|
|
177
|
+
},
|
|
90
178
|
title: {
|
|
91
179
|
type: [
|
|
92
180
|
Function,
|
|
@@ -217,12 +305,25 @@ const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots })
|
|
|
217
305
|
"onUpdate:activeTabKey": {
|
|
218
306
|
type: Function,
|
|
219
307
|
required: false
|
|
308
|
+
},
|
|
309
|
+
align: {
|
|
310
|
+
type: [String, Object],
|
|
311
|
+
required: false
|
|
312
|
+
},
|
|
313
|
+
justify: {
|
|
314
|
+
type: [String, Object],
|
|
315
|
+
required: false
|
|
316
|
+
},
|
|
317
|
+
wrap: {
|
|
318
|
+
type: Boolean,
|
|
319
|
+
required: false,
|
|
320
|
+
default: void 0
|
|
220
321
|
}
|
|
221
322
|
},
|
|
222
323
|
name: "StatisticCard",
|
|
223
324
|
inheritAttrs: false
|
|
224
325
|
});
|
|
225
326
|
StatisticCard.isProCard = true;
|
|
226
|
-
StatisticCard.Statistic = Statistic
|
|
327
|
+
StatisticCard.Statistic = Statistic;
|
|
227
328
|
//#endregion
|
|
228
329
|
export { StatisticCard as default };
|