@props([ 'field' => null, 'hasInlineLabel' => null, 'hasNestedRecursiveValidationRules' => false, 'helperText' => null, 'hint' => null, 'hintActions' => null, 'hintColor' => null, 'hintIcon' => null, 'id' => null, 'isDisabled' => null, 'isMarkedAsRequired' => 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(); $id ??= $field->getId(); $isDisabled ??= $field->isDisabled(); $isMarkedAsRequired ??= $field->isMarkedAsRequired(); $label ??= $field->getLabel(); $labelSrOnly ??= $field->isLabelHidden(); $required ??= $field->isRequired(); $statePath ??= $field->getStatePath(); } $hintActions = array_filter( $hintActions ?? [], fn (\Filament\Forms\Components\Actions\Action $hintAction): bool => $hintAction->isVisible(), ); $hasError = $errors->has($statePath) || ($hasNestedRecursiveValidationRules && $errors->has("{$statePath}.*")); @endphp
class(['fi-fo-field-wrp']) }}> @if ($label && $labelSrOnly) @endif
$hasInlineLabel, ]) > @if (($label && (! $labelSrOnly)) || $labelPrefix || $labelSuffix || filled($hint) || $hintIcon || count($hintActions))
$hasInlineLabel, ]) > @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->first($statePath) ?? ($hasNestedRecursiveValidationRules ? $errors->first("{$statePath}.*") : null) }} @endif @if (filled($helperText)) {{ $helperText }} @endif
@endif