@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