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.
@@ -50,6 +50,7 @@ export interface FormSectionPropsItem {
50
50
  maxTime?: string;
51
51
  ampm?: boolean;
52
52
  settings?: FormSectionPropsItem[];
53
+ filesize?: number;
53
54
  }
54
55
  export interface FormRenderProps {
55
56
  item: FormSectionPropsItem;
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
- ((_f = props.item) === null || _f === void 0 ? void 0 : _f.handleFileError) &&
59378
- ((_g = props.item) === null || _g === void 0 ? void 0 : _g.handleFileError(`File size should be less than 20MB`));
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", "");