next-helios-fe 1.8.135 → 1.8.137
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
@@ -51,9 +51,26 @@ export const File: React.FC<FileProps> = ({
|
|
51
51
|
useEffect(() => {
|
52
52
|
if (value) {
|
53
53
|
setTempFile(value);
|
54
|
+
|
55
|
+
if (value[0]?.size > (options?.maxSizeInMb || 0) * (1024 * 1024)) {
|
56
|
+
inputRef.current?.setCustomValidity(
|
57
|
+
`Please select a file less than ${options?.maxSizeInMb} MB.`
|
58
|
+
);
|
59
|
+
} else {
|
60
|
+
inputRef.current?.setCustomValidity("");
|
61
|
+
}
|
62
|
+
|
54
63
|
return;
|
55
64
|
} else if (defaultValue) {
|
56
65
|
setTempFile(defaultValue);
|
66
|
+
|
67
|
+
if (defaultValue[0]?.size > (options?.maxSizeInMb || 0) * (1024 * 1024)) {
|
68
|
+
inputRef.current?.setCustomValidity(
|
69
|
+
`Please select a file less than ${options?.maxSizeInMb} MB.`
|
70
|
+
);
|
71
|
+
} else {
|
72
|
+
inputRef.current?.setCustomValidity("");
|
73
|
+
}
|
57
74
|
return;
|
58
75
|
}
|
59
76
|
}, [value, defaultValue]);
|
@@ -137,6 +154,7 @@ export const File: React.FC<FileProps> = ({
|
|
137
154
|
) : (
|
138
155
|
<div className="relative flex-1 flex items-center h-full">
|
139
156
|
<input
|
157
|
+
ref={inputRef}
|
140
158
|
type="file"
|
141
159
|
className={`w-full 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 disabled:cursor-default ${
|
142
160
|
options?.height === "full" ? "min-h-60 h-full" : "h-60"
|
@@ -214,9 +232,11 @@ export const File: React.FC<FileProps> = ({
|
|
214
232
|
>
|
215
233
|
{tempFile.length !== 0
|
216
234
|
? `${
|
217
|
-
tempFile[0]?.size <
|
218
|
-
? `${(tempFile[0]?.size /
|
219
|
-
: `${(tempFile[0]?.size /
|
235
|
+
tempFile[0]?.size < 1024 * 1024
|
236
|
+
? `${(tempFile[0]?.size / 1024).toFixed(2)} KB`
|
237
|
+
: `${(tempFile[0]?.size / (1024 * 1024)).toFixed(
|
238
|
+
2
|
239
|
+
)} MB`
|
220
240
|
}`
|
221
241
|
: `Maximum file size ${options?.maxSizeInMb} MB`}
|
222
242
|
</span>
|
@@ -660,7 +660,7 @@ export const Table: TableComponentProps = ({
|
|
660
660
|
});
|
661
661
|
|
662
662
|
const dataArr = (
|
663
|
-
options?.toolbar?.pagination?.show !== false
|
663
|
+
options?.toolbar?.pagination?.show !== false && !dynamicTable
|
664
664
|
? filteredData?.slice((page - 1) * maxRow, page * maxRow)
|
665
665
|
: filteredData
|
666
666
|
)?.map((item, index) => {
|