@if(isset($label))
{!! e($label) ?? '' !!}@if($required)*@endif
@endif
@if(isset($type)) @if(isset($preIcon) && !in_array($type, ['number', 'slider', 'date', 'datetime-local', 'color']))
@endif @elseif(isset($preIcon))
@endif @if(!isset($preIcon) && isset($type) && in_array($type, ['date','datetime-local']))
@endif @if(isset($type) && $type == 'color') @php $kfwColorRawValue = isset($name) ? old($name, $value ?? ($default ?? '')) : ($value ?? ($default ?? '')); $kfwColorRawValue = is_string($kfwColorRawValue) ? trim($kfwColorRawValue) : ''; $kfwColorRawDefault = isset($default) && is_string($default) ? trim($default) : ''; $kfwNormalizeHex = function ($raw) { $raw = is_string($raw) ? trim($raw) : ''; if ($raw === '') { return null; } if (preg_match('/^#([0-9a-fA-F]{6})$/', $raw, $m)) { return '#' . strtolower($m[1]); } if (preg_match('/^#([0-9a-fA-F]{3})$/', $raw, $m)) { $expanded = $m[1][0] . $m[1][0] . $m[1][1] . $m[1][1] . $m[1][2] . $m[1][2]; return '#' . strtolower($expanded); } if (preg_match('/^([0-9a-fA-F]{6})$/', $raw, $m)) { return '#' . strtolower($m[1]); } if (preg_match('/^([0-9a-fA-F]{3})$/', $raw, $m)) { $expanded = $m[1][0] . $m[1][0] . $m[1][1] . $m[1][1] . $m[1][2] . $m[1][2]; return '#' . strtolower($expanded); } return null; }; $kfwColorPickerDefault = $kfwNormalizeHex($kfwColorRawDefault) ?? '#000000'; $kfwColorPickerValue = $kfwNormalizeHex($kfwColorRawValue) ?? $kfwColorPickerDefault; @endphp {{-- Renders the color picker inside the pre-icon slot for direct alignment with the input. --}}
@endif @if(isset($prefix))
{!! $prefix !!}
@endif @if(isset($type) && $type == 'number')
@endif {!! $slot !!} @if($type != 'richtext') @endif @if(isset($suffix))
{!! $suffix !!}
@endif @if(isset($type) && $type == 'password') @endif @if(isset($postIcon))
@endif
@if(isset($name) && session('errors')) @error($name)
{{ $message }}
@enderror @endif @if(isset($type) && $type == 'file' && isset($value))
{!! $kfwDownloader::make() ->setValue($value) !!}
@endif
{!! $hint ?? '' !!}