@antdv-next1/pro-card 2.0.15 → 2.0.17
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/LICENSE +1 -1
- package/dist/Card.js +11 -11
- package/dist/components/CheckCard/CheckCard.js +8 -8
- package/dist/components/CheckCard/Group.js +5 -5
- package/dist/components/CheckCard/style/group.d.ts +5 -8
- package/dist/components/CheckCard/style/group.js +6 -11
- package/dist/components/CheckCard/style/index.d.ts +5 -8
- package/dist/components/CheckCard/style/index.js +24 -29
- package/dist/components/Statistic/index.js +10 -10
- package/dist/components/Statistic/style/index.d.ts +5 -8
- package/dist/components/Statistic/style/index.js +7 -11
- package/dist/components/StatisticCard/index.js +8 -8
- package/dist/components/StatisticCard/style/index.d.ts +5 -8
- package/dist/components/StatisticCard/style/index.js +7 -11
- package/dist/pro-card.esm.js +906 -927
- package/dist/pro-card.js +14 -14
- package/dist/style/index.d.ts +3 -4
- package/dist/style/index.js +33 -38
- package/package.json +4 -4
package/LICENSE
CHANGED
package/dist/Card.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import style_default from "./style/index.js";
|
|
2
2
|
import { Fragment, cloneVNode, computed, createVNode, defineComponent, isVNode, mergeProps, shallowRef } from "vue";
|
|
3
3
|
import { LabelIconTip, childrenToArray, isSpecialNode } from "@antdv-next1/pro-utils";
|
|
4
4
|
import { classNames } from "@v-c/util";
|
|
@@ -27,7 +27,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
27
27
|
const config = useConfig();
|
|
28
28
|
const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
|
|
29
29
|
const baseClassName = computed(() => `${prefixCls.value}-card`);
|
|
30
|
-
const
|
|
30
|
+
const [hashId, cssVarCls] = style_default(baseClassName);
|
|
31
31
|
const screens = useBreakpoint();
|
|
32
32
|
const collapsed = shallowRef(props.defaultCollapsed || false);
|
|
33
33
|
/**
|
|
@@ -89,7 +89,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
89
89
|
...colStyle
|
|
90
90
|
},
|
|
91
91
|
"key": index,
|
|
92
|
-
"class": classNames([`${baseClassName.value}-col`], colPropsClass, hashId.value, {
|
|
92
|
+
"class": classNames([`${baseClassName.value}-col`], colPropsClass, hashId.value, cssVarCls.value, {
|
|
93
93
|
[`${baseClassName.value}-split-horizontal`]: split === "horizontal" && index !== childrenArray.length - 1,
|
|
94
94
|
[`${baseClassName.value}-split-vertical`]: split === "vertical" && index !== childrenArray.length - 1
|
|
95
95
|
})
|
|
@@ -108,7 +108,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
108
108
|
}, {});
|
|
109
109
|
return createVNode(Col, mergeProps(Object.keys(colProps).length ? colProps : wrap ? {} : { flex: 1 }, {
|
|
110
110
|
"style": { ...colStyle },
|
|
111
|
-
"class": classNames({ [`${baseClassName.value}-split-vertical`]: split === "vertical" && index !== childrenArray.length - 1 }, hashId.value),
|
|
111
|
+
"class": classNames({ [`${baseClassName.value}-split-vertical`]: split === "vertical" && index !== childrenArray.length - 1 }, hashId.value, cssVarCls.value),
|
|
112
112
|
"key": index
|
|
113
113
|
}), _isSlot(_slot = cloneVNode(element, {
|
|
114
114
|
size: rest.size,
|
|
@@ -126,7 +126,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
126
126
|
}, collapsibleIconRender ? { expandIcon: (panelProps) => collapsibleIconRender({ collapsed: panelProps.isActive || false }) } : {}, {
|
|
127
127
|
"collapsible": typeof collapsible !== "boolean" && collapsible !== "header" ? collapsible : void 0,
|
|
128
128
|
"defaultActiveKey": defaultCollapsed ? void 0 : ["collapseCard"],
|
|
129
|
-
"class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
129
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value, {
|
|
130
130
|
[`${baseClassName.value}-headerBordered`]: headerBordered,
|
|
131
131
|
[`${baseClassName.value}-type-inner`]: type === "inner",
|
|
132
132
|
[`${baseClassName.value}-ghost`]: ghost,
|
|
@@ -141,7 +141,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
141
141
|
body: classNames({
|
|
142
142
|
[`${baseClassName.value}-body-direction-column`]: direction === "column",
|
|
143
143
|
[`${baseClassName.value}-body-layout-center`]: layout === "center"
|
|
144
|
-
}, hashId.value),
|
|
144
|
+
}, hashId.value, cssVarCls.value),
|
|
145
145
|
...rest.classes
|
|
146
146
|
},
|
|
147
147
|
"styles": {
|
|
@@ -157,7 +157,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
157
157
|
"tooltip": props.tooltip
|
|
158
158
|
}, null),
|
|
159
159
|
content: containProCard ? direction !== "column" && split !== "horizontal" ? createVNode(Row, { "gutter": gutter }, _isSlot(childrenDom) ? childrenDom : { default: () => [childrenDom] }) : createVNode("div", {
|
|
160
|
-
"class": classNames(`${baseClassName.value}-col`, hashId.value, {}),
|
|
160
|
+
"class": classNames(`${baseClassName.value}-col`, hashId.value, cssVarCls.value, {}),
|
|
161
161
|
"style": {
|
|
162
162
|
...getStyle(horizontalGutter > 0, {
|
|
163
163
|
marginInlineEnd: `-${horizontalGutter / 2}px`,
|
|
@@ -174,7 +174,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
174
174
|
}), null);
|
|
175
175
|
const cardDom = createVNode(Card, mergeProps(attrs, rest, {
|
|
176
176
|
"type": containProCard ? void 0 : type,
|
|
177
|
-
"class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
177
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value, {
|
|
178
178
|
[`${baseClassName.value}-ghost`]: ghost,
|
|
179
179
|
[`${baseClassName.value}-split`]: split,
|
|
180
180
|
[`${baseClassName.value}-disabled`]: disabled,
|
|
@@ -187,7 +187,7 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
187
187
|
body: classNames(`${baseClassName.value}-body`, {
|
|
188
188
|
[`${baseClassName.value}-body-direction-column`]: direction === "column",
|
|
189
189
|
[`${baseClassName.value}-body-layout-center`]: layout === "center"
|
|
190
|
-
}, hashId.value),
|
|
190
|
+
}, hashId.value, cssVarCls.value),
|
|
191
191
|
...rest.classes
|
|
192
192
|
}
|
|
193
193
|
}, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
@@ -205,14 +205,14 @@ const InternalProCard = /* @__PURE__ */ defineComponent((props, { slots, expose,
|
|
|
205
205
|
},
|
|
206
206
|
...rest.styles
|
|
207
207
|
} }), {
|
|
208
|
-
default: () => [containProCard ? direction !== "column" && split !== "horizontal" ? createVNode(Row, { "gutter": gutter }, _isSlot(childrenDom) ? childrenDom : { default: () => [childrenDom] }) : createVNode("div", { "class": classNames(`${baseClassName.value}-row`, hashId.value) }, [childrenDom]) : childrenDom],
|
|
208
|
+
default: () => [containProCard ? direction !== "column" && split !== "horizontal" ? createVNode(Row, { "gutter": gutter }, _isSlot(childrenDom) ? childrenDom : { default: () => [childrenDom] }) : createVNode("div", { "class": classNames(`${baseClassName.value}-row`, hashId.value, cssVarCls.value) }, [childrenDom]) : childrenDom],
|
|
209
209
|
...restSlots,
|
|
210
210
|
...slotTitle || tooltip ? { title: () => createVNode(LabelIconTip, {
|
|
211
211
|
"label": slotTitle?.() || props.title,
|
|
212
212
|
"tooltip": props.tooltip
|
|
213
213
|
}, null) } : {}
|
|
214
214
|
});
|
|
215
|
-
return
|
|
215
|
+
return createVNode(Fragment, null, [typeof collapsible !== "boolean" ? hasBorderBeamDom ? createVNode(BorderBeam, typeof borderBeam === "boolean" ? {} : borderBeam, _isSlot(collapseCardDom) ? collapseCardDom : { default: () => [collapseCardDom] }) : collapseCardDom : hasBorderBeamDom ? createVNode(BorderBeam, typeof borderBeam === "boolean" ? {} : borderBeam, _isSlot(cardDom) ? cardDom : { default: () => [cardDom] }) : cardDom]);
|
|
216
216
|
};
|
|
217
217
|
}, {
|
|
218
218
|
props: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ProCard from "../../ProCard.js";
|
|
2
2
|
import ProCheckCardGroup, { useCheckCardGroupContextInject } from "./Group.js";
|
|
3
|
-
import
|
|
3
|
+
import style_default from "./style/index.js";
|
|
4
4
|
import { Fragment, computed, createVNode, defineComponent, mergeProps, reactive, ref, toRef } from "vue";
|
|
5
5
|
import { isImg, isNil, isUrl, transformVueNodeType, useEffect, useMountMergeState } from "@antdv-next1/pro-utils";
|
|
6
6
|
import { classNames } from "@v-c/util";
|
|
@@ -18,7 +18,7 @@ const ProCheckCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) =
|
|
|
18
18
|
const baseClassName = computed(() => `${prefixCls.value}-checkcard`);
|
|
19
19
|
const multiple = ref(false);
|
|
20
20
|
const checkCardGroupProvide = useCheckCardGroupContextInject();
|
|
21
|
-
const
|
|
21
|
+
const [hashId, cssVarCls] = style_default(baseClassName);
|
|
22
22
|
const checkCardProps = reactive({});
|
|
23
23
|
const [stateChecked, setStateChecked] = useMountMergeState(props.defaultChecked || false, {
|
|
24
24
|
value: toRef(() => props.checked),
|
|
@@ -67,10 +67,10 @@ const ProCheckCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) =
|
|
|
67
67
|
"shape": "square",
|
|
68
68
|
"src": avatar
|
|
69
69
|
}, null) : transformVueNodeType(avatar);
|
|
70
|
-
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])]);
|
|
71
|
-
return
|
|
70
|
+
const headerDom = isNil(titleDom ?? extraDom) ? null : createVNode(Fragment, null, [titleDom && createVNode("div", { "class": classNames(`${baseClassName.value}-meta-header`, hashId.value, cssVarCls.value) }, [createVNode("div", { "class": classNames(`${baseClassName.value}-meta-title`, `${baseClassName.value}-meta-title-with-ellipsis`, hashId.value, cssVarCls.value) }, [titleDom])]), extraDom && createVNode("div", { "class": classNames(`${baseClassName.value}-meta-title-extra`, hashId.value, cssVarCls.value) }, [extraDom])]);
|
|
71
|
+
return createVNode(ProCard, mergeProps({
|
|
72
72
|
"style": attrs.style,
|
|
73
|
-
"class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
73
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value, {
|
|
74
74
|
[`${baseClassName.value}-checked`]: propsChecked,
|
|
75
75
|
[`${baseClassName.value}-multiple`]: checkCardProps.multiple,
|
|
76
76
|
[`${baseClassName.value}-disabled`]: disabled,
|
|
@@ -92,13 +92,13 @@ const ProCheckCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) =
|
|
|
92
92
|
default: () => createVNode(Fragment, null, [(headerDom || avatarDom || descriptionDom || cardLoading) && createVNode(CardMeta, {
|
|
93
93
|
"title": headerDom,
|
|
94
94
|
"description": descriptionDom,
|
|
95
|
-
"class": classNames(`${baseClassName.value}-meta`, hashId.value, {
|
|
95
|
+
"class": classNames(`${baseClassName.value}-meta`, hashId.value, cssVarCls.value, {
|
|
96
96
|
[`${baseClassName.value}-meta-avatar-header`]: avatarDom && headerDom && !descriptionDom,
|
|
97
97
|
[`${baseClassName.value}-meta-extra-header`]: !isNil(extraDom)
|
|
98
98
|
}),
|
|
99
99
|
"avatar": avatarDom
|
|
100
|
-
}, null), slots.default?.() && createVNode("div", { "class": classNames(`${baseClassName.value}-body`, hashId.value) }, [slots.default?.()])])
|
|
101
|
-
})
|
|
100
|
+
}, null), slots.default?.() && createVNode("div", { "class": classNames(`${baseClassName.value}-body`, hashId.value, cssVarCls.value) }, [slots.default?.()])])
|
|
101
|
+
});
|
|
102
102
|
};
|
|
103
103
|
}, {
|
|
104
104
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ProCard from "../../ProCard.js";
|
|
2
|
-
import
|
|
2
|
+
import group_default from "./style/group.js";
|
|
3
3
|
import ProCheckCard from "./CheckCard.js";
|
|
4
4
|
import { computed, createVNode, defineComponent, inject, provide, shallowRef, toRef } from "vue";
|
|
5
5
|
import { childrenToArray, isSpecialNode, useMountMergeState } from "@antdv-next1/pro-utils";
|
|
@@ -29,7 +29,7 @@ const InternalCheckCardGroup = /* @__PURE__ */ defineComponent((props, { slots,
|
|
|
29
29
|
const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
|
|
30
30
|
const baseClassName = computed(() => `${prefixCls.value}-checkcard-group`);
|
|
31
31
|
const registerValueMap = shallowRef(/* @__PURE__ */ new Map());
|
|
32
|
-
const
|
|
32
|
+
const [hashId, cssVarCls] = group_default(baseClassName);
|
|
33
33
|
const [stateValue, setStateValue] = useMountMergeState(props.defaultValue, {
|
|
34
34
|
value: toRef(() => props.value),
|
|
35
35
|
onChange: (value) => {
|
|
@@ -111,10 +111,10 @@ const InternalCheckCardGroup = /* @__PURE__ */ defineComponent((props, { slots,
|
|
|
111
111
|
registerValue,
|
|
112
112
|
cancelValue
|
|
113
113
|
})));
|
|
114
|
-
return () =>
|
|
115
|
-
"class": classNames(baseClassName.value, hashId.value),
|
|
114
|
+
return () => createVNode("div", {
|
|
115
|
+
"class": classNames(baseClassName.value, hashId.value, cssVarCls.value),
|
|
116
116
|
"style": attrs.style
|
|
117
|
-
}, [children.value])
|
|
117
|
+
}, [children.value]);
|
|
118
118
|
}, {
|
|
119
119
|
props: {
|
|
120
120
|
prefixCls: {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ProAliasToken } from "@antdv-next1/pro-provider";
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { ProAliasCssVarToken } from "@antdv-next1/pro-provider";
|
|
4
3
|
import { Keyframes } from "@antdv-next/cssinjs";
|
|
5
4
|
|
|
6
5
|
//#region src/components/CheckCard/style/group.d.ts
|
|
7
|
-
interface ProCheckCardGroupToken extends
|
|
8
|
-
componentCls: string;
|
|
9
|
-
}
|
|
6
|
+
interface ProCheckCardGroupToken extends ProAliasCssVarToken {}
|
|
10
7
|
declare const cardLoading: Keyframes;
|
|
11
|
-
declare
|
|
8
|
+
declare const _default: (prefixCls: _$vue.Ref<string>, rootCls?: _$vue.Ref<string | undefined>) => readonly [_$vue.Ref<string, string>, _$vue.ComputedRef<string | undefined>];
|
|
12
9
|
//#endregion
|
|
13
|
-
export { ProCheckCardGroupToken, cardLoading,
|
|
10
|
+
export { ProCheckCardGroupToken, cardLoading, _default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useStyle
|
|
2
|
-
import { Keyframes } from "@antdv-next/cssinjs";
|
|
1
|
+
import { useStyle } from "@antdv-next1/pro-provider";
|
|
2
|
+
import { Keyframes, mergeToken } from "@antdv-next/cssinjs";
|
|
3
3
|
//#region src/components/CheckCard/style/group.ts
|
|
4
4
|
const cardLoading = new Keyframes("card-loading", {
|
|
5
5
|
"0%": { backgroundPosition: "0 50%" },
|
|
@@ -20,13 +20,8 @@ const genProCheckCardGroupStyle = (token) => {
|
|
|
20
20
|
}
|
|
21
21
|
} };
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
...token,
|
|
27
|
-
componentCls: `.${prefixCls.value}`
|
|
28
|
-
})];
|
|
29
|
-
});
|
|
30
|
-
}
|
|
23
|
+
var group_default = useStyle("ProCheckCardGroup", (token) => {
|
|
24
|
+
return [genProCheckCardGroupStyle(mergeToken(token, {}))];
|
|
25
|
+
});
|
|
31
26
|
//#endregion
|
|
32
|
-
export { cardLoading,
|
|
27
|
+
export { cardLoading, group_default as default };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ProAliasToken } from "@antdv-next1/pro-provider";
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { ProAliasCssVarToken } from "@antdv-next1/pro-provider";
|
|
4
3
|
import { Keyframes } from "@antdv-next/cssinjs";
|
|
5
4
|
|
|
6
5
|
//#region src/components/CheckCard/style/index.d.ts
|
|
7
|
-
interface ProCheckCardToken extends
|
|
8
|
-
componentCls: string;
|
|
9
|
-
}
|
|
6
|
+
interface ProCheckCardToken extends ProAliasCssVarToken {}
|
|
10
7
|
declare const cardLoading: Keyframes;
|
|
11
|
-
declare
|
|
8
|
+
declare const _default: (prefixCls: _$vue.Ref<string>, rootCls?: _$vue.Ref<string | undefined>) => readonly [_$vue.Ref<string, string>, _$vue.ComputedRef<string | undefined>];
|
|
12
9
|
//#endregion
|
|
13
|
-
export { ProCheckCardToken, cardLoading,
|
|
10
|
+
export { ProCheckCardToken, cardLoading, _default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useStyle
|
|
2
|
-
import { Keyframes } from "@antdv-next/cssinjs";
|
|
1
|
+
import { useStyle } from "@antdv-next1/pro-provider";
|
|
2
|
+
import { Keyframes, mergeToken } from "@antdv-next/cssinjs";
|
|
3
3
|
//#region src/components/CheckCard/style/index.ts
|
|
4
4
|
function proCheckCardActive(token) {
|
|
5
5
|
return {
|
|
@@ -46,17 +46,17 @@ const genProCheckCardStyle = (token) => {
|
|
|
46
46
|
...proCheckCardActive(token),
|
|
47
47
|
[`${token.antCls}-card-cover`]: { "&:after": {
|
|
48
48
|
opacity: 1,
|
|
49
|
-
border: `${token.borderRadius
|
|
50
|
-
borderBlockEnd: `${token.borderRadius
|
|
51
|
-
borderInlineStart: `${token.borderRadius
|
|
52
|
-
borderStartEndRadius:
|
|
49
|
+
border: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} ${token.colorPrimary}`,
|
|
50
|
+
borderBlockEnd: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
51
|
+
borderInlineStart: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
52
|
+
borderStartEndRadius: token.borderRadius
|
|
53
53
|
} },
|
|
54
54
|
[`${token.antCls}-card-body`]: { "&:after": {
|
|
55
55
|
opacity: 1,
|
|
56
|
-
border: `${token.borderRadius
|
|
57
|
-
borderBlockEnd: `${token.borderRadius
|
|
58
|
-
borderInlineStart: `${token.borderRadius
|
|
59
|
-
borderStartEndRadius:
|
|
56
|
+
border: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} ${token.colorPrimary}`,
|
|
57
|
+
borderBlockEnd: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
58
|
+
borderInlineStart: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
59
|
+
borderStartEndRadius: token.borderRadius
|
|
60
60
|
} }
|
|
61
61
|
} },
|
|
62
62
|
[`&${token.antCls}-card`]: {
|
|
@@ -80,9 +80,9 @@ const genProCheckCardStyle = (token) => {
|
|
|
80
80
|
height: 0,
|
|
81
81
|
opacity: 0,
|
|
82
82
|
transition: `all 0.3s ${token.motionEaseInOut}`,
|
|
83
|
-
borderBlockEnd: `${token.borderRadius
|
|
84
|
-
borderInlineStart: `${token.borderRadius
|
|
85
|
-
borderStartEndRadius:
|
|
83
|
+
borderBlockEnd: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
84
|
+
borderInlineStart: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
85
|
+
borderStartEndRadius: token.borderRadius
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
[`${token.antCls}-card-body`]: {
|
|
@@ -143,9 +143,9 @@ const genProCheckCardStyle = (token) => {
|
|
|
143
143
|
height: 0,
|
|
144
144
|
opacity: 0,
|
|
145
145
|
transition: `all 0.3s ${token.motionEaseInOut}`,
|
|
146
|
-
borderBlockEnd: `${token.borderRadius
|
|
147
|
-
borderInlineStart: `${token.borderRadius
|
|
148
|
-
borderStartEndRadius:
|
|
146
|
+
borderBlockEnd: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
147
|
+
borderInlineStart: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
148
|
+
borderStartEndRadius: token.borderRadius
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
},
|
|
@@ -158,21 +158,16 @@ const genProCheckCardStyle = (token) => {
|
|
|
158
158
|
insetInlineEnd: 2,
|
|
159
159
|
width: 0,
|
|
160
160
|
height: 0,
|
|
161
|
-
border: `${token.borderRadius
|
|
162
|
-
borderBlockEnd: `${token.borderRadius
|
|
163
|
-
borderInlineStart: `${token.borderRadius
|
|
164
|
-
borderStartEndRadius:
|
|
161
|
+
border: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} ${token.colorTextDisabled}`,
|
|
162
|
+
borderBlockEnd: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
163
|
+
borderInlineStart: `${token.calc(token.borderRadius).add(4).equal()} ${token.lineType} transparent`,
|
|
164
|
+
borderStartEndRadius: token.borderRadius
|
|
165
165
|
} } },
|
|
166
166
|
[`&&:not(${token.componentCls}-disabled)`]: { "&:hover": { borderColor: token.colorPrimary } }
|
|
167
167
|
} };
|
|
168
168
|
};
|
|
169
|
-
|
|
170
|
-
return
|
|
171
|
-
|
|
172
|
-
...token,
|
|
173
|
-
componentCls: `.${prefixCls.value}`
|
|
174
|
-
})];
|
|
175
|
-
});
|
|
176
|
-
}
|
|
169
|
+
var style_default = useStyle("ProCheckCard", (token) => {
|
|
170
|
+
return [genProCheckCardStyle(mergeToken(token, {}))];
|
|
171
|
+
});
|
|
177
172
|
//#endregion
|
|
178
|
-
export { cardLoading,
|
|
173
|
+
export { cardLoading, style_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import style_default from "./style/index.js";
|
|
2
2
|
import { Fragment, computed, createVNode, defineComponent, mergeProps } from "vue";
|
|
3
3
|
import { classNames } from "@v-c/util";
|
|
4
4
|
import { Badge, Statistic as Statistic$1, Tooltip } from "antdv-next";
|
|
@@ -9,25 +9,25 @@ const Statistic = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
9
9
|
const config = useConfig();
|
|
10
10
|
const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
|
|
11
11
|
const baseClassName = computed(() => `${prefixCls.value}-card-statistic`);
|
|
12
|
-
const
|
|
12
|
+
const [hashId, cssVarCls] = style_default(baseClassName);
|
|
13
13
|
return () => {
|
|
14
14
|
const { layout = "inline", description, title, tooltip, status, trend, prefix, icon, ...rest } = props;
|
|
15
|
-
const tooltipDom = tooltip && createVNode(Tooltip, { "title": tooltip }, { default: () => [createVNode(QuestionCircleOutlined, { "class": classNames(`${baseClassName.value}-tip`, hashId.value) }, null)] });
|
|
16
|
-
const trendDom = trend && createVNode("div", { "class": classNames(`${baseClassName.value}-trend-icon`, hashId.value, { [`${baseClassName.value}-trend-icon-${trend}`]: trend }) }, null);
|
|
17
|
-
return
|
|
18
|
-
"class": classNames(baseClassName.value, attrs.class, hashId.value),
|
|
15
|
+
const tooltipDom = tooltip && createVNode(Tooltip, { "title": tooltip }, { default: () => [createVNode(QuestionCircleOutlined, { "class": classNames(`${baseClassName.value}-tip`, hashId.value, cssVarCls.value) }, null)] });
|
|
16
|
+
const trendDom = trend && createVNode("div", { "class": classNames(`${baseClassName.value}-trend-icon`, hashId.value, cssVarCls.value, { [`${baseClassName.value}-trend-icon-${trend}`]: trend }) }, null);
|
|
17
|
+
return createVNode("div", {
|
|
18
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value),
|
|
19
19
|
"style": attrs.style
|
|
20
|
-
}, [icon && createVNode("div", { "class": classNames(`${baseClassName.value}-icon`, hashId.value) }, [icon]), createVNode("div", { "class": classNames(`${baseClassName.value}-wrapper`, hashId.value) }, [status && createVNode("div", { "class": classNames(`${baseClassName.value}-status`, hashId.value) }, [createVNode(Badge, {
|
|
20
|
+
}, [icon && createVNode("div", { "class": classNames(`${baseClassName.value}-icon`, hashId.value, cssVarCls.value) }, [icon]), createVNode("div", { "class": classNames(`${baseClassName.value}-wrapper`, hashId.value, cssVarCls.value) }, [status && createVNode("div", { "class": classNames(`${baseClassName.value}-status`, hashId.value, cssVarCls.value) }, [createVNode(Badge, {
|
|
21
21
|
"status": status,
|
|
22
22
|
"text": null
|
|
23
|
-
}, null)]), createVNode("div", { "class": classNames(`${baseClassName.value}-content`, hashId.value) }, [createVNode(Statistic$1, mergeProps({
|
|
23
|
+
}, null)]), createVNode("div", { "class": classNames(`${baseClassName.value}-content`, hashId.value, cssVarCls.value) }, [createVNode(Statistic$1, mergeProps({
|
|
24
24
|
"title": (title || tooltipDom) && createVNode(Fragment, null, [title, tooltipDom]),
|
|
25
25
|
"prefix": (trendDom || prefix) && createVNode(Fragment, null, [trendDom, prefix]),
|
|
26
|
-
"class": classNames(hashId.value, {
|
|
26
|
+
"class": classNames(hashId.value, cssVarCls.value, {
|
|
27
27
|
[`${baseClassName.value}-layout-${layout}`]: layout,
|
|
28
28
|
[`${baseClassName.value}-trend-${trend}`]: trend
|
|
29
29
|
})
|
|
30
|
-
}, rest), null), description && createVNode("div", { "class": classNames(`${baseClassName.value}-description`, hashId.value) }, [description])])])])
|
|
30
|
+
}, rest), null), description && createVNode("div", { "class": classNames(`${baseClassName.value}-description`, hashId.value, cssVarCls.value) }, [description])])])]);
|
|
31
31
|
};
|
|
32
32
|
}, {
|
|
33
33
|
props: {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ProAliasToken } from "@antdv-next1/pro-provider";
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { ProAliasCssVarToken } from "@antdv-next1/pro-provider";
|
|
4
3
|
|
|
5
4
|
//#region src/components/Statistic/style/index.d.ts
|
|
6
|
-
interface
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
declare function useStyle(prefixCls: ComputedRef<string>): _$_antdv_next1_pro_provider0.UseStyleResult;
|
|
5
|
+
interface ProStatisticToken extends ProAliasCssVarToken {}
|
|
6
|
+
declare const _default: (prefixCls: _$vue.Ref<string>, rootCls?: _$vue.Ref<string | undefined>) => readonly [_$vue.Ref<string, string>, _$vue.ComputedRef<string | undefined>];
|
|
10
7
|
//#endregion
|
|
11
|
-
export {
|
|
8
|
+
export { ProStatisticToken, _default as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useStyle
|
|
1
|
+
import { useStyle } from "@antdv-next1/pro-provider";
|
|
2
|
+
import { mergeToken } from "@antdv-next/cssinjs";
|
|
2
3
|
//#region src/components/Statistic/style/index.ts
|
|
3
|
-
const
|
|
4
|
+
const genProStatisticStyle = (token) => {
|
|
4
5
|
return { [token.componentCls]: {
|
|
5
6
|
boxSizing: "border-box",
|
|
6
7
|
display: "flex",
|
|
@@ -52,13 +53,8 @@ const genProStyle = (token) => {
|
|
|
52
53
|
}
|
|
53
54
|
} };
|
|
54
55
|
};
|
|
55
|
-
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
...token,
|
|
59
|
-
componentCls: `.${prefixCls.value}`
|
|
60
|
-
})];
|
|
61
|
-
});
|
|
62
|
-
}
|
|
56
|
+
var style_default = useStyle("Statistic", (token) => {
|
|
57
|
+
return [genProStatisticStyle(mergeToken(token, {}))];
|
|
58
|
+
});
|
|
63
59
|
//#endregion
|
|
64
|
-
export {
|
|
60
|
+
export { style_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ProCard from "../../ProCard.js";
|
|
2
2
|
import Statistic from "../Statistic/index.js";
|
|
3
|
-
import
|
|
3
|
+
import style_default from "./style/index.js";
|
|
4
4
|
import { Fragment, computed, createVNode, defineComponent, mergeProps } from "vue";
|
|
5
5
|
import { classNames } from "@v-c/util";
|
|
6
6
|
import { useConfig } from "antdv-next/dist/config-provider/context";
|
|
@@ -9,24 +9,24 @@ const StatisticCard = /* @__PURE__ */ defineComponent((props, { attrs, slots })
|
|
|
9
9
|
const config = useConfig();
|
|
10
10
|
const prefixCls = computed(() => props.prefixCls || config.value.getPrefixCls("pro"));
|
|
11
11
|
const baseClassName = computed(() => `${prefixCls.value}-statistic-card`);
|
|
12
|
-
const
|
|
12
|
+
const [hashId, cssVarCls] = style_default(baseClassName);
|
|
13
13
|
return () => {
|
|
14
14
|
const { statistic, chart, chartPlacement, footer, ...restProps } = props;
|
|
15
15
|
const statisticDom = statistic && createVNode(Statistic, mergeProps({ "layout": "vertical" }, statistic), null);
|
|
16
|
-
const chartDom = chart && createVNode("div", { "class": classNames(`${baseClassName.value}-chart`, hashId.value, {
|
|
16
|
+
const chartDom = chart && createVNode("div", { "class": classNames(`${baseClassName.value}-chart`, hashId.value, cssVarCls.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
|
-
const contentCls = classNames(`${baseClassName.value}-content `, hashId.value, { [`${baseClassName.value}-content-horizontal`]: chartPlacement === "left" || chartPlacement === "right" });
|
|
20
|
+
const contentCls = classNames(`${baseClassName.value}-content `, hashId.value, cssVarCls.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
|
|
22
|
+
return createVNode(Fragment, null, [createVNode(ProCard, mergeProps({
|
|
23
23
|
"style": attrs.style,
|
|
24
|
-
"class": classNames(baseClassName.value, attrs.class, hashId.value)
|
|
24
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value, cssVarCls.value)
|
|
25
25
|
}, restProps), { default: () => [
|
|
26
26
|
contentDom,
|
|
27
27
|
slots.default?.(),
|
|
28
|
-
footer && createVNode("div", { "class": classNames(`${baseClassName.value}-footer`, hashId.value) }, [footer])
|
|
29
|
-
] })])
|
|
28
|
+
footer && createVNode("div", { "class": classNames(`${baseClassName.value}-footer`, hashId.value, cssVarCls.value) }, [footer])
|
|
29
|
+
] })]);
|
|
30
30
|
};
|
|
31
31
|
}, {
|
|
32
32
|
props: {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ProAliasToken } from "@antdv-next1/pro-provider";
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { ProAliasCssVarToken } from "@antdv-next1/pro-provider";
|
|
4
3
|
|
|
5
4
|
//#region src/components/StatisticCard/style/index.d.ts
|
|
6
|
-
interface
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
declare function useStyle(prefixCls: ComputedRef<string>): _$_antdv_next1_pro_provider0.UseStyleResult;
|
|
5
|
+
interface ProStatisticCardToken extends ProAliasCssVarToken {}
|
|
6
|
+
declare const _default: (prefixCls: _$vue.Ref<string>, rootCls?: _$vue.Ref<string | undefined>) => readonly [_$vue.Ref<string, string>, _$vue.ComputedRef<string | undefined>];
|
|
10
7
|
//#endregion
|
|
11
|
-
export {
|
|
8
|
+
export { ProStatisticCardToken, _default as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useStyle
|
|
1
|
+
import { useStyle } from "@antdv-next1/pro-provider";
|
|
2
|
+
import { mergeToken, unit } from "@antdv-next/cssinjs";
|
|
2
3
|
//#region src/components/StatisticCard/style/index.ts
|
|
3
4
|
const genProStyle = (token) => {
|
|
4
5
|
return { [token.componentCls]: {
|
|
@@ -31,17 +32,12 @@ const genProStyle = (token) => {
|
|
|
31
32
|
"&-footer": {
|
|
32
33
|
marginBlockStart: 8,
|
|
33
34
|
paddingBlockStart: 8,
|
|
34
|
-
borderBlockStart: `${token.lineWidth}
|
|
35
|
+
borderBlockStart: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
|
|
35
36
|
}
|
|
36
37
|
} };
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
...token,
|
|
42
|
-
componentCls: `.${prefixCls.value}`
|
|
43
|
-
})];
|
|
44
|
-
});
|
|
45
|
-
}
|
|
39
|
+
var style_default = useStyle("StatisticCard", (token) => {
|
|
40
|
+
return [genProStyle(mergeToken(token, {}))];
|
|
41
|
+
});
|
|
46
42
|
//#endregion
|
|
47
|
-
export {
|
|
43
|
+
export { style_default as default };
|