@pnkx-lib/ui 1.9.337 → 1.9.339
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/es/ui/ImportFile.js
CHANGED
package/es/ui/UploadComponent.js
CHANGED
|
@@ -9,25 +9,20 @@ const logoUpload = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUgAAADwCAYAAA
|
|
|
9
9
|
|
|
10
10
|
const { Dragger } = Upload;
|
|
11
11
|
const UploadComponent = ({
|
|
12
|
-
onUploadSuccess,
|
|
13
12
|
customStyleUpload,
|
|
14
13
|
styleImageDefault,
|
|
15
14
|
loading,
|
|
16
15
|
field,
|
|
17
16
|
imageUpload,
|
|
18
|
-
setImageUpload,
|
|
19
17
|
label,
|
|
20
18
|
required,
|
|
21
19
|
customStyleContainer,
|
|
22
20
|
content = "Tải hình ảnh lên",
|
|
23
21
|
description = "Ảnh có kích thước 400x400 px và dung lượng ảnh < 1 mb",
|
|
22
|
+
handleRemoveImage,
|
|
24
23
|
...restProps
|
|
25
24
|
}) => {
|
|
26
25
|
const imageUrl = field?.value;
|
|
27
|
-
const handleRemoveImage = () => {
|
|
28
|
-
setImageUpload("");
|
|
29
|
-
if (onUploadSuccess) onUploadSuccess("");
|
|
30
|
-
};
|
|
31
26
|
return /* @__PURE__ */ jsxs("div", { className: customStyleContainer, children: [
|
|
32
27
|
label && /* @__PURE__ */ jsx(Label, { label, required }),
|
|
33
28
|
/* @__PURE__ */ jsx(
|
|
@@ -55,10 +50,7 @@ const UploadComponent = ({
|
|
|
55
50
|
/* @__PURE__ */ jsx(Tooltip, { title: "Xóa ảnh", children: /* @__PURE__ */ jsx(
|
|
56
51
|
"button",
|
|
57
52
|
{
|
|
58
|
-
onClick:
|
|
59
|
-
e.stopPropagation();
|
|
60
|
-
handleRemoveImage();
|
|
61
|
-
},
|
|
53
|
+
onClick: handleRemoveImage,
|
|
62
54
|
className: "absolute top-1 right-1 w-6 h-6 flex items-center justify-center bg-white cursor-pointer bg-opacity-80 rounded-full hover:bg-opacity-100 transition",
|
|
63
55
|
children: /* @__PURE__ */ jsx(RefIcon, { className: "text-black text-[12px]" })
|
|
64
56
|
}
|
package/es/ui/UploadImage.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { UploadProps } from 'antd';
|
|
3
3
|
interface UploadImageProps extends UploadProps {
|
|
4
|
-
onUploadSuccess?: (url: string) => void;
|
|
5
4
|
customStyleContainer?: string;
|
|
6
5
|
customStyleUpload?: string;
|
|
7
6
|
label?: string;
|
|
@@ -13,6 +12,7 @@ interface UploadImageProps extends UploadProps {
|
|
|
13
12
|
setImageUpload?: any;
|
|
14
13
|
content?: string;
|
|
15
14
|
description?: string;
|
|
15
|
+
handleRemoveImage?: any;
|
|
16
16
|
}
|
|
17
17
|
export declare const UploadComponent: React.FC<UploadImageProps & {
|
|
18
18
|
field: any;
|