@momo-kits/native-kits 0.156.6-beta.17-debug → 0.156.6-beta.18-debug
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/compose/build.gradle.kts +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +10 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +4 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +2 -1
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
|
@@ -52,6 +52,7 @@ import vn.momo.kits.const.Typography
|
|
|
52
52
|
import vn.momo.kits.const.getFont
|
|
53
53
|
import vn.momo.kits.const.scaleSize
|
|
54
54
|
import vn.momo.kits.modifier.conditional
|
|
55
|
+
import vn.momo.kits.modifier.setAutomationId
|
|
55
56
|
import vn.momo.uikits.resources.Res
|
|
56
57
|
import vn.momo.uikits.resources.sfprotext_regular
|
|
57
58
|
|
|
@@ -140,7 +141,7 @@ fun getBorderColor(isFocused: Boolean, error: String, disabled: Boolean): Color
|
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
@Composable
|
|
143
|
-
fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () -> Unit) {
|
|
144
|
+
internal fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
|
144
145
|
if (loading) {
|
|
145
146
|
Box {
|
|
146
147
|
CircularProgressIndicator(
|
|
@@ -156,7 +157,7 @@ fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () ->
|
|
|
156
157
|
source = icon,
|
|
157
158
|
color = color,
|
|
158
159
|
size = 24.dp,
|
|
159
|
-
modifier =
|
|
160
|
+
modifier = modifier.clickable(
|
|
160
161
|
onClick = onClick,
|
|
161
162
|
interactionSource = remember { MutableInteractionSource() },
|
|
162
163
|
indication = null
|
|
@@ -412,7 +413,7 @@ fun Input(
|
|
|
412
413
|
},
|
|
413
414
|
interactionSource = remember { MutableInteractionSource() },
|
|
414
415
|
indication = null
|
|
415
|
-
)
|
|
416
|
+
).setAutomationId("ic_clear")
|
|
416
417
|
)
|
|
417
418
|
}
|
|
418
419
|
}
|
|
@@ -425,7 +426,12 @@ fun Input(
|
|
|
425
426
|
onRightIconPressed()
|
|
426
427
|
inputState = inputState.copy(passHidden = !inputState.passHidden)
|
|
427
428
|
}
|
|
428
|
-
RenderRightIcon(
|
|
429
|
+
RenderRightIcon(
|
|
430
|
+
loading = loading,
|
|
431
|
+
icon = iconName,
|
|
432
|
+
color = iconTintColor,
|
|
433
|
+
onClick = togglePassword,
|
|
434
|
+
modifier = Modifier.setAutomationId("ic_show_hide"))
|
|
429
435
|
}
|
|
430
436
|
else -> {
|
|
431
437
|
RenderRightIcon(loading, icon, iconTintColor, onRightIconPressed)
|
|
@@ -39,6 +39,7 @@ import vn.momo.kits.const.Spacing
|
|
|
39
39
|
import vn.momo.kits.const.Typography
|
|
40
40
|
import vn.momo.kits.const.scaleSize
|
|
41
41
|
import vn.momo.kits.modifier.conditional
|
|
42
|
+
import vn.momo.kits.modifier.setAutomationId
|
|
42
43
|
|
|
43
44
|
data class InputPhoneNumberSizeDetail(
|
|
44
45
|
val borderWidth: Dp,
|
|
@@ -215,6 +216,7 @@ fun InputPhoneNumber(
|
|
|
215
216
|
indication = null
|
|
216
217
|
)
|
|
217
218
|
.padding(horizontal = Spacing.S)
|
|
219
|
+
.setAutomationId("ic_clear")
|
|
218
220
|
)
|
|
219
221
|
}
|
|
220
222
|
}
|
|
@@ -35,6 +35,7 @@ import vn.momo.kits.application.IsShowBaseLineDebug
|
|
|
35
35
|
import vn.momo.kits.const.Spacing
|
|
36
36
|
import vn.momo.kits.modifier.activeOpacityClickable
|
|
37
37
|
import vn.momo.kits.modifier.conditional
|
|
38
|
+
import vn.momo.kits.modifier.setAutomationId
|
|
38
39
|
import vn.momo.kits.navigation.LocalHeaderRightWidthPx
|
|
39
40
|
import vn.momo.kits.navigation.LocalNavigator
|
|
40
41
|
import vn.momo.kits.navigation.LocalOptions
|
|
@@ -119,14 +120,15 @@ fun Header(onBackHandler: (() -> Unit)? = null) {
|
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
@Composable
|
|
122
|
-
fun BackButton(borderColor: Color, backgroundButton: Color, tintIconColor: Color, onBackHandler: () -> Unit){
|
|
123
|
+
private fun BackButton(borderColor: Color, backgroundButton: Color, tintIconColor: Color, onBackHandler: () -> Unit){
|
|
123
124
|
Box(
|
|
124
125
|
modifier = Modifier
|
|
125
126
|
.size(28.dp)
|
|
126
127
|
.background(backgroundButton, RoundedCornerShape(100))
|
|
127
128
|
.border(width = 0.2.dp, color = borderColor, shape = RoundedCornerShape(100))
|
|
128
129
|
.activeOpacityClickable(onClick = onBackHandler)
|
|
129
|
-
.padding(Spacing.XS)
|
|
130
|
+
.padding(Spacing.XS)
|
|
131
|
+
.setAutomationId("btn_navigation_back"),
|
|
130
132
|
contentAlignment = Alignment.Center
|
|
131
133
|
) {
|
|
132
134
|
Icon(
|
|
@@ -10,6 +10,7 @@ import androidx.compose.ui.unit.sp
|
|
|
10
10
|
import androidx.compose.ui.zIndex
|
|
11
11
|
import vn.momo.kits.components.Text
|
|
12
12
|
import vn.momo.kits.const.Typography
|
|
13
|
+
import vn.momo.kits.modifier.setAutomationId
|
|
13
14
|
|
|
14
15
|
@Composable
|
|
15
16
|
fun HeaderTitle(
|
|
@@ -17,7 +18,7 @@ fun HeaderTitle(
|
|
|
17
18
|
color: Color? = null,
|
|
18
19
|
) {
|
|
19
20
|
Text(
|
|
20
|
-
modifier = Modifier.fillMaxWidth().zIndex(1f),
|
|
21
|
+
modifier = Modifier.fillMaxWidth().zIndex(1f).setAutomationId("title_navigation_header"),
|
|
21
22
|
text = title,
|
|
22
23
|
textAlign = TextAlign.Start,
|
|
23
24
|
style = Typography.actionSBold.copy(
|