@antdv-next1/pro-card 1.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/LICENSE +21 -0
- package/dist/ProCard.d.ts +82 -0
- package/dist/ProCard.js +456 -0
- package/dist/components/CheckCard/CheckCard.d.ts +46 -0
- package/dist/components/CheckCard/CheckCard.js +265 -0
- package/dist/components/CheckCard/Group.d.ts +154 -0
- package/dist/components/CheckCard/Group.js +183 -0
- package/dist/components/CheckCard/index.d.ts +3 -0
- package/dist/components/CheckCard/index.js +3 -0
- package/dist/components/CheckCard/style/group.d.ts +13 -0
- package/dist/components/CheckCard/style/group.js +32 -0
- package/dist/components/CheckCard/style/index.d.ts +13 -0
- package/dist/components/CheckCard/style/index.js +165 -0
- package/dist/components/Statistic/index.d.ts +26 -0
- package/dist/components/Statistic/index.js +185 -0
- package/dist/components/Statistic/style/index.d.ts +11 -0
- package/dist/components/Statistic/style/index.js +64 -0
- package/dist/components/StatisticCard/index.d.ts +30 -0
- package/dist/components/StatisticCard/index.js +228 -0
- package/dist/components/StatisticCard/style/index.d.ts +11 -0
- package/dist/components/StatisticCard/style/index.js +47 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/pro-card.esm.js +24585 -0
- package/dist/pro-card.js +169 -0
- package/dist/style/index.d.ts +7 -0
- package/dist/style/index.js +107 -0
- package/dist/typing.d.ts +6 -0
- package/dist/typing.js +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 asuradaSong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { CollapsibleType } from "./typing.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import { CSSProperties, Plugin, VNode } from "vue";
|
|
4
|
+
import { VueNode } from "@antdv-next1/pro-utils";
|
|
5
|
+
import { BorderBeamProps, CardProps, ColProps, RowProps } from "antdv-next";
|
|
6
|
+
import { CustomSlotsType } from "@v-c/util/dist/type";
|
|
7
|
+
import { Gutter } from "antdv-next/dist/grid/row";
|
|
8
|
+
|
|
9
|
+
//#region src/ProCard.d.ts
|
|
10
|
+
interface ProCardProps extends CardProps, RowProps {
|
|
11
|
+
/** 标题说明 */
|
|
12
|
+
tooltip?: VueNode;
|
|
13
|
+
/** 拆分卡片方式 */
|
|
14
|
+
split?: 'vertical' | 'horizontal';
|
|
15
|
+
/** 指定 Flex 方向,仅在嵌套子卡片时有效 */
|
|
16
|
+
direction?: 'column' | 'row';
|
|
17
|
+
/** 栅格间距 */
|
|
18
|
+
gutter?: Gutter | [Gutter, Gutter];
|
|
19
|
+
colStyle?: CSSProperties;
|
|
20
|
+
/** 边框流光 */
|
|
21
|
+
borderBeam?: BorderBeamProps | boolean;
|
|
22
|
+
/** 布局,center 代表垂直居中 */
|
|
23
|
+
layout?: 'default' | 'center';
|
|
24
|
+
/** 是否有卡片阴影 */
|
|
25
|
+
boxShadow?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** 头部是否有分割线 */
|
|
28
|
+
headerBordered?: boolean;
|
|
29
|
+
/** 幽灵模式,即是否取消卡片内容区域的 padding 和 背景颜色。 */
|
|
30
|
+
ghost?: boolean;
|
|
31
|
+
collapsible?: CollapsibleType;
|
|
32
|
+
/** 受控 collapsed 属性 */
|
|
33
|
+
collapsed?: boolean;
|
|
34
|
+
/** 折叠按钮自定义节点 */
|
|
35
|
+
collapsibleIconRender?: ({
|
|
36
|
+
collapsed
|
|
37
|
+
}: {
|
|
38
|
+
collapsed: boolean;
|
|
39
|
+
}) => VueNode;
|
|
40
|
+
/** 配置默认是否折叠 */
|
|
41
|
+
defaultCollapsed?: boolean;
|
|
42
|
+
/** 收起卡片的事件 */
|
|
43
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
44
|
+
/** 是否展示选中样式 */
|
|
45
|
+
checked?: boolean;
|
|
46
|
+
/** 选中改变 */
|
|
47
|
+
onChecked?: (e: MouseEvent) => void;
|
|
48
|
+
/** 栅格占位格数,24 栅格,colSpan={6} */
|
|
49
|
+
colSpan?: ColProps['span'];
|
|
50
|
+
/** 栅格左侧的间隔格数,间隔内不可以有栅格 */
|
|
51
|
+
colOffset?: ColProps['offset'];
|
|
52
|
+
/** flex 布局填充 */
|
|
53
|
+
colFlex?: ColProps['flex'];
|
|
54
|
+
/** 栅格顺序,flex 布局模式下有效 */
|
|
55
|
+
colOrder?: ColProps['order'];
|
|
56
|
+
/** 栅格向左移动格数 */
|
|
57
|
+
colPull?: ColProps['pull'];
|
|
58
|
+
colPush?: ColProps['push'];
|
|
59
|
+
/** <576px 响应式栅格,可为栅格数或一个包含其他属性的对象 */
|
|
60
|
+
colXs?: ColProps['xs'];
|
|
61
|
+
/** ≥576px 响应式栅格,可为栅格数或一个包含其他属性的对象 */
|
|
62
|
+
colSm?: ColProps['sm'];
|
|
63
|
+
/** ≥768px 响应式栅格,可为栅格数或一个包含其他属性的对象 */
|
|
64
|
+
colMd?: ColProps['md'];
|
|
65
|
+
/** ≥992px 响应式栅格,可为栅格数或一个包含其他属性的对象 */
|
|
66
|
+
colLg?: ColProps['lg'];
|
|
67
|
+
/** ≥1200px 响应式栅格,可为栅格数或一个包含其他属性的对象 */
|
|
68
|
+
colXl?: ColProps['xl'];
|
|
69
|
+
/** ≥1600px 响应式栅格,可为栅格数或一个包含其他属性的对象 */
|
|
70
|
+
colXxl?: ColProps['xxl'];
|
|
71
|
+
onClick?: (e: MouseEvent) => void;
|
|
72
|
+
}
|
|
73
|
+
declare const _ProCard: _$vue.DefineSetupFnComponent<ProCardProps, {}, CustomSlotsType<{
|
|
74
|
+
default?: () => VNode[];
|
|
75
|
+
extra?: () => VueNode;
|
|
76
|
+
title?: () => VueNode;
|
|
77
|
+
}>, ProCardProps & {}, _$vue.PublicProps>;
|
|
78
|
+
declare const ProCard: typeof _ProCard & Plugin & {
|
|
79
|
+
isProCard?: boolean;
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
export { ProCardProps, ProCard as default };
|
package/dist/ProCard.js
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import useStyle from "./style/index.js";
|
|
2
|
+
import { Fragment, computed, createTextVNode, createVNode, defineComponent, isVNode, mergeProps, ref, watch } from "vue";
|
|
3
|
+
import { InfoCircleOutlined } from "@antdv-next/icons";
|
|
4
|
+
import { childrenToArray, isSpecialNode } from "@antdv-next1/pro-utils";
|
|
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";
|
|
9
|
+
//#region src/ProCard.tsx
|
|
10
|
+
function _isSlot(s) {
|
|
11
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
12
|
+
}
|
|
13
|
+
const ProCard = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
14
|
+
const config = useConfig();
|
|
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
|
+
const colProps = [
|
|
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
|
+
}, {});
|
|
123
|
+
console.log(colProps, element, "colProps");
|
|
124
|
+
return createVNode(Col, colProps, _isSlot(element) ? element : { default: () => [element] });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return element;
|
|
128
|
+
});
|
|
129
|
+
return wrapSSR(createVNode(Fragment, null, [collapsible ? createVNode(Collapse, mergeProps({ "bordered": rest.variant !== "borderless" }, defaultCollapsed ? {} : { activeKey: activeKey.value }, {
|
|
130
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value),
|
|
131
|
+
"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
|
+
"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
|
+
}),
|
|
139
|
+
"title": title
|
|
140
|
+
}, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
141
|
+
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
142
|
+
...rest.styles
|
|
143
|
+
} }), {
|
|
144
|
+
default: () => [direction !== "column" && containProCard ? createVNode(Row, { "gutter": gutter }, _isSlot(childrenDom) ? childrenDom : { default: () => [childrenDom] }) : ghost && containProCard ? createVNode("div", {
|
|
145
|
+
"class": `${baseClassName.value}-column`,
|
|
146
|
+
"style": {
|
|
147
|
+
...getStyle(horizontalGutter > 0, {
|
|
148
|
+
marginInlineEnd: `-${horizontalGutter / 2}px`,
|
|
149
|
+
marginInlineStart: `-${horizontalGutter / 2}px`
|
|
150
|
+
}),
|
|
151
|
+
...getStyle(verticalGutter > 0, {
|
|
152
|
+
marginBlockStart: `-${verticalGutter / 2}px`,
|
|
153
|
+
marginBlockEnd: `-${verticalGutter / 2}px`
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
}, [childrenDom]) : childrenDom],
|
|
157
|
+
...restSlots,
|
|
158
|
+
...slotTitleProps.value
|
|
159
|
+
})] }) : createVNode(Card, mergeProps(attrs, rest, {
|
|
160
|
+
"class": classNames(baseClassName.value, attrs.class, hashId.value, {
|
|
161
|
+
[`${baseClassName.value}-direction-column`]: split === "horizontal" || direction === "column",
|
|
162
|
+
[`${baseClassName.value}-ghost`]: ghost,
|
|
163
|
+
[`${baseClassName.value}-disabled`]: disabled,
|
|
164
|
+
[`${baseClassName.value}-box-shadow`]: boxShadow,
|
|
165
|
+
[`${baseClassName.value}-contain-card`]: containProCard
|
|
166
|
+
}),
|
|
167
|
+
"title": title
|
|
168
|
+
}, title && !tooltip && !slotTitle ? { title } : {}, { "styles": {
|
|
169
|
+
header: headerBordered ? {} : { borderBlockEnd: "none" },
|
|
170
|
+
...rest.styles
|
|
171
|
+
} }), {
|
|
172
|
+
default: () => [direction !== "column" && containProCard ? createVNode(Row, { "gutter": gutter }, _isSlot(childrenDom) ? childrenDom : { default: () => [childrenDom] }) : ghost && containProCard ? createVNode("div", {
|
|
173
|
+
"class": `${baseClassName.value}-column`,
|
|
174
|
+
"style": {
|
|
175
|
+
...getStyle(horizontalGutter > 0, {
|
|
176
|
+
marginInlineEnd: `-${horizontalGutter / 2}px`,
|
|
177
|
+
marginInlineStart: `-${horizontalGutter / 2}px`
|
|
178
|
+
}),
|
|
179
|
+
...getStyle(verticalGutter > 0, {
|
|
180
|
+
marginBlockStart: `-${verticalGutter / 2}px`,
|
|
181
|
+
marginBlockEnd: `-${verticalGutter / 2}px`
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
}, [childrenDom]) : childrenDom],
|
|
185
|
+
...restSlots,
|
|
186
|
+
...slotTitleProps.value
|
|
187
|
+
})])]));
|
|
188
|
+
};
|
|
189
|
+
}, {
|
|
190
|
+
props: {
|
|
191
|
+
tooltip: {
|
|
192
|
+
type: [
|
|
193
|
+
Object,
|
|
194
|
+
Function,
|
|
195
|
+
String,
|
|
196
|
+
Number,
|
|
197
|
+
null,
|
|
198
|
+
Boolean,
|
|
199
|
+
Array
|
|
200
|
+
],
|
|
201
|
+
required: false,
|
|
202
|
+
default: void 0
|
|
203
|
+
},
|
|
204
|
+
split: {
|
|
205
|
+
type: String,
|
|
206
|
+
required: false
|
|
207
|
+
},
|
|
208
|
+
direction: {
|
|
209
|
+
type: String,
|
|
210
|
+
required: false
|
|
211
|
+
},
|
|
212
|
+
gutter: {
|
|
213
|
+
type: [
|
|
214
|
+
Number,
|
|
215
|
+
null,
|
|
216
|
+
Object,
|
|
217
|
+
Array
|
|
218
|
+
],
|
|
219
|
+
required: false
|
|
220
|
+
},
|
|
221
|
+
colStyle: {
|
|
222
|
+
type: Object,
|
|
223
|
+
required: false
|
|
224
|
+
},
|
|
225
|
+
borderBeam: {
|
|
226
|
+
type: [Object, Boolean],
|
|
227
|
+
required: false,
|
|
228
|
+
default: void 0
|
|
229
|
+
},
|
|
230
|
+
layout: {
|
|
231
|
+
type: String,
|
|
232
|
+
required: false
|
|
233
|
+
},
|
|
234
|
+
boxShadow: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
required: false,
|
|
237
|
+
default: void 0
|
|
238
|
+
},
|
|
239
|
+
disabled: {
|
|
240
|
+
type: Boolean,
|
|
241
|
+
required: false,
|
|
242
|
+
default: void 0
|
|
243
|
+
},
|
|
244
|
+
headerBordered: {
|
|
245
|
+
type: Boolean,
|
|
246
|
+
required: false,
|
|
247
|
+
default: void 0
|
|
248
|
+
},
|
|
249
|
+
ghost: {
|
|
250
|
+
type: Boolean,
|
|
251
|
+
required: false,
|
|
252
|
+
default: void 0
|
|
253
|
+
},
|
|
254
|
+
collapsible: {
|
|
255
|
+
type: [String, Boolean],
|
|
256
|
+
required: false,
|
|
257
|
+
default: void 0
|
|
258
|
+
},
|
|
259
|
+
collapsed: {
|
|
260
|
+
type: Boolean,
|
|
261
|
+
required: false,
|
|
262
|
+
default: void 0
|
|
263
|
+
},
|
|
264
|
+
collapsibleIconRender: {
|
|
265
|
+
type: Function,
|
|
266
|
+
required: false
|
|
267
|
+
},
|
|
268
|
+
defaultCollapsed: {
|
|
269
|
+
type: Boolean,
|
|
270
|
+
required: false,
|
|
271
|
+
default: void 0
|
|
272
|
+
},
|
|
273
|
+
onCollapse: {
|
|
274
|
+
type: Function,
|
|
275
|
+
required: false
|
|
276
|
+
},
|
|
277
|
+
checked: {
|
|
278
|
+
type: Boolean,
|
|
279
|
+
required: false,
|
|
280
|
+
default: void 0
|
|
281
|
+
},
|
|
282
|
+
onChecked: {
|
|
283
|
+
type: Function,
|
|
284
|
+
required: false
|
|
285
|
+
},
|
|
286
|
+
colSpan: { required: false },
|
|
287
|
+
colOffset: { required: false },
|
|
288
|
+
colFlex: { required: false },
|
|
289
|
+
colOrder: { required: false },
|
|
290
|
+
colPull: { required: false },
|
|
291
|
+
colPush: { required: false },
|
|
292
|
+
colXs: { required: false },
|
|
293
|
+
colSm: { required: false },
|
|
294
|
+
colMd: { required: false },
|
|
295
|
+
colLg: { required: false },
|
|
296
|
+
colXl: { required: false },
|
|
297
|
+
colXxl: { required: false },
|
|
298
|
+
onClick: {
|
|
299
|
+
type: Function,
|
|
300
|
+
required: false
|
|
301
|
+
},
|
|
302
|
+
title: {
|
|
303
|
+
type: [
|
|
304
|
+
Function,
|
|
305
|
+
String,
|
|
306
|
+
Number,
|
|
307
|
+
null,
|
|
308
|
+
Object,
|
|
309
|
+
Boolean
|
|
310
|
+
],
|
|
311
|
+
required: false,
|
|
312
|
+
default: void 0
|
|
313
|
+
},
|
|
314
|
+
extra: {
|
|
315
|
+
type: [
|
|
316
|
+
Function,
|
|
317
|
+
String,
|
|
318
|
+
Number,
|
|
319
|
+
null,
|
|
320
|
+
Object,
|
|
321
|
+
Boolean
|
|
322
|
+
],
|
|
323
|
+
required: false,
|
|
324
|
+
default: void 0
|
|
325
|
+
},
|
|
326
|
+
bordered: {
|
|
327
|
+
type: Boolean,
|
|
328
|
+
required: false,
|
|
329
|
+
default: void 0
|
|
330
|
+
},
|
|
331
|
+
headStyle: {
|
|
332
|
+
type: Object,
|
|
333
|
+
required: false
|
|
334
|
+
},
|
|
335
|
+
bodyStyle: {
|
|
336
|
+
type: Object,
|
|
337
|
+
required: false
|
|
338
|
+
},
|
|
339
|
+
loading: {
|
|
340
|
+
type: Boolean,
|
|
341
|
+
required: false,
|
|
342
|
+
default: void 0
|
|
343
|
+
},
|
|
344
|
+
hoverable: {
|
|
345
|
+
type: Boolean,
|
|
346
|
+
required: false,
|
|
347
|
+
default: void 0
|
|
348
|
+
},
|
|
349
|
+
id: {
|
|
350
|
+
type: String,
|
|
351
|
+
required: false
|
|
352
|
+
},
|
|
353
|
+
size: {
|
|
354
|
+
type: String,
|
|
355
|
+
required: false
|
|
356
|
+
},
|
|
357
|
+
type: {
|
|
358
|
+
type: String,
|
|
359
|
+
required: false
|
|
360
|
+
},
|
|
361
|
+
cover: {
|
|
362
|
+
type: [
|
|
363
|
+
Function,
|
|
364
|
+
String,
|
|
365
|
+
Number,
|
|
366
|
+
null,
|
|
367
|
+
Object,
|
|
368
|
+
Boolean
|
|
369
|
+
],
|
|
370
|
+
required: false,
|
|
371
|
+
default: void 0
|
|
372
|
+
},
|
|
373
|
+
actions: {
|
|
374
|
+
type: Array,
|
|
375
|
+
required: false
|
|
376
|
+
},
|
|
377
|
+
tabList: {
|
|
378
|
+
type: Array,
|
|
379
|
+
required: false
|
|
380
|
+
},
|
|
381
|
+
tabBarExtraContent: {
|
|
382
|
+
type: [
|
|
383
|
+
Function,
|
|
384
|
+
String,
|
|
385
|
+
Number,
|
|
386
|
+
null,
|
|
387
|
+
Object,
|
|
388
|
+
Boolean
|
|
389
|
+
],
|
|
390
|
+
required: false,
|
|
391
|
+
default: void 0
|
|
392
|
+
},
|
|
393
|
+
activeTabKey: {
|
|
394
|
+
type: String,
|
|
395
|
+
required: false
|
|
396
|
+
},
|
|
397
|
+
defaultActiveTabKey: {
|
|
398
|
+
type: String,
|
|
399
|
+
required: false
|
|
400
|
+
},
|
|
401
|
+
tabProps: {
|
|
402
|
+
type: Object,
|
|
403
|
+
required: false
|
|
404
|
+
},
|
|
405
|
+
classes: {
|
|
406
|
+
type: [Object, Function],
|
|
407
|
+
required: false
|
|
408
|
+
},
|
|
409
|
+
styles: {
|
|
410
|
+
type: [Object, Function],
|
|
411
|
+
required: false
|
|
412
|
+
},
|
|
413
|
+
variant: {
|
|
414
|
+
type: String,
|
|
415
|
+
required: false
|
|
416
|
+
},
|
|
417
|
+
rootClass: {
|
|
418
|
+
type: String,
|
|
419
|
+
required: false
|
|
420
|
+
},
|
|
421
|
+
prefixCls: {
|
|
422
|
+
type: String,
|
|
423
|
+
required: false
|
|
424
|
+
},
|
|
425
|
+
onTabChange: {
|
|
426
|
+
type: Function,
|
|
427
|
+
required: false
|
|
428
|
+
},
|
|
429
|
+
"onUpdate:activeTabKey": {
|
|
430
|
+
type: Function,
|
|
431
|
+
required: false
|
|
432
|
+
},
|
|
433
|
+
align: {
|
|
434
|
+
type: [String, Object],
|
|
435
|
+
required: false
|
|
436
|
+
},
|
|
437
|
+
justify: {
|
|
438
|
+
type: [String, Object],
|
|
439
|
+
required: false
|
|
440
|
+
},
|
|
441
|
+
wrap: {
|
|
442
|
+
type: Boolean,
|
|
443
|
+
required: false,
|
|
444
|
+
default: void 0
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
name: "ProCard",
|
|
448
|
+
inheritAttrs: false
|
|
449
|
+
});
|
|
450
|
+
ProCard.isProCard = true;
|
|
451
|
+
ProCard.install = (app) => {
|
|
452
|
+
app.component(ProCard.name, ProCard);
|
|
453
|
+
return app;
|
|
454
|
+
};
|
|
455
|
+
//#endregion
|
|
456
|
+
export { ProCard as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ProCardProps } from "../../ProCard.js";
|
|
2
|
+
import ProCheckCardGroup from "./Group.js";
|
|
3
|
+
import * as _$vue from "vue";
|
|
4
|
+
import { VNode } from "vue";
|
|
5
|
+
import { BorderBeamProps, CardMetaProps, CardProps } from "antdv-next";
|
|
6
|
+
import { CustomSlotsType } from "@v-c/util/dist/type";
|
|
7
|
+
|
|
8
|
+
//#region src/components/CheckCard/CheckCard.d.ts
|
|
9
|
+
type ProCheckCardProps = CardMetaProps & Omit<CardProps, 'title' | 'onTabChange' | 'activeTabKey' | 'defaultActiveTabKey' | 'headStyle' | 'bodyStyle' | 'tabBarExtraContent' | 'tabList' | 'type' | 'size'> & {
|
|
10
|
+
/** 边框流光 */borderBeam?: BorderBeamProps | boolean;
|
|
11
|
+
size?: CardProps['size'] | 'large';
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
value?: string | number | boolean;
|
|
14
|
+
'onUpdate:value'?: (value: boolean) => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
'onUpdate:checked'?: (checked: boolean) => void;
|
|
17
|
+
onChange?: (checked: boolean) => void;
|
|
18
|
+
defaultChecked?: boolean;
|
|
19
|
+
onClick?: (e: MouseEvent) => void;
|
|
20
|
+
collapsible?: ProCardProps['collapsible'];
|
|
21
|
+
};
|
|
22
|
+
declare const _ProCheckCard: _$vue.DefineSetupFnComponent<ProCheckCardProps, {}, CustomSlotsType<{
|
|
23
|
+
default?: () => VNode[];
|
|
24
|
+
avatar?: () => VNode[];
|
|
25
|
+
title?: () => VNode[];
|
|
26
|
+
extra?: () => VNode[];
|
|
27
|
+
cover?: () => VNode[];
|
|
28
|
+
description?: () => VNode[];
|
|
29
|
+
}>, CardMetaProps & Omit<CardProps, "title" | "onTabChange" | "activeTabKey" | "defaultActiveTabKey" | "headStyle" | "bodyStyle" | "tabBarExtraContent" | "tabList" | "type" | "size"> & {
|
|
30
|
+
/** 边框流光 */borderBeam?: BorderBeamProps | boolean;
|
|
31
|
+
size?: CardProps["size"] | "large";
|
|
32
|
+
checked?: boolean;
|
|
33
|
+
value?: string | number | boolean;
|
|
34
|
+
'onUpdate:value'?: (value: boolean) => void;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
'onUpdate:checked'?: (checked: boolean) => void;
|
|
37
|
+
onChange?: (checked: boolean) => void;
|
|
38
|
+
defaultChecked?: boolean;
|
|
39
|
+
onClick?: (e: MouseEvent) => void;
|
|
40
|
+
collapsible?: ProCardProps["collapsible"];
|
|
41
|
+
} & {}, _$vue.PublicProps>;
|
|
42
|
+
declare const ProCheckCard: typeof _ProCheckCard & {
|
|
43
|
+
Group?: typeof ProCheckCardGroup;
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { ProCheckCardProps, ProCheckCard as default };
|