Skip to content

Commit a0dcc15

Browse files
committed
chore: fix code style
1 parent 1f50fb3 commit a0dcc15

1 file changed

Lines changed: 119 additions & 119 deletions

File tree

packages/support/resources/views/components/modal/index.blade.php

Lines changed: 119 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@
6464
6565
$wireSubmitHandler = $attributes->get('wire:submit.prevent');
6666
$attributes = $attributes->except(['wire:submit.prevent']);
67-
$isClickThrough = $clickThrough && !$closeByClickingAway;
67+
$isClickThrough = $clickThrough && ! $closeByClickingAway;
6868
@endphp
6969

7070
@if ($trigger)
7171
{!! '<div>' !!}
7272
{{-- Avoid formatting issues with unclosed elements --}}
7373

7474
<div
75-
@if (! $trigger->attributes->get('disabled'))
76-
@if ($id)
77-
x-on:click="$dispatch(@js($openEventName), { id: @js($id) })"
75+
@if (! $trigger->attributes->get('disabled'))
76+
@if ($id)
77+
x-on:click="$dispatch(@js($openEventName), { id: @js($id) })"
7878
@else
7979
x-on:click="$el.nextElementSibling.dispatchEvent(new CustomEvent(@js($openEventName)))"
8080
@endif
81-
@endif
82-
{{ $trigger->attributes->except(['disabled'])->class(['fi-modal-trigger']) }}
81+
@endif
82+
{{ $trigger->attributes->except(['disabled'])->class(['fi-modal-trigger']) }}
8383
>
8484
{{ $trigger }}
8585
</div>
@@ -91,28 +91,28 @@
9191
@endif
9292

9393
<div
94-
@if ($ariaLabelledby)
95-
aria-labelledby="{{ $ariaLabelledby }}"
96-
@elseif ($heading)
97-
aria-labelledby="{{ "{$id}.heading" }}"
98-
@endif
99-
aria-modal="true"
100-
id="{{ $id }}"
101-
role="dialog"
102-
x-data="filamentModal({
94+
@if ($ariaLabelledby)
95+
aria-labelledby="{{ $ariaLabelledby }}"
96+
@elseif ($heading)
97+
aria-labelledby="{{ "{$id}.heading" }}"
98+
@endif
99+
aria-modal="true"
100+
id="{{ $id }}"
101+
role="dialog"
102+
x-data="filamentModal({
103103
id: @js($id),
104104
})"
105-
@if ($id)
106-
data-fi-modal-id="{{ $id }}"
105+
@if ($id)
106+
data-fi-modal-id="{{ $id }}"
107107
x-on:{{ $closeEventName }}.window="if (($event.detail.id === @js($id)) && isOpen) close()"
108108
x-on:{{ $closeQuietlyEventName }}.window="if (($event.detail.id === @js($id)) && isOpen) closeQuietly()"
109109
x-on:{{ $openEventName }}.window="if (($event.detail.id === @js($id)) && (! isOpen)) open()"
110-
@else
111-
x-on:{{ $closeEventName }}.stop="if (isOpen) close()"
110+
@else
111+
x-on:{{ $closeEventName }}.stop="if (isOpen) close()"
112112
x-on:{{ $closeQuietlyEventName }}.stop="if (isOpen) closeQuietly()"
113113
x-on:{{ $openEventName }}.stop="if (! isOpen) open()"
114-
@endif
115-
x-bind:class="{
114+
@endif
115+
x-bind:class="{
116116
'fi-modal-open': isOpen,
117117
}"
118118
x-cloak
@@ -134,73 +134,73 @@
134134
])
135135
}}
136136
>
137-
@unless($isClickThrough)
137+
@unless ($isClickThrough)
138138
<div
139-
aria-hidden="true"
140-
x-show="isOpen"
141-
x-transition.duration.300ms.opacity
142-
{{
143-
($extraModalOverlayAttributeBag ?? new \Illuminate\View\ComponentAttributeBag)->class([
144-
'fi-modal-close-overlay',
145-
])
146-
}}
139+
aria-hidden="true"
140+
x-show="isOpen"
141+
x-transition.duration.300ms.opacity
142+
{{
143+
($extraModalOverlayAttributeBag ?? new \Illuminate\View\ComponentAttributeBag)->class([
144+
'fi-modal-close-overlay',
145+
])
146+
}}
147147
></div>
148148
@endunless
149149

150150
<div
151-
@if ($closeByClickingAway)
152-
x-on:click.self="{{ $closeEventHandler }}"
153-
@endif
154-
@class([
155-
'fi-modal-window-ctn',
156-
'fi-clickable' => $closeByClickingAway,
157-
'pointer-events-none' => $isClickThrough,
158-
])
151+
@if ($closeByClickingAway)
152+
x-on:click.self="{{ $closeEventHandler }}"
153+
@endif
154+
@class([
155+
'fi-modal-window-ctn',
156+
'fi-clickable' => $closeByClickingAway,
157+
'pointer-events-none' => $isClickThrough,
158+
])
159159
>
160160
<{{ filled($wireSubmitHandler) ? 'form' : 'div' }}
161161
@if ($closeByEscaping)
162-
x-on:keydown.window.escape="if (isTopmost()) {{ $closeEventHandler }}"
163-
@endif
164-
x-show="isWindowVisible"
165-
x-transition:enter="fi-transition-enter"
166-
x-transition:leave="fi-transition-leave"
167-
@if ($width !== Width::Screen)
168-
x-transition:enter-start="fi-transition-enter-start"
169-
x-transition:enter-end="fi-transition-enter-end"
170-
x-transition:leave-start="fi-transition-leave-start"
171-
x-transition:leave-end="fi-transition-leave-end"
172-
@endif
173-
@if (filled($wireSubmitHandler))
174-
wire:submit.prevent="{!! $wireSubmitHandler !!}"
175-
@endif
176-
@if (filled($id))
177-
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.window"
178-
@endif
179-
{{
180-
($extraModalWindowAttributeBag ?? new \Illuminate\View\ComponentAttributeBag)->class([
181-
'fi-modal-window',
182-
'fi-modal-window-has-close-btn' => $closeButton,
183-
'fi-modal-window-has-content' => $hasContent,
184-
'fi-modal-window-has-footer' => $hasFooter,
185-
'fi-modal-window-has-icon' => $hasIcon,
186-
'fi-hidden' => ! $visible,
187-
($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : null,
188-
($width instanceof Width) ? "fi-width-{$width->value}" : (is_string($width) ? $width : null),
189-
])
190-
}}
162+
x-on:keydown.window.escape="if (isTopmost()) {{ $closeEventHandler }}"
163+
@endif
164+
x-show="isWindowVisible"
165+
x-transition:enter="fi-transition-enter"
166+
x-transition:leave="fi-transition-leave"
167+
@if ($width !== Width::Screen)
168+
x-transition:enter-start="fi-transition-enter-start"
169+
x-transition:enter-end="fi-transition-enter-end"
170+
x-transition:leave-start="fi-transition-leave-start"
171+
x-transition:leave-end="fi-transition-leave-end"
172+
@endif
173+
@if (filled($wireSubmitHandler))
174+
wire:submit.prevent="{!! $wireSubmitHandler !!}"
175+
@endif
176+
@if (filled($id))
177+
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.window"
178+
@endif
179+
{{
180+
($extraModalWindowAttributeBag ?? new \Illuminate\View\ComponentAttributeBag)->class([
181+
'fi-modal-window',
182+
'fi-modal-window-has-close-btn' => $closeButton,
183+
'fi-modal-window-has-content' => $hasContent,
184+
'fi-modal-window-has-footer' => $hasFooter,
185+
'fi-modal-window-has-icon' => $hasIcon,
186+
'fi-hidden' => ! $visible,
187+
($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : null,
188+
($width instanceof Width) ? "fi-width-{$width->value}" : (is_string($width) ? $width : null),
189+
])
190+
}}
191191
>
192-
@if ($heading || $header)
193-
<div
192+
@if ($heading || $header)
193+
<div
194194
@if (filled($id))
195195
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.header"
196196
@endif
197197
@class([
198198
'fi-modal-header',
199199
'fi-vertical-align-center' => $hasIcon && $hasHeading && (! $hasDescription) && in_array($alignment, [Alignment::Start, Alignment::Left]),
200200
])
201-
>
202-
@if ($closeButton)
203-
<x-filament::icon-button
201+
>
202+
@if ($closeButton)
203+
<x-filament::icon-button
204204
color="gray"
205205
:icon="\Filament\Support\Icons\Heroicon::OutlinedXMark"
206206
:icon-alias="\Filament\Support\View\SupportIconAlias::MODAL_CLOSE_BUTTON"
@@ -209,75 +209,75 @@
209209
tabindex="-1"
210210
:x-on:click="$closeEventHandler"
211211
class="fi-modal-close-btn"
212-
/>
213-
@endif
212+
/>
213+
@endif
214214

215-
@if ($header)
216-
{{ $header }}
217-
@else
218-
@if ($hasIcon)
219-
<div class="fi-modal-icon-ctn">
220-
<div
215+
@if ($header)
216+
{{ $header }}
217+
@else
218+
@if ($hasIcon)
219+
<div class="fi-modal-icon-ctn">
220+
<div
221221
{{ (new ComponentAttributeBag)->color(IconComponent::class, $iconColor)->class(['fi-modal-icon-bg']) }}
222222
>
223223
{{ $iconHtml }}
224224
</div>
225225
</div>
226226
@endif
227227

228-
<div>
229-
<h2 class="fi-modal-heading">
230-
{{ $heading }}
231-
</h2>
228+
<div>
229+
<h2 class="fi-modal-heading">
230+
{{ $heading }}
231+
</h2>
232232

233-
@if ($hasDescription)
234-
<p class="fi-modal-description">
235-
{{ $description }}
236-
</p>
237-
@endif
238-
</div>
239-
@endif
240-
</div>
241-
@endif
233+
@if ($hasDescription)
234+
<p class="fi-modal-description">
235+
{{ $description }}
236+
</p>
237+
@endif
238+
</div>
239+
@endif
240+
</div>
241+
@endif
242242

243-
@if ($hasContent)
244-
<div
243+
@if ($hasContent)
244+
<div
245245
@if (filled($id))
246246
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.content"
247247
@endif
248248
class="fi-modal-content"
249-
>
250-
{{ $slot }}
251-
</div>
252-
@endif
249+
>
250+
{{ $slot }}
251+
</div>
252+
@endif
253253

254-
@if ($hasFooter)
255-
<div
254+
@if ($hasFooter)
255+
<div
256256
@if (filled($id))
257257
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.footer"
258258
@endif
259259
@class([
260260
'fi-modal-footer',
261261
($footerActionsAlignment instanceof Alignment) ? "fi-align-{$footerActionsAlignment->value}" : null,
262262
])
263-
>
264-
@if (! \Filament\Support\is_slot_empty($footer))
265-
{{ $footer }}
266-
@else
267-
<div class="fi-modal-footer-actions">
268-
@if (is_array($footerActions))
269-
@foreach ($footerActions as $action)
270-
{{ $action }}
271-
@endforeach
272-
@else
273-
{{ $footerActions }}
274-
@endif
275-
</div>
276-
@endif
277-
</div>
278-
@endif
279-
</{{ filled($wireSubmitHandler) ? 'form' : 'div' }}>
280-
</div>
263+
>
264+
@if (! \Filament\Support\is_slot_empty($footer))
265+
{{ $footer }}
266+
@else
267+
<div class="fi-modal-footer-actions">
268+
@if (is_array($footerActions))
269+
@foreach ($footerActions as $action)
270+
{{ $action }}
271+
@endforeach
272+
@else
273+
{{ $footerActions }}
274+
@endif
275+
</div>
276+
@endif
277+
</div>
278+
@endif
279+
</{{ filled($wireSubmitHandler) ? 'form' : 'div' }}>
280+
</div>
281281
</div>
282282

283283
@if (filled($teleport))

0 commit comments

Comments
 (0)