@widergy/mobile-ui 0.35.5 → 0.35.7

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.35.7](https://github.com/widergy/mobile-ui/compare/v0.35.6...v0.35.7) (2022-11-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * now blob gets converted to file when returning ([#230](https://github.com/widergy/mobile-ui/issues/230)) ([7d1c01f](https://github.com/widergy/mobile-ui/commit/7d1c01f0d06eb5c0bb098316512adc23f8c4f3ab))
7
+
8
+ ## [0.35.6](https://github.com/widergy/mobile-ui/compare/v0.35.5...v0.35.6) (2022-10-28)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * tooltip text ([#229](https://github.com/widergy/mobile-ui/issues/229)) ([b20d8e1](https://github.com/widergy/mobile-ui/commit/b20d8e11ca52e7b762587c7dc06182bcbb0dd2a3))
14
+
1
15
  ## [0.35.5](https://github.com/widergy/mobile-ui/compare/v0.35.4...v0.35.5) (2022-10-27)
2
16
 
3
17
 
@@ -5,7 +5,7 @@ import DocumentPicker from 'react-native-document-picker';
5
5
  import { isEmpty } from '@widergy/web-utils/lib/array';
6
6
 
7
7
  import Picker from '../Picker';
8
- import { retrieveFile, isImageByUri } from '../../utils/fileUtils.js';
8
+ import { retrieveFile, isImageByUri, blobToFile } from '../../utils/fileUtils.js';
9
9
 
10
10
  import { UPLOAD_ICON, DEFAULT_ALLOWED_TYPES, DEFAULT_MAX_SIZE } from './constants';
11
11
  import filePickerPropTypes from './propTypes';
@@ -62,7 +62,7 @@ class FilePicker extends Component {
62
62
  }
63
63
  }
64
64
  if (onChange) {
65
- onChange(avoidRetrieveFile ? { document } : { file });
65
+ onChange(avoidRetrieveFile ? { document } : { file: blobToFile(file, document.type) });
66
66
  }
67
67
  this.setState({ fileName: document.name });
68
68
  } catch (err) {
@@ -136,7 +136,7 @@ const OutlinedInput = ({
136
136
  </View>
137
137
  {!!tooltip && (
138
138
  <View style={[ownStyles.tooltipContainer, multiline && { height: initialHeight }]}>
139
- <UTTooltip content={<Label>tooltip</Label>} position="left" {...tooltipProps}>
139
+ <UTTooltip content={<Label>{tooltip}</Label>} position="left" {...tooltipProps}>
140
140
  <Icon
141
141
  name="questioncircleo"
142
142
  type="antdesign"
@@ -12,7 +12,7 @@ export const isImageByUri = uri => {
12
12
  return uCaseUri.includes('.JPG') || uCaseUri.includes('.JPEG') || uCaseUri.includes('PNG');
13
13
  };
14
14
 
15
- const blobToFile = (blob, type) => new File([blob], blob.data.name, { type });
15
+ export const blobToFile = (blob, type) => new File([blob], blob.data.name, { type });
16
16
 
17
17
  export const retrieveFile = async (uri, type) => {
18
18
  const uriToUse = IS_IOS ? uri.replace('file://', '') : uri;
@@ -33,7 +33,7 @@ export const retrieveFile = async (uri, type) => {
33
33
  blob = await res.blob();
34
34
  }
35
35
 
36
- return blobToFile(blob, type);
36
+ return blob;
37
37
  };
38
38
 
39
39
  export const MEGABYTE = 1024 * 1024;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "0.35.5",
5
+ "version": "0.35.7",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [