sapo-components-ui-rn 1.0.69 → 1.0.70
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/dist/index.esm.js +50 -32
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +50 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/src/components/Image/index.tsx +49 -49
package/dist/index.esm.js
CHANGED
|
@@ -9,7 +9,6 @@ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
|
9
9
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
10
10
|
import Svg, { Rect, Path, Circle } from 'react-native-svg';
|
|
11
11
|
import { useSafeAreaInsets, SafeAreaProvider } from 'react-native-safe-area-context';
|
|
12
|
-
import FastImage from '@d11/react-native-fast-image';
|
|
13
12
|
|
|
14
13
|
/******************************************************************************
|
|
15
14
|
Copyright (c) Microsoft Corporation.
|
|
@@ -6846,7 +6845,9 @@ var getSource = function (source) {
|
|
|
6846
6845
|
return newSource;
|
|
6847
6846
|
};
|
|
6848
6847
|
var Image = function (props) {
|
|
6849
|
-
var children = props.children, source = props.source,
|
|
6848
|
+
var children = props.children, source = props.source,
|
|
6849
|
+
// useFastImage,
|
|
6850
|
+
disableDefaultImage = props.disableDefaultImage, style = props.style, _a = props.resizeMode, resizeMode = _a === void 0 ? "contain" : _a;
|
|
6850
6851
|
var _b = useState(false), hasError = _b[0], setHasError = _b[1];
|
|
6851
6852
|
var image = getSource(disableDefaultImage
|
|
6852
6853
|
? source
|
|
@@ -6854,39 +6855,56 @@ var Image = function (props) {
|
|
|
6854
6855
|
? require("./assets/images/image_default.png")
|
|
6855
6856
|
: source || require("./assets/images/image_default.png"));
|
|
6856
6857
|
var ImageComponent = children ? ImageBackground : Image$2;
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
};
|
|
6858
|
+
// const getUriImage = (uri: string) => {
|
|
6859
|
+
// return uri !== null &&
|
|
6860
|
+
// uri !== undefined &&
|
|
6861
|
+
// uri.includes("/") &&
|
|
6862
|
+
// uri.includes(".")
|
|
6863
|
+
// ? uri
|
|
6864
|
+
// : "";
|
|
6865
|
+
// };
|
|
6865
6866
|
var handleError = function () {
|
|
6866
6867
|
setHasError(true);
|
|
6867
6868
|
};
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
};
|
|
6882
|
-
if (useFastImage &&
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6869
|
+
// const getFastImageResizeMode = (mode: string): ResizeMode => {
|
|
6870
|
+
// switch (mode) {
|
|
6871
|
+
// case "cover":
|
|
6872
|
+
// return FastImage.resizeMode.cover;
|
|
6873
|
+
// case "contain":
|
|
6874
|
+
// return FastImage.resizeMode.contain;
|
|
6875
|
+
// case "stretch":
|
|
6876
|
+
// return FastImage.resizeMode.stretch;
|
|
6877
|
+
// case "center":
|
|
6878
|
+
// return FastImage.resizeMode.center;
|
|
6879
|
+
// default:
|
|
6880
|
+
// return FastImage.resizeMode.contain;
|
|
6881
|
+
// }
|
|
6882
|
+
// };
|
|
6883
|
+
// if (useFastImage && image?.uri) {
|
|
6884
|
+
// const {
|
|
6885
|
+
// defaultSource,
|
|
6886
|
+
// onLoad,
|
|
6887
|
+
// onLoadStart,
|
|
6888
|
+
// onLoadEnd,
|
|
6889
|
+
// onProgress,
|
|
6890
|
+
// style: imageStyle,
|
|
6891
|
+
// ...restProps
|
|
6892
|
+
// } = props;
|
|
6893
|
+
// return (
|
|
6894
|
+
// <View style={style}>
|
|
6895
|
+
// <FastImage
|
|
6896
|
+
// resizeMode={getFastImageResizeMode(resizeMode)}
|
|
6897
|
+
// {...restProps}
|
|
6898
|
+
// onError={handleError}
|
|
6899
|
+
// source={{
|
|
6900
|
+
// uri: getUriImage(image.uri),
|
|
6901
|
+
// cache: FastImage.cacheControl.immutable,
|
|
6902
|
+
// }}
|
|
6903
|
+
// style={imageStyle as any}
|
|
6904
|
+
// />
|
|
6905
|
+
// </View>
|
|
6906
|
+
// );
|
|
6907
|
+
// }
|
|
6890
6908
|
if (!source && disableDefaultImage) {
|
|
6891
6909
|
if (children) {
|
|
6892
6910
|
return React__default.createElement(View$1, __assign({}, props), children);
|