sandstone/ Input
Popup style inputs for text and numbers.
import Input from '@enact/sandstone/Input';Members
InputComponent
Provides an input in the form of a popup.
Usage:
<Input
onComplete={this.handleInputComplete}
placeholder="Placeholder"
subtitle="TitleBelow"
title="Title"
/>import Input from '@enact/sandstone/Input';InputBaseComponent
Base component for providing text input in the form of a popup.
import {InputBase} from '@enact/sandstone/Input';Properties
Disables the button that activates the input popup.
Text displayed when value is not set.
Default: '-'The size of the input field.
Default: 'small'Type of the input.
Default: 'text'Initial value of the input.
This value is used for setting the
defaultValueof theInputField.
InputDecoratorHigher-Order Component
Sandstone specific item behaviors to apply to Input.
import {InputDecorator} from '@enact/sandstone/Input';InputFieldComponent
A Spottable, Sandstone styled input component with embedded icon support.
By default, InputField maintains the state of its value property. Supply the defaultValue
property to control its initial value. If you wish to directly control updates to the component,
supply a value to value at creation time and update it in response to onChange events.
import {InputField} from '@enact/sandstone/Input';Properties
Focuses the internal input when the component gains 5-way focus.
By default, the internal input is not editable when the component is focused via 5-way and must be selected to become interactive. In pointer mode, the input will be editable when clicked.
Default: falseSets the initial value.
Applies a disabled style and prevents interacting with the component.
Default: falseBlurs the input when the "enter" key is pressed.
Default: falseCalled when the internal input is focused.
Called when the internal input loses focus.
Called when the component is removed when it had focus.
Disables spotlight navigation into the component.
Default: false
InputFieldBaseComponent
A Sandstone styled input component.
It supports start and end icons but it does not support Spotlight. Apps should use sandstone/Input.InputField.
import {InputFieldBase} from '@enact/sandstone/Input';Properties
Passed by AnnounceDecorator for accessibility.
Disables InputField and becomes non-interactive.
Default: falseBlurs the input when the "enter" key is pressed.
Default: falseThe icon to be placed at the end of the input.
See: sandstone/Icon.IconThe icon to be placed at the beginning of the input.
See: sandstone/Icon.IconIndicates value is invalid and shows invalidMessage, if set.
Default: falseThe tooltip text to be displayed when the input is invalid.
If this value is falsy, the tooltip will be shown with the default message.
Default: 'Please enter a valid value.'Called before the input value is changed.
The change can be prevented by calling
preventDefaulton the event.Called when blurred.
Called when the input value is changed.
The event payload includes the current
valueas well as astopPropagation()method which may be called to stop the originalonChangeevent from the<input>from bubbling.Called when clicked.
Called when focused.
Called when a key is pressed down.
Text to display when value is not set.
Default: ''The size of the input field.
Default: 'small'The type of input.
Accepted values correspond to the standard HTML5 input types.
See: MDN input types docDefault: 'text'The value of the input.
InputFieldDecoratorHigher-Order Component
Sandstone specific item behaviors to apply to InputField.
import {InputFieldDecorator} from '@enact/sandstone/Input';InputPopupComponent
Provides an input popup without button.
Usage:
<InputPopup
open={this.state.open}
onComplete={this.handleInputPopupComplete}
placeholder="Placeholder"
subtitle="Subtitle"
title="Title"
/>import {InputPopup} from '@enact/sandstone/Input';InputPopupBaseComponent
Base component for providing text input in the form of a popup without button.
import {InputPopupBase} from '@enact/sandstone/Input';Properties
Passed by AnnounceDecorator for accessibility.
Sets the hint string read when focusing the back button.
Default: 'go to previous'Customize component style
Disables the input popup.
Sets spotlightId to InputField.
Indicates value is invalid and shows invalidMessage, if set.
The tooltip text to be displayed when the input is invalid.
If this value is falsy, the tooltip will be shown with the default message.
Default: 'Please enter a valid value.'Set the length of number input field.
Sets the amount of numbers this field will collect. Any number between 1 and 6 (inclusive) will render individual number cells, greater than 6 will render a single box with numbers in it. This only has an effect on
'number'and'passwordnumber'typeand whennumberInputFieldis'auto'.This value will override
minLengthandmaxLength.The maximum length of number input fields.
Overridden by
lengthvalue.Default: 4The minimum length of number input fields.
Overridden by
lengthvalue.When smaller than
maxLength, number type inputs will show a submit button and will not auto-submit when the length reachesmaxLength. Defaults to themaxLengthvalue.Omits the back button.
Omits the submit button.
The type of numeric input to use.
The default is to display separated digits when
lengthis less than7. Iffieldis set, a standardInputFieldwill be used instead of the normal number input.This has no effect on other types.
Default: 'auto'Called before the input value is changed.
The change can be prevented by calling
preventDefaulton the event.Called when the input value is changed.
Called when the popup is closed.
Called when input is complete.
Called when the popup is opened.
Opens the popup.
Text displayed when value is not set.
The "aria-label" for the popup when opened.
Type of popup.
Default: 'fullscreen'Size of the input field.
Default: 'small'Subtitle below the title of popup.
Default: ''Title text of popup.
Default: ''Type of the input.
Default: 'text'Initial value of the input.
This value is used for setting the
defaultValueof theInputField.