@php use Filament\Support\Enums\VerticalAlignment; @endphp @props([ 'field' => null, 'hasInlineLabel' => null, 'hasNestedRecursiveValidationRules' => null, 'helperText' => null, 'hint' => null, 'hintActions' => null, 'hintColor' => null, 'hintIcon' => null, 'hintIconTooltip' => null, 'id' => null, 'inlineLabelVerticalAlignment' => VerticalAlignment::Start, 'isDisabled' => null, 'label' => null, 'labelPrefix' => null, 'labelSrOnly' => null, 'labelSuffix' => null, 'required' => null, 'statePath' => null, ]) @php if ($field) { $hasInlineLabel ??= $field->hasInlineLabel(); $hasNestedRecursiveValidationRules ??= $field instanceof \Filament\Forms\Components\Contracts\HasNestedRecursiveValidationRules; $helperText ??= $field->getHelperText(); $hint ??= $field->getHint(); $hintActions ??= $field->getHintActions(); $hintColor ??= $field->getHintColor(); $hintIcon ??= $field->getHintIcon(); $hintIconTooltip ??= $field->getHintIconTooltip(); $id ??= $field->getId(); $isDisabled ??= $field->isDisabled(); $label ??= $field->getLabel(); $labelSrOnly ??= $field->isLabelHidden(); $required ??= $field->isMarkedAsRequired(); $statePath ??= $field->getStatePath(); } $hintActions = array_filter( $hintActions ?? [], fn (\Filament\Forms\Components\Actions\Action $hintAction): bool => $hintAction->isVisible(), ); $hasError = filled($statePath) && ($errors->has($statePath) || ($hasNestedRecursiveValidationRules && $errors->has("{$statePath}.*"))); @endphp
class(['fi-fo-field-wrp']) }}> @if ($label && $labelSrOnly) @endif
$hasInlineLabel, match ($inlineLabelVerticalAlignment) { VerticalAlignment::Start => 'sm:items-start', VerticalAlignment::Center => 'sm:items-center', VerticalAlignment::End => 'sm:items-end', } => $hasInlineLabel, ]) > @if (($label && (! $labelSrOnly)) || $labelPrefix || $labelSuffix || filled($hint) || $hintIcon || count($hintActions))
attributes->get('class') : null, ]) > @if ($label && (! $labelSrOnly)) {{ $label }} @elseif ($labelPrefix) {{ $labelPrefix }} @elseif ($labelSuffix) {{ $labelSuffix }} @endif @if (filled($hint) || $hintIcon || count($hintActions)) {{ $hint }} @endif
@endif @if ((! \Filament\Support\is_slot_empty($slot)) || $hasError || filled($helperText))
$hasInlineLabel, ]) > {{ $slot }} @if ($hasError) {{ $errors->has($statePath) ? $errors->first($statePath) : ($hasNestedRecursiveValidationRules ? $errors->first("{$statePath}.*") : null) }} @endif @if (filled($helperText)) {{ $helperText }} @endif
@endif