@php use Filament\Support\Enums\VerticalAlignment; @endphp @props([ 'htmlErrorMessage' => null, 'errorMessage' => null, 'field' => null, 'hasErrors' => true, 'hasInlineLabel' => null, 'hasNestedRecursiveValidationRules' => 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; $id ??= $field->getId(); $isDisabled ??= $field->isDisabled(); $label ??= $field->getLabel(); $labelSrOnly ??= $field->isLabelHidden(); $required ??= $field->isMarkedAsRequired(); $statePath ??= $field->getStatePath(); } $aboveLabelSchema = $field?->getChildSchema($field::ABOVE_LABEL_SCHEMA_KEY)?->toHtmlString(); $belowLabelSchema = $field?->getChildSchema($field::BELOW_LABEL_SCHEMA_KEY)?->toHtmlString(); $beforeLabelSchema = $field?->getChildSchema($field::BEFORE_LABEL_SCHEMA_KEY)?->toHtmlString(); $afterLabelSchema = $field?->getChildSchema($field::AFTER_LABEL_SCHEMA_KEY)?->toHtmlString(); $aboveContentSchema = $field?->getChildSchema($field::ABOVE_CONTENT_SCHEMA_KEY)?->toHtmlString(); $belowContentSchema = $field?->getChildSchema($field::BELOW_CONTENT_SCHEMA_KEY)?->toHtmlString(); $beforeContentSchema = $field?->getChildSchema($field::BEFORE_CONTENT_SCHEMA_KEY)?->toHtmlString(); $afterContentSchema = $field?->getChildSchema($field::AFTER_CONTENT_SCHEMA_KEY)?->toHtmlString(); $aboveErrorMessageSchema = $field?->getChildSchema($field::ABOVE_ERROR_MESSAGE_SCHEMA_KEY)?->toHtmlString(); $belowErrorMessageSchema = $field?->getChildSchema($field::BELOW_ERROR_MESSAGE_SCHEMA_KEY)?->toHtmlString(); $hasError = $hasErrors && (filled($errorMessage) || (filled($statePath) && ($errors->has($statePath) || ($hasNestedRecursiveValidationRules && $errors->has("{$statePath}.*"))))); @endphp
merge($field?->getExtraFieldWrapperAttributes() ?? [], escape: false) ->class([ 'fi-fo-field', 'fi-fo-field-has-inline-label' => $hasInlineLabel, ]) }} > @if (filled($label) && $labelSrOnly) @endif @if ((filled($label) && (! $labelSrOnly)) || $hasInlineLabel || $aboveLabelSchema || $belowLabelSchema || $beforeLabelSchema || $afterLabelSchema || $labelPrefix || $labelSuffix)
value}" => $hasInlineLabel, ]) > {{ $aboveLabelSchema }}
attributes->get('class') : null, ]) > {{ $beforeLabelSchema }} @if ((filled($label) && (! $labelSrOnly)) || $labelPrefix || $labelSuffix) @endif {{ $afterLabelSchema }}
{{ $belowLabelSchema }}
@endif @if ((! \Filament\Support\is_slot_empty($slot)) || $hasError || $aboveContentSchema || $belowContentSchema || $beforeContentSchema || $afterContentSchema || $aboveErrorMessageSchema || $belowErrorMessageSchema)
{{ $aboveContentSchema }} @if ($beforeContentSchema || $afterContentSchema)
{{ $beforeContentSchema }}
{{ $slot }}
{{ $afterContentSchema }}
@else {{ $slot }} @endif {{ $belowContentSchema }} @if ($hasError) @php $errorMessage ??= $errors->has($statePath) ? $errors->first($statePath) : ($hasNestedRecursiveValidationRules ? $errors->first("{$statePath}.*") : null); @endphp {{ $aboveErrorMessageSchema }} @if ($htmlErrorMessage ?? $field?->areHtmlValidationMessagesAllowed())
{!! $errorMessage !!}
@else

{{ $errorMessage }}

@endif {{ $belowErrorMessageSchema }} @endif
@endif