coolify/resources/views/components/forms/checkbox.blade.php

31 lines
1,010 B
PHP
Raw Normal View History

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