@jzwd/vnd-design 0.0.0-stage → 0.2.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/README.md +259 -2
- package/dist/file-center/api/endpoints.d.ts +42 -0
- package/dist/file-center/api/endpoints.js +45 -0
- package/dist/file-center/api/error.d.ts +6 -0
- package/dist/file-center/api/error.js +34 -0
- package/dist/file-center/api/index.d.ts +64 -0
- package/dist/file-center/api/index.js +238 -0
- package/dist/file-center/api/request.d.ts +28 -0
- package/dist/file-center/api/request.js +170 -0
- package/dist/file-center/api/token.d.ts +10 -0
- package/dist/file-center/api/token.js +122 -0
- package/dist/file-center/components/FcFileList/index.d.ts +39 -0
- package/dist/file-center/components/FcFileList/index.js +804 -0
- package/dist/file-center/components/FcFileList/style.css +106 -0
- package/dist/file-center/components/FcImage/index.d.ts +30 -0
- package/dist/file-center/components/FcImage/index.js +144 -0
- package/dist/file-center/components/FcImage/style.css +14 -0
- package/dist/file-center/components/FcUpload/index.d.ts +5 -0
- package/dist/file-center/components/FcUpload/index.js +642 -0
- package/dist/file-center/components/FcUpload/interface.d.ts +65 -0
- package/dist/file-center/components/FcUpload/interface.js +1 -0
- package/dist/file-center/components/FcUpload/style.css +279 -0
- package/dist/file-center/context.d.ts +22 -0
- package/dist/file-center/context.js +22 -0
- package/dist/file-center/index.d.ts +26 -0
- package/dist/file-center/index.js +21 -0
- package/dist/file-center/types.d.ts +144 -0
- package/dist/file-center/types.js +1 -0
- package/dist/file-center/upload.d.ts +35 -0
- package/dist/file-center/upload.js +295 -0
- package/dist/file-center/utils/common.d.ts +10 -0
- package/dist/file-center/utils/common.js +165 -0
- package/dist/file-center/utils/compress.d.ts +18 -0
- package/dist/file-center/utils/compress.js +108 -0
- package/dist/file-center/utils/md5.d.ts +5 -0
- package/dist/file-center/utils/md5.js +41 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +15 -0
- package/dist/mobile/FcImage/index.d.ts +26 -0
- package/dist/mobile/FcImage/index.js +114 -0
- package/dist/mobile/FcImage/style.css +11 -0
- package/dist/mobile/FcUpload/index.d.ts +74 -0
- package/dist/mobile/FcUpload/index.js +539 -0
- package/dist/mobile/FcUpload/style.css +233 -0
- package/dist/mobile/index.d.ts +13 -0
- package/dist/mobile/index.js +9 -0
- package/package.json +70 -4
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/* FcUpload 移动端样式:前缀 bcm-fc-upload */
|
|
2
|
+
|
|
3
|
+
.bcm-fc-upload {
|
|
4
|
+
position: relative;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
color: rgba(0, 0, 0, 0.88);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.bcm-fc-upload-input {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ---- 图片宫格形态 ---- */
|
|
14
|
+
.bcm-fc-upload-grid {
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-template-columns: repeat(3, 1fr);
|
|
17
|
+
gap: 8px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bcm-fc-upload-tile {
|
|
21
|
+
position: relative;
|
|
22
|
+
aspect-ratio: 1 / 1;
|
|
23
|
+
border-radius: 8px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
background: #fafafa;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bcm-fc-upload-tile-img {
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
object-fit: cover;
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.bcm-fc-upload-tile-ph {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
font-size: 24px;
|
|
42
|
+
color: rgba(0, 0, 0, 0.45);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.bcm-fc-upload-tile-add {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
gap: 4px;
|
|
51
|
+
border: 1px dashed #d9d9d9;
|
|
52
|
+
background: #fafafa;
|
|
53
|
+
color: rgba(0, 0, 0, 0.65);
|
|
54
|
+
transition:
|
|
55
|
+
border-color 0.2s,
|
|
56
|
+
color 0.2s;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.bcm-fc-upload-tile-add:active {
|
|
60
|
+
border-color: #1677ff;
|
|
61
|
+
color: #1677ff;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.bcm-fc-upload-tile-add .antd-mobile-icon {
|
|
65
|
+
font-size: 22px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bcm-fc-upload-tile-mask {
|
|
69
|
+
position: absolute;
|
|
70
|
+
inset: 0;
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
gap: 4px;
|
|
76
|
+
padding: 0 6px;
|
|
77
|
+
background: rgba(0, 0, 0, 0.5);
|
|
78
|
+
color: #fff;
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.bcm-fc-upload-tile-mask-error {
|
|
83
|
+
background: rgba(255, 77, 79, 0.75);
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.bcm-fc-upload-tile-mask-error span {
|
|
88
|
+
font-size: 11px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.bcm-fc-upload-tile-del {
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: 2px;
|
|
94
|
+
right: 2px;
|
|
95
|
+
width: 20px;
|
|
96
|
+
height: 20px;
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
border-radius: 50%;
|
|
101
|
+
background: rgba(0, 0, 0, 0.45);
|
|
102
|
+
color: #fff;
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ---- 文件列表形态 ---- */
|
|
107
|
+
.bcm-fc-upload-rows {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.bcm-fc-upload-row {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: 10px;
|
|
116
|
+
padding: 10px 0;
|
|
117
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.bcm-fc-upload-row-thumb {
|
|
121
|
+
flex: none;
|
|
122
|
+
width: 44px;
|
|
123
|
+
height: 44px;
|
|
124
|
+
border-radius: 6px;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
background: #fafafa;
|
|
130
|
+
color: rgba(0, 0, 0, 0.45);
|
|
131
|
+
font-size: 20px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.bcm-fc-upload-row-thumb img {
|
|
135
|
+
width: 100%;
|
|
136
|
+
height: 100%;
|
|
137
|
+
object-fit: cover;
|
|
138
|
+
display: block;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.bcm-fc-upload-row-main {
|
|
142
|
+
flex: 1;
|
|
143
|
+
min-width: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.bcm-fc-upload-row-name {
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.bcm-fc-upload-row-sub {
|
|
154
|
+
margin-top: 2px;
|
|
155
|
+
font-size: 12px;
|
|
156
|
+
color: rgba(0, 0, 0, 0.45);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.bcm-fc-upload-row-sub.is-error {
|
|
160
|
+
color: #ff4d4f;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.bcm-fc-upload-row-progress {
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 8px;
|
|
167
|
+
margin-top: 4px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.bcm-fc-upload-row-progress .adm-progress {
|
|
171
|
+
flex: 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.bcm-fc-upload-row-progress span {
|
|
175
|
+
flex: none;
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
color: rgba(0, 0, 0, 0.45);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.bcm-fc-upload-row-actions {
|
|
181
|
+
flex: none;
|
|
182
|
+
display: flex;
|
|
183
|
+
gap: 14px;
|
|
184
|
+
font-size: 18px;
|
|
185
|
+
color: rgba(0, 0, 0, 0.65);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.bcm-fc-upload-row-actions span:active {
|
|
189
|
+
color: #1677ff;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.bcm-fc-upload-addbtn {
|
|
193
|
+
margin-top: 12px;
|
|
194
|
+
height: 40px;
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
gap: 6px;
|
|
199
|
+
border: 1px dashed #d9d9d9;
|
|
200
|
+
border-radius: 8px;
|
|
201
|
+
background: #fafafa;
|
|
202
|
+
color: rgba(0, 0, 0, 0.65);
|
|
203
|
+
transition:
|
|
204
|
+
border-color 0.2s,
|
|
205
|
+
color 0.2s;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.bcm-fc-upload-addbtn:active {
|
|
209
|
+
border-color: #1677ff;
|
|
210
|
+
color: #1677ff;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* ---- 引用确认弹窗 ---- */
|
|
214
|
+
.bcm-fc-upload-refs {
|
|
215
|
+
text-align: left;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.bcm-fc-upload-refs-tip {
|
|
219
|
+
margin-bottom: 8px;
|
|
220
|
+
font-size: 13px;
|
|
221
|
+
color: rgba(0, 0, 0, 0.65);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.bcm-fc-upload-refs-list {
|
|
225
|
+
margin: 0 0 12px;
|
|
226
|
+
padding-left: 18px;
|
|
227
|
+
font-size: 13px;
|
|
228
|
+
color: rgba(0, 0, 0, 0.88);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.bcm-fc-upload-refs-list li {
|
|
232
|
+
margin-bottom: 4px;
|
|
233
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 移动端入口(@jzwd/vnd-design/mobile)
|
|
3
|
+
* 基于 antd-mobile 的 H5 组件,与 PC 端共用同一套接口契约与上传编排
|
|
4
|
+
*/
|
|
5
|
+
export { default as FcUpload, FcUpload as FcUploadMobile } from './FcUpload';
|
|
6
|
+
export type { FcMobileUploadFile, FcUploadMobileProps } from './FcUpload';
|
|
7
|
+
export { default as FcImage, FcImage as FcImageMobile } from './FcImage';
|
|
8
|
+
export type { FcImageMobileProps } from './FcImage';
|
|
9
|
+
export { FC_DEFAULT_BASE_URL } from '../file-center/context';
|
|
10
|
+
export type { FcComponentConfigProps } from '../file-center/context';
|
|
11
|
+
export { uploadFile } from '../file-center/upload';
|
|
12
|
+
export type { FcUploadOptions } from '../file-center/upload';
|
|
13
|
+
export type { FcFileInfo, FcFileReference, FcUploadProgress, FcBizInfo } from '../file-center/types';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 移动端入口(@jzwd/vnd-design/mobile)
|
|
3
|
+
* 基于 antd-mobile 的 H5 组件,与 PC 端共用同一套接口契约与上传编排
|
|
4
|
+
*/
|
|
5
|
+
export { default as FcUpload, FcUpload as FcUploadMobile } from "./FcUpload";
|
|
6
|
+
export { default as FcImage, FcImage as FcImageMobile } from "./FcImage";
|
|
7
|
+
/* 文件中心配置直接通过组件 props 传入(appKey 必填,baseUrl 有内置默认值) */
|
|
8
|
+
export { FC_DEFAULT_BASE_URL } from "../file-center/context";
|
|
9
|
+
export { uploadFile } from "../file-center/upload";
|
package/package.json
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jzwd/vnd-design",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Vnd design(简称 Vnd)组件库:继承 antd 全部组件,并提供公司自有业务组件(首个模块:文件中心 FileCenter)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": ["vnd", "vnd-design", "react", "antd", "components", "upload", "file-center"],
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./mobile": {
|
|
19
|
+
"types": "./dist/mobile/index.d.ts",
|
|
20
|
+
"import": "./dist/mobile/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./dist/*": "./dist/*",
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist"],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "father build",
|
|
28
|
+
"dev": "father dev",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"mock": "node mock/server.mjs",
|
|
31
|
+
"playground": "vite --config vite.playground.config.ts",
|
|
32
|
+
"docs": "dumi dev",
|
|
33
|
+
"docs:build": "dumi build",
|
|
34
|
+
"prepublishOnly": "father build"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"spark-md5": "^3.0.2"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@ant-design/icons": ">=5.0.0",
|
|
41
|
+
"antd": ">=5.0.0",
|
|
42
|
+
"antd-mobile": ">=5.0.0",
|
|
43
|
+
"antd-mobile-icons": ">=0.3.0",
|
|
44
|
+
"dayjs": ">=1.11.0",
|
|
45
|
+
"react": ">=17.0.0",
|
|
46
|
+
"react-dom": ">=17.0.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependenciesMeta": {
|
|
49
|
+
"antd-mobile": {
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
52
|
+
"antd-mobile-icons": {
|
|
53
|
+
"optional": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@ant-design/icons": "^5.5.1",
|
|
58
|
+
"@types/react": "^18.3.12",
|
|
59
|
+
"@types/react-dom": "^18.3.1",
|
|
60
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
61
|
+
"antd": "^5.22.0",
|
|
62
|
+
"antd-mobile": "^5.43.0",
|
|
63
|
+
"antd-mobile-icons": "^0.3.0",
|
|
64
|
+
"busboy": "^1.6.0",
|
|
65
|
+
"dayjs": "^1.11.13",
|
|
66
|
+
"father": "^4.5.1",
|
|
67
|
+
"react": "^18.3.1",
|
|
68
|
+
"react-dom": "^18.3.1",
|
|
69
|
+
"typescript": "^5.6.3",
|
|
70
|
+
"vite": "^5.4.11"
|
|
71
|
+
}
|
|
72
|
+
}
|