css and stuffs
This commit is contained in:
@@ -1,17 +1,30 @@
|
||||
@props([
|
||||
'type' => $attributes->get('type') ?? 'button',
|
||||
'disabled' => null,
|
||||
'confirm' => null,
|
||||
'confirmAction' => null,
|
||||
])
|
||||
<button {{ $attributes }}
|
||||
@if ($attributes->whereStartsWith('wire:click') && !$disabled) wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
|
||||
wire:loading.delay.class='loading' wire:loading.delay.attr="disabled" @endif
|
||||
@if ($disabled !== null) disabled title="{{ $disabled }}" @endif
|
||||
@isset($confirm)
|
||||
@if ($type === 'submit')
|
||||
<button type="submit" @if ($disabled !== null) disabled @endif wire:target="submit"
|
||||
wire:loading.delay.shorter.class="loading"
|
||||
@isset($confirm)
|
||||
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
|
||||
@endisset
|
||||
@isset($confirmAction)
|
||||
@isset($confirmAction)
|
||||
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
|
||||
@endisset>
|
||||
{{ $slot }}
|
||||
</button>
|
||||
{{ $slot }}
|
||||
</button>
|
||||
@elseif($type === 'button')
|
||||
<button {{ $attributes }} @if ($disabled !== null) disabled @endif type="button"
|
||||
wire:target="{{ explode('(', $attributes->whereStartsWith('wire:click')->first())[0] }}"
|
||||
wire:loading.delay.shorter.class="loading"
|
||||
@isset($confirm)
|
||||
x-on:click="toggleConfirmModal('{{ $confirm }}', '{{ explode('(', $confirmAction)[0] }}')"
|
||||
@endisset
|
||||
@isset($confirmAction)
|
||||
x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}"
|
||||
@endisset>
|
||||
{{ $slot }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user