import React, {Component} from 'react'; import {ScrollView, ActivityIndicator} from 'react-native'; import { Assets, Colors, Spacings, View, Text, Button, Keyboard, TextField, TextFieldRef, FieldContextType, TextFieldProps, SegmentedControl, Icon } from 'react-native-ui-lib'; const {KeyboardAwareInsetsView} = Keyboard; const {loadDemoConfigurations} = require('../../../src/configurations.js'); loadDemoConfigurations(); const priceFormatter = Intl.NumberFormat('en-US'); export default class TextFieldScreen extends Component { input = React.createRef(); input2 = React.createRef(); input3 = React.createRef(); inputWithValidation = React.createRef(); state = { errorPosition: TextField.validationMessagePositions.BOTTOM, isDisabled: false, isReadonly: false, value: 'Initial Value', isSearching: false, preset: undefined, price: '', editable: false }; componentDidMount() { this.input.current?.focus(); } resetFieldValue = () => { this.input2.current?.clear(); }; renderDefaultExample() { return ( <> Default ); } renderPresetExample() { return ( <> Presets ); } renderReadonlyExample() { const {editable, preset} = this.state; return ( <> Disabled vs Readonly ); } renderPlaceholdersExample() { return ( <> Static vs Floating Placeholder ); } renderHintExample() { return ( <> Hint vs HelperText ); } renderTrailingAccessory() { const {isSearching} = this.state; if (isSearching) { return ; } else { return (