@fe-free/core 4.1.1 → 4.1.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
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @fe-free/core
|
|
2
2
|
|
|
3
|
+
## 4.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix some
|
|
8
|
+
- @fe-free/icons@4.1.3
|
|
9
|
+
- @fe-free/tool@4.1.3
|
|
10
|
+
|
|
11
|
+
## 4.1.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- fix some
|
|
16
|
+
- @fe-free/icons@4.1.2
|
|
17
|
+
- @fe-free/tool@4.1.2
|
|
18
|
+
|
|
3
19
|
## 4.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"i18next-icu": "^2.4.1",
|
|
51
51
|
"react": "^19.2.0",
|
|
52
52
|
"react-i18next": "^16.4.0",
|
|
53
|
-
"@fe-free/icons": "4.1.
|
|
54
|
-
"@fe-free/tool": "4.1.
|
|
53
|
+
"@fe-free/icons": "4.1.3",
|
|
54
|
+
"@fe-free/tool": "4.1.3"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"i18n-extract": "rm -rf ./src/locales/zh-CN && npx i18next-cli extract"
|
package/src/upload/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CloseOutlined, InboxOutlined, PlusOutlined, UploadOutlined } from '@fe-free/icons';
|
|
2
2
|
import type { UploadProps as AntdUploadProps, UploadFile } from 'antd';
|
|
3
3
|
import { Upload as AntdUpload, App, Avatar, Button } from 'antd';
|
|
4
4
|
import type { UploadChangeParam } from 'antd/es/upload';
|
|
@@ -272,37 +272,39 @@ interface AvatarImageUploadProps {
|
|
|
272
272
|
}
|
|
273
273
|
function AvatarImageUpload(props: AvatarImageUploadProps) {
|
|
274
274
|
const { value, onChange, action, customRequest, accept = 'image/*', headers } = props;
|
|
275
|
-
const { t } = useTranslation();
|
|
276
275
|
|
|
277
276
|
return (
|
|
278
|
-
<div
|
|
279
|
-
<
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
277
|
+
<div>
|
|
278
|
+
<AntdUpload
|
|
279
|
+
action={action}
|
|
280
|
+
customRequest={customRequest}
|
|
281
|
+
onChange={(info) => {
|
|
282
|
+
const url = info.file.response?.data?.url;
|
|
283
|
+
if (url) {
|
|
284
|
+
onChange?.(url);
|
|
285
|
+
}
|
|
286
|
+
}}
|
|
287
|
+
accept={accept}
|
|
288
|
+
headers={headers}
|
|
289
|
+
itemRender={() => null}
|
|
290
|
+
>
|
|
291
|
+
{value ? (
|
|
292
|
+
<div className="group relative h-20 w-20">
|
|
293
|
+
<Avatar size={80} src={value} shape="square" className="bg-01 shadow" />
|
|
294
|
+
<CloseOutlined
|
|
295
|
+
className="absolute right-1 top-1 cursor-pointer rounded-full bg-black/50 p-1 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100"
|
|
296
|
+
onClick={(e) => {
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
onChange?.();
|
|
299
|
+
}}
|
|
300
|
+
/>
|
|
301
|
+
</div>
|
|
302
|
+
) : (
|
|
303
|
+
<div className="flex h-20 w-20 cursor-pointer items-center justify-center rounded bg-01 shadow transition-colors hover:bg-02">
|
|
304
|
+
<PlusOutlined className="text-xl text-02" />
|
|
305
|
+
</div>
|
|
306
|
+
)}
|
|
307
|
+
</AntdUpload>
|
|
306
308
|
</div>
|
|
307
309
|
);
|
|
308
310
|
}
|