pianello-api/resources/views/components/base/transition/index.blade.php
Ale Gallo 96c0bfb8ce Committing laravel (part 5)
committing blade templating files and components that might come in handy
2023-11-10 16:41:20 +01:00

43 lines
1.1 KiB
PHP

@props([
'as' => 'div',
'selector' => null,
'enter' => null,
'enterFrom' => null,
'enterTo' => null,
'leave' => null,
'leaveFrom' => null,
'leaveTo' => null,
])
@once
@push('vendors')
@vite('resources/js/vendor/transition/index.js')
@endpush
@endonce
@if (substr($as, 0, 2) == 'x-')
<x-dynamic-component
data-transition
data-selector="{{ $selector }}"
data-enter="{{ $enter }}"
data-enter-from="{{ $enterFrom }}"
data-enter-to="{{ $enterTo }}"
data-leave="{{ $leave }}"
data-leave-from="{{ $leaveFrom }}"
data-leave-to="{{ $leaveTo }}"
{{ $attributes }}
:component="substr($as, 2)"
>{{ $slot }}</x-dynamic-component>
@else
<{{ $as }}
data-transition
data-selector="{{ $selector }}"
data-enter="{{ $enter }}"
data-enter-from="{{ $enterFrom }}"
data-enter-to="{{ $enterTo }}"
data-leave="{{ $leave }}"
data-leave-from="{{ $leaveFrom }}"
data-leave-to="{{ $leaveTo }}"
{{ $attributes }}
>{{ $slot }}</{{ $as }}>
@endif