@php use Filament\Support\Enums\Alignment; use Filament\Support\Enums\Width; use Filament\Support\Facades\FilamentView; use Filament\Support\View\Components\ModalComponent\IconComponent; use Illuminate\View\ComponentAttributeBag; @endphp @props([ 'alignment' => Alignment::Start, 'ariaLabelledby' => null, 'autofocus' => \Filament\Support\View\Components\ModalComponent::$isAutofocused, 'closeButton' => \Filament\Support\View\Components\ModalComponent::$hasCloseButton, 'closeByClickingAway' => \Filament\Support\View\Components\ModalComponent::$isClosedByClickingAway, 'closeByEscaping' => \Filament\Support\View\Components\ModalComponent::$isClosedByEscaping, 'closeEventName' => 'close-modal', 'closeQuietlyEventName' => 'close-modal-quietly', 'description' => null, 'extraModalWindowAttributeBag' => null, 'footer' => null, 'footerActions' => [], 'footerActionsAlignment' => Alignment::Start, 'header' => null, 'heading' => null, 'icon' => null, 'iconAlias' => null, 'iconColor' => 'primary', 'id' => null, 'openEventName' => 'open-modal', 'slideOver' => false, 'stickyFooter' => false, 'stickyHeader' => false, 'trigger' => null, 'visible' => true, 'width' => 'sm', ]) @php $hasContent = ! \Filament\Support\is_slot_empty($slot); $hasDescription = filled($description); $hasFooter = (! \Filament\Support\is_slot_empty($footer)) || (is_array($footerActions) && count($footerActions)) || (! is_array($footerActions) && (! \Filament\Support\is_slot_empty($footerActions))); $hasHeading = filled($heading); $hasIcon = filled($icon); if (! $alignment instanceof Alignment) { $alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null; } if (! $footerActionsAlignment instanceof Alignment) { $footerActionsAlignment = filled($footerActionsAlignment) ? (Alignment::tryFrom($footerActionsAlignment) ?? $footerActionsAlignment) : null; } if (is_string($width)) { $width = Width::tryFrom($width) ?? $width; } $closeEventHandler = filled($id) ? '$dispatch(' . \Illuminate\Support\Js::from($closeEventName) . ', { id: ' . \Illuminate\Support\Js::from($id) . ' })' : 'close()'; $wireSubmitHandler = $attributes->get('wire:submit.prevent'); $attributes = $attributes->except(['wire:submit.prevent']); @endphp @if ($trigger) {!! '
' !!} {{-- Avoid formatting issues with unclosed elements --}}
attributes->get('disabled')) x-on:click="$el.nextElementSibling.dispatchEvent(new CustomEvent(@js($openEventName)))" @endif {{ $trigger->attributes->except(['disabled'])->class(['fi-modal-trigger']) }} > {{ $trigger }}
@endif @if ($trigger) {!! '
' !!} {{-- Avoid formatting issues with unclosed elements --}} @endif