@momo-kits/native-kits 0.110.1-beta.10 → 0.110.1-beta.31

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