react-native-package-fast 0.1.3 → 0.1.4
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,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-package-fast",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "test",
|
|
5
5
|
"main": "./src/module/index.js",
|
|
6
6
|
"types": "./src/typescript/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "test1"
|
|
8
|
+
"test": "test1",
|
|
9
|
+
"pub": "npm publish"
|
|
9
10
|
},
|
|
10
11
|
"author": "dung.dang",
|
|
11
12
|
"license": "ISC"
|
|
12
|
-
|
|
13
13
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'react-native-fast-image';
|
|
4
|
+
import { ImageAppStyles, parseStyles } from './Utils';
|
|
5
|
+
import { ScaleSize } from './DeviceUtils';
|
|
6
|
+
const ImageFastApp = props => {
|
|
7
|
+
const {
|
|
8
|
+
size,
|
|
9
|
+
source,
|
|
10
|
+
ratio,
|
|
11
|
+
color
|
|
12
|
+
} = props;
|
|
13
|
+
let styleAll = parseStyles({
|
|
14
|
+
passStyle: ['flex', 'width', 'height', 'ratio'],
|
|
15
|
+
styles: ImageAppStyles,
|
|
16
|
+
props
|
|
17
|
+
});
|
|
18
|
+
if (size) {
|
|
19
|
+
styleAll = {
|
|
20
|
+
...styleAll,
|
|
21
|
+
width: ScaleSize(size),
|
|
22
|
+
height: ScaleSize(size)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (ratio) {
|
|
26
|
+
styleAll = {
|
|
27
|
+
...styleAll,
|
|
28
|
+
aspectRatio: ratio
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (color) {
|
|
32
|
+
styleAll = {
|
|
33
|
+
...styleAll,
|
|
34
|
+
tintColor: color
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement(Image, _extends({}, props, {
|
|
38
|
+
style: styleAll,
|
|
39
|
+
source: typeof source === 'string' ? {
|
|
40
|
+
uri: source
|
|
41
|
+
} : source
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
export default ImageFastApp;
|
|
45
|
+
//# sourceMappingURL=ImageFastApp.js.map
|
package/src/module/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import ViewApp from './cores/ViewApp';
|
|
|
3
3
|
import ButtonApp from './cores/ButtonApp';
|
|
4
4
|
import ImageApp from './cores/ImageApp';
|
|
5
5
|
import InputApp from './cores/InputApp';
|
|
6
|
+
import ImageFastApp from './cores/ImageFastApp';
|
|
6
7
|
import { ScaleSize } from './cores/DeviceUtils';
|
|
7
|
-
export { TextApp, ScaleSize, ButtonApp, ViewApp, InputApp, ImageApp };
|
|
8
|
+
export { TextApp, ScaleSize, ButtonApp, ViewApp, InputApp, ImageApp, ImageFastApp };
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ImageProps, TextInputProps, TextProps, ViewProps } from 'react-native';
|
|
2
2
|
import { TouchableOpacityProps } from 'react-native';
|
|
3
|
+
import { FastImageProps } from 'react-native-fast-image';
|
|
3
4
|
interface ByPassProps {
|
|
4
5
|
flex?: any;
|
|
5
6
|
width?: any;
|
|
@@ -317,6 +318,14 @@ export declare const InputAppStyles: {
|
|
|
317
318
|
justifyContent: "center";
|
|
318
319
|
};
|
|
319
320
|
};
|
|
321
|
+
export interface ImageFastAppProps extends FastImageProps, CommonProps {
|
|
322
|
+
contain?: any;
|
|
323
|
+
cover?: any;
|
|
324
|
+
stretch?: any;
|
|
325
|
+
size?: any;
|
|
326
|
+
ratio?: any;
|
|
327
|
+
color?: any;
|
|
328
|
+
}
|
|
320
329
|
export interface ImageAppProps extends ImageProps, CommonProps {
|
|
321
330
|
contain?: any;
|
|
322
331
|
cover?: any;
|
|
@@ -3,6 +3,7 @@ import ViewApp from './cores/ViewApp';
|
|
|
3
3
|
import ButtonApp from './cores/ButtonApp';
|
|
4
4
|
import ImageApp from './cores/ImageApp';
|
|
5
5
|
import InputApp from './cores/InputApp';
|
|
6
|
+
import ImageFastApp from './cores/ImageFastApp';
|
|
6
7
|
import { ScaleSize } from './cores/DeviceUtils';
|
|
7
|
-
export { TextApp, ScaleSize, ButtonApp, ViewApp, InputApp, ImageApp };
|
|
8
|
+
export { TextApp, ScaleSize, ButtonApp, ViewApp, InputApp, ImageApp, ImageFastApp, };
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|