@antdv-vue/pro-skeleton 0.0.0-stage → 1.0.3
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/CHANGELOG.md +25 -0
- package/README.md +4 -2
- package/dist/Skeleton.d.ts +18 -0
- package/dist/Skeleton.js +57 -0
- package/dist/components/Descriptions/DescriptionsItem.d.ts +13 -0
- package/dist/components/Descriptions/DescriptionsItem.js +73 -0
- package/dist/components/Descriptions/DescriptionsLargeItem.d.ts +12 -0
- package/dist/components/Descriptions/DescriptionsLargeItem.js +66 -0
- package/dist/components/Descriptions/Table.d.ts +13 -0
- package/dist/components/Descriptions/Table.js +57 -0
- package/dist/components/Descriptions/TableItem.d.ts +13 -0
- package/dist/components/Descriptions/TableItem.js +76 -0
- package/dist/components/Descriptions/index.d.ts +18 -0
- package/dist/components/Descriptions/index.js +64 -0
- package/dist/components/List/Statistic.d.ts +21 -0
- package/dist/components/List/Statistic.js +78 -0
- package/dist/components/List/index.d.ts +46 -0
- package/dist/components/List/index.js +167 -0
- package/dist/components/Result/index.d.ts +13 -0
- package/dist/components/Result/index.js +58 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/pro-skeleton.esm.js +571 -0
- package/package.json +59 -3
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import StatisticSkeleton from "./Statistic.js";
|
|
2
|
+
import { Fragment, createVNode, defineComponent } from "vue";
|
|
3
|
+
import { Card, Divider, Skeleton, SkeletonButton, Space } from "antdv-next";
|
|
4
|
+
import { unit } from "@antdv-next/cssinjs";
|
|
5
|
+
//#region src/components/List/index.tsx
|
|
6
|
+
/** 一条分割线 */
|
|
7
|
+
const Line = ({ padding }) => {
|
|
8
|
+
return createVNode("div", { "style": { padding: unit(padding || "") || "0 24px" } }, [createVNode(Divider, { "style": { margin: 0 } }, null)]);
|
|
9
|
+
};
|
|
10
|
+
/** 列表子项目骨架屏 */
|
|
11
|
+
const ListSkeletonItem = ({ active }) => createVNode(Fragment, null, [createVNode(Card, {
|
|
12
|
+
"variant": "borderless",
|
|
13
|
+
"styles": {
|
|
14
|
+
root: { borderRadius: 0 },
|
|
15
|
+
body: { padding: "24px" }
|
|
16
|
+
}
|
|
17
|
+
}, { default: () => [createVNode("div", { "style": {
|
|
18
|
+
width: "100%",
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "space-between"
|
|
22
|
+
} }, [createVNode("div", { "style": {
|
|
23
|
+
maxWidth: "100%",
|
|
24
|
+
flex: 1
|
|
25
|
+
} }, [createVNode(Skeleton, {
|
|
26
|
+
"active": active,
|
|
27
|
+
"title": {
|
|
28
|
+
width: "100px",
|
|
29
|
+
style: { marginBlockStart: 0 }
|
|
30
|
+
},
|
|
31
|
+
"paragraph": {
|
|
32
|
+
rows: 1,
|
|
33
|
+
style: { margin: 0 }
|
|
34
|
+
}
|
|
35
|
+
}, null)]), createVNode(Skeleton.Button, {
|
|
36
|
+
"active": active,
|
|
37
|
+
"size": "small",
|
|
38
|
+
"style": {
|
|
39
|
+
width: "165px",
|
|
40
|
+
marginBlockStart: "12px"
|
|
41
|
+
}
|
|
42
|
+
}, null)])] }), createVNode(Line, null, null)]);
|
|
43
|
+
/** 列表骨架屏 */
|
|
44
|
+
const ListSkeleton = ({ size, active = true, actionButton }) => createVNode(Card, {
|
|
45
|
+
"variant": "borderless",
|
|
46
|
+
"styles": { body: { padding: 0 } }
|
|
47
|
+
}, { default: () => [Array.from({ length: size }).fill(null).map((_, index) => createVNode(ListSkeletonItem, {
|
|
48
|
+
"key": index,
|
|
49
|
+
"active": !!active
|
|
50
|
+
}, null)), actionButton !== false && createVNode(Card, {
|
|
51
|
+
"variant": "borderless",
|
|
52
|
+
"styles": {
|
|
53
|
+
root: {
|
|
54
|
+
borderStartEndRadius: 0,
|
|
55
|
+
borderTopLeftRadius: 0
|
|
56
|
+
},
|
|
57
|
+
body: {
|
|
58
|
+
display: "flex",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, { default: () => [createVNode(SkeletonButton, {
|
|
64
|
+
"style": { width: "102px" },
|
|
65
|
+
"active": active,
|
|
66
|
+
"size": "small"
|
|
67
|
+
}, null)] })] });
|
|
68
|
+
/**
|
|
69
|
+
* 面包屑的 骨架屏
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
const PageHeaderSkeleton = ({ active }) => {
|
|
73
|
+
return createVNode("div", { "style": { marginBlockEnd: "16px" } }, [createVNode(Skeleton, {
|
|
74
|
+
"paragraph": false,
|
|
75
|
+
"title": { width: "185px" }
|
|
76
|
+
}, null), createVNode(SkeletonButton, {
|
|
77
|
+
"active": active,
|
|
78
|
+
"size": "small"
|
|
79
|
+
}, null)]);
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* 列表操作栏的骨架屏
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
const ListToolbarSkeleton = ({ active }) => createVNode(Card, {
|
|
86
|
+
"variant": "borderless",
|
|
87
|
+
"styles": {
|
|
88
|
+
root: {
|
|
89
|
+
borderBottomRightRadius: 0,
|
|
90
|
+
borderBottomLeftRadius: 0
|
|
91
|
+
},
|
|
92
|
+
body: { paddingBlockEnd: "8px" }
|
|
93
|
+
}
|
|
94
|
+
}, { default: () => [createVNode(Space, { "style": {
|
|
95
|
+
width: "100%",
|
|
96
|
+
justifyContent: "space-between"
|
|
97
|
+
} }, { default: () => [createVNode(SkeletonButton, {
|
|
98
|
+
"active": active,
|
|
99
|
+
"style": { width: "200px" },
|
|
100
|
+
"size": "small"
|
|
101
|
+
}, null), createVNode(Space, null, { default: () => [createVNode(SkeletonButton, {
|
|
102
|
+
"active": active,
|
|
103
|
+
"size": "small",
|
|
104
|
+
"style": { width: "120px" }
|
|
105
|
+
}, null), createVNode(SkeletonButton, {
|
|
106
|
+
"active": active,
|
|
107
|
+
"size": "small",
|
|
108
|
+
"style": { width: "80px" }
|
|
109
|
+
}, null)] })] })] });
|
|
110
|
+
const ListPageSkeleton = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
111
|
+
expose({});
|
|
112
|
+
return () => {
|
|
113
|
+
const { active = true, statistic, actionButton, toolbar, pageHeader, list = 5 } = props;
|
|
114
|
+
return createVNode("div", { "style": { width: "100%" } }, [
|
|
115
|
+
pageHeader !== false && createVNode(PageHeaderSkeleton, { "active": active }, null),
|
|
116
|
+
statistic !== false && createVNode(StatisticSkeleton, {
|
|
117
|
+
"size": statistic,
|
|
118
|
+
"active": active
|
|
119
|
+
}, null),
|
|
120
|
+
(toolbar !== false || list !== false) && createVNode(Card, {
|
|
121
|
+
"variant": "borderless",
|
|
122
|
+
"styles": { body: { padding: 0 } }
|
|
123
|
+
}, { default: () => [toolbar !== false && createVNode(ListToolbarSkeleton, { "active": active }, null), list !== false && createVNode(ListSkeleton, {
|
|
124
|
+
"size": list,
|
|
125
|
+
"active": active,
|
|
126
|
+
"actionButton": actionButton
|
|
127
|
+
}, null)] })
|
|
128
|
+
]);
|
|
129
|
+
};
|
|
130
|
+
}, {
|
|
131
|
+
props: {
|
|
132
|
+
active: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
required: false,
|
|
135
|
+
default: void 0
|
|
136
|
+
},
|
|
137
|
+
pageHeader: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
required: false,
|
|
140
|
+
default: void 0
|
|
141
|
+
},
|
|
142
|
+
statistic: {
|
|
143
|
+
type: [Number, Boolean],
|
|
144
|
+
required: false,
|
|
145
|
+
default: void 0
|
|
146
|
+
},
|
|
147
|
+
actionButton: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
required: false,
|
|
150
|
+
default: void 0
|
|
151
|
+
},
|
|
152
|
+
toolbar: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
required: false,
|
|
155
|
+
default: void 0
|
|
156
|
+
},
|
|
157
|
+
list: {
|
|
158
|
+
type: [Number, Boolean],
|
|
159
|
+
required: false,
|
|
160
|
+
default: void 0
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
name: "ListPageSkeleton",
|
|
164
|
+
inheritAttrs: false
|
|
165
|
+
});
|
|
166
|
+
//#endregion
|
|
167
|
+
export { Line, ListSkeleton, ListSkeletonItem, ListToolbarSkeleton, PageHeaderSkeleton, ListPageSkeleton as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { CustomSlotsType, VueNode } from "@v-c/util/dist/type";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Result/index.d.ts
|
|
5
|
+
interface ResultPageSkeletonProps {
|
|
6
|
+
active?: boolean;
|
|
7
|
+
pageHeader?: false;
|
|
8
|
+
}
|
|
9
|
+
declare const ResultPageSkeleton: _$vue.DefineSetupFnComponent<ResultPageSkeletonProps, {}, CustomSlotsType<{
|
|
10
|
+
default?: () => VueNode[];
|
|
11
|
+
}>, ResultPageSkeletonProps & {}, _$vue.PublicProps>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ResultPageSkeletonProps, ResultPageSkeleton as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PageHeaderSkeleton } from "../List/index.js";
|
|
2
|
+
import { createVNode, defineComponent } from "vue";
|
|
3
|
+
import { Card, SkeletonAvatar, SkeletonButton, Space } from "antdv-next";
|
|
4
|
+
//#region src/components/Result/index.tsx
|
|
5
|
+
const ResultPageSkeleton = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
6
|
+
expose({});
|
|
7
|
+
return () => {
|
|
8
|
+
const { active = true, pageHeader } = props;
|
|
9
|
+
return createVNode("div", { "style": { width: "100%" } }, [pageHeader !== false && createVNode(PageHeaderSkeleton, { "active": active }, null), createVNode(Card, null, { default: () => [createVNode("div", { "style": {
|
|
10
|
+
display: "flex",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
padding: "128px"
|
|
15
|
+
} }, [
|
|
16
|
+
createVNode(SkeletonAvatar, {
|
|
17
|
+
"size": 64,
|
|
18
|
+
"style": { marginBlockEnd: "32px" }
|
|
19
|
+
}, null),
|
|
20
|
+
createVNode(SkeletonButton, {
|
|
21
|
+
"active": active,
|
|
22
|
+
"style": {
|
|
23
|
+
width: "214px",
|
|
24
|
+
marginBlockEnd: "8px"
|
|
25
|
+
}
|
|
26
|
+
}, null),
|
|
27
|
+
createVNode(SkeletonButton, {
|
|
28
|
+
"active": active,
|
|
29
|
+
"style": { width: "328px" },
|
|
30
|
+
"size": "small"
|
|
31
|
+
}, null),
|
|
32
|
+
createVNode(Space, { "style": { marginBlockStart: "24px" } }, { default: () => [createVNode(SkeletonButton, {
|
|
33
|
+
"active": active,
|
|
34
|
+
"style": { width: "116px" }
|
|
35
|
+
}, null), createVNode(SkeletonButton, {
|
|
36
|
+
"active": active,
|
|
37
|
+
"style": { width: "116px" }
|
|
38
|
+
}, null)] })
|
|
39
|
+
])] })]);
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
props: {
|
|
43
|
+
active: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
required: false,
|
|
46
|
+
default: void 0
|
|
47
|
+
},
|
|
48
|
+
pageHeader: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: false,
|
|
51
|
+
default: void 0
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
name: "ResultPageSkeleton",
|
|
55
|
+
inheritAttrs: false
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { ResultPageSkeleton as default };
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED