From fbfecc8ebc139acae0c4d2ebb31cf7a5be3f87bb Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Mon, 20 Mar 2023 21:01:49 +0000 Subject: [PATCH] Add more screenshots --- docs-assets/app/app/Http/Livewire/Actions.php | 38 +++++++++++++++ .../views/livewire/actions.blade.php | 12 +++++ .../modal/confirmation-custom-text.jpg | Bin 0 -> 46634 bytes .../images/dark/actions/modal/form.jpg | Bin 0 -> 46847 bytes .../images/dark/actions/modal/slide-over.jpg | Bin 0 -> 31340 bytes .../modal/confirmation-custom-text.jpg | Bin 0 -> 52489 bytes .../light/actions/modal/confirmation.jpg | Bin 42899 -> 41486 bytes .../images/light/actions/modal/form.jpg | Bin 0 -> 53115 bytes .../images/light/actions/modal/slide-over.jpg | Bin 0 -> 32217 bytes docs-assets/screenshots/schema.js | 45 ++++++++++++++++++ docs-assets/screenshots/script.js | 3 ++ packages/actions/docs/04-modals.md | 14 ++++-- 12 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 docs-assets/screenshots/images/dark/actions/modal/confirmation-custom-text.jpg create mode 100644 docs-assets/screenshots/images/dark/actions/modal/form.jpg create mode 100644 docs-assets/screenshots/images/dark/actions/modal/slide-over.jpg create mode 100644 docs-assets/screenshots/images/light/actions/modal/confirmation-custom-text.jpg create mode 100644 docs-assets/screenshots/images/light/actions/modal/form.jpg create mode 100644 docs-assets/screenshots/images/light/actions/modal/slide-over.jpg diff --git a/docs-assets/app/app/Http/Livewire/Actions.php b/docs-assets/app/app/Http/Livewire/Actions.php index 01a98751f6..00ca03b710 100644 --- a/docs-assets/app/app/Http/Livewire/Actions.php +++ b/docs-assets/app/app/Http/Livewire/Actions.php @@ -5,6 +5,7 @@ namespace App\Http\Livewire; use Filament\Actions\Action; use Filament\Actions\Concerns\InteractsWithActions; use Filament\Actions\Contracts\HasActions; +use Filament\Forms\Components\Select; use Livewire\Component; class Actions extends Component implements HasActions @@ -70,6 +71,43 @@ class Actions extends Component implements HasActions ->action(fn () => null); } + public function confirmationModalCustomTextAction(): Action + { + return Action::make('confirmationModalCustomTextAction') + ->label('Delete') + ->color('danger') + ->requiresConfirmation() + ->modalHeading('Delete post') + ->modalSubheading('Are you sure you\'d like to delete this post? This cannot be undone.') + ->modalButton('Yes, delete it') + ->action(fn () => null); + } + + public function modalFormAction(): Action + { + return Action::make('modalFormAction') + ->label('Update author') + ->form([ + Select::make('authorId') + ->label('Author') + ->required(), + ]) + ->action(fn () => null); + } + + public function slideOverAction(): Action + { + return Action::make('slideOverAction') + ->label('Update author') + ->form([ + Select::make('authorId') + ->label('Author') + ->required(), + ]) + ->slideOver() + ->action(fn () => null); + } + public function render() { return view('livewire.actions'); diff --git a/docs-assets/app/resources/views/livewire/actions.blade.php b/docs-assets/app/resources/views/livewire/actions.blade.php index 660473596c..e358364c88 100644 --- a/docs-assets/app/resources/views/livewire/actions.blade.php +++ b/docs-assets/app/resources/views/livewire/actions.blade.php @@ -31,6 +31,18 @@
{{ $this->confirmationModalAction }}
+ +
+ {{ $this->confirmationModalCustomTextAction }} +
+ +
+ {{ $this->modalFormAction }} +
+ +
+ {{ $this->slideOverAction }} +
@endif