FioriSimpleTextField

fun FioriSimpleTextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, readOnly: Boolean = false, readOnlyMaxLines: Int = Int.MAX_VALUE, textSelectable: Boolean = true, isError: Boolean = false, interactionState: FioriTextFieldInteractionState = FioriTextFieldInteractionState.NORMAL, content: FioriTextFieldContent = FioriTextFieldContent(), leadingIcon: FioriTextFieldIcon? = null, trailingIcon: FioriTextFieldIcon? = null, colors: FioriTextFieldColors = FioriTextFieldDefaults.colors(), textStyles: FioriTextFieldTextStyles = FioriTextFieldDefaults.textStyles(), styles: FioriTextFieldStyles = FioriTextFieldDefaults.styles(), keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, visualTransformation: VisualTransformation = VisualTransformation.None, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onHyperlinkClick: () -> Unit? = null)

The composable FioriSimpleTextField component.

The FioriTextFieldTestTags class serves as a comprehensive collection of test tags for the various components used in the FioriSimpleTextField. This class is particularly beneficial for automated testing, ensuring that each UI component is properly identified and tested in accordance with best practices.

Parameters

value

the input String text to be shown in the FioriSimpleTextField

onValueChange

the callback that is triggered when the input service updates the text. An updated text comes as a parameter of the callback.

modifier

a Modifier object that defines the height/width of the text field.

enabled

controls the enabled state of the FioriSimpleTextField. When false, the text field will be neither editable nor focusable, the input of the text field will not be selectable

readOnly

controls the editable state of the FioriSimpleTextField. When true, the text field can not be modified, however, a user can focus it and copy text from it. Read-only text fields are usually used to display pre-filled forms that user can not edit

readOnlyMaxLines

the maximum height in terms of maximum number of visible lines. Should be equal or greater than 1. Note that this parameter will be ignored and instead maxLines will be set to 1 if readonly is set to false.

textSelectable

to enable or disable the ability to select the value text in readOnly states. By default, it was true.

isError

controls the error state of the FioriSimpleTextField, When true, the error icon was shown in the text field and error message was showing in helper text area

interactionState

an Enum object TextInputInteractionState to present the interaction state with trailing icon for this FioriSimpleTextField. With the default NORMAL state, the specified trailing icon through TrailingIcon object will not be presented when the text field was on focused base on some conditions. At the same time, a cancel icon was presented to clear all inputs when the text field which has input was focused and an error icon was presented when the text field input was invalid. With the INTERACTIVE state which was the opposite of NORMAL state, the cancel icon and the error icon will not be presented and it only take effect when the text field has declared trailing icon. E,g the Password text field

content

an FioriTextFieldContent object to declare all necessary information of FioriSimpleTextField

leadingIcon

the optional leading icon to be displayed at the beginning of the text field container. The prefixText in FioriTextFieldContent will be ignored when the leading icon was presented.

trailingIcon

the optional trailing icon to be displayed at the end of the text field container

textStyles

FioriTextFieldTextStyles that will be used to determine the text style of the text field parts in different state. See FioriTextFieldDefaults.textStyles to customize

colors

FioriTextFieldColors that will be used to determine the color of the text field parts in different state. See FioriTextFieldDefaults.colors to customize

styles

FioriTextFieldStyles that will be used to determine the style of the text field parts in different state. E,g, the padding, height. See FioriTextFieldDefaults.styles to customize

keyboardOptions

software keyboard options that contains configuration such as KeyboardType and ImeAction.

keyboardActions

when the input service emits an IME action, the corresponding callback is called. Note that this IME action may be different from what you specified in KeyboardOptions.imeAction.

visualTransformation

The visual transformation filter for changing the visual representation of the input. By default no visual transformation is applied.

interactionSource

the MutableInteractionSource representing the stream of Interactions for this text field.

onHyperlinkClick

This optional callback function is called when the hyperlink in the inline notice is clicked.


fun FioriSimpleTextField(value: TextFieldValue, onValueChange: (TextFieldValue) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, readOnly: Boolean = false, readOnlyMaxLines: Int = Int.MAX_VALUE, textSelectable: Boolean = true, isError: Boolean = false, interactionState: FioriTextFieldInteractionState = FioriTextFieldInteractionState.NORMAL, content: FioriTextFieldContent = FioriTextFieldContent(), leadingIcon: FioriTextFieldIcon? = null, trailingIcon: FioriTextFieldIcon? = null, colors: FioriTextFieldColors = FioriTextFieldDefaults.colors(), textStyles: FioriTextFieldTextStyles = FioriTextFieldDefaults.textStyles(), styles: FioriTextFieldStyles = FioriTextFieldDefaults.styles(), keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, visualTransformation: VisualTransformation = VisualTransformation.None, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, onHyperlinkClick: () -> Unit? = null)

The composable FioriSimpleTextField component.

The FioriTextFieldTestTags class serves as a comprehensive collection of test tags for the various components used in the FioriSimpleTextField. This class is particularly beneficial for automated testing, ensuring that each UI component is properly identified and tested in accordance with best practices.

Parameters

value

The TextFieldValue to be shown in the FioriSimpleTextField.

onValueChange

Called when the input service updates the values in FioriSimpleTextField.

modifier

a Modifier object that defines the height/width of the text field.

enabled

controls the enabled state of the FioriSimpleTextField. When false, the text field will be neither editable nor focusable, the input of the text field will not be selectable

readOnly

controls the editable state of the FioriSimpleTextField. When true, the text field can not be modified, however, a user can focus it and copy text from it. Read-only text fields are usually used to display pre-filled forms that user can not edit

readOnlyMaxLines

the maximum height in terms of maximum number of visible lines. Should be equal or greater than 1. Note that this parameter will be ignored and instead maxLines will be set to 1 if readonly is set to false.

textSelectable

to enable or disable the ability to select the value text in readOnly states. By default, it was true.

isError

controls the error state of the FioriSimpleTextField, When true, the error icon was shown in the text field and error message was showing in helper text area

interactionState

an Enum object TextInputInteractionState to present the interaction state with trailing icon for this FioriSimpleTextField. With the default NORMAL state, the specified trailing icon through TrailingIcon object will not be presented when the text field was on focused base on some conditions. At the same time, a cancel icon was presented to clear all inputs when the text field which has input was focused and an error icon was presented when the text field input was invalid. With the INTERACTIVE state which was the opposite of NORMAL state, the cancel icon and the error icon will not be presented and it only take effect when the text field has declared trailing icon. E,g the Password text field

content

an FioriTextFieldContent object to declare all necessary information of FioriSimpleTextField

leadingIcon

the optional leading icon to be displayed at the beginning of the text field container. The prefixText in FioriTextFieldContent will be ignored when the leading icon was presented.

trailingIcon

the optional trailing icon to be displayed at the end of the text field container

textStyles

FioriTextFieldTextStyles that will be used to determine the text style of the text field parts in different state. See FioriTextFieldDefaults.textStyles to customize

colors

FioriTextFieldColors that will be used to determine the color of the text field parts in different state. See FioriTextFieldDefaults.colors to customize

styles

FioriTextFieldStyles that will be used to determine the style of the text field parts in different state. E,g, the padding, height. See FioriTextFieldDefaults.styles to customize

keyboardOptions

software keyboard options that contains configuration such as KeyboardType and ImeAction.

keyboardActions

when the input service emits an IME action, the corresponding callback is called. Note that this IME action may be different from what you specified in KeyboardOptions.imeAction.

visualTransformation

The visual transformation filter for changing the visual representation of the input. By default no visual transformation is applied.

interactionSource

the MutableInteractionSource representing the stream of Interactions for this text field.

onHyperlinkClick

This optional callback function is called when the hyperlink in the inline notice is clicked.