@props([ 'alpineDisabled' => null, 'alpineValid' => null, 'disabled' => false, 'inlinePrefix' => false, 'inlineSuffix' => false, 'prefix' => null, 'prefixActions' => [], 'prefixIcon' => null, 'prefixIconColor' => 'gray', 'prefixIconAlias' => null, 'suffix' => null, 'suffixActions' => [], 'suffixIcon' => null, 'suffixIconColor' => 'gray', 'suffixIconAlias' => null, 'valid' => true, ]) @php use Filament\Support\View\Components\InputComponent\WrapperComponent\IconComponent; use Illuminate\View\ComponentAttributeBag; $prefixActions = array_filter( $prefixActions, fn (\Filament\Actions\Action $prefixAction): bool => $prefixAction->isVisible(), ); $suffixActions = array_filter( $suffixActions, fn (\Filament\Actions\Action $suffixAction): bool => $suffixAction->isVisible(), ); $hasPrefix = count($prefixActions) || $prefixIcon || filled($prefix); $hasSuffix = count($suffixActions) || $suffixIcon || filled($suffix); $hasAlpineDisabledClasses = filled($alpineDisabled); $hasAlpineValidClasses = filled($alpineValid); $hasAlpineClasses = $hasAlpineDisabledClasses || $hasAlpineValidClasses; $wireTarget = $attributes->whereStartsWith(['wire:target'])->first(); $hasLoadingIndicator = filled($wireTarget); if ($hasLoadingIndicator) { $loadingIndicatorTarget = html_entity_decode($wireTarget, ENT_QUOTES); } @endphp
except(['wire:target', 'tabindex']) ->class([ 'fi-input-wrp', 'fi-disabled' => (! $hasAlpineClasses) && $disabled, 'fi-invalid' => (! $hasAlpineClasses) && (! $valid), ]) }} > @if ($hasPrefix || $hasLoadingIndicator) @endif
$hasLoadingIndicator && (! $hasPrefix) && $inlinePrefix, ]) > {{ $slot }}
@if ($hasSuffix)
$inlineSuffix, 'fi-input-wrp-suffix-has-label' => filled($suffix), ]) > @if (filled($suffix)) {{ $suffix }} @endif {{ \Filament\Support\generate_icon_html($suffixIcon, $suffixIconAlias, (new \Illuminate\View\ComponentAttributeBag) ->merge([ 'wire:loading.remove.delay.' . config('filament.livewire_loading_delay', 'default') => $hasLoadingIndicator, 'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false, ], escape: false) ->color(IconComponent::class, $suffixIconColor)) }} @if (count($suffixActions))
@foreach ($suffixActions as $suffixAction) {{ $suffixAction }} @endforeach
@endif
@endif