@momo-kits/native-kits 0.89.33-beta.23 → 0.89.33-beta.25
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.
|
@@ -30,6 +30,7 @@ import androidx.compose.ui.focus.onFocusChanged
|
|
|
30
30
|
import androidx.compose.ui.graphics.Color
|
|
31
31
|
import androidx.compose.ui.text.TextStyle
|
|
32
32
|
import androidx.compose.ui.text.input.KeyboardType
|
|
33
|
+
import androidx.compose.ui.text.style.TextOverflow
|
|
33
34
|
import androidx.compose.ui.unit.dp
|
|
34
35
|
import androidx.compose.ui.unit.sp
|
|
35
36
|
import vn.momo.kits.const.AppTheme
|
|
@@ -45,6 +46,7 @@ fun RenderRightIconSearch(
|
|
|
45
46
|
icon: String,
|
|
46
47
|
color: Color,
|
|
47
48
|
onClick: () -> Unit,
|
|
49
|
+
iconModifier: Modifier = Modifier
|
|
48
50
|
) {
|
|
49
51
|
if (loading) {
|
|
50
52
|
Box(Modifier.padding(horizontal = Spacing.S)) {
|
|
@@ -65,7 +67,7 @@ fun RenderRightIconSearch(
|
|
|
65
67
|
source = icon,
|
|
66
68
|
color = color,
|
|
67
69
|
size = 24.dp,
|
|
68
|
-
modifier =
|
|
70
|
+
modifier = iconModifier.padding(start = Spacing.S, end = 0.dp).clickable(
|
|
69
71
|
onClick = onClick,
|
|
70
72
|
interactionSource = remember { MutableInteractionSource() },
|
|
71
73
|
indication = null
|
|
@@ -94,7 +96,8 @@ data class InputSearchProps(
|
|
|
94
96
|
val clearCondition: (() -> Boolean)? = null,
|
|
95
97
|
val keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
|
|
96
98
|
val keyboardActions: KeyboardActions = KeyboardActions.Default,
|
|
97
|
-
val modifier: Modifier = Modifier
|
|
99
|
+
val modifier: Modifier = Modifier,
|
|
100
|
+
val iconModifier: Modifier = Modifier,
|
|
98
101
|
)
|
|
99
102
|
|
|
100
103
|
@Composable
|
|
@@ -130,7 +133,7 @@ fun InputSearch(
|
|
|
130
133
|
),
|
|
131
134
|
keyboardOptions = inputSearchProps.keyboardOptions.copy(keyboardType = inputSearchProps.keyboardType),
|
|
132
135
|
keyboardActions = inputSearchProps.keyboardActions,
|
|
133
|
-
modifier =
|
|
136
|
+
modifier = inputSearchProps.modifier.height(36.dp).onFocusChanged {
|
|
134
137
|
isFocused = it.isFocused
|
|
135
138
|
if (it.isFocused) {
|
|
136
139
|
inputSearchProps.onFocus()
|
|
@@ -177,7 +180,8 @@ fun InputSearch(
|
|
|
177
180
|
lineHeight = 24.sp,
|
|
178
181
|
fontWeight = inputSearchProps.fontWeight.value
|
|
179
182
|
),
|
|
180
|
-
color = placeholderColor
|
|
183
|
+
color = placeholderColor,
|
|
184
|
+
overflow = TextOverflow.Ellipsis
|
|
181
185
|
)
|
|
182
186
|
}
|
|
183
187
|
innerTextField()
|
|
@@ -201,7 +205,8 @@ fun InputSearch(
|
|
|
201
205
|
inputSearchProps.loading,
|
|
202
206
|
inputSearchProps.icon,
|
|
203
207
|
iconTintColor,
|
|
204
|
-
inputSearchProps.onRightIconPressed
|
|
208
|
+
inputSearchProps.onRightIconPressed,
|
|
209
|
+
iconModifier = inputSearchProps.iconModifier
|
|
205
210
|
)
|
|
206
211
|
}
|
|
207
212
|
}
|