Auto get input mode

## Features
- auto get input mode based on input text
- only text attribute is required
- add unit test spec