@widergy/mobile-ui 0.35.6 → 0.35.8
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.8](https://github.com/widergy/mobile-ui/compare/v0.35.7...v0.35.8) (2022-11-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added disable color for select field ([#231](https://github.com/widergy/mobile-ui/issues/231)) ([116e827](https://github.com/widergy/mobile-ui/commit/116e8275de542d6dbb766f2a9fd7c0d60bd07f37))
|
|
7
|
+
|
|
8
|
+
## [0.35.7](https://github.com/widergy/mobile-ui/compare/v0.35.6...v0.35.7) (2022-11-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* 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))
|
|
14
|
+
|
|
1
15
|
## [0.35.6](https://github.com/widergy/mobile-ui/compare/v0.35.5...v0.35.6) (2022-10-28)
|
|
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) {
|
|
@@ -90,7 +90,7 @@ const BaseInput = forwardRef(
|
|
|
90
90
|
editable={!select && !disabled}
|
|
91
91
|
{...props}
|
|
92
92
|
secureTextEntry={!showInput}
|
|
93
|
-
style={[...variantStyle.text, select && { color: theme.fonts
|
|
93
|
+
style={[...variantStyle.text, select && { color: theme.fonts?.fontColor }, select && disabled && { color: theme.fonts?.fontDisabledColor}]}
|
|
94
94
|
/>
|
|
95
95
|
{(RightIcon || hiddenInput) && (
|
|
96
96
|
<Touchable
|
|
@@ -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
|
|
36
|
+
return blob;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export const MEGABYTE = 1024 * 1024;
|
package/package.json
CHANGED