ui fixes
This commit is contained in:
@@ -1,36 +1,40 @@
|
||||
@props([
|
||||
'id' => null,
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
'required' => $attributes->has('required'),
|
||||
'label' => null,
|
||||
'instantSave' => false,
|
||||
'disabled' => false,
|
||||
'hidden' => false,
|
||||
'noLabel' => false,
|
||||
'noDirty' => false,
|
||||
])
|
||||
|
||||
|
||||
<span @class([
|
||||
'flex justify-end' => $type === 'checkbox',
|
||||
'flex flex-col' => $type !== 'checkbox',
|
||||
])>
|
||||
<label for={{ $id }}>
|
||||
@if ($label)
|
||||
{{ $label }}
|
||||
@else
|
||||
{{ $id }}
|
||||
@endif
|
||||
@if ($required)
|
||||
*
|
||||
@endif
|
||||
</label>
|
||||
@if (!$noLabel)
|
||||
<label for={{ $id }}>
|
||||
@if ($label)
|
||||
{{ $label }}
|
||||
@else
|
||||
{{ $id }}
|
||||
@endif
|
||||
@if ($required)
|
||||
*
|
||||
@endif
|
||||
</label>
|
||||
@endif
|
||||
@if ($type === 'textarea')
|
||||
<textarea {{ $attributes }} type={{ $type }} id={{ $id }} wire:model.defer={{ $id }}></textarea>
|
||||
<textarea @if (!$noDirty) wire:dirty.class="text-black bg-amber-300" @endif {{ $attributes }}
|
||||
required={{ $required }} type={{ $type }} id={{ $id }} wire:model.defer={{ $id }}></textarea>
|
||||
@else
|
||||
<input wire:dirty.class="text-black bg-amber-300" {{ $attributes }} type={{ $type }}
|
||||
id={{ $id }}
|
||||
<input {{ $attributes }} required={{ $required }}
|
||||
@if (!$noDirty) wire:dirty.class="text-black bg-amber-300" @endif
|
||||
type={{ $type }} id={{ $id }}
|
||||
@if ($instantSave) wire:click='instantSave' wire:model.defer={{ $id }} @else wire:model.defer={{ $value ?? $id }} @endif />
|
||||
@endif
|
||||
|
||||
@error($id)
|
||||
<div class="text-red-500">{{ $message }}</div>
|
||||
@enderror
|
||||
|
||||
Reference in New Issue
Block a user