@experium/findy-form 1.2.44 → 1.2.45

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.
@@ -179,6 +179,7 @@ var File = /*#__PURE__*/function (_Component) {
179
179
  var type = (0, _ramda.prop)('type', settings);
180
180
  var fd = new FormData();
181
181
  var fileExtenstion = (0, _ramda.last)("".concat(file.name).split('.'));
182
+ var fileType = file.type || (0, _ramda.path)([type, fileExtenstion], _allowFileExtensions.defaultAllowFileExtensions);
182
183
  var validFileType = (0, _validation.checkFileType)(type, file.type, fileExtenstion, allowFileExtensions);
183
184
  fd.append('file', file);
184
185
  fd.append('name', file.name);
@@ -228,7 +229,7 @@ var File = /*#__PURE__*/function (_Component) {
228
229
  url: url,
229
230
  text: fileName,
230
231
  extenstion: fileExtenstion,
231
- contentType: file.type,
232
+ contentType: fileType,
232
233
  type: type
233
234
  };
234
235
 
@@ -258,7 +259,7 @@ var File = /*#__PURE__*/function (_Component) {
258
259
  var fileItem = {
259
260
  text: file.name,
260
261
  extenstion: fileExtenstion,
261
- contentType: file.type,
262
+ contentType: fileType,
262
263
  type: type
263
264
  };
264
265
  setInputError((0, _validation.getFileTypeMessage)(type, allowFileExtensions));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experium/findy-form",
3
- "version": "1.2.44",
3
+ "version": "1.2.45",
4
4
  "main": "./lib/index.js",
5
5
  "homepage": "https://experium.github.io/findy-form",
6
6
  "repository": "https://github.com/experium/findy-form",
@@ -12,7 +12,7 @@ import styles from '../../styles/index.module.css';
12
12
  import formStyles from '../../styles/index.module.css';
13
13
  import Spinner from './Spinner';
14
14
  import { getFileErrorText } from '../../utils/file';
15
- import { TYPES } from '../../constants/allowFileExtensions';
15
+ import { TYPES, defaultAllowFileExtensions } from '../../constants/allowFileExtensions';
16
16
  import { checkFileType, getFileTypeMessage } from '../../utils/validation';
17
17
 
18
18
  const FILE_TYPES = {
@@ -56,6 +56,7 @@ class File extends Component {
56
56
  const type = prop('type', settings);
57
57
  const fd = new FormData();
58
58
  const fileExtenstion = last(`${file.name}`.split('.'));
59
+ const fileType = file.type || path([type, fileExtenstion], defaultAllowFileExtensions);
59
60
  const validFileType = checkFileType(type, file.type, fileExtenstion, allowFileExtensions);
60
61
 
61
62
  fd.append('file', file);
@@ -96,7 +97,7 @@ class File extends Component {
96
97
  url,
97
98
  text: fileName,
98
99
  extenstion: fileExtenstion,
99
- contentType: file.type,
100
+ contentType: fileType,
100
101
  type,
101
102
  };
102
103
 
@@ -121,7 +122,7 @@ class File extends Component {
121
122
  const fileItem = {
122
123
  text: file.name,
123
124
  extenstion: fileExtenstion,
124
- contentType: file.type,
125
+ contentType: fileType,
125
126
  type,
126
127
  };
127
128