next-helios-fe 1.6.20 → 1.6.22
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/package.json
CHANGED
@@ -12,8 +12,8 @@ export interface FileProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
12
12
|
height?: "short" | "medium" | "high";
|
13
13
|
};
|
14
14
|
label?: string;
|
15
|
-
defaultValue?: [];
|
16
|
-
value?: [];
|
15
|
+
defaultValue?: any[];
|
16
|
+
value?: any[];
|
17
17
|
}
|
18
18
|
|
19
19
|
export const File: React.FC<FileProps> = ({
|
@@ -52,15 +52,6 @@ export const File: React.FC<FileProps> = ({
|
|
52
52
|
}
|
53
53
|
}, [value, defaultValue]);
|
54
54
|
|
55
|
-
useEffect(() => {
|
56
|
-
if (tempFile.length !== 0) {
|
57
|
-
rest.onChange &&
|
58
|
-
rest.onChange({
|
59
|
-
target: { files: tempFile } as HTMLInputElement,
|
60
|
-
} as any);
|
61
|
-
}
|
62
|
-
}, [tempFile]);
|
63
|
-
|
64
55
|
return (
|
65
56
|
<label className={`grid gap-2 ${width}`}>
|
66
57
|
{label && (
|
@@ -84,7 +75,13 @@ export const File: React.FC<FileProps> = ({
|
|
84
75
|
type="file"
|
85
76
|
className={`peer/file w-full px-4 border-default border rounded-md bg-secondary-bg text-transparent file:hidden focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-slate-400 ${height}`}
|
86
77
|
onChange={(e) => {
|
87
|
-
|
78
|
+
if (rest.onChange) {
|
79
|
+
rest.onChange({
|
80
|
+
target: { files: e.target.files } as HTMLInputElement,
|
81
|
+
} as any);
|
82
|
+
} else {
|
83
|
+
setTempFile(e.target.files);
|
84
|
+
}
|
88
85
|
}}
|
89
86
|
{...rest}
|
90
87
|
/>
|
@@ -103,7 +100,13 @@ export const File: React.FC<FileProps> = ({
|
|
103
100
|
type="file"
|
104
101
|
className={`w-full h-60 px-4 border-default border border-dashed rounded-md bg-secondary-bg text-transparent cursor-pointer file:hidden focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light`}
|
105
102
|
onChange={(e) => {
|
106
|
-
|
103
|
+
if (rest.onChange) {
|
104
|
+
rest.onChange({
|
105
|
+
target: { files: e.target.files } as HTMLInputElement,
|
106
|
+
} as any);
|
107
|
+
} else {
|
108
|
+
setTempFile(e.target.files);
|
109
|
+
}
|
107
110
|
}}
|
108
111
|
onDragEnter={(e) => {
|
109
112
|
if (!rest.disabled) {
|
@@ -140,7 +143,15 @@ export const File: React.FC<FileProps> = ({
|
|
140
143
|
"border-primary",
|
141
144
|
"bg-primary-transparent"
|
142
145
|
);
|
143
|
-
|
146
|
+
if (rest.onChange) {
|
147
|
+
rest.onChange({
|
148
|
+
target: {
|
149
|
+
files: e.dataTransfer.files,
|
150
|
+
} as HTMLInputElement,
|
151
|
+
} as any);
|
152
|
+
} else {
|
153
|
+
setTempFile(e.dataTransfer.files);
|
154
|
+
}
|
144
155
|
}
|
145
156
|
}}
|
146
157
|
{...rest}
|
@@ -52,11 +52,11 @@ interface TableProps {
|
|
52
52
|
height?: "full" | "fit" | "20" | "40" | "80";
|
53
53
|
};
|
54
54
|
checkbox?: {
|
55
|
-
checked
|
55
|
+
checked: {
|
56
56
|
id: number | string;
|
57
57
|
[key: string]: any;
|
58
58
|
}[];
|
59
|
-
onChange
|
59
|
+
onChange: (
|
60
60
|
checked: {
|
61
61
|
id: number | string;
|
62
62
|
[key: string]: any;
|