@codezee/sixtify-brahma 0.2.8 → 0.2.10
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/FormFields/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,eAAe,EAChB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/FormFields/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AASzB,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACzC,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAAE,EAChD,OAAe,EACf,QAAQ,EACR,UAAU,EACV,QAAgB,EAChB,KAAK,EACL,UAAU,EACV,KAAK,EACL,SAAS,EACT,IAAS,EACT,QAAQ,EACR,MAA0C,EAC1C,WAAsD,EACtD,GAAG,SAAS,EACb,EAAE,eAAe,CAAC,CAAC,CAAC,2CA6GpB"}
|
|
@@ -8,7 +8,8 @@ const react_1 = require("react");
|
|
|
8
8
|
const react_i18next_1 = require("react-i18next");
|
|
9
9
|
const PadBox_1 = require("../../PadBox");
|
|
10
10
|
const Svgs_1 = require("../../Svgs");
|
|
11
|
-
const
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
12
|
+
const file_1 = require("../../utils/file");
|
|
12
13
|
const FileUpload_styled_1 = require("./FileUpload.styled");
|
|
13
14
|
const Skeleton_1 = require("./Skeleton");
|
|
14
15
|
function FileUpload({ loading = false, onChange, isDisabled, multiple = false, error, helperText, label, fileNames, size = 10, setError, accept = ".png,.jpg,.jpeg,.doc,.docx,.pdf", acceptTitle = "Only JPG, PNG, PDF files are accepted.", ...restProps }) {
|
|
@@ -23,7 +24,7 @@ function FileUpload({ loading = false, onChange, isDisabled, multiple = false, e
|
|
|
23
24
|
const inValidFiles = [];
|
|
24
25
|
let isShowError = false;
|
|
25
26
|
for (const element of files) {
|
|
26
|
-
if (!(0,
|
|
27
|
+
if (!(0, utils_1.isFileSizeValid)(element, size)) {
|
|
27
28
|
isShowError = true;
|
|
28
29
|
inValidFiles.push(t("fileUpload.fileSize.error.message", {
|
|
29
30
|
fileName: element.name,
|