@props([ 'id' => null, 'maxWidth' => 'sm', 'title' => null, 'triggerAs' => 'button', 'description' => null, 'icon' => null, 'buttons' => null, 'focusable' => false, 'cancelAttributes' => [], 'showCancelButton' => false, 'cancelButtonText' => __('Cancel'), 'dismiss' => true, 'noCancelClick' => false, 'inlineButtons' => false, ]) @php $hasWireModel = $attributes->has('wire:model.live'); $id = $id ?? md5($hasWireModel ? $attributes->wire('model') : $title ?? $description); $maxWidth = [ 'sm' => 'sm:max-w-sm', 'md' => 'sm:max-w-md', 'lg' => 'sm:max-w-lg', 'xl' => 'sm:max-w-xl', '2xl' => 'sm:max-w-2xl', ][$maxWidth ?? '2xl']; if ($showCancelButton || $dismiss) { $cancelAttributes = new \Illuminate\View\ComponentAttributeBag($noCancelClick ? $cancelAttributes : array_merge(['@click' => 'closeModal'], $cancelAttributes)); } @endphp
except('wire:model.live')->merge() }}> @isset($trigger) @if ($triggerAs === 'button') {!! $trigger !!} @else attributes->merge([ '@click' => 'openModal', ]) }}>{!! $trigger !!} @endif @endisset