-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<x-tall::modal :showClose="false"> | ||
<x-slot name="title">{!! $title !!}</x-slot> | ||
|
||
<div class=""> | ||
{!! $message !!} | ||
</div> | ||
|
||
<x-slot name="actions"> | ||
<x-tall::button.flat style="secondary" wire:click="cancel()" class="mr-2">{{$cancelText}}</x-tall::button.flat> | ||
<x-tall::button style="{{$style}}" wire:click="confirm()">{{$confirmText}}</x-tall::button> | ||
</x-slot> | ||
</x-tall::modal> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Tall; | ||
|
||
use LivewireUI\Modal\ModalComponent; | ||
|
||
class ConfirmationDialog extends ModalComponent | ||
{ | ||
public $message; | ||
public $title; | ||
public $confirmText = 'OK'; | ||
public $cancelText = 'Cancel'; | ||
public $event = 'confirmed'; | ||
public $data; | ||
public $style = 'primary'; | ||
|
||
public function confirm() | ||
{ | ||
$this->closeModalWithEvents([ | ||
[$this->event, [true, $this->data]] | ||
]); | ||
} | ||
|
||
public function cancel() | ||
{ | ||
$this->closeModalWithEvents([ | ||
[$this->event, [false, $this->data]] | ||
]); | ||
} | ||
|
||
public static function closeModalOnEscape(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public static function closeModalOnClickAway(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function mount() | ||
{ | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('tall::confirmation-dialog'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters