@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.
@@ -100,6 +100,7 @@ const ImportFile = ({ onUploadSuccess, ...rest }) => {
100
100
  {
101
101
  customRequest: handleUploadFile,
102
102
  listType: "picture",
103
+ accept: ".xlsx",
103
104
  ...rest,
104
105
  onRemove: () => setStatus(() => ({
105
106
  message: "",
@@ -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: (e) => {
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
  }
@@ -23,7 +23,6 @@ const UploadImage = ({
23
23
  {
24
24
  field,
25
25
  customRequest: handleUpload,
26
- onUploadSuccess: (url) => field.onChange(url),
27
26
  label,
28
27
  imageUpload: field.value,
29
28
  required,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.337",
4
+ "version": "1.9.339",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
@@ -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;