-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Component: Multiline Text Input (#88)
* committing this insanity before i probably destroy it * ok we're getting closer * width is more stable * Fix code styling * remove old bad stuff * remove unused method * Fix code styling * i think we've reached some level of stability he said cautiously * fixed value with cursor method * submit state * cancel and error states * fix cursor position if current is a new line * do a final check to make sure we still have the minimum number of rows * fixed error state * actually fixed error display * allow new lines as text input * fixing formatting again * handle scroll bottom buffer in renderer * Update textarea.php * Fix code styling * Update TextareaPrompt.php * rows param + docs * Create TextareaPromptTest.php * Fix code styling * fix static analysis * Update scrolling initialization * Fix test * Formatting * Fix issue with empty last line * fixed cancelled state so that the strikethrough doesn't affect the box * calculate proper width with each render * pass max width as a negative number to avoid truncation * Fix code styling * fix long word wrapping + cursor position * Fix code styling * mb_wordwrap * getting closer to consistent * fix scroll width * Fix code styling * appease phpstan * Fix code styling * Create MultiByteWordWrapTest.php * remove maxLineWIdth property * actually remove maxLineWidth property * fixed the off by one errors when using the up/down keys * fixed bug where pasting a bunch of content didn't put the cursor in the viewport * Fix code styling * changed visiblity of validate property * Fix code styling * validate property should be public * validate property should be mixed * Fix code styling * add ability to reset cancel using + reset when using it in tests * fix for strange down arrow behavior * move mb_wordwrap to truncation trait * move rows param to last position * Fix code styling * Formatting * Allow placeholder to wrap and contain newlines --------- Co-authored-by: joetannenbaum <joetannenbaum@users.noreply.github.com> Co-authored-by: Jess Archer <jess@jessarcher.com> Co-authored-by: jessarcher <jessarcher@users.noreply.github.com>
- Loading branch information
1 parent
0ee548f
commit 3318556
Showing
12 changed files
with
870 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
use function Laravel\Prompts\textarea; | ||
|
||
require __DIR__.'/../vendor/autoload.php'; | ||
|
||
$email = textarea( | ||
label: 'Tell me a story', | ||
placeholder: 'Weave me a tale', | ||
); | ||
|
||
var_dump($email); | ||
|
||
echo str_repeat(PHP_EOL, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,11 @@ class Key | |
*/ | ||
const CTRL_A = "\x01"; | ||
|
||
/** | ||
* EOF | ||
*/ | ||
const CTRL_D = "\x04"; | ||
|
||
/** | ||
* End | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.