sapo-components-ui-rn 1.0.69 → 1.0.71
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 +71 -35
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +71 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/src/components/Image/index.tsx +49 -49
- package/src/components/TextInput/TextInputDefault.tsx +12 -2
- package/src/components/TextInput/TextInputFlat.tsx +12 -2
- package/src/components/TextInput/TextInputNumber.tsx +2 -2
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.
|
|
@@ -5438,6 +5437,15 @@ var TextInputFlat = function (_a) {
|
|
|
5438
5437
|
}
|
|
5439
5438
|
return React$3.createElement(View$1, null);
|
|
5440
5439
|
};
|
|
5440
|
+
var checkLineRightAction = function () {
|
|
5441
|
+
if (!multiline && right && inputValue) {
|
|
5442
|
+
return true;
|
|
5443
|
+
}
|
|
5444
|
+
if (parentState.focused && right) {
|
|
5445
|
+
return true;
|
|
5446
|
+
}
|
|
5447
|
+
return false;
|
|
5448
|
+
};
|
|
5441
5449
|
return (React$3.createElement(View$1, null,
|
|
5442
5450
|
React$3.createElement(View$1, { style: {
|
|
5443
5451
|
flexDirection: "row",
|
|
@@ -5485,7 +5493,7 @@ var TextInputFlat = function (_a) {
|
|
|
5485
5493
|
renderSuffix())),
|
|
5486
5494
|
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$d.clearButton },
|
|
5487
5495
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
|
|
5488
|
-
|
|
5496
|
+
checkLineRightAction() && (React$3.createElement(Spacer, { width: 1, height: 24, backgroundColor: theme.colors.borderPrimaryDefault, style: {
|
|
5489
5497
|
marginRight: SPACE_8,
|
|
5490
5498
|
} })),
|
|
5491
5499
|
React$3.createElement(View$1, { style: {
|
|
@@ -5666,6 +5674,15 @@ var TextInputDefault = function (_a) {
|
|
|
5666
5674
|
}
|
|
5667
5675
|
return React$3.createElement(View, null);
|
|
5668
5676
|
};
|
|
5677
|
+
var checkLineRightAction = function () {
|
|
5678
|
+
if (!multiline && right && inputValue) {
|
|
5679
|
+
return true;
|
|
5680
|
+
}
|
|
5681
|
+
if (parentState.focused && right) {
|
|
5682
|
+
return true;
|
|
5683
|
+
}
|
|
5684
|
+
return false;
|
|
5685
|
+
};
|
|
5669
5686
|
return (React$3.createElement(View, { style: viewStyle },
|
|
5670
5687
|
React$3.createElement(View, { row: true, alignCenter: !multiline, justifyCenter: true, style: [
|
|
5671
5688
|
{
|
|
@@ -5724,7 +5741,7 @@ var TextInputDefault = function (_a) {
|
|
|
5724
5741
|
!multiline && renderSuffix()))),
|
|
5725
5742
|
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$c.clearButtonMultiline : styles$c.clearButton },
|
|
5726
5743
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
|
|
5727
|
-
|
|
5744
|
+
checkLineRightAction() && (React$3.createElement(Spacer, { width: 1, height: 24, backgroundColor: colors.borderPrimaryDefault, style: {
|
|
5728
5745
|
marginRight: CONSTANTS.SPACE_8,
|
|
5729
5746
|
} })),
|
|
5730
5747
|
right && !clearButton && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_2 }),
|
|
@@ -6051,7 +6068,7 @@ var TextInputNumber = function (_a) {
|
|
|
6051
6068
|
suffix)))),
|
|
6052
6069
|
clearButton && !checkValueEmpty() && (React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, onPress: handleClearInput },
|
|
6053
6070
|
React__default.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))),
|
|
6054
|
-
right && (React__default.createElement(Spacer, { width: 1, height:
|
|
6071
|
+
right && numberValue && (React__default.createElement(Spacer, { width: 1, height: 24, backgroundColor: theme.colors.borderPrimaryDefault, style: {
|
|
6055
6072
|
marginLeft: SPACE_4,
|
|
6056
6073
|
} })),
|
|
6057
6074
|
right && (React__default.createElement(View, { center: true, paddingLeft: SPACE_8, height: "100%" }, right)),
|
|
@@ -6846,7 +6863,9 @@ var getSource = function (source) {
|
|
|
6846
6863
|
return newSource;
|
|
6847
6864
|
};
|
|
6848
6865
|
var Image = function (props) {
|
|
6849
|
-
var children = props.children, source = props.source,
|
|
6866
|
+
var children = props.children, source = props.source,
|
|
6867
|
+
// useFastImage,
|
|
6868
|
+
disableDefaultImage = props.disableDefaultImage, style = props.style, _a = props.resizeMode, resizeMode = _a === void 0 ? "contain" : _a;
|
|
6850
6869
|
var _b = useState(false), hasError = _b[0], setHasError = _b[1];
|
|
6851
6870
|
var image = getSource(disableDefaultImage
|
|
6852
6871
|
? source
|
|
@@ -6854,39 +6873,56 @@ var Image = function (props) {
|
|
|
6854
6873
|
? require("./assets/images/image_default.png")
|
|
6855
6874
|
: source || require("./assets/images/image_default.png"));
|
|
6856
6875
|
var ImageComponent = children ? ImageBackground : Image$2;
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
};
|
|
6876
|
+
// const getUriImage = (uri: string) => {
|
|
6877
|
+
// return uri !== null &&
|
|
6878
|
+
// uri !== undefined &&
|
|
6879
|
+
// uri.includes("/") &&
|
|
6880
|
+
// uri.includes(".")
|
|
6881
|
+
// ? uri
|
|
6882
|
+
// : "";
|
|
6883
|
+
// };
|
|
6865
6884
|
var handleError = function () {
|
|
6866
6885
|
setHasError(true);
|
|
6867
6886
|
};
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
};
|
|
6882
|
-
if (useFastImage &&
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6887
|
+
// const getFastImageResizeMode = (mode: string): ResizeMode => {
|
|
6888
|
+
// switch (mode) {
|
|
6889
|
+
// case "cover":
|
|
6890
|
+
// return FastImage.resizeMode.cover;
|
|
6891
|
+
// case "contain":
|
|
6892
|
+
// return FastImage.resizeMode.contain;
|
|
6893
|
+
// case "stretch":
|
|
6894
|
+
// return FastImage.resizeMode.stretch;
|
|
6895
|
+
// case "center":
|
|
6896
|
+
// return FastImage.resizeMode.center;
|
|
6897
|
+
// default:
|
|
6898
|
+
// return FastImage.resizeMode.contain;
|
|
6899
|
+
// }
|
|
6900
|
+
// };
|
|
6901
|
+
// if (useFastImage && image?.uri) {
|
|
6902
|
+
// const {
|
|
6903
|
+
// defaultSource,
|
|
6904
|
+
// onLoad,
|
|
6905
|
+
// onLoadStart,
|
|
6906
|
+
// onLoadEnd,
|
|
6907
|
+
// onProgress,
|
|
6908
|
+
// style: imageStyle,
|
|
6909
|
+
// ...restProps
|
|
6910
|
+
// } = props;
|
|
6911
|
+
// return (
|
|
6912
|
+
// <View style={style}>
|
|
6913
|
+
// <FastImage
|
|
6914
|
+
// resizeMode={getFastImageResizeMode(resizeMode)}
|
|
6915
|
+
// {...restProps}
|
|
6916
|
+
// onError={handleError}
|
|
6917
|
+
// source={{
|
|
6918
|
+
// uri: getUriImage(image.uri),
|
|
6919
|
+
// cache: FastImage.cacheControl.immutable,
|
|
6920
|
+
// }}
|
|
6921
|
+
// style={imageStyle as any}
|
|
6922
|
+
// />
|
|
6923
|
+
// </View>
|
|
6924
|
+
// );
|
|
6925
|
+
// }
|
|
6890
6926
|
if (!source && disableDefaultImage) {
|
|
6891
6927
|
if (children) {
|
|
6892
6928
|
return React__default.createElement(View$1, __assign({}, props), children);
|