sapo-components-ui-rn 1.0.4 → 1.0.6
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/README.md +10 -6
- package/dist/assets/avatar.png +0 -0
- package/dist/assets/badge.png +0 -0
- package/dist/assets/button-icon.png +0 -0
- package/dist/assets/button.png +0 -0
- package/dist/assets/checkbox.png +0 -0
- package/dist/assets/chipbar.png +0 -0
- package/dist/assets/counting-dot.png +0 -0
- package/dist/assets/floating-button.png +0 -0
- package/dist/assets/image.png +0 -0
- package/dist/assets/images/avatar.png +0 -0
- package/dist/assets/images/badge.png +0 -0
- package/dist/assets/images/button-icon.png +0 -0
- package/dist/assets/images/button.png +0 -0
- package/dist/assets/images/checkbox.png +0 -0
- package/dist/assets/images/chipbar.png +0 -0
- package/dist/assets/images/counting-dot.png +0 -0
- package/dist/assets/images/floating-button.png +0 -0
- package/dist/assets/images/image.png +0 -0
- package/dist/assets/images/radio-button.png +0 -0
- package/dist/assets/images/search-input.png +0 -0
- package/dist/assets/images/selection-field.png +0 -0
- package/dist/assets/images/switch.png +0 -0
- package/dist/assets/images/text-area.png +0 -0
- package/dist/assets/images/text-input.png +0 -0
- package/dist/assets/images/toast.png +0 -0
- package/dist/assets/radio-button.png +0 -0
- package/dist/assets/search-input.png +0 -0
- package/dist/assets/selection-field.png +0 -0
- package/dist/assets/switch.png +0 -0
- package/dist/assets/text-area.png +0 -0
- package/dist/assets/text-input.png +0 -0
- package/dist/assets/toast.png +0 -0
- package/dist/components/Button/index.d.ts +6 -1
- package/dist/index.esm.js +78 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +78 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/images/avatar.png +0 -0
- package/src/assets/images/badge.png +0 -0
- package/src/assets/images/button-icon.png +0 -0
- package/src/assets/images/button.png +0 -0
- package/src/assets/images/checkbox.png +0 -0
- package/src/assets/images/chipbar.png +0 -0
- package/src/assets/images/counting-dot.png +0 -0
- package/src/assets/images/floating-button.png +0 -0
- package/src/assets/images/image.png +0 -0
- package/src/assets/images/radio-button.png +0 -0
- package/src/assets/images/search-input.png +0 -0
- package/src/assets/images/selection-field.png +0 -0
- package/src/assets/images/switch.png +0 -0
- package/src/assets/images/text-area.png +0 -0
- package/src/assets/images/text-input.png +0 -0
- package/src/assets/images/toast.png +0 -0
- package/src/components/Button/index.tsx +23 -3
- package/src/components/FloatingButton/index.tsx +1 -0
- package/src/components/SelectionField/index.tsx +20 -15
- package/src/components/TextInput/TextInputDefault.tsx +8 -1
- package/src/components/Toast/index.tsx +39 -5
package/README.md
CHANGED
|
@@ -42,20 +42,24 @@ function MyComponent() {
|
|
|
42
42
|
|
|
43
43
|
Thư viện bao gồm các components sau:
|
|
44
44
|
|
|
45
|
-
- [Button](Button.md)
|
|
46
|
-
- [ButtonIcon](ButtonIcon.md)
|
|
47
|
-
- [Text](Text.md)
|
|
48
|
-
- [TextInput](TextInput.md)
|
|
49
45
|
- [Avatar](Avatar.md)
|
|
50
46
|
- [Badge](Badge.md)
|
|
47
|
+
- [Button](Button.md)
|
|
48
|
+
- [ButtonIcon](ButtonIcon.md)
|
|
51
49
|
- [Checkbox](Checkbox.md)
|
|
52
50
|
- [ChipBar](ChipBar.md)
|
|
53
|
-
- [RadioButton](RadioButton.md)
|
|
54
|
-
- [Switch](Switch.md)
|
|
55
51
|
- [CountingDot](CountingDot.md)
|
|
56
52
|
- [FloatingButton](FloatingButton.md)
|
|
57
53
|
- [Image](Image.md)
|
|
54
|
+
- [RadioButton](RadioButton.md)
|
|
55
|
+
- [SearchInput](SearchInput.md)
|
|
56
|
+
- [SelectionField](SelectionField.md)
|
|
58
57
|
- [Spacer](Spacer.md)
|
|
58
|
+
- [Switch](Switch.md)
|
|
59
|
+
- [Text](Text.md)
|
|
60
|
+
- [TextInput](TextInput.md)
|
|
61
|
+
- [TextArea](TextArea.md)
|
|
62
|
+
- [Toast](Toast.md)
|
|
59
63
|
- [View](View.md)
|
|
60
64
|
<!--
|
|
61
65
|
## Đóng góp
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, TouchableOpacityProps, TextStyle } from "react-native";
|
|
3
|
+
import { IText } from "../Text";
|
|
3
4
|
import { ThemeProp } from "../../types";
|
|
4
5
|
export interface ButtonProps extends TouchableOpacityProps {
|
|
5
6
|
style?: StyleProp<ViewStyle>;
|
|
7
|
+
border?: boolean;
|
|
6
8
|
borderColor?: string;
|
|
7
9
|
title?: string;
|
|
8
10
|
backgroundColor?: string;
|
|
@@ -10,14 +12,17 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
10
12
|
left?: React.ReactNode;
|
|
11
13
|
right?: React.ReactNode;
|
|
12
14
|
small?: boolean;
|
|
15
|
+
margin?: Number;
|
|
16
|
+
textProps?: IText;
|
|
13
17
|
textColor?: string;
|
|
14
18
|
bold?: boolean;
|
|
15
19
|
size?: number;
|
|
16
20
|
textStyle?: TextStyle;
|
|
17
21
|
medium?: boolean;
|
|
18
22
|
mode?: "outlined" | "contained" | "transparent";
|
|
23
|
+
transparent?: boolean;
|
|
19
24
|
onPress?: (res?: any) => void;
|
|
20
25
|
theme?: ThemeProp;
|
|
21
26
|
}
|
|
22
|
-
declare const _default: React.MemoExoticComponent<({ style, title, borderColor, isLoading, left, right, small, textStyle, onPress, disabled, backgroundColor, textColor, bold, size, medium, mode, theme: themeOverrides, ...props }: ButtonProps) => React.JSX.Element>;
|
|
27
|
+
declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, small, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor, bold, size, medium, mode, transparent, theme: themeOverrides, ...props }: ButtonProps) => React.JSX.Element>;
|
|
23
28
|
export default _default;
|
package/dist/index.esm.js
CHANGED
|
@@ -5524,13 +5524,14 @@ var Text = function (props) {
|
|
|
5524
5524
|
var Text$1 = memoDeepEqual(Text);
|
|
5525
5525
|
|
|
5526
5526
|
var TextInputDefault = function (_a) {
|
|
5527
|
-
var _b
|
|
5527
|
+
var _b;
|
|
5528
|
+
var _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.editable, editable = _d === void 0 ? true : _d, label = _a.label, _e = _a.error, error = _e === void 0 ? false : _e, customSelectionColor = _a.selectionColor, cursorColor = _a.cursorColor, customOutlineColor = _a.outlineColor, activeOutlineColor = _a.activeOutlineColor; _a.outlineStyle; var textColor = _a.textColor; _a.dense; var style = _a.style, theme = _a.theme, _f = _a.render, render = _f === void 0 ? function (props) { return React$3.createElement(TextInput$1, __assign({}, props)); } : _f, _g = _a.multiline, multiline = _g === void 0 ? false : _g, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus; _a.forceFocus; var onBlur = _a.onBlur, onChangeText = _a.onChangeText; _a.onLayout; var left = _a.left, right = _a.right, placeholderTextColor = _a.placeholderTextColor, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, contentStyle = _a.contentStyle, value = _a.value, rest = __rest(_a, ["disabled", "editable", "label", "error", "selectionColor", "cursorColor", "outlineColor", "activeOutlineColor", "outlineStyle", "textColor", "dense", "style", "theme", "render", "multiline", "parentState", "innerRef", "onFocus", "forceFocus", "onBlur", "onChangeText", "onLayout", "left", "right", "placeholderTextColor", "clearButton", "contentStyle", "value"]);
|
|
5528
5529
|
var colors = theme.colors;
|
|
5529
5530
|
var font = theme.fonts.bodyLarge;
|
|
5530
|
-
var
|
|
5531
|
+
var _j = (StyleSheet.flatten(style) || {}), fontSizeStyle = _j.fontSize, fontWeight = _j.fontWeight, lineHeightStyle = _j.lineHeight, height = _j.height, _k = _j.backgroundColor; _k === void 0 ? colors === null || colors === void 0 ? void 0 : colors.backgroundPrimary : _k; var textAlign = _j.textAlign, viewStyle = __rest(_j, ["fontSize", "fontWeight", "lineHeight", "height", "backgroundColor", "textAlign"]);
|
|
5531
5532
|
var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
|
|
5532
5533
|
var lineHeight = lineHeightStyle || (Platform.OS === "web" ? fontSize * 1.2 : undefined);
|
|
5533
|
-
var
|
|
5534
|
+
var _l = getOutlinedInputColors({
|
|
5534
5535
|
activeOutlineColor: activeOutlineColor,
|
|
5535
5536
|
customOutlineColor: customOutlineColor,
|
|
5536
5537
|
customSelectionColor: customSelectionColor,
|
|
@@ -5538,8 +5539,8 @@ var TextInputDefault = function (_a) {
|
|
|
5538
5539
|
disabled: disabled,
|
|
5539
5540
|
error: error,
|
|
5540
5541
|
theme: theme,
|
|
5541
|
-
}), inputTextColor =
|
|
5542
|
-
var
|
|
5542
|
+
}), inputTextColor = _l.inputTextColor, activeColor = _l.activeColor, selectionColor = _l.selectionColor;
|
|
5543
|
+
var _m = React$3.useState(value || ""), inputValue = _m[0], setInputValue = _m[1];
|
|
5543
5544
|
React$3.useEffect(function () {
|
|
5544
5545
|
setInputValue(value || "");
|
|
5545
5546
|
}, [value]);
|
|
@@ -5601,7 +5602,11 @@ var TextInputDefault = function (_a) {
|
|
|
5601
5602
|
left && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
5602
5603
|
React$3.createElement(View, { full: true },
|
|
5603
5604
|
multiline && renderLabel(), render === null || render === void 0 ? void 0 :
|
|
5604
|
-
render(__assign(__assign({}, rest), { ref: innerRef, onChangeText: handleChangeText, value: inputValue, placeholder:
|
|
5605
|
+
render(__assign(__assign({}, rest), { ref: innerRef, onChangeText: handleChangeText, value: inputValue, placeholder: ((_b = parentState.value) === null || _b === void 0 ? void 0 : _b.toString()) == ""
|
|
5606
|
+
? parentState.focused
|
|
5607
|
+
? rest.placeholder
|
|
5608
|
+
: label
|
|
5609
|
+
: rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
|
|
5605
5610
|
styles$a.input,
|
|
5606
5611
|
__assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
|
|
5607
5612
|
? textAlign
|
|
@@ -5623,6 +5628,8 @@ var styles$a = StyleSheet.create({
|
|
|
5623
5628
|
},
|
|
5624
5629
|
clearButton: {
|
|
5625
5630
|
padding: CONSTANTS.SPACE_8,
|
|
5631
|
+
height: "100%",
|
|
5632
|
+
paddingTop: CONSTANTS.SPACE_16,
|
|
5626
5633
|
},
|
|
5627
5634
|
});
|
|
5628
5635
|
|
|
@@ -5887,7 +5894,7 @@ var ScaleButton = function (_a) {
|
|
|
5887
5894
|
var ScaleButton$1 = React__default.memo(ScaleButton);
|
|
5888
5895
|
|
|
5889
5896
|
var Button = function (_a) {
|
|
5890
|
-
var style = _a.style, title = _a.title
|
|
5897
|
+
var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right, small = _a.small; _a.margin; var textStyle = _a.textStyle, textProps = _a.textProps, onPress = _a.onPress, disabled = _a.disabled, backgroundColor = _a.backgroundColor, textColor = _a.textColor, _b = _a.bold, bold = _b === void 0 ? true : _b, _c = _a.size, size = _c === void 0 ? 16 : _c, _d = _a.medium, medium = _d === void 0 ? false : _d, _e = _a.mode, mode = _e === void 0 ? "contained" : _e; _a.transparent; _a.theme; var props = __rest(_a, ["style", "title", "border", "borderColor", "isLoading", "left", "right", "small", "margin", "textStyle", "textProps", "onPress", "disabled", "backgroundColor", "textColor", "bold", "size", "medium", "mode", "transparent", "theme"]);
|
|
5891
5898
|
var theme = useInternalTheme();
|
|
5892
5899
|
var colors = theme.colors;
|
|
5893
5900
|
var disabledTextStyle = {
|
|
@@ -5906,6 +5913,16 @@ var Button = function (_a) {
|
|
|
5906
5913
|
];
|
|
5907
5914
|
}
|
|
5908
5915
|
};
|
|
5916
|
+
var renderTextColor = function () {
|
|
5917
|
+
switch (mode) {
|
|
5918
|
+
case "outlined":
|
|
5919
|
+
return colors.textBrandDefault;
|
|
5920
|
+
case "contained":
|
|
5921
|
+
return colors.textOnFillDefault;
|
|
5922
|
+
case "transparent":
|
|
5923
|
+
return colors.textBrandDefault;
|
|
5924
|
+
}
|
|
5925
|
+
};
|
|
5909
5926
|
return (React__default.createElement(View, { style: styles$9.container },
|
|
5910
5927
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
5911
5928
|
React__default.createElement(View, { style: [
|
|
@@ -5933,7 +5950,7 @@ var Button = function (_a) {
|
|
|
5933
5950
|
React__default.createElement(Spacer, { width: left ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 }),
|
|
5934
5951
|
!isLoading && left,
|
|
5935
5952
|
left && React__default.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
5936
|
-
isLoading ? (React__default.createElement(ActivityIndicator$1, { color: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.color) || colors.borderBrandDefault })) : (React__default.createElement(Text$1, { numberOfLines: 1, color: textColor ||
|
|
5953
|
+
isLoading ? (React__default.createElement(ActivityIndicator$1, { color: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.color) || colors.borderBrandDefault })) : (React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || renderTextColor(), size: size, bold: bold, medium: medium, style: [disabled && disabledTextStyle, textStyle] }, textProps), title)),
|
|
5937
5954
|
right && React__default.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
5938
5955
|
!isLoading && right,
|
|
5939
5956
|
React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))));
|
|
@@ -6040,6 +6057,7 @@ var styles$7 = StyleSheet.create({
|
|
|
6040
6057
|
shadowOpacity: 0.25,
|
|
6041
6058
|
shadowRadius: 3.84,
|
|
6042
6059
|
elevation: 5,
|
|
6060
|
+
zIndex: 99,
|
|
6043
6061
|
},
|
|
6044
6062
|
});
|
|
6045
6063
|
var index$1 = memoDeepEqual(FloatingButton);
|
|
@@ -6164,17 +6182,26 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6164
6182
|
var viewVisibleAnimatedRef = useRef(null);
|
|
6165
6183
|
var _b = useSafeAreaInsets(), bottom = _b.bottom, top = _b.top;
|
|
6166
6184
|
var _c = useState({
|
|
6167
|
-
position: POSITION.
|
|
6185
|
+
position: POSITION.BOTTOM,
|
|
6168
6186
|
type: "success",
|
|
6169
6187
|
title: "Thông báo",
|
|
6188
|
+
spacer: "normal",
|
|
6170
6189
|
}), options = _c[0], setOptions = _c[1];
|
|
6171
6190
|
var theme = useInternalTheme();
|
|
6172
6191
|
var colors = theme.colors;
|
|
6173
6192
|
var TIME_OUT = useRef(null);
|
|
6174
6193
|
var show = function (_a) {
|
|
6175
|
-
var message = _a.message, _b = _a.duration, duration = _b === void 0 ? 1000 : _b, _c = _a.position, position = _c === void 0 ? POSITION.
|
|
6194
|
+
var message = _a.message, _b = _a.duration, duration = _b === void 0 ? 1000 : _b, _c = _a.position, position = _c === void 0 ? POSITION.BOTTOM : _c, _d = _a.type, type = _d === void 0 ? "success" : _d, onPress = _a.onPress, _e = _a.title, title = _e === void 0 ? "Thông báo" : _e, _f = _a.spacer, spacer = _f === void 0 ? "normal" : _f;
|
|
6176
6195
|
if (!TIME_OUT.current) {
|
|
6177
|
-
handleShow({
|
|
6196
|
+
handleShow({
|
|
6197
|
+
message: message,
|
|
6198
|
+
position: position,
|
|
6199
|
+
type: type,
|
|
6200
|
+
onPress: onPress,
|
|
6201
|
+
title: title,
|
|
6202
|
+
duration: duration,
|
|
6203
|
+
spacer: spacer,
|
|
6204
|
+
});
|
|
6178
6205
|
return;
|
|
6179
6206
|
}
|
|
6180
6207
|
clearTimeout(TIME_OUT.current);
|
|
@@ -6194,9 +6221,9 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6194
6221
|
}); }, []);
|
|
6195
6222
|
var handleShow = function (_a) {
|
|
6196
6223
|
var _b, _c;
|
|
6197
|
-
var message = _a.message, _d = _a.position, position = _d === void 0 ? POSITION.TOP : _d, _e = _a.type, type = _e === void 0 ? "success" : _e, onPress = _a.onPress, _f = _a.title, title = _f === void 0 ? "Thông báo" : _f, _g = _a.duration, duration = _g === void 0 ? 1000 : _g;
|
|
6224
|
+
var message = _a.message, _d = _a.position, position = _d === void 0 ? POSITION.TOP : _d, _e = _a.type, type = _e === void 0 ? "success" : _e, onPress = _a.onPress, _f = _a.title, title = _f === void 0 ? "Thông báo" : _f, _g = _a.duration, duration = _g === void 0 ? 1000 : _g, _h = _a.spacer, spacer = _h === void 0 ? "normal" : _h;
|
|
6198
6225
|
setMessage(message || "");
|
|
6199
|
-
setOptions({ position: position, type: type, onPress: onPress, title: title });
|
|
6226
|
+
setOptions({ position: position, type: type, onPress: onPress, title: title, spacer: spacer });
|
|
6200
6227
|
(_c = (_b = viewVisibleAnimatedRef.current) === null || _b === void 0 ? void 0 : _b.show) === null || _c === void 0 ? void 0 : _c.call(_b, function () {
|
|
6201
6228
|
TIME_OUT.current = setTimeout(function () {
|
|
6202
6229
|
hide(function () { }, false);
|
|
@@ -6245,10 +6272,28 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6245
6272
|
return require("./assets/images/success.png");
|
|
6246
6273
|
}
|
|
6247
6274
|
};
|
|
6275
|
+
var handleToastBottomHeight = function () {
|
|
6276
|
+
var spacer = options.spacer;
|
|
6277
|
+
if (typeof spacer === "number") {
|
|
6278
|
+
return spacer;
|
|
6279
|
+
}
|
|
6280
|
+
switch (spacer) {
|
|
6281
|
+
case "normal":
|
|
6282
|
+
return 64;
|
|
6283
|
+
case "medium":
|
|
6284
|
+
return 100;
|
|
6285
|
+
case "large":
|
|
6286
|
+
return 120;
|
|
6287
|
+
default:
|
|
6288
|
+
return 64;
|
|
6289
|
+
}
|
|
6290
|
+
};
|
|
6248
6291
|
return (React__default.createElement(ViewVisibleAnimated, { ref: viewVisibleAnimatedRef, autoShow: false, scaleEnable: true, style: [
|
|
6249
6292
|
styles$6.container,
|
|
6250
6293
|
options.position === POSITION.BOTTOM && {
|
|
6251
|
-
bottom: bottom
|
|
6294
|
+
bottom: bottom
|
|
6295
|
+
? bottom + handleToastBottomHeight()
|
|
6296
|
+
: CONSTANTS.SPACE_16 + handleToastBottomHeight(),
|
|
6252
6297
|
},
|
|
6253
6298
|
options.position === POSITION.TOP && {
|
|
6254
6299
|
top: top ? top : CONSTANTS.SPACE_16,
|
|
@@ -6369,10 +6414,18 @@ var Badge = function (_a) {
|
|
|
6369
6414
|
|
|
6370
6415
|
Dimensions.get("window").height;
|
|
6371
6416
|
Dimensions.get("window").width;
|
|
6417
|
+
var BUTTON_HEIGHT = 48;
|
|
6418
|
+
var BUTTON_HEIGHT_SMALL = 40;
|
|
6419
|
+
var SPACE_4 = 4;
|
|
6420
|
+
var SPACE_6 = 6;
|
|
6372
6421
|
var SPACE_8 = 8;
|
|
6422
|
+
var SPACE_12 = 12;
|
|
6373
6423
|
var SPACE_16 = 16;
|
|
6424
|
+
//MARK: Border radius
|
|
6425
|
+
var BORDER_RADIUS_6 = 6;
|
|
6374
6426
|
//MARK: Border width
|
|
6375
6427
|
StyleSheet.hairlineWidth; //0.3-0.5
|
|
6428
|
+
var BORDER_WIDTH_1 = 1;
|
|
6376
6429
|
|
|
6377
6430
|
var containerStyles = StyleSheet.create({
|
|
6378
6431
|
container: { flex: 1 },
|
|
@@ -6682,9 +6735,9 @@ var SelectionField = function (_a) {
|
|
|
6682
6735
|
React__default.createElement(View, { style: [
|
|
6683
6736
|
styles.container,
|
|
6684
6737
|
{
|
|
6685
|
-
borderRadius:
|
|
6738
|
+
borderRadius: BORDER_RADIUS_6,
|
|
6686
6739
|
},
|
|
6687
|
-
[styles.border, { borderColor: colors.
|
|
6740
|
+
[styles.border, { borderColor: colors.borderPrimaryDefault }],
|
|
6688
6741
|
borderColor && { borderColor: borderColor },
|
|
6689
6742
|
disabled && [
|
|
6690
6743
|
styles.disabled,
|
|
@@ -6701,9 +6754,9 @@ var SelectionField = function (_a) {
|
|
|
6701
6754
|
],
|
|
6702
6755
|
style,
|
|
6703
6756
|
] },
|
|
6704
|
-
React__default.createElement(Spacer, { width:
|
|
6757
|
+
React__default.createElement(Spacer, { width: SPACE_12 }),
|
|
6705
6758
|
React__default.createElement(View, { full: true },
|
|
6706
|
-
label.toString() !== "" && (React__default.createElement(Text$1, { color: labelColor || colors.textSecondary, style: [
|
|
6759
|
+
content.toString() !== "" && label.toString() !== "" && (React__default.createElement(Text$1, { color: labelColor || colors.textSecondary, style: [
|
|
6707
6760
|
styles.text12,
|
|
6708
6761
|
disabled && {
|
|
6709
6762
|
color: colors.textPlaceholder,
|
|
@@ -6712,22 +6765,22 @@ var SelectionField = function (_a) {
|
|
|
6712
6765
|
color: colors.textErrorDefault,
|
|
6713
6766
|
},
|
|
6714
6767
|
] }, label)),
|
|
6715
|
-
React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || colors.textDefault, size: size, style: [disabled && disabledTextStyle, textStyle] }, textProps), content)),
|
|
6768
|
+
React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || colors.textDefault, size: size, style: [disabled && disabledTextStyle, textStyle] }, textProps), content.toString() === "" ? label : content)),
|
|
6716
6769
|
right || React__default.createElement(Icon$1, { name: "IconArrowDown", type: "Svg", size: 24 }),
|
|
6717
|
-
React__default.createElement(Spacer, { width:
|
|
6718
|
-
error.length > 0 && (React__default.createElement(View, { paddingHorizontal:
|
|
6770
|
+
React__default.createElement(Spacer, { width: SPACE_12 }))),
|
|
6771
|
+
error.length > 0 && (React__default.createElement(View, { paddingHorizontal: SPACE_12, paddingVertical: SPACE_4 },
|
|
6719
6772
|
React__default.createElement(Text$1, { style: styles.text12, color: colors.textErrorDefault }, error)))));
|
|
6720
6773
|
};
|
|
6721
6774
|
var styles = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
|
|
6722
|
-
minHeight:
|
|
6775
|
+
minHeight: BUTTON_HEIGHT,
|
|
6723
6776
|
flexDirection: "row",
|
|
6724
6777
|
alignItems: "center",
|
|
6725
6778
|
justifyContent: "space-between",
|
|
6726
|
-
paddingVertical:
|
|
6779
|
+
paddingVertical: SPACE_6,
|
|
6727
6780
|
}, border: {
|
|
6728
|
-
borderWidth:
|
|
6781
|
+
borderWidth: BORDER_WIDTH_1,
|
|
6729
6782
|
}, small: {
|
|
6730
|
-
height:
|
|
6783
|
+
height: BUTTON_HEIGHT_SMALL,
|
|
6731
6784
|
} }));
|
|
6732
6785
|
var index = React__default.memo(SelectionField);
|
|
6733
6786
|
|