TP-35050 add on input value change action on text fields renderer (#113)
This commit is contained in:
committed by
GitHub Enterprise
parent
0356a8d7c2
commit
7aeef2b5b0
@@ -3,6 +3,7 @@ package com.navi.uitron.model.data
|
||||
data class CustomTextFieldData(
|
||||
var hint: String? = null,
|
||||
var onValueChangeAction: UiTronActionData? = null,
|
||||
var onInputValueChangeAction: UiTronActionData? = null,
|
||||
var inputText: String? = null,
|
||||
var hasError: Boolean? = null,
|
||||
var errorMessage: String? = null,
|
||||
@@ -13,6 +14,7 @@ data class CustomTextFieldData(
|
||||
fun copyNonNull(data: CustomTextFieldData?): CustomTextFieldData {
|
||||
hint = data?.hint ?: hint
|
||||
onValueChangeAction = data?.onValueChangeAction ?: onValueChangeAction
|
||||
onInputValueChangeAction = data?.onInputValueChangeAction ?: onInputValueChangeAction
|
||||
inputText = data?.inputText ?: inputText
|
||||
hasError = data?.hasError ?: hasError
|
||||
errorMessage = data?.errorMessage ?: errorMessage
|
||||
|
||||
@@ -5,6 +5,7 @@ data class DateTextFieldData(
|
||||
var dateFormat: String? = null,
|
||||
var dateSeparator: String? = null,
|
||||
var onValueChangeAction: UiTronActionData? = null,
|
||||
var onInputValueChangeAction: UiTronActionData? = null,
|
||||
var inputText: String? = null,
|
||||
var hasError: Boolean? = null,
|
||||
var errorMessage: String? = null,
|
||||
@@ -16,6 +17,7 @@ data class DateTextFieldData(
|
||||
dateFormat = data?.dateFormat ?: dateFormat
|
||||
dateSeparator = data?.dateSeparator ?: dateSeparator
|
||||
onValueChangeAction = data?.onValueChangeAction ?: onValueChangeAction
|
||||
onInputValueChangeAction = data?.onInputValueChangeAction ?: onInputValueChangeAction
|
||||
inputText = data?.inputText ?: inputText
|
||||
hasError = data?.hasError ?: hasError
|
||||
errorMessage = data?.errorMessage ?: errorMessage
|
||||
|
||||
@@ -15,6 +15,7 @@ package com.navi.uitron.model.data
|
||||
data class OutlinedTextFieldData(
|
||||
var hint: String? = null,
|
||||
var onValueChangeAction: UiTronActionData? = null,
|
||||
var onInputValueChangeAction: UiTronActionData? = null,
|
||||
var inputText: String? = null,
|
||||
var hasError: Boolean? = null,
|
||||
var errorMessage: String? = null,
|
||||
@@ -24,10 +25,11 @@ data class OutlinedTextFieldData(
|
||||
|
||||
fun copyNonNull(data: OutlinedTextFieldData?): OutlinedTextFieldData {
|
||||
hint = data?.hint ?: hint
|
||||
onValueChangeAction = data?.onValueChangeAction?:onValueChangeAction
|
||||
inputText = data?.inputText?:inputText
|
||||
hasError = data?.hasError?:hasError
|
||||
errorMessage = data?.errorMessage?:errorMessage
|
||||
onValueChangeAction = data?.onValueChangeAction ?: onValueChangeAction
|
||||
onInputValueChangeAction = data?.onInputValueChangeAction ?: onInputValueChangeAction
|
||||
inputText = data?.inputText ?: inputText
|
||||
hasError = data?.hasError ?: hasError
|
||||
errorMessage = data?.errorMessage ?: errorMessage
|
||||
onFocusAction = data?.onFocusAction ?: onFocusAction
|
||||
onDeFocusAction = data?.onDeFocusAction ?: onDeFocusAction
|
||||
return this
|
||||
|
||||
@@ -182,6 +182,7 @@ class CustomTextFieldRenderer(
|
||||
),
|
||||
value = inputValue,
|
||||
onValueChange = {
|
||||
uiTronViewModel.handleActions(customTextFieldData?.onInputValueChangeAction)
|
||||
property.maxChar?.let { maxChar ->
|
||||
if (maxChar >= it.length) {
|
||||
inputValue = it
|
||||
|
||||
@@ -127,6 +127,7 @@ class DateTextFieldRenderer() : Renderer<DateTextFieldProperty> {
|
||||
BasicTextField(
|
||||
value = inputDateValues[index].value,
|
||||
onValueChange = { value ->
|
||||
uiTronViewModel.handleActions(dateTextFieldData?.onInputValueChangeAction)
|
||||
if (value.text.isDigitsOnly()) {
|
||||
if (maxCharList[index] >= value.text.length) {
|
||||
inputDateValues[index].value = value
|
||||
|
||||
@@ -125,6 +125,7 @@ class OutlinedTextFieldRenderer(
|
||||
),
|
||||
value = inputValue,
|
||||
onValueChange = {
|
||||
uiTronViewModel.handleActions(outlinedTextFieldData?.onInputValueChangeAction)
|
||||
property.maxChar?.let { maxChar ->
|
||||
if (maxChar >= it.length) {
|
||||
inputValue = it
|
||||
|
||||
Reference in New Issue
Block a user