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

44 lines
1.6 KiB
PHP
Raw Normal View History

2023-05-04 10:45:09 +02:00
@props([
'id' => null,
'label' => null,
2023-06-05 13:50:34 +02:00
'helper' => $attributes->has('helper'),
2023-05-04 10:45:09 +02:00
'required' => false,
])
2023-06-05 13:50:34 +02:00
<div {{ $attributes->merge(['class' => 'flex flex-col']) }}>
2023-06-12 12:00:01 +02:00
@if ($label)
<label class="label" for={{ $id }}>
2023-06-12 13:48:26 +02:00
<span class="flex gap-1 label-text">
2023-06-05 12:07:55 +02:00
{{ $label }}
2023-06-12 12:00:01 +02:00
@if ($required)
<span class="text-warning">*</span>
@endif
@if ($helper)
<div class="group">
<div class="cursor-pointer text-warning">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
class="w-4 h-4 stroke-current">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</div>
<div class="absolute hidden text-xs group-hover:block border-coolgray-400 bg-coolgray-500">
<div class="p-4 card-body">
{!! $helper !!}
</div>
2023-06-05 13:50:34 +02:00
</div>
</div>
2023-06-12 12:00:01 +02:00
@endif
</span>
</label>
@endif
2023-06-13 10:02:58 +02:00
<select {{ $attributes }}
2023-06-08 11:43:14 +02:00
@if ($id) name={{ $id }} wire:model.defer={{ $id }} @endif>
2023-05-04 10:45:09 +02:00
{{ $slot }}
</select>
@error($id)
<div class="text-red-500">{{ $message }}</div>
@enderror
2023-06-05 13:50:34 +02:00
</div>