TypedValue
trait TypedValue
Properties
| protected string | $typedValue | The value that has been typed. |
|
| protected int | $cursorPosition | The position of the virtual cursor. |
Methods
Track the value as the user types.
Get the value of the prompt.
Add a virtual cursor to the value and truncate if necessary.
Delete from the start of the current word (before cursor) through the cursor.
Get the character offset of the word boundary immediately before the cursor.
Start (character offset) of the last run of letters/numbers in string (punctuation breaks words).
Details
at line 25
protected void
trackTypedValue(string $default = '', bool $submit = true, callable|null $ignore = null, bool $allowNewLine = false)
Track the value as the user types.
at line 89
string
value()
Get the value of the prompt.
at line 97
protected string
addCursor(string $value, int $cursorPosition, int|null $maxWidth = null)
Add a virtual cursor to the value and truncate if necessary.
at line 138
protected void
deleteWordBackward()
Delete from the start of the current word (before cursor) through the cursor.
at line 155
protected int
findWordStartBeforeCursor()
Get the character offset of the word boundary immediately before the cursor.
Uses the later of the intl word boundary, when the extension is loaded, and the start of the last run of letters and numbers, so punctuation such as . - _ ends a word.
at line 186
protected int
findLastWordStartByLettersAndNumbers(string $before)
Start (character offset) of the last run of letters/numbers in string (punctuation breaks words).