ods-component-lib 1.18.201 → 1.18.202

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.
@@ -1907,7 +1907,11 @@ function OdsFileUpload(props) {
1907
1907
  customValidationMessages = props.customValidationMessages,
1908
1908
  RemoveTitle = props.RemoveTitle,
1909
1909
  RemoveOkText = props.RemoveOkText,
1910
- RemoveCancelText = props.RemoveCancelText;
1910
+ RemoveCancelText = props.RemoveCancelText,
1911
+ _props$skipSizeValida = props.skipSizeValidation,
1912
+ skipSizeValidation = _props$skipSizeValida === void 0 ? false : _props$skipSizeValida,
1913
+ _props$maxFileSizeMB = props.maxFileSizeMB,
1914
+ maxFileSizeMB = _props$maxFileSizeMB === void 0 ? 10 : _props$maxFileSizeMB;
1911
1915
  var confirm = Modal.confirm;
1912
1916
  var _useState = useState(false),
1913
1917
  previewOpen = _useState[0],
@@ -1967,7 +1971,7 @@ function OdsFileUpload(props) {
1967
1971
  beforeUpload: function (file) {
1968
1972
  try {
1969
1973
  var fileType = allowDocumentUpload ? ["image/png", "image/jpg", "image/jpeg", "image/svg+xml", "application/pdf", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"] : ["image/png", "image/jpg", "image/jpeg", "image/svg+xml"];
1970
- var isFileSizeOk = file.size / (1024 * 1024) <= 1;
1974
+ var isFileSizeOk = skipSizeValidation ? true : file.size / (1024 * 1024) <= maxFileSizeMB;
1971
1975
  var checkType = fileType.includes(file.type);
1972
1976
  if (!checkType) {
1973
1977
  OdsNotification({
@@ -2090,7 +2094,8 @@ function OdsFileUpload(props) {
2090
2094
  src: previewSrc
2091
2095
  });
2092
2096
  } else {
2093
- var fileExtension = fileName != "" ? fileName.split(".").pop().toLowerCase() : previewSrc.split(".").pop().toLowerCase();
2097
+ var _fileName$split$pop, _previewSrc$split$pop;
2098
+ var fileExtension = fileName !== "" ? (_fileName$split$pop = fileName.split(".").pop()) === null || _fileName$split$pop === void 0 ? void 0 : _fileName$split$pop.toLowerCase() : (_previewSrc$split$pop = previewSrc.split(".").pop()) === null || _previewSrc$split$pop === void 0 ? void 0 : _previewSrc$split$pop.toLowerCase();
2094
2099
  if (fileExtension === "png" || fileExtension === "jpg" || fileExtension === "jpeg" || fileExtension === "svg") {
2095
2100
  return React.createElement("img", {
2096
2101
  alt: fileName == "" ? "file" : fileName,