@momo-kits/native-kits 0.110.1-beta.10 → 0.110.1-beta.30
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.
|
@@ -121,112 +121,114 @@ fun InputSearch(
|
|
|
121
121
|
iconTintColor = disabledColor
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
Row(
|
|
148
|
-
modifier = Modifier.weight(
|
|
149
|
-
inputSearchProps.showButtonText.ifTrue(
|
|
150
|
-
8f,
|
|
151
|
-
1f
|
|
152
|
-
)
|
|
153
|
-
)
|
|
154
|
-
.background(
|
|
155
|
-
inputSearchProps.backgroundColor,
|
|
156
|
-
RoundedCornerShape(Radius.XL)
|
|
157
|
-
),
|
|
158
|
-
horizontalArrangement = Arrangement.Start,
|
|
159
|
-
verticalAlignment = Alignment.CenterVertically
|
|
160
|
-
) {
|
|
124
|
+
Column {
|
|
125
|
+
BasicTextField(
|
|
126
|
+
enabled = !inputSearchProps.disabled,
|
|
127
|
+
singleLine = true,
|
|
128
|
+
value = inputSearchProps.text.value,
|
|
129
|
+
textStyle = TextStyle(
|
|
130
|
+
color = textColor,
|
|
131
|
+
fontSize = 14.sp,
|
|
132
|
+
lineHeight = 20.sp,
|
|
133
|
+
fontWeight = inputSearchProps.fontWeight.value
|
|
134
|
+
),
|
|
135
|
+
keyboardOptions = inputSearchProps.keyboardOptions.copy(keyboardType = inputSearchProps.keyboardType),
|
|
136
|
+
keyboardActions = inputSearchProps.keyboardActions,
|
|
137
|
+
modifier = inputSearchProps.modifier.height(36.dp).onFocusChanged {
|
|
138
|
+
isFocused = it.isFocused
|
|
139
|
+
if (it.isFocused) {
|
|
140
|
+
inputSearchProps.onFocus()
|
|
141
|
+
}
|
|
142
|
+
if (!it.isFocused && isBlurred) inputSearchProps.onBlur()
|
|
143
|
+
if (it.isFocused && !isBlurred) isBlurred = true
|
|
144
|
+
},
|
|
145
|
+
onValueChange = inputSearchProps.onChangeText,
|
|
146
|
+
decorationBox = { innerTextField ->
|
|
147
|
+
Row(verticalAlignment = Alignment.CenterVertically) {
|
|
161
148
|
Row(
|
|
162
|
-
modifier = Modifier.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
149
|
+
modifier = Modifier.weight(
|
|
150
|
+
inputSearchProps.showButtonText.ifTrue(
|
|
151
|
+
8f,
|
|
152
|
+
1f
|
|
153
|
+
)
|
|
154
|
+
)
|
|
155
|
+
.background(
|
|
156
|
+
inputSearchProps.backgroundColor,
|
|
157
|
+
RoundedCornerShape(Radius.XL)
|
|
158
|
+
),
|
|
159
|
+
horizontalArrangement = Arrangement.Start,
|
|
166
160
|
verticalAlignment = Alignment.CenterVertically
|
|
167
161
|
) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
162
|
+
Row(
|
|
163
|
+
modifier = Modifier.padding(
|
|
164
|
+
horizontal = Spacing.M,
|
|
165
|
+
vertical = Spacing.S
|
|
166
|
+
),
|
|
167
|
+
verticalAlignment = Alignment.CenterVertically
|
|
168
|
+
) {
|
|
169
|
+
Icon(
|
|
170
|
+
source = "navigation_search",
|
|
171
|
+
modifier = Modifier.padding(end = Spacing.XS),
|
|
172
|
+
size = 24.dp,
|
|
173
|
+
color = AppTheme.current.colors.text.hint
|
|
174
|
+
)
|
|
175
|
+
Box(Modifier.weight(1f)) {
|
|
176
|
+
if (inputSearchProps.text.value.isEmpty()) {
|
|
177
|
+
Text(
|
|
178
|
+
text = inputSearchProps.placeholder,
|
|
179
|
+
style = TextStyle(
|
|
180
|
+
fontSize = 14.sp,
|
|
181
|
+
lineHeight = 20.sp,
|
|
182
|
+
fontWeight = inputSearchProps.fontWeight.value
|
|
183
|
+
),
|
|
184
|
+
maxLines = 1,
|
|
185
|
+
color = placeholderColor,
|
|
186
|
+
overflow = TextOverflow.Ellipsis
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
innerTextField()
|
|
187
190
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
indication = null
|
|
191
|
+
if (inputSearchProps.clearCondition?.invoke() == true || (isFocused && inputSearchProps.text.value.isNotEmpty())) {
|
|
192
|
+
Row {
|
|
193
|
+
Spacer(Modifier.width(Spacing.XS))
|
|
194
|
+
Icon(
|
|
195
|
+
source = "24_navigation_close_circle_full",
|
|
196
|
+
size = 16.dp,
|
|
197
|
+
color = AppTheme.current.colors.text.hint,
|
|
198
|
+
modifier = Modifier.clickable(
|
|
199
|
+
onClick = {
|
|
200
|
+
inputSearchProps.text.value = ""
|
|
201
|
+
inputSearchProps.onClearPress.invoke()
|
|
202
|
+
},
|
|
203
|
+
interactionSource = remember { MutableInteractionSource() },
|
|
204
|
+
indication = null
|
|
205
|
+
)
|
|
204
206
|
)
|
|
205
|
-
|
|
207
|
+
}
|
|
206
208
|
}
|
|
209
|
+
RenderRightIconSearch(
|
|
210
|
+
inputSearchProps.loading,
|
|
211
|
+
inputSearchProps.icon,
|
|
212
|
+
iconTintColor,
|
|
213
|
+
inputSearchProps.onRightIconPressed,
|
|
214
|
+
iconModifier = inputSearchProps.iconModifier
|
|
215
|
+
)
|
|
207
216
|
}
|
|
208
|
-
RenderRightIconSearch(
|
|
209
|
-
inputSearchProps.loading,
|
|
210
|
-
inputSearchProps.icon,
|
|
211
|
-
iconTintColor,
|
|
212
|
-
inputSearchProps.onRightIconPressed,
|
|
213
|
-
iconModifier = inputSearchProps.iconModifier
|
|
214
|
-
)
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
219
|
+
},
|
|
220
|
+
)
|
|
221
|
+
if (inputSearchProps.showButtonText) {
|
|
222
|
+
Text(
|
|
223
|
+
text = inputSearchProps.buttonText,
|
|
224
|
+
style = Typography.actionDefault,
|
|
225
|
+
color = AppTheme.current.colors.text.default,
|
|
226
|
+
modifier = Modifier.padding(start = Spacing.L).clickable(
|
|
227
|
+
interactionSource = remember { MutableInteractionSource() },
|
|
228
|
+
indication = null,
|
|
229
|
+
onClick = inputSearchProps.onPressButtonText
|
|
230
|
+
)
|
|
231
|
+
)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
232
234
|
}
|