@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComputedRef } from "vue";
|
|
2
|
+
import * as _$_antdv_next1_pro_provider0 from "@antdv-next1/pro-provider";
|
|
3
|
+
|
|
4
|
+
//#region src/style/index.d.ts
|
|
5
|
+
declare function useStyle(prefixCls: ComputedRef<string>): _$_antdv_next1_pro_provider0.UseStyleResult;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { useStyle as default };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { useStyle as useStyle$1 } from "@antdv-next1/pro-provider";
|
|
2
|
+
//#region src/style/index.ts
|
|
3
|
+
const genProCardStyle = (token) => {
|
|
4
|
+
const { componentCls } = token;
|
|
5
|
+
return { [componentCls]: {
|
|
6
|
+
[`&${token.antCls}-collapse`]: {
|
|
7
|
+
"&&-ghost": { [`${token.antCls}-collapse-item`]: {
|
|
8
|
+
[`${componentCls}-header`]: { borderRadius: 0 },
|
|
9
|
+
[`${token.antCls}-collapse-content`]: { "&-box": { padding: token.paddingLG } }
|
|
10
|
+
} },
|
|
11
|
+
[`${token.antCls}-collapse-item`]: {
|
|
12
|
+
"&-active": { [`${componentCls}-header`]: {
|
|
13
|
+
transition: "none",
|
|
14
|
+
"&-border": { borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}` }
|
|
15
|
+
} },
|
|
16
|
+
[`${componentCls}-header`]: { [`&${token.antCls}-collapse-header`]: {
|
|
17
|
+
paddingBlock: 16,
|
|
18
|
+
paddingInline: 24,
|
|
19
|
+
[`${token.antCls}-collapse-header-text`]: { fontSize: token.fontSizeLG }
|
|
20
|
+
} }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
[`&${token.antCls}-card:not(${token.antCls}-card-bordered):not(&-box-shadow)`]: { boxShadow: "none" },
|
|
24
|
+
"&&-direction-column": {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
[`& > ${token.antCls}-card-body`]: { [`${componentCls}-column`]: {
|
|
28
|
+
display: "flex",
|
|
29
|
+
boxSizing: "border-box",
|
|
30
|
+
height: "100%",
|
|
31
|
+
flexDirection: "column"
|
|
32
|
+
} }
|
|
33
|
+
},
|
|
34
|
+
[`&${token.antCls}-card&-ghost`]: {
|
|
35
|
+
boxShadow: "none",
|
|
36
|
+
backgroundColor: "transparent",
|
|
37
|
+
[`& > ${token.antCls}-card-body`]: {
|
|
38
|
+
paddingBlock: 0,
|
|
39
|
+
paddingInline: 0,
|
|
40
|
+
borderRadius: 0
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"&-disabled": {
|
|
44
|
+
backgroundColor: token.colorBgContainerDisabled,
|
|
45
|
+
borderColor: token.colorBorder,
|
|
46
|
+
color: token.colorTextDisabled,
|
|
47
|
+
cursor: "not-allowed"
|
|
48
|
+
}
|
|
49
|
+
} };
|
|
50
|
+
};
|
|
51
|
+
function genLoopGridColumnsStyle(token, sizeCls) {
|
|
52
|
+
const { componentCls, gridColumns } = token;
|
|
53
|
+
return Array.from({ length: gridColumns + 1 }).fill(1).reduce((gridColumnsStyle, _, index) => {
|
|
54
|
+
if (index === 0) {
|
|
55
|
+
gridColumnsStyle[`${componentCls}-col${sizeCls}-${index}`] = { display: "none" };
|
|
56
|
+
gridColumnsStyle[`${componentCls}-push-${index}`] = { insetInlineStart: "auto" };
|
|
57
|
+
gridColumnsStyle[`${componentCls}-pull-${index}`] = { insetInlineEnd: "auto" };
|
|
58
|
+
gridColumnsStyle[`${componentCls}${sizeCls}-push-${index}`] = { insetInlineStart: "auto" };
|
|
59
|
+
gridColumnsStyle[`${componentCls}${sizeCls}-pull-${index}`] = { insetInlineEnd: "auto" };
|
|
60
|
+
gridColumnsStyle[`${componentCls}${sizeCls}-offset-${index}`] = { marginInlineEnd: 0 };
|
|
61
|
+
gridColumnsStyle[`${componentCls}${sizeCls}-order-${index}`] = { order: 0 };
|
|
62
|
+
} else {
|
|
63
|
+
gridColumnsStyle[`${componentCls}-col${sizeCls}-${index}`] = {
|
|
64
|
+
display: "block",
|
|
65
|
+
flex: `0 0 ${index / gridColumns * 100}%`,
|
|
66
|
+
maxWidth: `${index / gridColumns * 100}%`
|
|
67
|
+
};
|
|
68
|
+
gridColumnsStyle[`${componentCls}-col${sizeCls}-push-${index}`] = { insetInlineStart: `${index / gridColumns * 100}%` };
|
|
69
|
+
gridColumnsStyle[`${componentCls}-col${sizeCls}-pull-${index}`] = { insetInlineEnd: `${index / gridColumns * 100}%` };
|
|
70
|
+
gridColumnsStyle[`${componentCls}-col${sizeCls}-offset-${index}`] = { marginInlineStart: `${index / gridColumns * 100}%` };
|
|
71
|
+
gridColumnsStyle[`${componentCls}-col${sizeCls}-order-${index}`] = { order: index };
|
|
72
|
+
}
|
|
73
|
+
return gridColumnsStyle;
|
|
74
|
+
}, {});
|
|
75
|
+
}
|
|
76
|
+
const genGridStyle = (token, sizeCls) => genLoopGridColumnsStyle(token, sizeCls);
|
|
77
|
+
const genGridMediaStyle = (token, screenSize, sizeCls) => {
|
|
78
|
+
return { [`@media (min-width: ${screenSize}px)`]: { ...genGridStyle(token, sizeCls) } };
|
|
79
|
+
};
|
|
80
|
+
function useStyle(prefixCls) {
|
|
81
|
+
return useStyle$1("ProCard", (token) => {
|
|
82
|
+
const proCardToken = {
|
|
83
|
+
...token,
|
|
84
|
+
gridColumns: 24,
|
|
85
|
+
componentCls: `.${prefixCls.value}`
|
|
86
|
+
};
|
|
87
|
+
const gridMediaSizesMap = {
|
|
88
|
+
"-xs": proCardToken.screenXSMin,
|
|
89
|
+
"-sm": proCardToken.screenSMMin,
|
|
90
|
+
"-md": proCardToken.screenMDMin,
|
|
91
|
+
"-lg": proCardToken.screenLGMin,
|
|
92
|
+
"-xl": proCardToken.screenXLMin,
|
|
93
|
+
"-xxl": proCardToken.screenXXLMin
|
|
94
|
+
};
|
|
95
|
+
return [
|
|
96
|
+
genProCardStyle(proCardToken),
|
|
97
|
+
genGridStyle(proCardToken, ""),
|
|
98
|
+
genGridStyle(proCardToken, "-xs"),
|
|
99
|
+
Object.keys(gridMediaSizesMap).map((key) => genGridMediaStyle(proCardToken, gridMediaSizesMap[key], key)).reduce((pre, cur) => ({
|
|
100
|
+
...pre,
|
|
101
|
+
...cur
|
|
102
|
+
}), {})
|
|
103
|
+
];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { useStyle as default };
|
package/dist/typing.d.ts
ADDED
package/dist/typing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@antdv-next1/pro-card",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "@antdv-next1/pro-card",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"./dist/pro-card.esm.js",
|
|
8
|
+
"./dist/pro-card.js"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./dist/*": {
|
|
17
|
+
"types": "./dist/*.d.ts",
|
|
18
|
+
"import": "./dist/*.js",
|
|
19
|
+
"default": "./dist/*.js"
|
|
20
|
+
},
|
|
21
|
+
"./dist/pro-card.esm.js": "./dist/pro-card.esm.js",
|
|
22
|
+
"./dist/pro-card.js": "./dist/pro-card.js"
|
|
23
|
+
},
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"unpkg": "dist/pro-card.js",
|
|
27
|
+
"jsdelivr": "dist/pro-card.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"README.md",
|
|
32
|
+
"dist",
|
|
33
|
+
"package.json"
|
|
34
|
+
],
|
|
35
|
+
"browserslist": [
|
|
36
|
+
"last 2 versions",
|
|
37
|
+
"Firefox ESR",
|
|
38
|
+
"> 1%",
|
|
39
|
+
"ie >= 11"
|
|
40
|
+
],
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"antdv-next": ">=1.1.6",
|
|
43
|
+
"vue": ">=3.5.30"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@antdv-next1/pro-provider": "1.0.0",
|
|
47
|
+
"@antdv-next1/pro-utils": "1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"authors": [
|
|
53
|
+
"Song Chao <archiesongqd@gmail.com> (https://github.com/asuradaSong)"
|
|
54
|
+
],
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "run-s build:esm build:vite:parallel",
|
|
57
|
+
"build:esm": "tsdown --config-loader unrun",
|
|
58
|
+
"build:vite:parallel": "run-p build:umd build:full-esm",
|
|
59
|
+
"build:full-esm": "vite build --config ./vite.esm.config.ts",
|
|
60
|
+
"build:umd": "vite build",
|
|
61
|
+
"prepublish": "pnpm build"
|
|
62
|
+
}
|
|
63
|
+
}
|