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

44 lines
1.5 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-05 10:07:55 +00:00
<label class="label" for={{ $id }}>
<span class="label-text">
@if ($label)
{{ $label }}
@endif
@if ($required)
<span class="text-warning">*</span>
@endif
2023-06-05 11:50:34 +00:00
@if ($helper)
2023-06-07 19:44:16 +00:00
<div class="group">
<div class="cursor-pointer text-warning">
2023-06-05 11:50:34 +00:00
<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>
2023-06-07 19:44:16 +00:00
</div>
<div class="absolute hidden text-xs group-hover:block border-coolgray-400 bg-coolgray-500">
<div class="p-4 card-body">
2023-06-05 11:50:34 +00:00
{!! $helper !!}
</div>
</div>
</div>
@endif
2023-06-05 10:07:55 +00:00
</span>
2023-05-04 08:45:09 +00:00
</label>
2023-06-08 09:43:14 +00:00
<select {{ $attributes }}
@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>