Masked Text input
Initial state
Text input element
Example:
type Msg = InputUpdated String | StateUpdated MaskedInput.State | FocusUpdated Bool
MaskedInput.Text.input
{ pattern = "(###) ###-####"
, inputCharacter = '#'
, onInput = InputUpdated
, toMsg = StateUpdated
, hasFocus = Just FocusUpdated
}
[ class "masked-input"
...
]
model.currentState
model.currentValueOptions of the input component.
* pattern is the pattern used to format the input value. e.g.: (###) ###-####
* inputCharacter: is the special character used to represent user input. Default value: #
* toMsg: is the Msg for updating internal State of the element.
* onInput is the Msg tagger for the onInput event.
* hasFocus is an optional Msg tagger for onFocus/onBlur event.
Default value for Options.
* onInput (type: String -> msg) : The onInput Msg tagger
* toMsg (type: String -> msg) : The Msg for updating internal State of the element.
Value:
{ pattern = ""
, inputCharacter = '#'
, onInput = onInput
, toMsg = toMsg
, hasFocus = Nothing
}
Opaque type for storing local State