intelicoreact 1.4.89 → 1.4.91

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.
@@ -16,7 +16,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
16
16
  const RC = "file-loader-description";
17
17
  const UPLOAD_TRIGGER_KEY = "uploadTrigger";
18
18
  const MAX_FILE_SIZE = 10 * 1024 * 1024;
19
- const ACCEPT_EXTENSIONS_DEFAULT = ".jpg, .jpeg, .png, .pdf";
19
+ const ACCEPT_EXTENSIONS_DEFAULT = ".jpg, .jpeg, .png, .pdf, .JPG, .JPEG, .PNG, .PDF";
20
20
  const uploadTriggerStucture = {
21
21
  id: UPLOAD_TRIGGER_KEY,
22
22
  isRequired: true,
@@ -52,9 +52,11 @@ const FileLoaderLocal = _ref => {
52
52
  };
53
53
  const handle = {
54
54
  change: e => {
55
- var _name$match, _e$target, _e$target2;
55
+ var _name$match, _name$split, _e$target, _e$target2;
56
56
  const name = getFileName(e.target.value);
57
57
  const valueExtension = name === null || name === void 0 || (_name$match = name.match(/[^\.]+$/)) === null || _name$match === void 0 ? void 0 : _name$match[0];
58
+ const fileName = (_name$split = name.split('.')) === null || _name$split === void 0 ? void 0 : _name$split[0];
59
+ const latinRegex = /^[A-Za-z\u00C0-\u00FF]+$/;
58
60
  const file = (_e$target = e.target) === null || _e$target === void 0 || (_e$target = _e$target.files) === null || _e$target === void 0 ? void 0 : _e$target[0];
59
61
  if (isFileSizeOutOfLimit((_e$target2 = e.target) === null || _e$target2 === void 0 || (_e$target2 = _e$target2.files) === null || _e$target2 === void 0 ? void 0 : _e$target2[0])) {
60
62
  onChange({
@@ -79,6 +81,16 @@ const FileLoaderLocal = _ref => {
79
81
  file,
80
82
  error: "Only ".concat(uniqExts, " are allowed")
81
83
  });
84
+ } else if (!latinRegex.test(fileName)) {
85
+ onChange({
86
+ id,
87
+ groupId,
88
+ name,
89
+ valueExtension,
90
+ e,
91
+ file,
92
+ error: "File name must be Latin characters only."
93
+ });
82
94
  } else onChange({
83
95
  id,
84
96
  groupId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.4.89",
3
+ "version": "1.4.91",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [