sapo-components-ui-rn 1.0.17 → 1.0.19
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/components/SearchInput/index.d.ts +2 -1
- package/dist/index.esm.js +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SearchInput/index.tsx +9 -2
- package/src/components/TextInput/TextInputDefault.tsx +7 -0
|
@@ -12,6 +12,7 @@ interface SearchInputProps {
|
|
|
12
12
|
onFocus?: () => void;
|
|
13
13
|
onBlur?: () => void;
|
|
14
14
|
onChangeText?: (text: string) => void;
|
|
15
|
+
height?: number;
|
|
15
16
|
}
|
|
16
|
-
declare const SearchInput: ({ value, disabled, rightIcon, clearButton, placeholder, onFocus, onBlur, onChangeText, style, }: SearchInputProps) => React.JSX.Element;
|
|
17
|
+
declare const SearchInput: ({ value, disabled, rightIcon, clearButton, placeholder, onFocus, onBlur, onChangeText, style, height, }: SearchInputProps) => React.JSX.Element;
|
|
17
18
|
export default SearchInput;
|
package/dist/index.esm.js
CHANGED
|
@@ -5618,7 +5618,11 @@ var TextInputDefault = function (_a) {
|
|
|
5618
5618
|
? textAlign
|
|
5619
5619
|
: I18nManager.getConstants().isRTL
|
|
5620
5620
|
? "right"
|
|
5621
|
-
: "left", height: height ? height : 48
|
|
5621
|
+
: "left", height: height ? height : 48, paddingTop: Platform.OS === "android"
|
|
5622
|
+
? multiline
|
|
5623
|
+
? CONSTANTS.SPACE_2
|
|
5624
|
+
: CONSTANTS.SPACE_8
|
|
5625
|
+
: CONSTANTS.SPACE_4 }),
|
|
5622
5626
|
contentStyle,
|
|
5623
5627
|
] }))),
|
|
5624
5628
|
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$a.clearButtonMultiline : styles$a.clearButton },
|
|
@@ -5641,6 +5645,7 @@ var styles$a = StyleSheet.create({
|
|
|
5641
5645
|
},
|
|
5642
5646
|
clearButton: {
|
|
5643
5647
|
justifyContent: "center",
|
|
5648
|
+
paddingHorizontal: CONSTANTS.SPACE_8,
|
|
5644
5649
|
},
|
|
5645
5650
|
});
|
|
5646
5651
|
|
|
@@ -6814,15 +6819,16 @@ var styles = StyleSheet.create(__assign(__assign({}, containerStyles), { disable
|
|
|
6814
6819
|
var index = React__default.memo(SelectionField);
|
|
6815
6820
|
|
|
6816
6821
|
var SearchInput = function (_a) {
|
|
6817
|
-
var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, rightIcon = _a.rightIcon, _d = _a.clearButton, clearButton = _d === void 0 ? false : _d, _e = _a.placeholder, placeholder = _e === void 0 ? "Tìm kiếm" : _e, onFocus = _a.onFocus, onBlur = _a.onBlur, onChangeText = _a.onChangeText, style = _a.style;
|
|
6822
|
+
var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, rightIcon = _a.rightIcon, _d = _a.clearButton, clearButton = _d === void 0 ? false : _d, _e = _a.placeholder, placeholder = _e === void 0 ? "Tìm kiếm" : _e, onFocus = _a.onFocus, onBlur = _a.onBlur, onChangeText = _a.onChangeText, style = _a.style, height = _a.height;
|
|
6818
6823
|
return (React__default.createElement(TextInput, { left: React__default.createElement(View, { paddingRight: SPACE_8 },
|
|
6819
|
-
React__default.createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 24 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", placeholder: placeholder, right: rightIcon, onFocus: onFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: onChangeText,
|
|
6824
|
+
React__default.createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 24 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", placeholder: placeholder, right: rightIcon, onFocus: onFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: onChangeText, style: [
|
|
6820
6825
|
{
|
|
6821
|
-
height: 40,
|
|
6826
|
+
height: height || 40,
|
|
6822
6827
|
},
|
|
6823
6828
|
style,
|
|
6824
6829
|
] }));
|
|
6825
6830
|
};
|
|
6831
|
+
StyleSheet.create(__assign({}, containerStyles));
|
|
6826
6832
|
|
|
6827
6833
|
var toastRef = React__default.createRef();
|
|
6828
6834
|
var showToast = function (_a) {
|