2024-09-02 19:54:21 +00:00
|
|
|
@props([
|
|
|
|
|
'id',
|
|
|
|
|
'label' => null,
|
|
|
|
|
'helper' => null,
|
|
|
|
|
'disabled' => false,
|
|
|
|
|
'instantSave' => false,
|
|
|
|
|
'value' => null,
|
2024-11-15 20:44:02 +00:00
|
|
|
'checked' => false,
|
2024-09-02 19:54:21 +00:00
|
|
|
'hideLabel' => false,
|
2024-09-25 07:16:28 +00:00
|
|
|
'fullWidth' => false,
|
2024-09-02 19:54:21 +00:00
|
|
|
])
|
|
|
|
|
|
2024-09-25 07:16:28 +00:00
|
|
|
<div @class([
|
2024-11-04 13:18:16 +00:00
|
|
|
'flex flex-row items-center gap-4 pr-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100',
|
2024-09-25 07:16:28 +00:00
|
|
|
'w-full' => $fullWidth,
|
|
|
|
|
])>
|
2024-09-24 19:04:04 +00:00
|
|
|
@if (!$hideLabel)
|
2024-11-15 20:44:02 +00:00
|
|
|
<label @class([
|
|
|
|
|
'flex gap-4 items-center px-0 min-w-fit label w-full cursor-pointer',
|
|
|
|
|
])>
|
2024-11-13 18:04:23 +00:00
|
|
|
<span class="flex flex-grow gap-2">
|
2024-09-24 19:04:04 +00:00
|
|
|
@if ($label)
|
|
|
|
|
{!! $label !!}
|
|
|
|
|
@else
|
|
|
|
|
{{ $id }}
|
|
|
|
|
@endif
|
|
|
|
|
@if ($helper)
|
|
|
|
|
<x-helper :helper="$helper" />
|
|
|
|
|
@endif
|
|
|
|
|
</span>
|
2024-11-13 18:04:23 +00:00
|
|
|
@endif
|
2024-11-15 20:44:02 +00:00
|
|
|
<input @disabled($disabled) type="checkbox" {{ $attributes->merge(['class' => $defaultClass]) }}
|
|
|
|
|
@if ($instantSave) wire:loading.attr="disabled" wire:click='{{ $instantSave === 'instantSave' || $instantSave == '1' ? 'instantSave' : $instantSave }}'
|
|
|
|
|
@if ($checked) checked @endif
|
|
|
|
|
wire:model={{ $id }} @else wire:model={{ $value ?? $id }} @endif />
|
2024-11-13 18:04:23 +00:00
|
|
|
@if (!$hideLabel)
|
2024-09-24 19:04:04 +00:00
|
|
|
</label>
|
2024-09-02 19:54:21 +00:00
|
|
|
@endif
|
2023-06-14 11:07:58 +00:00
|
|
|
</div>
|