From 92049cba92ac2b796e43dfce6fd60929d9c0feac Mon Sep 17 00:00:00 2001 From: MMTE Date: Sun, 23 Jun 2024 22:13:50 +0330 Subject: [PATCH] add monaco-editor as option to textarea component --- app/View/Components/Forms/Textarea.php | 2 ++ resources/views/components/forms/textarea.blade.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/View/Components/Forms/Textarea.php b/app/View/Components/Forms/Textarea.php index bfdf03a31..7d1860500 100644 --- a/app/View/Components/Forms/Textarea.php +++ b/app/View/Components/Forms/Textarea.php @@ -19,6 +19,8 @@ public function __construct( public ?string $value = null, public ?string $label = null, public ?string $placeholder = null, + public ?string $monacoEditorLanguage = '', + public bool $useMonacoEditor = false, public bool $required = false, public bool $disabled = false, public bool $readonly = false, diff --git a/resources/views/components/forms/textarea.blade.php b/resources/views/components/forms/textarea.blade.php index 2c32c585e..7f7457c4f 100644 --- a/resources/views/components/forms/textarea.blade.php +++ b/resources/views/components/forms/textarea.blade.php @@ -24,6 +24,17 @@ function handleKeydown(e) { @endif @endif + @if($useMonacoEditor) + + @else @if ($type === 'password')
@if ($allowToPeak) @@ -64,7 +75,7 @@ class="absolute inset-y-0 right-0 flex items-center h-6 pt-2 pr-2 cursor-pointer @disabled($disabled) @readonly($readonly) @required($required) id="{{ $id }}" name="{{ $name }}" name={{ $id }}> @endif - + @endif @error($id)