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.
Character offset of the word boundary immediately before the cursor (Intl + punctuation).
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 153
protected int
findWordStartBeforeCursor()
Character offset of the word boundary immediately before the cursor (Intl + punctuation).
Punctuation (e.g. . - _) is treated as a word boundary so "word.word" deletes in two steps.
at line 184
protected int
findLastWordStartByLettersAndNumbers(string $before)
Start (character offset) of the last run of letters/numbers in string (punctuation breaks words).