@props([ 'alpineDisabled' => null, 'alpineValid' => null, 'disabled' => false, 'inlinePrefix' => false, 'inlineSuffix' => false, 'prefix' => null, 'prefixActions' => [], 'prefixIcon' => null, 'prefixIconAlias' => null, 'suffix' => null, 'suffixActions' => [], 'suffixIcon' => null, 'suffixIconAlias' => null, 'valid' => true, ]) @php $hasPrefix = count($prefixActions) || $prefixIcon || filled($prefix); $hasSuffix = count($suffixActions) || $suffixIcon || filled($suffix); $hasAlpineDisabledClasses = filled($alpineDisabled); $hasAlpineValidClasses = filled($alpineValid); $hasAlpineClasses = $hasAlpineDisabledClasses || $hasAlpineValidClasses; $enabledWrapperClasses = 'bg-white focus-within:ring-2 dark:bg-white/5'; $disabledWrapperClasses = 'bg-gray-50 dark:bg-transparent'; $validWrapperClasses = 'ring-gray-950/10'; $invalidWrapperClasses = 'ring-danger-600 dark:ring-danger-500'; $enabledValidWrapperClasses = 'focus-within:ring-primary-600 dark:ring-white/20 dark:focus-within:ring-primary-500'; $enabledInvalidWrapperClasses = 'focus-within:ring-danger-600 dark:focus-within:ring-danger-500'; $disabledValidWrapperClasses = 'dark:ring-white/10'; $actionsClasses = '-mx-1.5 flex items-center'; $iconClasses = 'fi-input-wrapper-icon h-5 w-5 text-gray-400 dark:text-gray-500'; $labelClasses = 'fi-input-wrapper-label whitespace-nowrap text-sm text-gray-500 dark:text-gray-400'; $prefixActions = array_filter( $prefixActions, fn (\Filament\Forms\Components\Actions\Action $prefixAction): bool => $prefixAction->isVisible(), ); $suffixActions = array_filter( $suffixActions, fn (\Filament\Forms\Components\Actions\Action $suffixAction): bool => $suffixAction->isVisible(), ); $wireTarget = $attributes->whereStartsWith(['wire:target'])->first(); $hasLoadingIndicator = filled($wireTarget); if ($hasLoadingIndicator) { $loadingIndicatorTarget = html_entity_decode($wireTarget, ENT_QUOTES); } @endphp
except(['wire:target']) ->class([ 'fi-input-wrapper flex rounded-lg shadow-sm ring-1 transition duration-75', $enabledWrapperClasses => (! $hasAlpineClasses) && (! $disabled), $disabledWrapperClasses => (! $hasAlpineClasses) && $disabled, $validWrapperClasses => (! $hasAlpineClasses) && $valid, $invalidWrapperClasses => (! $hasAlpineClasses) && (! $valid), $enabledValidWrapperClasses => (! $hasAlpineClasses) && (! $disabled) && $valid, $enabledInvalidWrapperClasses => (! $hasAlpineClasses) && (! $disabled) && (! $valid), $disabledValidWrapperClasses => (! $hasAlpineClasses) && $disabled && $valid, ]) }} > @if ($hasPrefix || $hasLoadingIndicator) @endif
$hasLoadingIndicator && (! $hasPrefix) && $inlinePrefix, ]) > {{ $slot }}
@if ($hasSuffix)
$inlineSuffix && filled($suffix), 'ps-2' => $inlineSuffix && blank($suffix), 'border-s border-gray-200 ps-3 dark:border-white/10' => ! $inlineSuffix, ]) > @if (filled($suffix)) {{ $suffix }} @endif @if ($suffixIcon) @endif @if (count($suffixActions))
@foreach ($suffixActions as $suffixAction) {{ $suffixAction }} @endforeach
@endif
@endif