Bugfix multi section renderer (#136)
* TP-00000 || Added enable property in MultiSectionTextFieldRenderer * TP-00000 || Bugfixes * TP-00000 || Bugfixes * TP-00000 || Bugfixes
This commit is contained in:
committed by
GitHub
parent
de5df1cb42
commit
4099d89569
@@ -11,7 +11,8 @@ data class MultiSectionTextFieldProperty(
|
||||
var errorMessageLayoutId: String? = null,
|
||||
var successMessageLayoutId: String? = null,
|
||||
var successTextTransformation: OutlinedTextFieldValueTransformation? = null,
|
||||
var valueTransformation: OutlinedTextFieldVisualTransformation? = null
|
||||
var valueTransformation: OutlinedTextFieldVisualTransformation? = null,
|
||||
var isEnabled: Boolean? = null
|
||||
) : BaseProperty() {
|
||||
override fun copyNonNullFrom(property: BaseProperty?) {
|
||||
super.copyNonNullFrom(property)
|
||||
@@ -24,5 +25,6 @@ data class MultiSectionTextFieldProperty(
|
||||
multiSectionTextFieldProperty?.errorMessageLayoutId?.let { errorMessageLayoutId = it }
|
||||
multiSectionTextFieldProperty?.successMessageLayoutId?.let { successMessageLayoutId = it }
|
||||
multiSectionTextFieldProperty?.successTextTransformation?.let { successTextTransformation = it }
|
||||
multiSectionTextFieldProperty?.isEnabled?.let { isEnabled = it }
|
||||
}
|
||||
}
|
||||
@@ -73,10 +73,9 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
multiSectionTextFieldData?.copyNonNull(dataState.value) ?: dataState.value
|
||||
}
|
||||
|
||||
var inputText by remember {
|
||||
var inputText by remember(multiSectionTextFieldData?.inputText) {
|
||||
mutableStateOf(multiSectionTextFieldData?.inputText.orEmpty())
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
uiTronViewModel.handle[property.layoutId.getInputId()] = inputText
|
||||
}
|
||||
@@ -89,7 +88,6 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
val totalChar = remember {
|
||||
mutableStateOf(property.textFieldPropertyList.sumOf { it.maxChar ?: 0 })
|
||||
}
|
||||
|
||||
val inputList: List<String> =
|
||||
if (multiSectionTextFieldData?.dateFormat.isNotNullAndNotEmpty()) {
|
||||
listOf(
|
||||
@@ -103,7 +101,7 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
defaultMaxCharList.map { "" }
|
||||
}
|
||||
|
||||
val inputValues = remember {
|
||||
val inputValues = remember(inputList) {
|
||||
(0 until property.textFieldPropertyList.size).map {
|
||||
mutableStateOf(TextFieldValue(inputList[it], TextRange(inputList[it].length)))
|
||||
}
|
||||
@@ -151,6 +149,7 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
focusRequesters
|
||||
.getOrNull(0)
|
||||
?.requestFocus()
|
||||
uiTronViewModel.handleActions(multiSectionTextFieldData?.onClick)
|
||||
}
|
||||
)
|
||||
) {
|
||||
@@ -237,7 +236,8 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
},
|
||||
textStyle = getTextStyle(property.textFieldPropertyList[index].textStyle),
|
||||
singleLine = property.textFieldPropertyList[index].singleLine ?: false,
|
||||
visualTransformation = getVisualTransformation(visualTransformation = property.textFieldPropertyList[index].visualTransformation)
|
||||
visualTransformation = getVisualTransformation(visualTransformation = property.textFieldPropertyList[index].visualTransformation),
|
||||
enabled = property.isEnabled.orTrue()
|
||||
)
|
||||
if (index != property.textFieldPropertyList.size - 1) {
|
||||
TextRenderer().Render(
|
||||
|
||||
Reference in New Issue
Block a user