@momo-kits/foundation 0.89.3-tracking.1 → 0.89.4-beta.1
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/Application/Components.tsx +3 -16
- package/Application/ModalScreen.tsx +4 -16
- package/Application/StackScreen.tsx +2 -13
- package/Application/types.ts +0 -2
- package/Application/utils.tsx +0 -2
- package/Button/index.tsx +14 -35
- package/CheckBox/index.tsx +0 -1
- package/IconButton/index.tsx +7 -28
- package/Input/Input.tsx +29 -26
- package/Input/InputDropDown.tsx +1 -6
- package/Input/InputMoney.tsx +4 -24
- package/Input/InputOTP.tsx +7 -26
- package/Input/InputSearch.tsx +25 -47
- package/Input/InputTextArea.tsx +1 -5
- package/Input/index.tsx +0 -7
- package/Input/styles.ts +1 -2
- package/Layout/Card.tsx +0 -1
- package/Layout/Item.tsx +0 -1
- package/Layout/Screen.tsx +1 -3
- package/Layout/Section.tsx +0 -1
- package/Pagination/PaginationScroll.tsx +0 -1
- package/Popup/PopupNotify.tsx +0 -1
- package/Popup/PopupPromotion.tsx +1 -1
- package/Radio/index.tsx +0 -1
- package/Skeleton/index.tsx +1 -1
- package/Switch/index.tsx +0 -1
- package/Tag/index.tsx +1 -3
- package/Text/index.tsx +0 -1
- package/package.json +1 -1
|
@@ -35,7 +35,6 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
35
35
|
tintColor,
|
|
36
36
|
onPress,
|
|
37
37
|
useBorder = true,
|
|
38
|
-
accessibilityLabel,
|
|
39
38
|
badgeType,
|
|
40
39
|
badgeValue,
|
|
41
40
|
}) => {
|
|
@@ -67,7 +66,6 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
67
66
|
return (
|
|
68
67
|
<View style={{width: scaleSize(28)}}>
|
|
69
68
|
<TouchableOpacity
|
|
70
|
-
accessibilityLabel={`NavigationButton/${accessibilityLabel}`}
|
|
71
69
|
style={[styles.navigationButton, buttonStyle]}
|
|
72
70
|
onPress={onPress}>
|
|
73
71
|
<Icon
|
|
@@ -81,7 +79,7 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
81
79
|
);
|
|
82
80
|
};
|
|
83
81
|
|
|
84
|
-
const HeaderTitle: React.FC<any> =
|
|
82
|
+
const HeaderTitle: React.FC<any> = props => {
|
|
85
83
|
const {theme} = useContext(ApplicationContext);
|
|
86
84
|
const opacity = props.animatedValue?.interpolate({
|
|
87
85
|
inputRange: [0, 200],
|
|
@@ -92,7 +90,6 @@ const HeaderTitle: React.FC<any> = ({accessibilityLabel = '', ...props}) => {
|
|
|
92
90
|
return (
|
|
93
91
|
<Animated.Text
|
|
94
92
|
{...props}
|
|
95
|
-
accessibilityLabel={`HeaderTitle/${accessibilityLabel}${props.children}`}
|
|
96
93
|
style={[
|
|
97
94
|
styles.title,
|
|
98
95
|
{fontFamily: `${theme.font}-Bold`, opacity, color: props.tintColor},
|
|
@@ -106,7 +103,6 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
106
103
|
preventBack,
|
|
107
104
|
onPressLeftHeader,
|
|
108
105
|
useBorder,
|
|
109
|
-
accessibilityLabel = '',
|
|
110
106
|
}) => {
|
|
111
107
|
const context = useContext(MiniAppContext);
|
|
112
108
|
const {navigator} = useContext(ApplicationContext);
|
|
@@ -171,7 +167,6 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
171
167
|
icon="ic_back"
|
|
172
168
|
tintColor={tintColor}
|
|
173
169
|
onPress={goBackSafe}
|
|
174
|
-
accessibilityLabel={`${accessibilityLabel}Back`}
|
|
175
170
|
useBorder={useBorder}
|
|
176
171
|
/>
|
|
177
172
|
</View>
|
|
@@ -368,7 +363,6 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
368
363
|
if (pinTool)
|
|
369
364
|
return (
|
|
370
365
|
<NavigationButton
|
|
371
|
-
accessibilityLabel={'UtilityTool'}
|
|
372
366
|
icon={pinTool.icon as string}
|
|
373
367
|
tintColor={tintColor}
|
|
374
368
|
badgeValue={badgeValue}
|
|
@@ -387,7 +381,6 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
387
381
|
);
|
|
388
382
|
};
|
|
389
383
|
|
|
390
|
-
if (toolConfig) {
|
|
391
384
|
return (
|
|
392
385
|
<View style={styles.headerRightButton}>
|
|
393
386
|
{renderPinnedTool()}
|
|
@@ -399,15 +392,11 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
399
392
|
borderWidth: backgroundColor ? 0.5 : 0,
|
|
400
393
|
},
|
|
401
394
|
]}>
|
|
402
|
-
<TouchableOpacity
|
|
403
|
-
accessibilityLabel={'Toolkit/More'}
|
|
404
|
-
onPress={onMore}>
|
|
395
|
+
<TouchableOpacity onPress={onMore}>
|
|
405
396
|
<Icon color={tintColor} source="navigation_more_horiz" size={20} />
|
|
406
397
|
</TouchableOpacity>
|
|
407
398
|
<View style={[styles.divider, {backgroundColor: tintColor}]} />
|
|
408
|
-
<TouchableOpacity
|
|
409
|
-
accessibilityLabel={`Toolkit/Close`}
|
|
410
|
-
onPress={onClose}>
|
|
399
|
+
<TouchableOpacity onPress={onClose}>
|
|
411
400
|
<Icon
|
|
412
401
|
color={tintColor}
|
|
413
402
|
source="16_navigation_close_circle"
|
|
@@ -417,9 +406,7 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
417
406
|
</View>
|
|
418
407
|
</View>
|
|
419
408
|
);
|
|
420
|
-
}
|
|
421
409
|
|
|
422
|
-
return <View />;
|
|
423
410
|
};
|
|
424
411
|
|
|
425
412
|
const HeaderAnimated: React.FC<HeaderAnimatedProps> = ({
|
|
@@ -74,7 +74,7 @@ const Modal: React.FC<ModalParams> = props => {
|
|
|
74
74
|
style={styles.modalSpaceVertical}
|
|
75
75
|
onPress={() => onDismiss()}
|
|
76
76
|
/>
|
|
77
|
-
<View style={styles.modalContent}
|
|
77
|
+
<View style={styles.modalContent}>
|
|
78
78
|
<Component {...params} />
|
|
79
79
|
</View>
|
|
80
80
|
<Pressable
|
|
@@ -167,7 +167,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
167
167
|
bottomInset={Platform.OS === 'ios' ? bottomInset : 0}
|
|
168
168
|
handleComponent={null}
|
|
169
169
|
backdropComponent={backdropComponent}>
|
|
170
|
-
<BottomSheetView
|
|
170
|
+
<BottomSheetView>
|
|
171
171
|
<View style={[styles.sheetContainer, {backgroundColor}]}>
|
|
172
172
|
<View style={styles.indicatorContainer}>
|
|
173
173
|
<View
|
|
@@ -189,22 +189,11 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
189
189
|
...{
|
|
190
190
|
headerLeft: (props: any) => {
|
|
191
191
|
if (props.canGoBack) {
|
|
192
|
-
return
|
|
193
|
-
<HeaderLeft
|
|
194
|
-
{...props}
|
|
195
|
-
useBorder={false}
|
|
196
|
-
accessibilityLabel={'BottomSheet/'}
|
|
197
|
-
/>
|
|
198
|
-
);
|
|
192
|
+
return <HeaderLeft {...props} useBorder={false} />;
|
|
199
193
|
}
|
|
200
194
|
},
|
|
201
195
|
headerTitle: (props: any) => {
|
|
202
|
-
return
|
|
203
|
-
<HeaderTitle
|
|
204
|
-
{...props}
|
|
205
|
-
accessibilityLabel={'BottomSheet/'}
|
|
206
|
-
/>
|
|
207
|
-
);
|
|
196
|
+
return <HeaderTitle {...props} />;
|
|
208
197
|
},
|
|
209
198
|
headerTintColor: theme.colors.text.default,
|
|
210
199
|
headerBackground: () => (
|
|
@@ -220,7 +209,6 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
220
209
|
icon="24_navigation_close"
|
|
221
210
|
useBorder={false}
|
|
222
211
|
onPress={() => bottomSheetRef.current?.dismiss()}
|
|
223
|
-
accessibilityLabel={'BottomSheet/Close'}
|
|
224
212
|
/>
|
|
225
213
|
</HeaderRightAction>
|
|
226
214
|
),
|
|
@@ -5,10 +5,6 @@ import {ApplicationContext, MiniAppContext} from './index';
|
|
|
5
5
|
import {GridSystem} from '../Layout';
|
|
6
6
|
import {useHeaderHeight} from '@react-navigation/stack';
|
|
7
7
|
|
|
8
|
-
const {
|
|
9
|
-
ScreenContext,
|
|
10
|
-
} = require('react-native/Libraries/Components/ScreenContext');
|
|
11
|
-
|
|
12
8
|
const StackScreen: React.FC<ScreenParams> = props => {
|
|
13
9
|
const {theme, showGrid, navigator} = useContext(ApplicationContext);
|
|
14
10
|
const context = useContext(MiniAppContext);
|
|
@@ -65,17 +61,10 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
65
61
|
}, []);
|
|
66
62
|
|
|
67
63
|
return (
|
|
68
|
-
|
|
69
|
-
value={{
|
|
70
|
-
...context,
|
|
71
|
-
screenName: Component.name,
|
|
72
|
-
autoTracking: (data: any) => {
|
|
73
|
-
navigator?.maxApi?.dispatchFunction?.('autoTracking', data);
|
|
74
|
-
},
|
|
75
|
-
}}>
|
|
64
|
+
<>
|
|
76
65
|
<Component heightHeader={heightHeader} {...params} />
|
|
77
66
|
{showGrid && <GridSystem />}
|
|
78
|
-
|
|
67
|
+
</>
|
|
79
68
|
);
|
|
80
69
|
};
|
|
81
70
|
|
package/Application/types.ts
CHANGED
|
@@ -127,7 +127,6 @@ export type NavigationButtonProps = {
|
|
|
127
127
|
tintColor?: string;
|
|
128
128
|
useBorder?: boolean;
|
|
129
129
|
onPress: () => void;
|
|
130
|
-
accessibilityLabel?: string;
|
|
131
130
|
badgeType?: 'dot' | 'number';
|
|
132
131
|
badgeValue?: number;
|
|
133
132
|
};
|
|
@@ -159,7 +158,6 @@ export interface NavigationOptions extends StackNavigationOptions {
|
|
|
159
158
|
export interface HeaderBackProps extends NavigationButtonProps {
|
|
160
159
|
preventBack?: PopupNotifyProps;
|
|
161
160
|
onPressLeftHeader?: () => void;
|
|
162
|
-
accessibilityLabel?: string;
|
|
163
161
|
}
|
|
164
162
|
|
|
165
163
|
export type HeaderBackgroundProps = {
|
package/Application/utils.tsx
CHANGED
|
@@ -126,7 +126,6 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
if (params.toolkitParams) {
|
|
130
129
|
options = {
|
|
131
130
|
...options,
|
|
132
131
|
headerRight: (props: any) => {
|
|
@@ -140,7 +139,6 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
140
139
|
);
|
|
141
140
|
},
|
|
142
141
|
};
|
|
143
|
-
}
|
|
144
142
|
|
|
145
143
|
return {
|
|
146
144
|
...params,
|
package/Button/index.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
TouchableOpacityProps,
|
|
7
7
|
View,
|
|
8
8
|
} from 'react-native';
|
|
9
|
+
|
|
9
10
|
import LinearGradient from 'react-native-linear-gradient';
|
|
10
11
|
import {ApplicationContext} from '../Application';
|
|
11
12
|
import {Text} from '../Text';
|
|
@@ -15,10 +16,6 @@ import styles from './styles';
|
|
|
15
16
|
import {Icon} from '../Icon';
|
|
16
17
|
import {Loader} from '../Loader';
|
|
17
18
|
|
|
18
|
-
const {
|
|
19
|
-
ScreenContext,
|
|
20
|
-
} = require('react-native/Libraries/Components/ScreenContext');
|
|
21
|
-
|
|
22
19
|
const AnimationLinear = Animated.createAnimatedComponent(LinearGradient);
|
|
23
20
|
|
|
24
21
|
export interface ButtonProps extends TouchableOpacityProps {
|
|
@@ -73,10 +70,6 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
73
70
|
* A callback function that is called when the button is pressed.
|
|
74
71
|
*/
|
|
75
72
|
onPress: () => void;
|
|
76
|
-
|
|
77
|
-
params?: any;
|
|
78
|
-
|
|
79
|
-
componentId?: string;
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
const Button: FC<ButtonProps> = ({
|
|
@@ -89,8 +82,6 @@ const Button: FC<ButtonProps> = ({
|
|
|
89
82
|
loading = false,
|
|
90
83
|
title = 'Button',
|
|
91
84
|
onPress,
|
|
92
|
-
params,
|
|
93
|
-
componentId,
|
|
94
85
|
...rest
|
|
95
86
|
}) => {
|
|
96
87
|
const {theme, config} = useContext(ApplicationContext);
|
|
@@ -103,8 +94,6 @@ const Button: FC<ButtonProps> = ({
|
|
|
103
94
|
end: {x: 0, y: 0.5},
|
|
104
95
|
};
|
|
105
96
|
}
|
|
106
|
-
|
|
107
|
-
const screenInfo = useContext<any>(ScreenContext);
|
|
108
97
|
const getSizeStyle = () => {
|
|
109
98
|
const styleSheet: {[key: string]: any} = styles;
|
|
110
99
|
return styleSheet[size ?? 'small'];
|
|
@@ -302,29 +291,19 @@ const Button: FC<ButtonProps> = ({
|
|
|
302
291
|
const activeOpacity = type === 'disabled' ? 0.75 : 0.5;
|
|
303
292
|
|
|
304
293
|
return (
|
|
305
|
-
<
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
style={buttonStyle}>
|
|
319
|
-
{renderLeading()}
|
|
320
|
-
{renderTitle()}
|
|
321
|
-
{renderTrailing()}
|
|
322
|
-
{gradientPros && (
|
|
323
|
-
<AnimationLinear {...gradientPros} style={styles.gradientView} />
|
|
324
|
-
)}
|
|
325
|
-
{gradientPros && <View style={styles.strokeView} />}
|
|
326
|
-
</TouchableOpacity>
|
|
327
|
-
</ScreenContext.Provider>
|
|
294
|
+
<TouchableOpacity
|
|
295
|
+
{...rest}
|
|
296
|
+
activeOpacity={activeOpacity}
|
|
297
|
+
onPress={onPressButton}
|
|
298
|
+
style={buttonStyle}>
|
|
299
|
+
{renderLeading()}
|
|
300
|
+
{renderTitle()}
|
|
301
|
+
{renderTrailing()}
|
|
302
|
+
{gradientPros && (
|
|
303
|
+
<AnimationLinear {...gradientPros} style={styles.gradientView} />
|
|
304
|
+
)}
|
|
305
|
+
{gradientPros && <View style={styles.strokeView} />}
|
|
306
|
+
</TouchableOpacity>
|
|
328
307
|
);
|
|
329
308
|
};
|
|
330
309
|
|
package/CheckBox/index.tsx
CHANGED
package/IconButton/index.tsx
CHANGED
|
@@ -10,10 +10,6 @@ import {Colors} from '../Consts';
|
|
|
10
10
|
import {Icon} from '../Icon';
|
|
11
11
|
import styles from './styles';
|
|
12
12
|
|
|
13
|
-
const {
|
|
14
|
-
ScreenContext,
|
|
15
|
-
} = require('react-native/Libraries/Components/ScreenContext');
|
|
16
|
-
|
|
17
13
|
export interface IconButtonProps extends TouchableOpacityProps {
|
|
18
14
|
/**
|
|
19
15
|
* Represents the name or key of the icon to be displayed on the IconButton.
|
|
@@ -30,10 +26,6 @@ export interface IconButtonProps extends TouchableOpacityProps {
|
|
|
30
26
|
* Optional. Defines the size of the IconButton.
|
|
31
27
|
*/
|
|
32
28
|
size?: 'large' | 'small';
|
|
33
|
-
|
|
34
|
-
params?: any;
|
|
35
|
-
|
|
36
|
-
componentId?: string;
|
|
37
29
|
}
|
|
38
30
|
|
|
39
31
|
const IconButton: React.FC<IconButtonProps> = ({
|
|
@@ -41,12 +33,9 @@ const IconButton: React.FC<IconButtonProps> = ({
|
|
|
41
33
|
icon,
|
|
42
34
|
size,
|
|
43
35
|
onPress,
|
|
44
|
-
params,
|
|
45
|
-
componentId,
|
|
46
36
|
...rest
|
|
47
37
|
}) => {
|
|
48
38
|
const {theme} = useContext(ApplicationContext);
|
|
49
|
-
const screenInfo = useContext<any>(ScreenContext);
|
|
50
39
|
|
|
51
40
|
/**
|
|
52
41
|
* get size icon button
|
|
@@ -132,23 +121,13 @@ const IconButton: React.FC<IconButtonProps> = ({
|
|
|
132
121
|
const iconSize = size === 'small' ? 16 : 24;
|
|
133
122
|
|
|
134
123
|
return (
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
action: 'click',
|
|
143
|
-
}}>
|
|
144
|
-
<TouchableOpacity
|
|
145
|
-
{...rest}
|
|
146
|
-
activeOpacity={activeOpacity}
|
|
147
|
-
onPress={onPressButton}
|
|
148
|
-
style={buttonStyle}>
|
|
149
|
-
<Icon size={iconSize} source={icon} color={getIconColor()} />
|
|
150
|
-
</TouchableOpacity>
|
|
151
|
-
</ScreenContext.Provider>
|
|
124
|
+
<TouchableOpacity
|
|
125
|
+
{...rest}
|
|
126
|
+
activeOpacity={activeOpacity}
|
|
127
|
+
onPress={onPressButton}
|
|
128
|
+
style={buttonStyle}>
|
|
129
|
+
<Icon size={iconSize} source={icon} color={getIconColor()} />
|
|
130
|
+
</TouchableOpacity>
|
|
152
131
|
);
|
|
153
132
|
};
|
|
154
133
|
|
package/Input/Input.tsx
CHANGED
|
@@ -14,10 +14,6 @@ import {Icon} from '../Icon';
|
|
|
14
14
|
import {checkTyping} from './utils';
|
|
15
15
|
import {Loader} from '../Loader';
|
|
16
16
|
|
|
17
|
-
const {
|
|
18
|
-
ScreenContext,
|
|
19
|
-
} = require('react-native/Libraries/Components/ScreenContext');
|
|
20
|
-
|
|
21
17
|
const Input = forwardRef(
|
|
22
18
|
(
|
|
23
19
|
{
|
|
@@ -41,9 +37,8 @@ const Input = forwardRef(
|
|
|
41
37
|
leadingIconColor,
|
|
42
38
|
fontWeight = 'Regular',
|
|
43
39
|
onPressIcon,
|
|
40
|
+
secureTextEntry,
|
|
44
41
|
style,
|
|
45
|
-
params,
|
|
46
|
-
componentId,
|
|
47
42
|
...props
|
|
48
43
|
}: InputProps,
|
|
49
44
|
ref,
|
|
@@ -51,9 +46,8 @@ const Input = forwardRef(
|
|
|
51
46
|
const {theme} = useContext(ApplicationContext);
|
|
52
47
|
const [focused, setFocused] = useState(false);
|
|
53
48
|
const [haveValue, setHaveValue] = useState(!!value || !!props.defaultValue);
|
|
49
|
+
const [secureTextInput, setSecureTextInput] = useState(secureTextEntry);
|
|
54
50
|
const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
|
|
55
|
-
const accessibilityLabel = `Input/${floatingValue ?? placeholder}`;
|
|
56
|
-
const screenInfo = useContext<any>(ScreenContext);
|
|
57
51
|
|
|
58
52
|
const onClearText = () => {
|
|
59
53
|
inputRef?.current?.clear();
|
|
@@ -77,11 +71,29 @@ const Input = forwardRef(
|
|
|
77
71
|
|
|
78
72
|
const renderIcon = (color: string | undefined) => {
|
|
79
73
|
if (loading) {
|
|
80
|
-
return <Loader type={'spinner'} color={color} />;
|
|
74
|
+
return <Loader type={'spinner'} color={color} style={styles.icon} />;
|
|
75
|
+
}
|
|
76
|
+
if (secureTextEntry) {
|
|
77
|
+
return (
|
|
78
|
+
<TouchableOpacity
|
|
79
|
+
onPress={() => setSecureTextInput(!secureTextInput)}
|
|
80
|
+
style={styles.icon}>
|
|
81
|
+
<Icon
|
|
82
|
+
color={color}
|
|
83
|
+
size={24}
|
|
84
|
+
source={
|
|
85
|
+
secureTextInput ? '24_security_eye_off' : '24_security_eye_open'
|
|
86
|
+
}
|
|
87
|
+
/>
|
|
88
|
+
</TouchableOpacity>
|
|
89
|
+
);
|
|
81
90
|
}
|
|
82
91
|
if (icon) {
|
|
83
92
|
return (
|
|
84
|
-
<TouchableOpacity
|
|
93
|
+
<TouchableOpacity
|
|
94
|
+
onPress={onPressIcon}
|
|
95
|
+
disabled={!onPressIcon}
|
|
96
|
+
style={styles.icon}>
|
|
85
97
|
<Icon color={color} source={icon} size={24} />
|
|
86
98
|
</TouchableOpacity>
|
|
87
99
|
);
|
|
@@ -90,6 +102,7 @@ const Input = forwardRef(
|
|
|
90
102
|
|
|
91
103
|
const renderInputView = () => {
|
|
92
104
|
const disabledColor = theme.colors.text.disable;
|
|
105
|
+
const secure = secureTextInput && secureTextEntry;
|
|
93
106
|
let textColor = theme.colors.text.default;
|
|
94
107
|
let placeholderColor = theme.colors.text.hint;
|
|
95
108
|
let iconTintColor = iconColor;
|
|
@@ -127,8 +140,8 @@ const Input = forwardRef(
|
|
|
127
140
|
)}
|
|
128
141
|
<TextInput
|
|
129
142
|
{...props}
|
|
130
|
-
accessibilityLabel={accessibilityLabel}
|
|
131
143
|
editable={!disabled}
|
|
144
|
+
secureTextEntry={secure}
|
|
132
145
|
textAlignVertical="center"
|
|
133
146
|
ref={inputRef}
|
|
134
147
|
style={[
|
|
@@ -137,6 +150,7 @@ const Input = forwardRef(
|
|
|
137
150
|
color: textColor,
|
|
138
151
|
fontFamily: `${theme.font}-${fontWeight}`,
|
|
139
152
|
},
|
|
153
|
+
secure && haveValue && {fontSize: size === 'small' ? 18 : 22},
|
|
140
154
|
]}
|
|
141
155
|
textBreakStrategy="highQuality"
|
|
142
156
|
value={value}
|
|
@@ -167,21 +181,10 @@ const Input = forwardRef(
|
|
|
167
181
|
};
|
|
168
182
|
|
|
169
183
|
return (
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
params,
|
|
175
|
-
state: disabled ? 'disabled' : 'enabled',
|
|
176
|
-
componentId,
|
|
177
|
-
}}>
|
|
178
|
-
<View
|
|
179
|
-
style={[style, styles.wrapper]}
|
|
180
|
-
accessibilityLabel={accessibilityLabel}>
|
|
181
|
-
{renderInputView()}
|
|
182
|
-
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
183
|
-
</View>
|
|
184
|
-
</ScreenContext.Provider>
|
|
184
|
+
<View style={[style, styles.wrapper]}>
|
|
185
|
+
{renderInputView()}
|
|
186
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
187
|
+
</View>
|
|
185
188
|
);
|
|
186
189
|
},
|
|
187
190
|
);
|
package/Input/InputDropDown.tsx
CHANGED
|
@@ -30,7 +30,6 @@ const InputDropDown = ({
|
|
|
30
30
|
}: InputDropDownProps) => {
|
|
31
31
|
const {theme} = useContext(ApplicationContext);
|
|
32
32
|
const full = !!value || !!placeholder;
|
|
33
|
-
const accessibilityLabel = `InputDropDown/${floatingValue ?? placeholder}`;
|
|
34
33
|
|
|
35
34
|
const renderIcon = (color: string | undefined) => {
|
|
36
35
|
if (loading) {
|
|
@@ -82,7 +81,6 @@ const InputDropDown = ({
|
|
|
82
81
|
<TextInput
|
|
83
82
|
{...props}
|
|
84
83
|
onPressIn={onPress}
|
|
85
|
-
accessibilityLabel={accessibilityLabel}
|
|
86
84
|
editable={false}
|
|
87
85
|
textAlignVertical="top"
|
|
88
86
|
style={[
|
|
@@ -106,10 +104,7 @@ const InputDropDown = ({
|
|
|
106
104
|
};
|
|
107
105
|
|
|
108
106
|
return (
|
|
109
|
-
<TouchableOpacity
|
|
110
|
-
onPress={onPress}
|
|
111
|
-
style={[style, full && styles.wrapper]}
|
|
112
|
-
accessibilityLabel={accessibilityLabel}>
|
|
107
|
+
<TouchableOpacity onPress={onPress} style={[style, full && styles.wrapper]}>
|
|
113
108
|
{renderInputView()}
|
|
114
109
|
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
115
110
|
</TouchableOpacity>
|
package/Input/InputMoney.tsx
CHANGED
|
@@ -19,10 +19,6 @@ import {InputMoneyProps} from './index';
|
|
|
19
19
|
import {Icon} from '../Icon';
|
|
20
20
|
import {formatMoneyToNumber, formatNumberToMoney} from './utils';
|
|
21
21
|
|
|
22
|
-
const {
|
|
23
|
-
ScreenContext,
|
|
24
|
-
} = require('react-native/Libraries/Components/ScreenContext');
|
|
25
|
-
|
|
26
22
|
const InputMoney = forwardRef(
|
|
27
23
|
(
|
|
28
24
|
{
|
|
@@ -40,9 +36,7 @@ const InputMoney = forwardRef(
|
|
|
40
36
|
required = false,
|
|
41
37
|
errorSpacing,
|
|
42
38
|
style,
|
|
43
|
-
params,
|
|
44
39
|
defaultValue = '',
|
|
45
|
-
componentId,
|
|
46
40
|
...props
|
|
47
41
|
}: InputMoneyProps,
|
|
48
42
|
ref,
|
|
@@ -50,8 +44,6 @@ const InputMoney = forwardRef(
|
|
|
50
44
|
const {theme} = useContext(ApplicationContext);
|
|
51
45
|
const [focused, setFocused] = useState(false);
|
|
52
46
|
const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
|
|
53
|
-
const accessibilityLabel = `InputMoney/${floatingValue}`;
|
|
54
|
-
const screenInfo = useContext<any>(ScreenContext);
|
|
55
47
|
|
|
56
48
|
const validateText = (text: string) => {
|
|
57
49
|
const valueFormat = formatMoneyToNumber(text, 'đ');
|
|
@@ -122,7 +114,6 @@ const InputMoney = forwardRef(
|
|
|
122
114
|
<View style={styles.inputView}>
|
|
123
115
|
<TextInput
|
|
124
116
|
{...props}
|
|
125
|
-
accessibilityLabel={accessibilityLabel}
|
|
126
117
|
editable={!disabled}
|
|
127
118
|
textAlignVertical="top"
|
|
128
119
|
ref={inputRef}
|
|
@@ -161,21 +152,10 @@ const InputMoney = forwardRef(
|
|
|
161
152
|
};
|
|
162
153
|
|
|
163
154
|
return (
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
params,
|
|
169
|
-
state: disabled ? 'disabled' : 'enabled',
|
|
170
|
-
componentId,
|
|
171
|
-
}}>
|
|
172
|
-
<View
|
|
173
|
-
style={[style, styles.wrapper]}
|
|
174
|
-
accessibilityLabel={accessibilityLabel}>
|
|
175
|
-
{renderInputView()}
|
|
176
|
-
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
177
|
-
</View>
|
|
178
|
-
</ScreenContext.Provider>
|
|
155
|
+
<View style={[style, styles.wrapper]}>
|
|
156
|
+
{renderInputView()}
|
|
157
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
158
|
+
</View>
|
|
179
159
|
);
|
|
180
160
|
},
|
|
181
161
|
);
|
package/Input/InputOTP.tsx
CHANGED
|
@@ -22,10 +22,6 @@ import {ErrorView, getBorderColor} from './common';
|
|
|
22
22
|
import {ApplicationContext} from '../Application';
|
|
23
23
|
import {Spacing} from '../Consts';
|
|
24
24
|
|
|
25
|
-
const {
|
|
26
|
-
ScreenContext,
|
|
27
|
-
} = require('react-native/Libraries/Components/ScreenContext');
|
|
28
|
-
|
|
29
25
|
const OTPCaret: FC<CaretProps> = ({index, length}) => {
|
|
30
26
|
const DURATION = 300;
|
|
31
27
|
const {theme} = useContext(ApplicationContext);
|
|
@@ -82,9 +78,7 @@ const InputOTP = forwardRef(
|
|
|
82
78
|
onFocus,
|
|
83
79
|
onBlur,
|
|
84
80
|
dataType = 'number',
|
|
85
|
-
params,
|
|
86
81
|
style,
|
|
87
|
-
componentId,
|
|
88
82
|
...props
|
|
89
83
|
}: InputOTPProps,
|
|
90
84
|
ref,
|
|
@@ -94,8 +88,6 @@ const InputOTP = forwardRef(
|
|
|
94
88
|
const [focused, setFocused] = useState(false);
|
|
95
89
|
const inputRef = useRef<TextInput>(null);
|
|
96
90
|
const {theme} = useContext(ApplicationContext);
|
|
97
|
-
const accessibilityLabel = `InputOTP/${floatingValue ?? placeholder}`;
|
|
98
|
-
const screenInfo = useContext<any>(ScreenContext);
|
|
99
91
|
|
|
100
92
|
useImperativeHandle(ref, () => ({
|
|
101
93
|
onChangeText: (text: string) => {
|
|
@@ -213,7 +205,6 @@ const InputOTP = forwardRef(
|
|
|
213
205
|
<View style={styles.inputView}>
|
|
214
206
|
<TextInput
|
|
215
207
|
{...props}
|
|
216
|
-
accessibilityLabel={accessibilityLabel}
|
|
217
208
|
ref={inputRef}
|
|
218
209
|
value={value}
|
|
219
210
|
onChangeText={_onChangeText}
|
|
@@ -230,23 +221,13 @@ const InputOTP = forwardRef(
|
|
|
230
221
|
};
|
|
231
222
|
|
|
232
223
|
return (
|
|
233
|
-
<
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}}>
|
|
241
|
-
<TouchableOpacity
|
|
242
|
-
activeOpacity={1}
|
|
243
|
-
onPress={onFocusInput}
|
|
244
|
-
style={[style, styles.otpWrapper]}
|
|
245
|
-
accessibilityLabel={accessibilityLabel}>
|
|
246
|
-
{renderInputView()}
|
|
247
|
-
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
248
|
-
</TouchableOpacity>
|
|
249
|
-
</ScreenContext.Provider>
|
|
224
|
+
<TouchableOpacity
|
|
225
|
+
activeOpacity={1}
|
|
226
|
+
onPress={onFocusInput}
|
|
227
|
+
style={[style, styles.otpWrapper]}>
|
|
228
|
+
{renderInputView()}
|
|
229
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
230
|
+
</TouchableOpacity>
|
|
250
231
|
);
|
|
251
232
|
},
|
|
252
233
|
);
|
package/Input/InputSearch.tsx
CHANGED
|
@@ -13,10 +13,6 @@ import {Icon} from '../Icon';
|
|
|
13
13
|
import {Text} from '../Text';
|
|
14
14
|
import {checkTyping} from './utils';
|
|
15
15
|
|
|
16
|
-
const {
|
|
17
|
-
ScreenContext,
|
|
18
|
-
} = require('react-native/Libraries/Components/ScreenContext');
|
|
19
|
-
|
|
20
16
|
const InputSearch = forwardRef(
|
|
21
17
|
(
|
|
22
18
|
{
|
|
@@ -33,8 +29,6 @@ const InputSearch = forwardRef(
|
|
|
33
29
|
style,
|
|
34
30
|
defaultValue,
|
|
35
31
|
onPressButtonText,
|
|
36
|
-
params,
|
|
37
|
-
componentId,
|
|
38
32
|
...props
|
|
39
33
|
}: InputSearchProps,
|
|
40
34
|
ref,
|
|
@@ -43,8 +37,6 @@ const InputSearch = forwardRef(
|
|
|
43
37
|
const [focused, setFocused] = useState(false);
|
|
44
38
|
const [haveValue, setHaveValue] = useState(!!value || !!defaultValue);
|
|
45
39
|
const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
|
|
46
|
-
const accessibilityLabel = `InputMoney/${placeholder}`;
|
|
47
|
-
const screenInfo = useContext<any>(ScreenContext);
|
|
48
40
|
|
|
49
41
|
const _onFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
|
|
50
42
|
setFocused(true);
|
|
@@ -70,7 +62,6 @@ const InputSearch = forwardRef(
|
|
|
70
62
|
return (
|
|
71
63
|
<TextInput
|
|
72
64
|
{...props}
|
|
73
|
-
accessibilityLabel={accessibilityLabel}
|
|
74
65
|
textAlignVertical="center"
|
|
75
66
|
ref={inputRef}
|
|
76
67
|
style={[
|
|
@@ -126,46 +117,33 @@ const InputSearch = forwardRef(
|
|
|
126
117
|
);
|
|
127
118
|
};
|
|
128
119
|
return (
|
|
129
|
-
<
|
|
130
|
-
value={{
|
|
131
|
-
...screenInfo,
|
|
132
|
-
componentName: 'InputSearch',
|
|
133
|
-
params,
|
|
134
|
-
state: 'enabled',
|
|
135
|
-
componentId,
|
|
136
|
-
}}>
|
|
120
|
+
<View style={[style, styles.searchInputContainer]}>
|
|
137
121
|
<View
|
|
138
|
-
style={[
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/>
|
|
155
|
-
{renderInputView()}
|
|
156
|
-
{renderIconView()}
|
|
157
|
-
</View>
|
|
158
|
-
{showButtonText && (
|
|
159
|
-
<TouchableOpacity onPress={onPressButtonText}>
|
|
160
|
-
<Text
|
|
161
|
-
typography={'action_default_bold'}
|
|
162
|
-
style={styles.textButton}>
|
|
163
|
-
{buttonText}
|
|
164
|
-
</Text>
|
|
165
|
-
</TouchableOpacity>
|
|
166
|
-
)}
|
|
122
|
+
style={[
|
|
123
|
+
styles.searchInputWrapper,
|
|
124
|
+
{
|
|
125
|
+
backgroundColor: theme.colors.background.surface,
|
|
126
|
+
borderColor: theme.colors.background.surface,
|
|
127
|
+
},
|
|
128
|
+
showBorder && {borderColor: theme.colors.border.default},
|
|
129
|
+
focused && {borderColor: theme.colors.primary},
|
|
130
|
+
]}>
|
|
131
|
+
<Icon
|
|
132
|
+
source={'navigation_search'}
|
|
133
|
+
size={24}
|
|
134
|
+
color={theme.colors.text.hint}
|
|
135
|
+
/>
|
|
136
|
+
{renderInputView()}
|
|
137
|
+
{renderIconView()}
|
|
167
138
|
</View>
|
|
168
|
-
|
|
139
|
+
{showButtonText && (
|
|
140
|
+
<TouchableOpacity onPress={onPressButtonText}>
|
|
141
|
+
<Text typography={'action_default_bold'} style={styles.textButton}>
|
|
142
|
+
{buttonText}
|
|
143
|
+
</Text>
|
|
144
|
+
</TouchableOpacity>
|
|
145
|
+
)}
|
|
146
|
+
</View>
|
|
169
147
|
);
|
|
170
148
|
},
|
|
171
149
|
);
|
package/Input/InputTextArea.tsx
CHANGED
|
@@ -46,7 +46,6 @@ const InputTextArea = forwardRef(
|
|
|
46
46
|
const [focused, setFocused] = useState(false);
|
|
47
47
|
const [inputValue, setInputValue] = useState(defaultValue ?? '');
|
|
48
48
|
const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
|
|
49
|
-
const accessibilityLabel = `InputTextArea/${floatingValue ?? placeholder}`;
|
|
50
49
|
|
|
51
50
|
const onClearText = () => {
|
|
52
51
|
inputRef?.current?.clear();
|
|
@@ -110,7 +109,6 @@ const InputTextArea = forwardRef(
|
|
|
110
109
|
<View style={styles.textAreaView}>
|
|
111
110
|
<TextInput
|
|
112
111
|
{...props}
|
|
113
|
-
accessibilityLabel={accessibilityLabel}
|
|
114
112
|
ref={inputRef}
|
|
115
113
|
editable={!disabled}
|
|
116
114
|
textAlignVertical="top"
|
|
@@ -150,9 +148,7 @@ const InputTextArea = forwardRef(
|
|
|
150
148
|
};
|
|
151
149
|
|
|
152
150
|
return (
|
|
153
|
-
<View
|
|
154
|
-
style={[style, styles.wrapper]}
|
|
155
|
-
accessibilityLabel={accessibilityLabel}>
|
|
151
|
+
<View style={[style, styles.wrapper]}>
|
|
156
152
|
{renderInputView()}
|
|
157
153
|
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
158
154
|
</View>
|
package/Input/index.tsx
CHANGED
|
@@ -80,9 +80,6 @@ export interface InputProps extends TextInputProps {
|
|
|
80
80
|
fontWeight?: 'Regular' | 'Bold';
|
|
81
81
|
|
|
82
82
|
onPressIcon?: () => void;
|
|
83
|
-
|
|
84
|
-
params?: any;
|
|
85
|
-
componentId?: string;
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
type InputPropsWithoutSizeAndIcon = Omit<
|
|
@@ -129,10 +126,6 @@ export interface InputSearchProps extends TextInputProps {
|
|
|
129
126
|
* Optional. Represents the name or key of the icon to be displayed in the Input component.
|
|
130
127
|
*/
|
|
131
128
|
icon?: string;
|
|
132
|
-
|
|
133
|
-
params?: any;
|
|
134
|
-
|
|
135
|
-
componentId?: string;
|
|
136
129
|
}
|
|
137
130
|
|
|
138
131
|
export interface InputMoneyProps extends InputPropsWithoutPlaceholder {}
|
package/Input/styles.ts
CHANGED
package/Layout/Card.tsx
CHANGED
package/Layout/Item.tsx
CHANGED
package/Layout/Screen.tsx
CHANGED
|
@@ -301,9 +301,7 @@ const Screen = forwardRef(
|
|
|
301
301
|
};
|
|
302
302
|
|
|
303
303
|
return (
|
|
304
|
-
<View
|
|
305
|
-
style={[Styles.flex, {backgroundColor}]}
|
|
306
|
-
accessibilityLabel={`ScreenContainer`}>
|
|
304
|
+
<View style={[Styles.flex, {backgroundColor}]}>
|
|
307
305
|
{!!headerBackground && (
|
|
308
306
|
<>
|
|
309
307
|
<Image
|
package/Layout/Section.tsx
CHANGED
package/Popup/PopupNotify.tsx
CHANGED
package/Popup/PopupPromotion.tsx
CHANGED
package/Radio/index.tsx
CHANGED
package/Skeleton/index.tsx
CHANGED
|
@@ -41,7 +41,7 @@ const Skeleton: React.FC<SkeletonTypes> = ({style}) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
return (
|
|
44
|
-
<View style={[styles.container, style]}
|
|
44
|
+
<View style={[styles.container, style]}>
|
|
45
45
|
<View
|
|
46
46
|
onLayout={e => onLayout(e.nativeEvent.layout.width)}
|
|
47
47
|
style={[Styles.flex, {backgroundColor: PRIMARY_COLOR}]}>
|
package/Switch/index.tsx
CHANGED
package/Tag/index.tsx
CHANGED
|
@@ -60,9 +60,7 @@ const Tag: FC<TagProps> = ({
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<View
|
|
64
|
-
style={[style, sizeStyle, {backgroundColor: tagColor}]}
|
|
65
|
-
accessibilityLabel={`Tag/${label}`}>
|
|
63
|
+
<View style={[style, sizeStyle, {backgroundColor: tagColor}]}>
|
|
66
64
|
{!!icon && (
|
|
67
65
|
<Icon
|
|
68
66
|
style={styles.icon}
|
package/Text/index.tsx
CHANGED