@antdv-next1/pro-card 2.0.8 → 2.0.10
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/Card.d.ts +54 -0
- package/dist/Card.js +443 -0
- package/dist/ProCard.d.ts +64 -54
- package/dist/ProCard.js +115 -289
- package/dist/components/CheckCard/CheckCard.d.ts +7 -6
- package/dist/components/CheckCard/CheckCard.js +24 -24
- package/dist/components/CheckCard/Group.js +2 -2
- package/dist/components/CheckCard/index.d.ts +2 -2
- package/dist/components/CheckCard/style/index.js +24 -12
- package/dist/components/Statistic/index.d.ts +18 -14
- package/dist/components/Statistic/index.js +48 -48
- package/dist/components/StatisticCard/index.d.ts +52 -12
- package/dist/components/StatisticCard/index.js +133 -133
- package/dist/index.d.ts +2 -2
- package/dist/pro-card.esm.js +17945 -21780
- package/dist/pro-card.js +79 -79
- package/package.json +3 -3
package/dist/ProCard.js
CHANGED
|
@@ -1,296 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { InfoCircleOutlined } from "@antdv-next/icons";
|
|
5
|
-
import { classNames } from "@v-c/util";
|
|
6
|
-
import { BorderBeam, Card, Col, Collapse, Row, Tooltip, useBreakpoint } from "antdv-next";
|
|
7
|
-
import { responsiveArray } from "antdv-next/dist/_util/responsiveObserver";
|
|
8
|
-
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
1
|
+
import InternalProCard from "./Card.js";
|
|
2
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
3
|
+
import ProConfigProvider from "@antdv-next1/pro-provider";
|
|
9
4
|
//#region src/ProCard.tsx
|
|
10
|
-
function _isSlot(s) {
|
|
11
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
12
|
-
}
|
|
13
5
|
const ProCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
14
|
-
|
|
15
|
-
const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
|
|
16
|
-
const baseClassName = computed(() => `${prefixCls.value}-card`);
|
|
17
|
-
const { wrapSSR, hashId } = useStyle(baseClassName);
|
|
18
|
-
const activeKey = ref();
|
|
19
|
-
const screens = useBreakpoint();
|
|
20
|
-
/**
|
|
21
|
-
* 根据响应式获取 gutter, 参考 antd 实现
|
|
22
|
-
* @param gut
|
|
23
|
-
*/
|
|
24
|
-
const getNormalizedGutter = (gut) => {
|
|
25
|
-
const results = [0, 0];
|
|
26
|
-
(Array.isArray(gut) ? gut : [gut, 0]).forEach((g, index) => {
|
|
27
|
-
if (typeof g === "object") for (let i = 0; i < responsiveArray.length; i += 1) {
|
|
28
|
-
const breakpoint = responsiveArray[i];
|
|
29
|
-
if (screens.value?.[breakpoint] && g[breakpoint] !== void 0) {
|
|
30
|
-
results[index] = g[breakpoint];
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
else results[index] = g || 0;
|
|
35
|
-
});
|
|
36
|
-
return results;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* 根据条件返回 style.ts,负责返回空对象
|
|
40
|
-
*
|
|
41
|
-
* @param withStyle 是否符合条件
|
|
42
|
-
* @param appendStyle 如果符合条件要返回的 style.ts 属性
|
|
43
|
-
*/
|
|
44
|
-
const getStyle = (withStyle, appendStyle) => {
|
|
45
|
-
return withStyle ? appendStyle : {};
|
|
46
|
-
};
|
|
47
|
-
watch(() => props.defaultCollapsed, (next) => {
|
|
48
|
-
if (!next) activeKey.value = ["collapseCard"];
|
|
49
|
-
}, { immediate: true });
|
|
50
|
-
let containProCard = false;
|
|
51
|
-
const slotTitleProps = computed(() => {
|
|
52
|
-
if (props.title && props.tooltip || slots.title && props.tooltip) return { title: () => createVNode(Fragment, null, [props.title || slots.title?.(), createVNode(Tooltip, null, {
|
|
53
|
-
default: () => [createVNode(InfoCircleOutlined, { "style": {
|
|
54
|
-
marginInlineStart: "4px",
|
|
55
|
-
cursor: "pointer"
|
|
56
|
-
} }, null)],
|
|
57
|
-
title: () => props.tooltip
|
|
58
|
-
})]) };
|
|
59
|
-
if (slots.title && !props.tooltip) return { title: slots.title };
|
|
60
|
-
return {};
|
|
61
|
-
});
|
|
62
|
-
return () => {
|
|
63
|
-
const { ghost, direction, boxShadow, colSpan, split, align, borderBeam, colStyle, headerBordered = false, collapsible = false, collapsibleIconRender, collapsed: controlCollapsed, defaultCollapsed = false, onChecked, checked, onCollapse, justify, colLg, colFlex, colMd, colXl, colXxl, colSm, colPush, colPull, colXs, disabled, gutter = 0, title, tooltip, ...rest } = props;
|
|
64
|
-
const [horizontalGutter, verticalGutter] = getNormalizedGutter(gutter);
|
|
65
|
-
const { default: children, title: slotTitle, ...restSlots } = slots;
|
|
66
|
-
const childrenDom = childrenToArray(children?.())?.map((element) => {
|
|
67
|
-
if (isVNode(element) && !isSpecialNode(element)) {
|
|
68
|
-
if (element.props && element.type.isProCard && direction === "column") {
|
|
69
|
-
const colBreakpointKeyList = [
|
|
70
|
-
"span",
|
|
71
|
-
"flex",
|
|
72
|
-
"offset",
|
|
73
|
-
"order",
|
|
74
|
-
"pull",
|
|
75
|
-
"push",
|
|
76
|
-
"xs",
|
|
77
|
-
"sm",
|
|
78
|
-
"md",
|
|
79
|
-
"lg",
|
|
80
|
-
"xl",
|
|
81
|
-
"xxl"
|
|
82
|
-
];
|
|
83
|
-
const colPropsClass = Object.entries(element.props).reduce((prev, [key, value]) => {
|
|
84
|
-
const keys = key.split("-");
|
|
85
|
-
if (colBreakpointKeyList.includes(keys[keys.length - 1])) if (["span", "flex"].includes(keys[keys.length - 1])) prev[`${baseClassName.value}-${keys[keys.length - 2]}-${value}`] = true;
|
|
86
|
-
else prev[`${baseClassName.value}-${key}-${value}`] = true;
|
|
87
|
-
return prev;
|
|
88
|
-
}, {});
|
|
89
|
-
containProCard = true;
|
|
90
|
-
return createVNode("div", {
|
|
91
|
-
"style": {
|
|
92
|
-
...getStyle(horizontalGutter > 0, {
|
|
93
|
-
paddingInlineEnd: `${horizontalGutter / 2}px`,
|
|
94
|
-
paddingInlineStart: `${horizontalGutter / 2}px`
|
|
95
|
-
}),
|
|
96
|
-
...getStyle(verticalGutter > 0, {
|
|
97
|
-
paddingBlockStart: `${verticalGutter / 2}px`,
|
|
98
|
-
paddingBlockEnd: `${verticalGutter / 2}px`
|
|
99
|
-
})
|
|
100
|
-
},
|
|
101
|
-
"class": classNames([`${baseClassName.value}-col`], colPropsClass)
|
|
102
|
-
}, [element]);
|
|
103
|
-
}
|
|
104
|
-
if (element.type.isProCard) {
|
|
105
|
-
containProCard = true;
|
|
106
|
-
return createVNode(Col, [
|
|
107
|
-
"span",
|
|
108
|
-
"flex",
|
|
109
|
-
"offset",
|
|
110
|
-
"order",
|
|
111
|
-
"pull",
|
|
112
|
-
"push",
|
|
113
|
-
"xs",
|
|
114
|
-
"sm",
|
|
115
|
-
"md",
|
|
116
|
-
"lg",
|
|
117
|
-
"xl",
|
|
118
|
-
"xxl"
|
|
119
|
-
].reduce((prev, key) => {
|
|
120
|
-
if (element.props?.[`col-${key}`] !== void 0) prev[key] = element.props?.[`col-${key}`];
|
|
121
|
-
return prev;
|
|
122
|
-
}, {}), _isSlot(element) ? element : { default: () => [element] });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return element;
|
|
126
|
-
});
|
|
127
|
-
return wrapSSR(createVNode(Fragment, null, [collapsible ? createVNode(Collapse, mergeProps({ "bordered": rest.variant !== "borderless" }, defaultCollapsed ? {} : { activeKey: activeKey.value }, {
|
|
128
|
-
"class": classNames(baseClassName.value, attrs.class, hashId.value),
|
|
129
|
-
"ghost": !ghost
|
|
130
|
-
}), { 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, {
|
|
131
|
-
[`${baseClassName.value}-direction-column`]: split === "horizontal" || direction === "column",
|
|
132
|
-
[`${baseClassName.value}-ghost`]: ghost,
|
|
133
|
-
[`${baseClassName.value}-box-shadow`]: boxShadow,
|
|
134
|
-
[`${baseClassName.value}-contain-card`]: containProCard
|
|
135
|
-
}) }, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
136
|
-
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
137
|
-
...rest.styles
|
|
138
|
-
} }), {
|
|
139
|
-
default: () => [direction !== "column" && containProCard ? createVNode(Row, { "gutter": gutter }, _isSlot(childrenDom) ? childrenDom : { default: () => [childrenDom] }) : ghost && containProCard ? createVNode("div", {
|
|
140
|
-
"class": `${baseClassName.value}-column`,
|
|
141
|
-
"style": {
|
|
142
|
-
...getStyle(horizontalGutter > 0, {
|
|
143
|
-
marginInlineEnd: `-${horizontalGutter / 2}px`,
|
|
144
|
-
marginInlineStart: `-${horizontalGutter / 2}px`
|
|
145
|
-
}),
|
|
146
|
-
...getStyle(verticalGutter > 0, {
|
|
147
|
-
marginBlockStart: `-${verticalGutter / 2}px`,
|
|
148
|
-
marginBlockEnd: `-${verticalGutter / 2}px`
|
|
149
|
-
})
|
|
150
|
-
}
|
|
151
|
-
}, [childrenDom]) : childrenDom],
|
|
152
|
-
...restSlots,
|
|
153
|
-
...slotTitleProps.value
|
|
154
|
-
})] }) : createVNode(Card, mergeProps(attrs, rest, { "class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
155
|
-
[`${baseClassName.value}-direction-column`]: split === "horizontal" || direction === "column",
|
|
156
|
-
[`${baseClassName.value}-ghost`]: ghost,
|
|
157
|
-
[`${baseClassName.value}-disabled`]: disabled,
|
|
158
|
-
[`${baseClassName.value}-box-shadow`]: boxShadow,
|
|
159
|
-
[`${baseClassName.value}-contain-card`]: containProCard
|
|
160
|
-
}) }, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
161
|
-
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
162
|
-
...rest.styles
|
|
163
|
-
} }), {
|
|
164
|
-
default: () => [direction !== "column" && containProCard ? createVNode(Row, { "gutter": gutter }, _isSlot(childrenDom) ? childrenDom : { default: () => [childrenDom] }) : ghost && containProCard ? createVNode("div", {
|
|
165
|
-
"class": `${baseClassName.value}-column`,
|
|
166
|
-
"style": {
|
|
167
|
-
...getStyle(horizontalGutter > 0, {
|
|
168
|
-
marginInlineEnd: `-${horizontalGutter / 2}px`,
|
|
169
|
-
marginInlineStart: `-${horizontalGutter / 2}px`
|
|
170
|
-
}),
|
|
171
|
-
...getStyle(verticalGutter > 0, {
|
|
172
|
-
marginBlockStart: `-${verticalGutter / 2}px`,
|
|
173
|
-
marginBlockEnd: `-${verticalGutter / 2}px`
|
|
174
|
-
})
|
|
175
|
-
}
|
|
176
|
-
}, [childrenDom]) : childrenDom],
|
|
177
|
-
...restSlots,
|
|
178
|
-
...slotTitleProps.value
|
|
179
|
-
})])]));
|
|
180
|
-
};
|
|
6
|
+
return () => createVNode(ProConfigProvider, { "needDeps": true }, { default: () => [createVNode(InternalProCard, mergeProps(attrs, props), slots)] });
|
|
181
7
|
}, {
|
|
182
8
|
props: {
|
|
183
|
-
tooltip: {
|
|
184
|
-
type: [
|
|
185
|
-
Object,
|
|
186
|
-
Function,
|
|
187
|
-
String,
|
|
188
|
-
Number,
|
|
189
|
-
null,
|
|
190
|
-
Boolean,
|
|
191
|
-
Array
|
|
192
|
-
],
|
|
193
|
-
required: false,
|
|
194
|
-
default: void 0
|
|
195
|
-
},
|
|
196
|
-
split: {
|
|
197
|
-
type: String,
|
|
198
|
-
required: false
|
|
199
|
-
},
|
|
200
|
-
direction: {
|
|
201
|
-
type: String,
|
|
202
|
-
required: false
|
|
203
|
-
},
|
|
204
|
-
gutter: {
|
|
205
|
-
type: [
|
|
206
|
-
Number,
|
|
207
|
-
null,
|
|
208
|
-
Object,
|
|
209
|
-
Array
|
|
210
|
-
],
|
|
211
|
-
required: false
|
|
212
|
-
},
|
|
213
|
-
colStyle: {
|
|
214
|
-
type: Object,
|
|
215
|
-
required: false
|
|
216
|
-
},
|
|
217
|
-
borderBeam: {
|
|
218
|
-
type: [Object, Boolean],
|
|
219
|
-
required: false,
|
|
220
|
-
default: void 0
|
|
221
|
-
},
|
|
222
|
-
layout: {
|
|
223
|
-
type: String,
|
|
224
|
-
required: false
|
|
225
|
-
},
|
|
226
|
-
boxShadow: {
|
|
227
|
-
type: Boolean,
|
|
228
|
-
required: false,
|
|
229
|
-
default: void 0
|
|
230
|
-
},
|
|
231
|
-
disabled: {
|
|
232
|
-
type: Boolean,
|
|
233
|
-
required: false,
|
|
234
|
-
default: void 0
|
|
235
|
-
},
|
|
236
|
-
headerBordered: {
|
|
237
|
-
type: Boolean,
|
|
238
|
-
required: false,
|
|
239
|
-
default: void 0
|
|
240
|
-
},
|
|
241
|
-
ghost: {
|
|
242
|
-
type: Boolean,
|
|
243
|
-
required: false,
|
|
244
|
-
default: void 0
|
|
245
|
-
},
|
|
246
|
-
collapsible: {
|
|
247
|
-
type: [String, Boolean],
|
|
248
|
-
required: false,
|
|
249
|
-
default: void 0
|
|
250
|
-
},
|
|
251
|
-
collapsed: {
|
|
252
|
-
type: Boolean,
|
|
253
|
-
required: false,
|
|
254
|
-
default: void 0
|
|
255
|
-
},
|
|
256
|
-
collapsibleIconRender: {
|
|
257
|
-
type: Function,
|
|
258
|
-
required: false
|
|
259
|
-
},
|
|
260
|
-
defaultCollapsed: {
|
|
261
|
-
type: Boolean,
|
|
262
|
-
required: false,
|
|
263
|
-
default: void 0
|
|
264
|
-
},
|
|
265
|
-
onCollapse: {
|
|
266
|
-
type: Function,
|
|
267
|
-
required: false
|
|
268
|
-
},
|
|
269
|
-
checked: {
|
|
270
|
-
type: Boolean,
|
|
271
|
-
required: false,
|
|
272
|
-
default: void 0
|
|
273
|
-
},
|
|
274
|
-
onChecked: {
|
|
275
|
-
type: Function,
|
|
276
|
-
required: false
|
|
277
|
-
},
|
|
278
|
-
colSpan: { required: false },
|
|
279
|
-
colOffset: { required: false },
|
|
280
|
-
colFlex: { required: false },
|
|
281
|
-
colOrder: { required: false },
|
|
282
|
-
colPull: { required: false },
|
|
283
|
-
colPush: { required: false },
|
|
284
|
-
colXs: { required: false },
|
|
285
|
-
colSm: { required: false },
|
|
286
|
-
colMd: { required: false },
|
|
287
|
-
colLg: { required: false },
|
|
288
|
-
colXl: { required: false },
|
|
289
|
-
colXxl: { required: false },
|
|
290
|
-
onClick: {
|
|
291
|
-
type: Function,
|
|
292
|
-
required: false
|
|
293
|
-
},
|
|
294
9
|
title: {
|
|
295
10
|
type: [
|
|
296
11
|
Function,
|
|
@@ -422,6 +137,15 @@ const ProCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
422
137
|
type: Function,
|
|
423
138
|
required: false
|
|
424
139
|
},
|
|
140
|
+
gutter: {
|
|
141
|
+
type: [
|
|
142
|
+
Number,
|
|
143
|
+
null,
|
|
144
|
+
Object,
|
|
145
|
+
Array
|
|
146
|
+
],
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
425
149
|
align: {
|
|
426
150
|
type: [String, Object],
|
|
427
151
|
required: false
|
|
@@ -434,6 +158,108 @@ const ProCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
434
158
|
type: Boolean,
|
|
435
159
|
required: false,
|
|
436
160
|
default: void 0
|
|
161
|
+
},
|
|
162
|
+
tooltip: {
|
|
163
|
+
type: [
|
|
164
|
+
Object,
|
|
165
|
+
Function,
|
|
166
|
+
String,
|
|
167
|
+
Number,
|
|
168
|
+
null,
|
|
169
|
+
Boolean,
|
|
170
|
+
Array
|
|
171
|
+
],
|
|
172
|
+
required: false,
|
|
173
|
+
default: void 0
|
|
174
|
+
},
|
|
175
|
+
split: {
|
|
176
|
+
type: String,
|
|
177
|
+
required: false
|
|
178
|
+
},
|
|
179
|
+
direction: {
|
|
180
|
+
type: String,
|
|
181
|
+
required: false
|
|
182
|
+
},
|
|
183
|
+
colStyle: {
|
|
184
|
+
type: Object,
|
|
185
|
+
required: false
|
|
186
|
+
},
|
|
187
|
+
borderBeam: {
|
|
188
|
+
type: [Object, Boolean],
|
|
189
|
+
required: false,
|
|
190
|
+
default: void 0
|
|
191
|
+
},
|
|
192
|
+
layout: {
|
|
193
|
+
type: String,
|
|
194
|
+
required: false
|
|
195
|
+
},
|
|
196
|
+
boxShadow: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
required: false,
|
|
199
|
+
default: void 0
|
|
200
|
+
},
|
|
201
|
+
disabled: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
required: false,
|
|
204
|
+
default: void 0
|
|
205
|
+
},
|
|
206
|
+
headerBordered: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
required: false,
|
|
209
|
+
default: void 0
|
|
210
|
+
},
|
|
211
|
+
ghost: {
|
|
212
|
+
type: Boolean,
|
|
213
|
+
required: false,
|
|
214
|
+
default: void 0
|
|
215
|
+
},
|
|
216
|
+
collapsible: {
|
|
217
|
+
type: [String, Boolean],
|
|
218
|
+
required: false,
|
|
219
|
+
default: void 0
|
|
220
|
+
},
|
|
221
|
+
collapsed: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
required: false,
|
|
224
|
+
default: void 0
|
|
225
|
+
},
|
|
226
|
+
collapsibleIconRender: {
|
|
227
|
+
type: Function,
|
|
228
|
+
required: false
|
|
229
|
+
},
|
|
230
|
+
defaultCollapsed: {
|
|
231
|
+
type: Boolean,
|
|
232
|
+
required: false,
|
|
233
|
+
default: void 0
|
|
234
|
+
},
|
|
235
|
+
onCollapse: {
|
|
236
|
+
type: Function,
|
|
237
|
+
required: false
|
|
238
|
+
},
|
|
239
|
+
checked: {
|
|
240
|
+
type: Boolean,
|
|
241
|
+
required: false,
|
|
242
|
+
default: void 0
|
|
243
|
+
},
|
|
244
|
+
onChecked: {
|
|
245
|
+
type: Function,
|
|
246
|
+
required: false
|
|
247
|
+
},
|
|
248
|
+
colSpan: { required: false },
|
|
249
|
+
colOffset: { required: false },
|
|
250
|
+
colFlex: { required: false },
|
|
251
|
+
colOrder: { required: false },
|
|
252
|
+
colPull: { required: false },
|
|
253
|
+
colPush: { required: false },
|
|
254
|
+
colXs: { required: false },
|
|
255
|
+
colSm: { required: false },
|
|
256
|
+
colMd: { required: false },
|
|
257
|
+
colLg: { required: false },
|
|
258
|
+
colXl: { required: false },
|
|
259
|
+
colXxl: { required: false },
|
|
260
|
+
onClick: {
|
|
261
|
+
type: Function,
|
|
262
|
+
required: false
|
|
437
263
|
}
|
|
438
264
|
},
|
|
439
265
|
name: "ProCard",
|
|
@@ -2,6 +2,7 @@ import { ProCardProps } from "../../ProCard.js";
|
|
|
2
2
|
import ProCheckCardGroup from "./Group.js";
|
|
3
3
|
import * as _$vue from "vue";
|
|
4
4
|
import { VNode } from "vue";
|
|
5
|
+
import { VueNode } from "@v-c/util";
|
|
5
6
|
import { BorderBeamProps, CardMetaProps, CardProps } from "antdv-next";
|
|
6
7
|
import { CustomSlotsType } from "@v-c/util/dist/type";
|
|
7
8
|
|
|
@@ -20,13 +21,13 @@ type ProCheckCardProps = CardMetaProps & Omit<CardProps, 'title' | 'onTabChange'
|
|
|
20
21
|
collapsible?: ProCardProps['collapsible'];
|
|
21
22
|
};
|
|
22
23
|
declare const _ProCheckCard: _$vue.DefineSetupFnComponent<ProCheckCardProps, {}, CustomSlotsType<{
|
|
23
|
-
default?: () =>
|
|
24
|
-
avatar?: () =>
|
|
25
|
-
title?: () =>
|
|
26
|
-
extra?: () =>
|
|
27
|
-
cover?: () =>
|
|
24
|
+
default?: () => VueNode[];
|
|
25
|
+
avatar?: () => VueNode[];
|
|
26
|
+
title?: () => VueNode[];
|
|
27
|
+
extra?: () => VueNode[];
|
|
28
|
+
cover?: () => VueNode[];
|
|
28
29
|
description?: () => VNode[];
|
|
29
|
-
}>, CardMetaProps & Omit<CardProps, "size" | "title" | "
|
|
30
|
+
}>, CardMetaProps & Omit<CardProps, "size" | "title" | "onTabChange" | "activeTabKey" | "defaultActiveTabKey" | "headStyle" | "bodyStyle" | "tabBarExtraContent" | "tabList" | "type"> & {
|
|
30
31
|
/** 边框流光 */borderBeam?: BorderBeamProps | boolean;
|
|
31
32
|
size?: CardProps["size"] | "large";
|
|
32
33
|
checked?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ProCard from "../../ProCard.js";
|
|
2
2
|
import ProCheckCardGroup, { useCheckCardGroupContextInject } from "./Group.js";
|
|
3
3
|
import { useStyle } from "./style/index.js";
|
|
4
|
-
import { Fragment, computed, createVNode, defineComponent,
|
|
5
|
-
import { isNil, useEffect, useMountMergeState } from "@antdv-next1/pro-utils";
|
|
4
|
+
import { Fragment, computed, createVNode, defineComponent, mergeProps, reactive, ref, toRef } from "vue";
|
|
5
|
+
import { isImg, isNil, isUrl, transformVueNodeType, useEffect, useMountMergeState } from "@antdv-next1/pro-utils";
|
|
6
6
|
import { classNames } from "@v-c/util";
|
|
7
7
|
import { Avatar, CardMeta } from "antdv-next";
|
|
8
8
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
@@ -51,20 +51,22 @@ const ProCheckCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) =
|
|
|
51
51
|
setStateChecked?.(newChecked);
|
|
52
52
|
};
|
|
53
53
|
return () => {
|
|
54
|
-
const { title, avatar, prefixCls, onChange, value, disabled: propsDisabled, defaultChecked, checked, "onUpdate:checked": onUpdateChecked, "onUpdate:value": onUpdateValue, description, borderBeam, size: propsSize, onClick, ...rest } = props;
|
|
54
|
+
const { title = slots.title, avatar = slots.avatar, prefixCls, onChange, value, disabled: propsDisabled, defaultChecked, checked, "onUpdate:checked": onUpdateChecked, "onUpdate:value": onUpdateValue, description = slots.description, borderBeam, size: propsSize, onClick, ...rest } = props;
|
|
55
55
|
Object.keys(rest).forEach((key) => {
|
|
56
56
|
checkCardProps[key] = rest[key];
|
|
57
57
|
});
|
|
58
|
-
const { disabled = propsDisabled || false, loading: cardLoading, bordered = true, size, checked: propsChecked = checked, cover, extra, ...restCardProps } = checkCardProps;
|
|
58
|
+
const { disabled = propsDisabled || false, loading: cardLoading, bordered = true, size, checked: propsChecked = checked, cover = slots.cover, extra = slots.extra, ...restCardProps } = checkCardProps;
|
|
59
59
|
const sizeCls = getSizeCls(size || propsSize);
|
|
60
|
-
const
|
|
60
|
+
const titleDom = transformVueNodeType(title);
|
|
61
|
+
const descriptionDom = transformVueNodeType(description);
|
|
62
|
+
const coverDom = transformVueNodeType(cover);
|
|
63
|
+
const extraDom = transformVueNodeType(extra);
|
|
64
|
+
const avatarDom = typeof avatar === "string" && isUrl(avatar) && isImg(avatar) ? createVNode(Avatar, {
|
|
61
65
|
"size": 48,
|
|
62
66
|
"shape": "square",
|
|
63
67
|
"src": avatar
|
|
64
|
-
}, null);
|
|
65
|
-
const headerDom = isNil(
|
|
66
|
-
const descriptionDom = slots.description?.() || description;
|
|
67
|
-
const coverDom = cover || slots.cover?.();
|
|
68
|
+
}, null) : transformVueNodeType(avatar);
|
|
69
|
+
const headerDom = isNil(titleDom ?? extraDom) ? null : createVNode(Fragment, null, [titleDom && createVNode("div", { "class": classNames(`${baseClassName.value}-meta-header`, hashId.value) }, [createVNode("div", { "class": classNames(`${baseClassName.value}-meta-title`, `${baseClassName.value}-meta-title-with-ellipsis`, hashId.value) }, [titleDom])]), extraDom && createVNode("div", { "class": classNames(`${baseClassName.value}-meta-title-extra`, hashId.value) }, [extraDom])]);
|
|
68
70
|
return wrapSSR(createVNode(ProCard, mergeProps({
|
|
69
71
|
"style": attrs.style,
|
|
70
72
|
"class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
@@ -79,22 +81,20 @@ const ProCheckCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) =
|
|
|
79
81
|
"loading": cardLoading,
|
|
80
82
|
"onClick": (e) => {
|
|
81
83
|
if (!cardLoading && !disabled) handleClick(e);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"src": coverDom,
|
|
84
|
+
},
|
|
85
|
+
"cover": typeof cover === "string" ? createVNode("img", {
|
|
86
|
+
"src": cover,
|
|
86
87
|
"alt": "checkcard"
|
|
87
|
-
}, null) : coverDom
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}));
|
|
88
|
+
}, null) : coverDom
|
|
89
|
+
}), { ...headerDom || avatarDom || descriptionDom || cardLoading ? { default: () => createVNode(CardMeta, {
|
|
90
|
+
"title": headerDom,
|
|
91
|
+
"description": descriptionDom,
|
|
92
|
+
"class": classNames(`${baseClassName.value}-meta`, hashId.value, {
|
|
93
|
+
[`${baseClassName.value}-meta-avatar-header`]: avatarDom && headerDom && !descriptionDom,
|
|
94
|
+
[`${baseClassName.value}-meta-extra-header`]: !isNil(extraDom)
|
|
95
|
+
}),
|
|
96
|
+
"avatar": avatarDom
|
|
97
|
+
}, null) } : {} }));
|
|
98
98
|
};
|
|
99
99
|
}, {
|
|
100
100
|
props: {
|
|
@@ -5,7 +5,7 @@ import { computed, createVNode, defineComponent, inject, provide, shallowRef, to
|
|
|
5
5
|
import { childrenToArray, isSpecialNode, useMountMergeState } from "@antdv-next1/pro-utils";
|
|
6
6
|
import { classNames } from "@v-c/util";
|
|
7
7
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
8
|
-
import { ProConfigProvider } from "@antdv-next1/pro-provider";
|
|
8
|
+
import { ProConfigProvider as ProConfigProvider$1 } from "@antdv-next1/pro-provider";
|
|
9
9
|
//#region src/components/CheckCard/Group.tsx
|
|
10
10
|
/**
|
|
11
11
|
* Represents the possible value types for a CheckGroup.
|
|
@@ -178,6 +178,6 @@ const InternalCheckCardGroup = /* @__PURE__ */ defineComponent((props, { slots,
|
|
|
178
178
|
name: "InternalCheckCardGroup",
|
|
179
179
|
inheritAttrs: false
|
|
180
180
|
});
|
|
181
|
-
const ProCheckCardGroup = (props, { slots }) => createVNode(ProConfigProvider, { "needDeps": true }, { default: () => [createVNode(InternalCheckCardGroup, props, slots)] });
|
|
181
|
+
const ProCheckCardGroup = (props, { slots }) => createVNode(ProConfigProvider$1, { "needDeps": true }, { default: () => [createVNode(InternalCheckCardGroup, props, slots)] });
|
|
182
182
|
//#endregion
|
|
183
183
|
export { checkCardGroupContextKey, ProCheckCardGroup as default, useCheckCardGroupContextInject, useCheckCardGroupContextProvider };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ProCheckCardGroup, { ProCheckCardGroupProps } from "./Group.js";
|
|
1
|
+
import ProCheckCardGroup, { CheckCardGroupContextType, CheckCardItemGroupType, CheckCardItemType, CheckCardOptionType, CheckCardValueType, CheckGroupValueType, ProCheckCardGroupProps } from "./Group.js";
|
|
2
2
|
import ProCheckCard, { ProCheckCardProps } from "./CheckCard.js";
|
|
3
|
-
export { ProCheckCard, ProCheckCardGroup, type ProCheckCardGroupProps, type ProCheckCardProps };
|
|
3
|
+
export { type CheckCardGroupContextType, type CheckCardItemGroupType, type CheckCardItemType, type CheckCardOptionType, type CheckCardValueType, type CheckGroupValueType, ProCheckCard, ProCheckCardGroup, type ProCheckCardGroupProps, type ProCheckCardProps };
|
|
@@ -59,6 +59,7 @@ const genProCheckCardStyle = (token) => {
|
|
|
59
59
|
} }
|
|
60
60
|
} },
|
|
61
61
|
[`&${token.antCls}-card`]: {
|
|
62
|
+
boxSizing: "border-box",
|
|
62
63
|
[`${token.antCls}-card-cover`]: {
|
|
63
64
|
paddingInline: token.paddingXXS,
|
|
64
65
|
paddingBlock: token.paddingXXS,
|
|
@@ -84,15 +85,33 @@ const genProCheckCardStyle = (token) => {
|
|
|
84
85
|
}
|
|
85
86
|
},
|
|
86
87
|
[`${token.antCls}-card-body`]: {
|
|
87
|
-
paddingBlock: token.
|
|
88
|
+
paddingBlock: token.paddingMD,
|
|
88
89
|
paddingInline: token.paddingSM,
|
|
89
90
|
[`${token.componentCls}-meta`]: { [`&${token.antCls}-card-meta`]: {
|
|
91
|
+
margin: 0,
|
|
90
92
|
[`${token.antCls}-card-meta-avatar`]: { paddingInlineEnd: token.paddingXS },
|
|
91
93
|
[`${token.antCls}-card-meta-section`]: {
|
|
92
94
|
"&>div:not(:last-child)": { marginBottom: token.marginXXS },
|
|
93
95
|
[`${token.antCls}-card-meta-title`]: {
|
|
94
96
|
fontSize: token.fontSize,
|
|
95
|
-
fontWeight: 500
|
|
97
|
+
fontWeight: 500,
|
|
98
|
+
[`${token.componentCls}-meta-header`]: {
|
|
99
|
+
display: "flex",
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: "space-between",
|
|
102
|
+
lineHeight: token.lineHeight,
|
|
103
|
+
[`${token.componentCls}-meta-title`]: {
|
|
104
|
+
fontSize: token.fontSize,
|
|
105
|
+
fontWeight: 500,
|
|
106
|
+
overflow: "hidden",
|
|
107
|
+
whiteSpace: "nowrap",
|
|
108
|
+
textOverflow: "ellipsis",
|
|
109
|
+
display: "flex",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
justifyContent: "space-between",
|
|
112
|
+
"&-with-ellipsis": { display: "inline-block" }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
96
115
|
}
|
|
97
116
|
},
|
|
98
117
|
[`&${token.componentCls}-meta-avatar-header`]: { alignItems: "center" },
|
|
@@ -105,20 +124,13 @@ const genProCheckCardStyle = (token) => {
|
|
|
105
124
|
whiteSpace: "normal",
|
|
106
125
|
textOverflow: "unset",
|
|
107
126
|
lineHeight: token.lineHeight,
|
|
108
|
-
[`${token.componentCls}-meta-
|
|
127
|
+
[`${token.componentCls}-meta-header`]: {
|
|
109
128
|
display: "flex",
|
|
110
129
|
alignItems: "center",
|
|
111
130
|
gap: token.sizeSM,
|
|
112
|
-
minWidth: 0
|
|
113
|
-
[`${token.componentCls}-meta-title-left-text`]: {
|
|
114
|
-
display: "inline-block",
|
|
115
|
-
overflow: "hidden",
|
|
116
|
-
textOverflow: "ellipsis",
|
|
117
|
-
whiteSpace: "nowrap",
|
|
118
|
-
alignItems: "center"
|
|
119
|
-
}
|
|
131
|
+
minWidth: 0
|
|
120
132
|
},
|
|
121
|
-
[`${token.componentCls}-meta-title-extra`]: {}
|
|
133
|
+
[`${token.componentCls}-meta-title-extra`]: { fontWeight: "normal" }
|
|
122
134
|
} } }
|
|
123
135
|
} },
|
|
124
136
|
"&:after": {
|
|
@@ -3,26 +3,30 @@ import { VNode } from "vue";
|
|
|
3
3
|
import { VueNode } from "@v-c/util";
|
|
4
4
|
import { BadgeProps, StatisticProps as StatisticProps$1, TooltipProps } from "antdv-next";
|
|
5
5
|
import { CustomSlotsType } from "@v-c/util/dist/type";
|
|
6
|
+
import * as _$antdv_next_dist_statistic_Statistic0 from "antdv-next/dist/statistic/Statistic";
|
|
6
7
|
|
|
7
8
|
//#region src/components/Statistic/index.d.ts
|
|
8
|
-
|
|
9
|
-
/** 描述性标签 */
|
|
10
|
-
description?: VueNode;
|
|
11
|
-
/** 标题提示 */
|
|
9
|
+
type StatisticProps = StatisticProps$1 & {
|
|
10
|
+
/** 描述性标签 */description?: VueNode; /** 标题提示 */
|
|
12
11
|
tooltip?: TooltipProps & {
|
|
13
12
|
icon?: VueNode;
|
|
14
|
-
} | VueNode;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
icon?: VueNode;
|
|
19
|
-
/** Layout 布局 */
|
|
20
|
-
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
21
|
-
/** 趋势 */
|
|
13
|
+
} | VueNode; /** 当前项显示的状态 */
|
|
14
|
+
status?: BadgeProps['status']; /** Icon 图标 */
|
|
15
|
+
icon?: VueNode; /** Layout 布局 */
|
|
16
|
+
layout?: 'horizontal' | 'vertical' | 'inline'; /** 趋势 */
|
|
22
17
|
trend?: 'up' | 'down';
|
|
23
|
-
}
|
|
18
|
+
};
|
|
24
19
|
declare const Statistic: _$vue.DefineSetupFnComponent<StatisticProps, {}, CustomSlotsType<{
|
|
25
20
|
default?: () => VNode[];
|
|
26
|
-
}>,
|
|
21
|
+
}>, _$antdv_next_dist_statistic_Statistic0.InternalStatisticProps & {
|
|
22
|
+
/** 描述性标签 */description?: VueNode; /** 标题提示 */
|
|
23
|
+
tooltip?: (TooltipProps & {
|
|
24
|
+
icon?: VueNode;
|
|
25
|
+
}) | VueNode; /** 当前项显示的状态 */
|
|
26
|
+
status?: BadgeProps["status"]; /** Icon 图标 */
|
|
27
|
+
icon?: VueNode; /** Layout 布局 */
|
|
28
|
+
layout?: "horizontal" | "vertical" | "inline"; /** 趋势 */
|
|
29
|
+
trend?: "up" | "down";
|
|
30
|
+
} & {}, _$vue.PublicProps>;
|
|
27
31
|
//#endregion
|
|
28
32
|
export { StatisticProps, Statistic as default };
|