@momo-kits/native-kits 0.112.1-rc.1 → 0.113.1-beta.0

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.
@@ -75,6 +75,7 @@ fun OTPCaret() {
75
75
 
76
76
  @Composable
77
77
  fun InputOTP(
78
+ value: String = "",
78
79
  length: Int? = null,
79
80
  errorMessage: String = "",
80
81
  errorSpacing: Boolean = false,
@@ -85,9 +86,9 @@ fun InputOTP(
85
86
  onBlur: () -> Unit = {},
86
87
  dataType: String = "number",
87
88
  accessibilityLabel: String? = null,
89
+ modifier: Modifier = Modifier
88
90
  ) {
89
91
  val MAX_LENGTH = 10
90
- var value by remember { mutableStateOf("") }
91
92
  var isFocused by remember { mutableStateOf(false) }
92
93
  var isBlurred = false
93
94
 
@@ -96,7 +97,6 @@ fun InputOTP(
96
97
  (dataType != "number" || !text.any { !it.isDigit() }) &&
97
98
  (text.length < value.length || value.length < text.length)
98
99
  ) {
99
- value = text
100
100
  onChangeText(text)
101
101
  }
102
102
  }
@@ -108,7 +108,7 @@ fun InputOTP(
108
108
  onValueChange = handleChangeText,
109
109
  singleLine = true,
110
110
  keyboardOptions = KeyboardOptions.Default.copy(keyboardType = if (dataType == "number") KeyboardType.Number else KeyboardType.Ascii),
111
- modifier = Modifier.height(56.dp).onFocusChanged {
111
+ modifier = modifier.height(56.dp).onFocusChanged {
112
112
  isFocused = it.isFocused
113
113
  if (it.isFocused) {
114
114
  onFocus()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.112.1-rc.1",
3
+ "version": "0.113.1-beta.0",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},