The inlineInput is a single-line user-input text field.
It is meant to be the equivalent/replacement of the non-document-model .inputField(), and in the futur, it will probably completely supersede it.
InlineInput features:
- prompt
- placeholder
- history
- auto-completion
- auto-completion hint
- auto-completion menu
-
Constructor:
-
Methods:
-
Inherit methods and properties from EditableTextBox
See Element's key event.
Arguments:
- value
stringthis is the value of the InlineInput, i.e. the user input - undefined
undefinednever used for InlineInput, exists for consistency across all submit events - element
InlineInputthe submitting InlineInput element
This event is triggered when the user submits its input, with said input as the submitted value.
Arguments:
- element
InlineInputthe canceling InlineInput element
This event is triggered when the user cancels the input, if the inlineInput is cancelable.
- submit: submit the input, default: ENTER, KP_ENTER
- cancel: cancel the input (if the input is cancelable), default: ESCAPE
- autoComplete: try to auto-complete the current input, if an auto-complete array or function was provided, default: TAB
- historyAutoComplete: try to auto-complete the current input using the history, if an history array was provided, default: CTRL_R
- historyPrevious: set the current input to the previous history value, default: UP
- historyNext: set the current input to the next history value, default: DOWN
- backDelete: delete one character backward, default: BACKSPACE
- delete: delete one character, default: DELETE
- backward: move the cursor one character backward, default: LEFT
- forward: move the cursor one character forward, default: RIGHT
- startOfWord: move the cursor to the begining of the previous word, default: CTRL_LEFT
- endOfWord: move the cursor to the end of the next word, default: CTRL_RIGHT
- startOfLine: move the cursor at the begining of input, default: HOME
- endOfLine: move the cursor at the end of input, default: END
- copyClipboard: copy to clipboard (rely on xclip), default: CTRL_Y
- pasteClipboard: paste from clipboard (rely on xclip), default: CTRL_P
- options
Object, where:- most of the base class EditableTextBox constructor's options
- value/content
stringthe initial input value (default to an empty string) - prompt
objectornull, if set, display a prompt before the user-input area, properties should be:- content
stringthe prompt string - any properties of the TextBox constructor's options
- content
- placeholder
stringthe placeholder string - placeholderHasMarkup
booleanorstring, true if the placeholder contains markup, can also be the string 'ansi' if the placeholder string contains ANSI code, default: false. - history
arrayornullif set, it is an array containing previous entry, browsable with historyPrevious/historyNext keys (default keys: UP and DOWN), default: null - disabled
booleanif true, the input is disabled (inactive, the user can't change it), default: false - submitted
booleanif true, the input is already submitted, default: false - cancelable
booleanif true, the inlineInput is cancelable, i.e. the user can use the cancel key (default key: ESCAPE), default: false - canceled
booleanif true, the input is already canceled, default: false - autoComplete
ArrayorFunction( inputString , [callback] )ornullif set, this is either an array of possible completion, so the autocomplete key (default key: TAB) will auto-complete the input. If it is a function, it should accept an inputstringand return the completedstring(if no completion can be done, it should return the input string, if multiple candidate are possible, it should return an array of string), the function can be asynchronous en return aPromise. - useAutoCompleteHint
booleanif true and used in conjunction with theautoCompleteoption, write an auto-completion preview at the right of the input (usually using a gray+italic style), default: false - autoCompleteHint
booleanalias ofuseAutoCompleteHint(mimic.inputField()'s option) - useAutoCompleteMenu
booleanif true and used in conjunction with theautoCompleteoption, create an addhoc RowMenu everytime the auto-completion return more than one candidate - autoCompleteMenu
booleanalias ofuseAutoCompleteMenu(mimic.inputField()'s option) - menu
objectornullif set and used in conjunction with theautoCompleteoption, this object is passed to the RowMenu's contructor
This creates an InlineInput element.