Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Input field for single line Text
. Allows setting the maximum number of
characters and a replacement character for password.
textField shortTextLens
With configuration options:
textField_ shortTextLens [maxLength 100, selectOnFocus_ False]
Synopsis
- data TextFieldCfg s e
- textFieldDisplayChar :: Char -> TextFieldCfg s e
- textField :: WidgetEvent e => ALens' s Text -> WidgetNode s e
- textField_ :: WidgetEvent e => ALens' s Text -> [TextFieldCfg s e] -> WidgetNode s e
- textFieldV :: WidgetEvent e => Text -> (Text -> e) -> WidgetNode s e
- textFieldV_ :: WidgetEvent e => Text -> (Text -> e) -> [TextFieldCfg s e] -> WidgetNode s e
- textFieldD_ :: WidgetEvent e => WidgetData s Text -> [TextFieldCfg s e] -> WidgetNode s e
Configuration
data TextFieldCfg s e Source #
Configuration options for textField:
validInput
: field indicating if the current input is valid. Useful to show warnings in the UI, or disable buttons if needed.resizeOnChange
: Whether input causes ResizeWidgets requests.selectOnFocus
: Whether all input should be selected when focus is received.readOnly
: Whether to prevent the user changing the input text.maxLength
: the maximum length of input text.textFieldDisplayChar
: the character that will be displayed as replacement of the real text. Useful for password fields.onFocus
: event to raise when focus is received.onFocusReq
:WidgetRequest
to generate when focus is received.onBlur
: event to raise when focus is lost.onBlurReq
:WidgetRequest
to generate when focus is lost.onChange
: event to raise when the value changes.onChangeReq
:WidgetRequest
to generate when the value changes.
Instances
textFieldDisplayChar :: Char -> TextFieldCfg s e Source #
Replacement character to show instead of real text. Useful for passwords.
Constructors
textField :: WidgetEvent e => ALens' s Text -> WidgetNode s e Source #
Creates a text field using the given lens.
textField_ :: WidgetEvent e => ALens' s Text -> [TextFieldCfg s e] -> WidgetNode s e Source #
Creates a text field using the given lens. Accepts config.
textFieldV :: WidgetEvent e => Text -> (Text -> e) -> WidgetNode s e Source #
Creates a text field using the given value and onChange
event handler.
textFieldV_ :: WidgetEvent e => Text -> (Text -> e) -> [TextFieldCfg s e] -> WidgetNode s e Source #
Creates a text field using the given value and onChange
event handler.
Accepts config.
textFieldD_ :: WidgetEvent e => WidgetData s Text -> [TextFieldCfg s e] -> WidgetNode s e Source #
Creates a text field providing a WidgetData
instance and config.