add monaco-editor as option to textarea component

This commit is contained in:
MMTE 2024-06-23 22:13:50 +03:30
parent 83d8963051
commit 92049cba92
2 changed files with 14 additions and 1 deletions

View File

@ -19,6 +19,8 @@ class Textarea extends Component
public ?string $value = null, public ?string $value = null,
public ?string $label = null, public ?string $label = null,
public ?string $placeholder = null, public ?string $placeholder = null,
public ?string $monacoEditorLanguage = '',
public bool $useMonacoEditor = false,
public bool $required = false, public bool $required = false,
public bool $disabled = false, public bool $disabled = false,
public bool $readonly = false, public bool $readonly = false,

View File

@ -24,6 +24,17 @@
@endif @endif
</label> </label>
@endif @endif
@if($useMonacoEditor)
<x-forms.monaco-editor
id="{{ $id }}"
language="{{$monacoEditorLanguage }}"
name="{{ $name }}"
name="{{ $id }}"
model="{{ $value ?? $id }}"
wire:model="{{ $value ?? $id }}"
label="dockerfile"
/>
@else
@if ($type === 'password') @if ($type === 'password')
<div class="relative" x-data="{ type: 'password' }"> <div class="relative" x-data="{ type: 'password' }">
@if ($allowToPeak) @if ($allowToPeak)
@ -64,7 +75,7 @@
@disabled($disabled) @readonly($readonly) @required($required) id="{{ $id }}" @disabled($disabled) @readonly($readonly) @required($required) id="{{ $id }}"
name="{{ $name }}" name={{ $id }}></textarea> name="{{ $name }}" name={{ $id }}></textarea>
@endif @endif
@endif
@error($id) @error($id)
<label class="label"> <label class="label">
<span class="text-red-500 label-text-alt">{{ $message }}</span> <span class="text-red-500 label-text-alt">{{ $message }}</span>