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.esm.js
CHANGED
|
@@ -59373,9 +59373,11 @@ const FormRenderFileUpload = ({ props, variant, }) => {
|
|
|
59373
59373
|
props.setValue(((_e = props.item) === null || _e === void 0 ? void 0 : _e.name) + "Name", "");
|
|
59374
59374
|
return;
|
|
59375
59375
|
}
|
|
59376
|
-
else if (event.target.files[0].size > 20000000) {
|
|
59377
|
-
|
|
59378
|
-
(
|
|
59376
|
+
else if (event.target.files[0].size > (props.item.filesize || 20000000)) {
|
|
59377
|
+
const maxSizeMB = ((props.item.filesize || 20000000) /
|
|
59378
|
+
(1024 * 1024)).toFixed(2);
|
|
59379
|
+
((_f = props.item) === null || _f === void 0 ? void 0 : _f.handleFileError) ?
|
|
59380
|
+
(_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`);
|
|
59379
59381
|
event.target.value = ""; // Clear the file input
|
|
59380
59382
|
props.setValue((_h = props.item) === null || _h === void 0 ? void 0 : _h.name, null);
|
|
59381
59383
|
props.setValue(((_j = props.item) === null || _j === void 0 ? void 0 : _j.name) + "Name", "");
|