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

44 lines
1.6 KiB
PHP
Raw Normal View History

2023-05-04 08:45:09 +00:00
@props([
'id' => null,
'label' => null,
2023-06-05 11:50:34 +00:00
'helper' => $attributes->has('helper'),
2023-05-04 08:45:09 +00:00
'required' => false,
])
2023-06-05 11:50:34 +00:00
<div {{ $attributes->merge(['class' => 'flex flex-col']) }}>
2023-06-12 10:00:01 +00:00
@if ($label)
<label class="label" for={{ $id }}>
<span class="label-text">
2023-06-05 10:07:55 +00:00
{{ $label }}
2023-06-12 10:00:01 +00: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 11:50:34 +00:00
</div>
</div>
2023-06-12 10:00:01 +00:00
@endif
</span>
</label>
@endif
<select class="select-xs h-7" {{ $attributes }}
2023-06-08 09:43:14 +00:00
@if ($id) name={{ $id }} wire:model.defer={{ $id }} @endif>
2023-05-04 08:45:09 +00:00
{{ $slot }}
</select>
@error($id)
<div class="text-red-500">{{ $message }}</div>
@enderror
2023-06-05 11:50:34 +00:00
</div>