@momo-kits/foundation 0.89.4-rc.3 → 0.89.4-rc.4
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/StackScreen.tsx +2 -1
- package/Button/index.tsx +8 -7
- package/CheckBox/index.tsx +3 -7
- package/IconButton/index.tsx +3 -6
- package/Input/Input.tsx +2 -6
- package/Input/InputDropDown.tsx +2 -6
- package/Input/InputMoney.tsx +2 -5
- package/Input/InputOTP.tsx +2 -5
- package/Radio/index.tsx +3 -6
- package/package.json +1 -1
|
@@ -67,7 +67,8 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
67
67
|
return (
|
|
68
68
|
<ScreenContext.Provider
|
|
69
69
|
value={{
|
|
70
|
-
|
|
70
|
+
appId: context.appId,
|
|
71
|
+
code: context.code,
|
|
71
72
|
screenName: Component.name,
|
|
72
73
|
autoTracking: (data: any) => {
|
|
73
74
|
navigator?.maxApi?.dispatchFunction?.('autoTracking', data);
|
package/Button/index.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import {Colors, Spacing} from '../Consts';
|
|
|
14
14
|
import styles from './styles';
|
|
15
15
|
import {Icon} from '../Icon';
|
|
16
16
|
import {Loader} from '../Loader';
|
|
17
|
-
import {formatComponentName} from
|
|
17
|
+
import {formatComponentName} from '../Application/utils';
|
|
18
18
|
|
|
19
19
|
const {
|
|
20
20
|
ScreenContext,
|
|
@@ -301,19 +301,20 @@ const Button: FC<ButtonProps> = ({
|
|
|
301
301
|
};
|
|
302
302
|
|
|
303
303
|
const activeOpacity = type === 'disabled' ? 0.75 : 0.5;
|
|
304
|
-
const button_name = formatComponentName(title)
|
|
305
304
|
|
|
306
305
|
return (
|
|
307
306
|
<ScreenContext.Provider
|
|
308
307
|
value={{
|
|
309
308
|
...screenInfo,
|
|
310
309
|
componentName: 'Button',
|
|
311
|
-
params
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
310
|
+
params,
|
|
311
|
+
state: loading
|
|
312
|
+
? 'loading'
|
|
313
|
+
: type === 'disabled'
|
|
314
|
+
? 'disabled'
|
|
315
|
+
: 'enabled',
|
|
316
316
|
componentId,
|
|
317
|
+
componentValue: formatComponentName(title),
|
|
317
318
|
action: 'click',
|
|
318
319
|
}}>
|
|
319
320
|
<TouchableOpacity
|
package/CheckBox/index.tsx
CHANGED
|
@@ -42,21 +42,17 @@ const CheckBox: FC<CheckBoxProps> = ({
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const component_name = formatNameLength(label || '');
|
|
46
|
-
|
|
47
45
|
return (
|
|
48
46
|
<ScreenContext.Provider
|
|
49
47
|
value={{
|
|
50
48
|
...screenInfo,
|
|
51
49
|
componentName: 'Button',
|
|
52
|
-
params
|
|
53
|
-
...params,
|
|
54
|
-
component_name,
|
|
55
|
-
},
|
|
50
|
+
params,
|
|
56
51
|
state: disabled ? 'disabled' : 'filled',
|
|
57
52
|
componentId,
|
|
58
|
-
componentValue: indeterminate ? 'indetermine' : value,
|
|
59
53
|
action: 'click',
|
|
54
|
+
componentLabel: formatNameLength(label || ''),
|
|
55
|
+
componentValue: indeterminate ? 'indetermine' : value,
|
|
60
56
|
}}>
|
|
61
57
|
<TouchableOpacity
|
|
62
58
|
activeOpacity={0.8}
|
package/IconButton/index.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import {ApplicationContext} from '../Application';
|
|
|
9
9
|
import {Colors} from '../Consts';
|
|
10
10
|
import {Icon} from '../Icon';
|
|
11
11
|
import styles from './styles';
|
|
12
|
-
import {formatComponentName} from
|
|
12
|
+
import {formatComponentName} from '../Application/utils';
|
|
13
13
|
|
|
14
14
|
const {
|
|
15
15
|
ScreenContext,
|
|
@@ -131,19 +131,16 @@ const IconButton: React.FC<IconButtonProps> = ({
|
|
|
131
131
|
const activeOpacity = type === 'disabled' ? 0.75 : 0.5;
|
|
132
132
|
const buttonStyle = StyleSheet.flatten([getTypeStyle(), getSizeStyle()]);
|
|
133
133
|
const iconSize = size === 'small' ? 16 : 24;
|
|
134
|
-
const icon_name = formatComponentName(icon)
|
|
135
134
|
|
|
136
135
|
return (
|
|
137
136
|
<ScreenContext.Provider
|
|
138
137
|
value={{
|
|
139
138
|
...screenInfo,
|
|
140
139
|
componentName: 'IconButton',
|
|
141
|
-
params
|
|
142
|
-
...params,
|
|
143
|
-
icon_name
|
|
144
|
-
},
|
|
140
|
+
params,
|
|
145
141
|
state: type === 'disabled' ? 'disabled' : 'enabled',
|
|
146
142
|
componentId,
|
|
143
|
+
componentValue: formatComponentName(icon),
|
|
147
144
|
action: 'click',
|
|
148
145
|
}}>
|
|
149
146
|
<TouchableOpacity
|
package/Input/Input.tsx
CHANGED
|
@@ -201,17 +201,13 @@ const Input = forwardRef(
|
|
|
201
201
|
inputState = 'disabled';
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
const component_name = formatComponentName(floatingValue || '');
|
|
205
|
-
|
|
206
204
|
return (
|
|
207
205
|
<ScreenContext.Provider
|
|
208
206
|
value={{
|
|
209
207
|
...screenInfo,
|
|
210
208
|
componentName: 'Input',
|
|
211
|
-
params
|
|
212
|
-
|
|
213
|
-
component_name,
|
|
214
|
-
},
|
|
209
|
+
params,
|
|
210
|
+
componentLabel: formatComponentName(floatingValue || ''),
|
|
215
211
|
state: inputState,
|
|
216
212
|
componentId,
|
|
217
213
|
}}>
|
package/Input/InputDropDown.tsx
CHANGED
|
@@ -111,18 +111,14 @@ const InputDropDown = ({
|
|
|
111
111
|
);
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
const button_name = formatComponentName(floatingValue || '');
|
|
115
|
-
|
|
116
114
|
return (
|
|
117
115
|
<ScreenContext.Provider
|
|
118
116
|
value={{
|
|
119
117
|
...screenInfo,
|
|
120
118
|
componentName: 'InputOTP',
|
|
121
|
-
params
|
|
122
|
-
...params,
|
|
123
|
-
button_name,
|
|
124
|
-
},
|
|
119
|
+
params,
|
|
125
120
|
state: 'enabled',
|
|
121
|
+
componentLabel: formatComponentName(floatingValue || ''),
|
|
126
122
|
componentId,
|
|
127
123
|
}}>
|
|
128
124
|
<TouchableOpacity
|
package/Input/InputMoney.tsx
CHANGED
|
@@ -171,17 +171,14 @@ const InputMoney = forwardRef(
|
|
|
171
171
|
if (disabled) {
|
|
172
172
|
inputState = 'disabled';
|
|
173
173
|
}
|
|
174
|
-
const component_name = formatComponentName(floatingValue || '');
|
|
175
174
|
|
|
176
175
|
return (
|
|
177
176
|
<ScreenContext.Provider
|
|
178
177
|
value={{
|
|
179
178
|
...screenInfo,
|
|
180
179
|
componentName: 'InputMoney',
|
|
181
|
-
params
|
|
182
|
-
|
|
183
|
-
component_name,
|
|
184
|
-
},
|
|
180
|
+
params,
|
|
181
|
+
componentLabel: formatComponentName(floatingValue || ''),
|
|
185
182
|
state: inputState,
|
|
186
183
|
componentId,
|
|
187
184
|
}}>
|
package/Input/InputOTP.tsx
CHANGED
|
@@ -227,17 +227,14 @@ const InputOTP = forwardRef(
|
|
|
227
227
|
</View>
|
|
228
228
|
);
|
|
229
229
|
};
|
|
230
|
-
const component_name = formatComponentName(floatingValue || '');
|
|
231
230
|
|
|
232
231
|
return (
|
|
233
232
|
<ScreenContext.Provider
|
|
234
233
|
value={{
|
|
235
234
|
...screenInfo,
|
|
236
235
|
componentName: 'InputOTP',
|
|
237
|
-
params
|
|
238
|
-
|
|
239
|
-
component_name,
|
|
240
|
-
},
|
|
236
|
+
params,
|
|
237
|
+
componentLabel: formatComponentName(floatingValue || ''),
|
|
241
238
|
state: 'enabled',
|
|
242
239
|
componentId,
|
|
243
240
|
}}>
|
package/Radio/index.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import styles from './styles';
|
|
|
7
7
|
import {ApplicationContext} from '../Application';
|
|
8
8
|
import {Spacing} from '../Consts';
|
|
9
9
|
import {formatNameLength} from '../Application/utils';
|
|
10
|
+
|
|
10
11
|
const {
|
|
11
12
|
ScreenContext,
|
|
12
13
|
} = require('react-native/Libraries/Components/ScreenContext');
|
|
@@ -44,19 +45,15 @@ const Radio: FC<RadioProps> = ({
|
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
const component_name = formatNameLength(label || '');
|
|
48
|
-
|
|
49
48
|
return (
|
|
50
49
|
<ScreenContext.Provider
|
|
51
50
|
value={{
|
|
52
51
|
...screenInfo,
|
|
53
52
|
componentName: 'Button',
|
|
54
|
-
params
|
|
55
|
-
...params,
|
|
56
|
-
component_name,
|
|
57
|
-
},
|
|
53
|
+
params,
|
|
58
54
|
state: disabled ? 'disabled' : 'enabled',
|
|
59
55
|
componentId,
|
|
56
|
+
componentLabel: formatNameLength(label || ''),
|
|
60
57
|
componentValue: value,
|
|
61
58
|
action: 'click',
|
|
62
59
|
}}>
|