tp-react-elements-dev 1.5.4 → 1.5.6
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/index.esm.js +16 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52257,7 +52257,7 @@ const FormRenderFileUpload = ({ props }) => {
|
|
|
52257
52257
|
? ".pdf,.jpg,.jpeg,.png,.xls,.xlsx,.doc,.docx"
|
|
52258
52258
|
: "",
|
|
52259
52259
|
}, onChange: (event) => {
|
|
52260
|
-
var _a, _b, _c, _d, _e;
|
|
52260
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
52261
52261
|
const file = event.target.files[0];
|
|
52262
52262
|
const fileName = file ? file.name : null;
|
|
52263
52263
|
const allowedExtensions = {
|
|
@@ -52276,13 +52276,24 @@ const FormRenderFileUpload = ({ props }) => {
|
|
|
52276
52276
|
if (((_a = props.item) === null || _a === void 0 ? void 0 : _a.fileType) &&
|
|
52277
52277
|
fileExtension &&
|
|
52278
52278
|
!validExtensions.includes(fileExtension)) {
|
|
52279
|
-
((_b = props.item) === null || _b === void 0 ? void 0 : _b.handleFileError) &&
|
|
52279
|
+
((_b = props.item) === null || _b === void 0 ? void 0 : _b.handleFileError) &&
|
|
52280
|
+
((_c = props.item) === null || _c === void 0 ? void 0 : _c.handleFileError(`Please upload ${allowedExtensions[props.item.fileType].join(",")} Files only`));
|
|
52281
|
+
event.target.value = ""; // Clear the file input\
|
|
52282
|
+
props.setValue((_d = props.item) === null || _d === void 0 ? void 0 : _d.name, null);
|
|
52283
|
+
props.setValue(((_e = props.item) === null || _e === void 0 ? void 0 : _e.name) + "Name", "");
|
|
52284
|
+
return;
|
|
52285
|
+
}
|
|
52286
|
+
else if (event.target.files[0].size > 20000000) {
|
|
52287
|
+
((_f = props.item) === null || _f === void 0 ? void 0 : _f.handleFileError) &&
|
|
52288
|
+
((_g = props.item) === null || _g === void 0 ? void 0 : _g.handleFileError(`File size should be less than 20MB`));
|
|
52280
52289
|
event.target.value = ""; // Clear the file input
|
|
52290
|
+
props.setValue((_h = props.item) === null || _h === void 0 ? void 0 : _h.name, null);
|
|
52291
|
+
props.setValue(((_j = props.item) === null || _j === void 0 ? void 0 : _j.name) + "Name", "");
|
|
52281
52292
|
return;
|
|
52282
52293
|
}
|
|
52283
52294
|
// Proceed if valid
|
|
52284
|
-
props.setValue((
|
|
52285
|
-
props.setValue(((
|
|
52295
|
+
props.setValue((_k = props.item) === null || _k === void 0 ? void 0 : _k.name, file);
|
|
52296
|
+
props.setValue(((_l = props.item) === null || _l === void 0 ? void 0 : _l.name) + "Name", fileName);
|
|
52286
52297
|
// props?.item?.onChangeFn({
|
|
52287
52298
|
// [props.item.name]: file,
|
|
52288
52299
|
// [props.item.name + "Name"]: fileName,
|
|
@@ -52374,7 +52385,7 @@ const RenderForm = (props) => {
|
|
|
52374
52385
|
fontFamily: "Roboto-Reg",
|
|
52375
52386
|
border: "none",
|
|
52376
52387
|
},
|
|
52377
|
-
}, sx: Object.assign({ fontFamily: "Roboto-Reg", "& .css-1holvmy,.css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
|
|
52388
|
+
}, autoComplete: "off", sx: Object.assign({ fontFamily: "Roboto-Reg", "& .css-1holvmy,.css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
|
|
52378
52389
|
top: "-10px",
|
|
52379
52390
|
// fontSize:'14px !important'
|
|
52380
52391
|
}, "& .css-2rul56-MuiFormLabel-root-MuiInputLabel-root": {
|