sapo-components-ui-rn 1.1.10 → 1.1.12
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/Button/index.d.ts +3 -4
- package/dist/components/SearchInput/index.d.ts +2 -1
- package/dist/index.esm.js +17 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/index.tsx +20 -13
- package/src/components/SearchInput/index.tsx +3 -4
|
@@ -14,10 +14,9 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
14
14
|
margin?: number;
|
|
15
15
|
textProps?: IText;
|
|
16
16
|
textColor?: string;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
textBold?: boolean;
|
|
18
|
+
textSize?: number;
|
|
19
19
|
textStyle?: TextStyle;
|
|
20
|
-
medium?: boolean;
|
|
21
20
|
mode?: "outlined" | "contained" | "transparent";
|
|
22
21
|
transparent?: boolean;
|
|
23
22
|
onPress?: (res?: any) => void;
|
|
@@ -28,5 +27,5 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
28
27
|
critical?: boolean;
|
|
29
28
|
width?: number;
|
|
30
29
|
}
|
|
31
|
-
declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor,
|
|
30
|
+
declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor, textBold, mode, transparent, full, theme: themeOverrides, buttonSize, textSize, critical, width, type, ...props }: ButtonProps) => React.JSX.Element>;
|
|
32
31
|
export default _default;
|
|
@@ -14,6 +14,7 @@ interface SearchInputProps {
|
|
|
14
14
|
onChangeText?: (text: string) => void;
|
|
15
15
|
height?: number;
|
|
16
16
|
debounceTime?: number;
|
|
17
|
+
autoFocus?: boolean;
|
|
17
18
|
}
|
|
18
|
-
declare const SearchInput: ({ value, disabled, rightIcon, clearButton, placeholder, onFocus, onBlur, onChangeText, style, height, debounceTime, }: SearchInputProps) => React.JSX.Element;
|
|
19
|
+
declare const SearchInput: ({ value, disabled, rightIcon, clearButton, placeholder, onFocus, onBlur, onChangeText, style, height, debounceTime, autoFocus, }: SearchInputProps) => React.JSX.Element;
|
|
19
20
|
export default SearchInput;
|
package/dist/index.esm.js
CHANGED
|
@@ -6281,7 +6281,7 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
6281
6281
|
TextInput.Affix = TextInputAffix;
|
|
6282
6282
|
|
|
6283
6283
|
var Button = function (_a) {
|
|
6284
|
-
var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right, margin = _a.margin, textStyle = _a.textStyle, textProps = _a.textProps, onPress = _a.onPress, disabled = _a.disabled, backgroundColor = _a.backgroundColor, textColor = _a.textColor, _b = _a.
|
|
6284
|
+
var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right, margin = _a.margin, textStyle = _a.textStyle, textProps = _a.textProps, onPress = _a.onPress, disabled = _a.disabled, backgroundColor = _a.backgroundColor, textColor = _a.textColor, _b = _a.textBold, textBold = _b === void 0 ? true : _b, _c = _a.mode, mode = _c === void 0 ? "contained" : _c; _a.transparent; var _e = _a.full, full = _e === void 0 ? false : _e; _a.theme; var _f = _a.buttonSize, buttonSize = _f === void 0 ? "normal" : _f, _g = _a.textSize, textSize = _g === void 0 ? buttonSize === "small" ? 14 : 16 : _g, _h = _a.critical, critical = _h === void 0 ? false : _h, width = _a.width, _j = _a.type, type = _j === void 0 ? "default" : _j, props = __rest(_a, ["style", "title", "border", "borderColor", "isLoading", "left", "right", "margin", "textStyle", "textProps", "onPress", "disabled", "backgroundColor", "textColor", "textBold", "mode", "transparent", "full", "theme", "buttonSize", "textSize", "critical", "width", "type"]);
|
|
6285
6285
|
var theme = useInternalTheme();
|
|
6286
6286
|
var colors = theme.colors;
|
|
6287
6287
|
var disabledTextStyle = {
|
|
@@ -6349,7 +6349,11 @@ var Button = function (_a) {
|
|
|
6349
6349
|
], disabled: isLoading }, isLoading ? (React__default.createElement(ActivityIndicator, { color: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.color) || colors.textBrandDefault })) : (React__default.createElement(View, { row: true },
|
|
6350
6350
|
!isLoading && left,
|
|
6351
6351
|
left && React__default.createElement(Spacer, { width: CONSTANTS.SPACE_4 }),
|
|
6352
|
-
React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || colors.textBrandDefault, size:
|
|
6352
|
+
React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || colors.textBrandDefault, size: textSize, bold: textBold, style: [
|
|
6353
|
+
disabled && disabledTextStyle,
|
|
6354
|
+
!textBold && styles$b.textMedium,
|
|
6355
|
+
textStyle,
|
|
6356
|
+
] }, textProps), title),
|
|
6353
6357
|
right && React__default.createElement(Spacer, { width: CONSTANTS.SPACE_4 }),
|
|
6354
6358
|
!isLoading && right)))));
|
|
6355
6359
|
}
|
|
@@ -6384,29 +6388,28 @@ var Button = function (_a) {
|
|
|
6384
6388
|
? CONSTANTS.SPACE_4
|
|
6385
6389
|
: CONSTANTS.SPACE_8 })),
|
|
6386
6390
|
React__default.createElement(View, { center: true },
|
|
6387
|
-
React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || renderTextColor(), size:
|
|
6391
|
+
React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || renderTextColor(), size: textSize, bold: textBold, style: [
|
|
6392
|
+
disabled && disabledTextStyle,
|
|
6393
|
+
!textBold && styles$b.textMedium,
|
|
6394
|
+
textStyle,
|
|
6395
|
+
] }, textProps), title)),
|
|
6388
6396
|
right && (React__default.createElement(Spacer, { width: buttonSize === "small"
|
|
6389
6397
|
? CONSTANTS.SPACE_4
|
|
6390
6398
|
: CONSTANTS.SPACE_8 })),
|
|
6391
6399
|
!isLoading && right,
|
|
6392
6400
|
React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))))));
|
|
6393
6401
|
};
|
|
6394
|
-
var styles$b = StyleSheet.create({
|
|
6395
|
-
disabled: { opacity: 0.6 },
|
|
6396
|
-
button: {
|
|
6402
|
+
var styles$b = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, button: {
|
|
6397
6403
|
height: CONSTANTS.BUTTON_HEIGHT,
|
|
6398
6404
|
alignItems: "center",
|
|
6399
6405
|
justifyContent: "center",
|
|
6400
6406
|
minWidth: CONSTANTS.DEVICE_WIDTH / 4.5,
|
|
6401
|
-
},
|
|
6402
|
-
border: {
|
|
6407
|
+
}, border: {
|
|
6403
6408
|
borderWidth: CONSTANTS.BORDER_WIDTH_1,
|
|
6404
6409
|
backgroundColor: "transparent",
|
|
6405
|
-
},
|
|
6406
|
-
small: {
|
|
6410
|
+
}, small: {
|
|
6407
6411
|
height: CONSTANTS.BUTTON_HEIGHT_SMALL,
|
|
6408
|
-
}
|
|
6409
|
-
});
|
|
6412
|
+
} }));
|
|
6410
6413
|
var index$3 = React__default.memo(Button);
|
|
6411
6414
|
|
|
6412
6415
|
var FloatingButton = function (_a) {
|
|
@@ -7246,14 +7249,14 @@ var styles$2 = StyleSheet.create(__assign(__assign({}, containerStyles), { disab
|
|
|
7246
7249
|
var index$1 = React__default.memo(SelectionField);
|
|
7247
7250
|
|
|
7248
7251
|
var SearchInput = function (_a) {
|
|
7249
|
-
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, _f = _a.debounceTime, debounceTime = _f === void 0 ? 500 : _f;
|
|
7252
|
+
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, _f = _a.debounceTime, debounceTime = _f === void 0 ? 500 : _f, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g;
|
|
7250
7253
|
var theme = useInternalTheme();
|
|
7251
7254
|
var colors = theme.colors;
|
|
7252
7255
|
var debouncedOnChangeText = useDebouncedCallback(function (text) {
|
|
7253
7256
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
|
|
7254
7257
|
}, debounceTime);
|
|
7255
7258
|
return (React__default.createElement(TextInput, { left: React__default.createElement(View, null,
|
|
7256
|
-
React__default.createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 18 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", label: placeholder, placeholder: placeholder, placeholderTextColor: colors.textPlaceholder, right: rightIcon, onFocus: onFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: debouncedOnChangeText, style: [
|
|
7259
|
+
React__default.createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 18 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", label: placeholder, placeholder: placeholder, placeholderTextColor: colors.textPlaceholder, right: rightIcon, onFocus: onFocus, autoFocus: autoFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: debouncedOnChangeText, style: [
|
|
7257
7260
|
{
|
|
7258
7261
|
height: height || 36,
|
|
7259
7262
|
},
|
|
@@ -7266,7 +7269,6 @@ var SearchInput = function (_a) {
|
|
|
7266
7269
|
style,
|
|
7267
7270
|
] }));
|
|
7268
7271
|
};
|
|
7269
|
-
StyleSheet.create(__assign({}, containerStyles));
|
|
7270
7272
|
|
|
7271
7273
|
var Tag = function (_a) {
|
|
7272
7274
|
var style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.checked, checked = _e === void 0 ? false : _e, _f = _a.ellipsizeMode, ellipsizeMode = _f === void 0 ? "tail" : _f, _g = _a.numberOfLines, numberOfLines = _g === void 0 ? 1 : _g, _h = _a.hideRightIcon, hideRightIcon = _h === void 0 ? false : _h, _j = _a.height, height = _j === void 0 ? 32 : _j;
|