tp-react-elements-dev 1.10.16 → 1.10.17
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/dist/components/Form/FormRender.d.ts +1 -0
- package/dist/index.esm.js +5 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -59393,9 +59393,11 @@ const FormRenderFileUpload = ({ props, variant, }) => {
|
|
|
59393
59393
|
props.setValue(((_e = props.item) === null || _e === void 0 ? void 0 : _e.name) + "Name", "");
|
|
59394
59394
|
return;
|
|
59395
59395
|
}
|
|
59396
|
-
else if (event.target.files[0].size > 20000000) {
|
|
59397
|
-
|
|
59398
|
-
(
|
|
59396
|
+
else if (event.target.files[0].size > (props.item.filesize || 20000000)) {
|
|
59397
|
+
const maxSizeMB = ((props.item.filesize || 20000000) /
|
|
59398
|
+
(1024 * 1024)).toFixed(2);
|
|
59399
|
+
((_f = props.item) === null || _f === void 0 ? void 0 : _f.handleFileError) ?
|
|
59400
|
+
(_g = props.item) === null || _g === void 0 ? void 0 : _g.handleFileError(`File size should be less than ${maxSizeMB}MB`) : alert(`File size should be less than ${maxSizeMB}MB`);
|
|
59399
59401
|
event.target.value = ""; // Clear the file input
|
|
59400
59402
|
props.setValue((_h = props.item) === null || _h === void 0 ? void 0 : _h.name, null);
|
|
59401
59403
|
props.setValue(((_j = props.item) === null || _j === void 0 ? void 0 : _j.name) + "Name", "");
|