From e5ef58f779036f1f1721971d3f15f30b7a0d2006 Mon Sep 17 00:00:00 2001 From: Kenneth Sese Date: Wed, 13 Sep 2023 20:48:19 -0600 Subject: [PATCH 01/12] Add toolbar renderhooks and docs --- packages/support/docs/06-render-hooks.md | 12 ++++++++++++ .../tables/resources/views/index.blade.php | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index 91f42e6c06..7d0d80427f 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -77,6 +77,18 @@ FilamentView::registerRenderHook( - `panels::user-menu.profile.after` - After the profile item in the [user menu](../panels/navigation#customizing-the-user-menu) - `panels::user-menu.profile.before` - Before the profile item in the [user menu](../panels/navigation#customizing-the-user-menu) +### Table Builder render hooks + +- `tables::toolbar.reorder.start` - Before the table [reorder](../tables/advanced#reordering-records) container +- `tables::toolbar.reorder.end` - After the table [reorder](../tables/advanced#reordering-records) container +- `tables::toolbar.groups.start` - Before the table [group](../tables/grouping) container +- `tables::toolbar.groups.end` - After the table [group](../tables/grouping) container +- `tables::toolbar.search.start` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.search.end` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.columns.start` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) container +- `tables::toolbar.columns.end` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) container +- `tables::toolbar.end` - The end of the table toolbar + ## Scoping render hooks Some render hooks can be given a "scope", which allows them to only be output on a specific page or Livewire component. For instance, you might want to register a render hook for just 1 page. To do that, you can pass the class of the page or component as the second argument to `registerRenderHook()`: diff --git a/packages/tables/resources/views/index.blade.php b/packages/tables/resources/views/index.blade.php index f9ef786a93..0cc8776b88 100644 --- a/packages/tables/resources/views/index.blade.php +++ b/packages/tables/resources/views/index.blade.php @@ -180,6 +180,8 @@ class="fi-ta-header-toolbar flex items-center justify-between gap-3 px-4 py-3 sm:px-6" >
+ {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder.start') }} + @if ($isReorderable) @endif + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder.end') }} + @if ((! $isReordering) && count($bulkActions)) @endif + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.start') }} + @if (count($groups)) @endif + + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.end') }}
@if ($isGlobalSearchVisible || $hasFiltersDropdown || $hasColumnToggleDropdown) @@ -217,10 +225,14 @@ 'gap-x-4' => $filtersTriggerAction->isIconButton() && $toggleColumnsTriggerAction->isIconButton(), ]) > + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.start') }} + @if ($isGlobalSearchVisible) @endif + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.end') }} + @if ($hasFiltersDropdown || $hasColumnToggleDropdown) @if ($hasFiltersDropdown) @endif + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.columns.start') }} + @if ($hasColumnToggleDropdown) @endif + + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.columns.end') }} @endif @endif + + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.end') }} From 7a5c68fcd82b0c982f9ec13933cad5712cd4c66b Mon Sep 17 00:00:00 2001 From: Kenneth Sese Date: Thu, 14 Sep 2023 08:39:34 -0600 Subject: [PATCH 02/12] Naming updates and scopes --- packages/support/docs/06-render-hooks.md | 17 +++++++++-------- .../tables/resources/views/index.blade.php | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index 7d0d80427f..c22be4a955 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -79,15 +79,16 @@ FilamentView::registerRenderHook( ### Table Builder render hooks -- `tables::toolbar.reorder.start` - Before the table [reorder](../tables/advanced#reordering-records) container -- `tables::toolbar.reorder.end` - After the table [reorder](../tables/advanced#reordering-records) container -- `tables::toolbar.groups.start` - Before the table [group](../tables/grouping) container -- `tables::toolbar.groups.end` - After the table [group](../tables/grouping) container -- `tables::toolbar.search.start` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container -- `tables::toolbar.search.end` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container -- `tables::toolbar.columns.start` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) container -- `tables::toolbar.columns.end` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) container +- `tables::toolbar.start` - The start of the table toolbar - `tables::toolbar.end` - The end of the table toolbar +- `tables::toolbar.reorder-trigger.before` - Before the table [reorder](../tables/advanced#reordering-records) trigger +- `tables::toolbar.reorder-trigger.after` - After the table [reorder](../tables/advanced#reordering-records) trigger +- `tables::toolbar.groups.before` - Before the table [group](../tables/grouping) container +- `tables::toolbar.groups.after` - After the table [group](../tables/grouping) container +- `tables::toolbar.search.before` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.search.after` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.column-toggle.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger +- `tables::toolbar.column-toggle.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger ## Scoping render hooks diff --git a/packages/tables/resources/views/index.blade.php b/packages/tables/resources/views/index.blade.php index 0cc8776b88..125c493097 100644 --- a/packages/tables/resources/views/index.blade.php +++ b/packages/tables/resources/views/index.blade.php @@ -179,8 +179,10 @@ x-show="@js($hasHeaderToolbar) || (selectedRecords.length && @js(count($bulkActions)))" class="fi-ta-header-toolbar flex items-center justify-between gap-3 px-4 py-3 sm:px-6" > + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.start', scopes: [static::class]) }} +
- {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder.start') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.before', scopes: [static::class]) }} @if ($isReorderable) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder.end') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.after', scopes: [static::class]) }} @if ((! $isReordering) && count($bulkActions)) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.start') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.before', scopes: [static::class]) }} @if (count($groups)) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.end') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.after', scopes: [static::class]) }}
@if ($isGlobalSearchVisible || $hasFiltersDropdown || $hasColumnToggleDropdown) @@ -225,13 +227,13 @@ 'gap-x-4' => $filtersTriggerAction->isIconButton() && $toggleColumnsTriggerAction->isIconButton(), ]) > - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.start') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.before', scopes: [static::class]) }} @if ($isGlobalSearchVisible) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.end') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.after', scopes: [static::class]) }} @if ($hasFiltersDropdown || $hasColumnToggleDropdown) @if ($hasFiltersDropdown) @@ -244,7 +246,7 @@ /> @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.columns.start') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.before', scopes: [static::class]) }} @if ($hasColumnToggleDropdown) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.columns.end') }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.after', scopes: [static::class]) }} @endif @endif From eef7cacacfa2c90d9e82dd77e73838157d7e9ab0 Mon Sep 17 00:00:00 2001 From: Kenneth Sese Date: Thu, 14 Sep 2023 08:49:59 -0600 Subject: [PATCH 03/12] Remove array Didn't need to add these as an array --- .../tables/resources/views/index.blade.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/tables/resources/views/index.blade.php b/packages/tables/resources/views/index.blade.php index 125c493097..d2801e8f52 100644 --- a/packages/tables/resources/views/index.blade.php +++ b/packages/tables/resources/views/index.blade.php @@ -179,10 +179,10 @@ x-show="@js($hasHeaderToolbar) || (selectedRecords.length && @js(count($bulkActions)))" class="fi-ta-header-toolbar flex items-center justify-between gap-3 px-4 py-3 sm:px-6" > - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.start', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.start', scopes: static::class) }}
- {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.before', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.before', scopes: static::class) }} @if ($isReorderable) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.after', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.reorder-trigger.after', scopes: static::class) }} @if ((! $isReordering) && count($bulkActions)) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.before', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.before', scopes: static::class) }} @if (count($groups)) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.after', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.after', scopes: static::class) }}
@if ($isGlobalSearchVisible || $hasFiltersDropdown || $hasColumnToggleDropdown) @@ -227,13 +227,13 @@ 'gap-x-4' => $filtersTriggerAction->isIconButton() && $toggleColumnsTriggerAction->isIconButton(), ]) > - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.before', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.before', scopes: static::class) }} @if ($isGlobalSearchVisible) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.after', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.search.after', scopes: static::class) }} @if ($hasFiltersDropdown || $hasColumnToggleDropdown) @if ($hasFiltersDropdown) @@ -246,7 +246,7 @@ /> @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.before', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.before', scopes: static::class) }} @if ($hasColumnToggleDropdown) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.after', scopes: [static::class]) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.after', scopes: static::class) }} @endif @endif From f77461357e47f93051fd51d6ad0b255909277242 Mon Sep 17 00:00:00 2001 From: Kenneth Sese Date: Thu, 14 Sep 2023 09:04:50 -0600 Subject: [PATCH 04/12] Add additional info about scoping --- packages/support/docs/06-render-hooks.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index c22be4a955..ba63e69778 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -79,16 +79,16 @@ FilamentView::registerRenderHook( ### Table Builder render hooks -- `tables::toolbar.start` - The start of the table toolbar -- `tables::toolbar.end` - The end of the table toolbar -- `tables::toolbar.reorder-trigger.before` - Before the table [reorder](../tables/advanced#reordering-records) trigger -- `tables::toolbar.reorder-trigger.after` - After the table [reorder](../tables/advanced#reordering-records) trigger -- `tables::toolbar.groups.before` - Before the table [group](../tables/grouping) container -- `tables::toolbar.groups.after` - After the table [group](../tables/grouping) container -- `tables::toolbar.search.before` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container -- `tables::toolbar.search.after` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container -- `tables::toolbar.column-toggle.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger -- `tables::toolbar.column-toggle.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger +- `tables::toolbar.start` - The start of the table toolbar, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.end` - The end of the table toolbar, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.reorder-trigger.before` - Before the table [reorder](../tables/advanced#reordering-records) trigger, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.reorder-trigger.after` - After the table [reorder](../tables/advanced#reordering-records) trigger, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.groups.before` - Before the table [group](../tables/grouping) container, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.groups.after` - After the table [group](../tables/grouping) container, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.search.before` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.search.after` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.column-toggle.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.column-toggle.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class ## Scoping render hooks From 3fdaf6dad42246f7bd56a668a7ac590576fd6c31 Mon Sep 17 00:00:00 2001 From: Kenneth Sese Date: Thu, 14 Sep 2023 09:05:57 -0600 Subject: [PATCH 05/12] Add renderhooks before and after the table widget --- packages/support/docs/06-render-hooks.md | 5 +++++ packages/widgets/resources/views/table-widget.blade.php | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index 91f42e6c06..78f08fa8c5 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -77,6 +77,11 @@ FilamentView::registerRenderHook( - `panels::user-menu.profile.after` - After the profile item in the [user menu](../panels/navigation#customizing-the-user-menu) - `panels::user-menu.profile.before` - Before the profile item in the [user menu](../panels/navigation#customizing-the-user-menu) +### Widgets render hooks + +- `widgets::table-widget.after` - After the [table widget](../panels/dashboard#table-widgets), also [can be scoped](#scoping-render-hooks) to the table widget class +- `widgets::table-widget.before` - Before the [table widget](../panels/dashboard#table-widgets), also [can be scoped](#scoping-render-hooks) to the table widget class + ## Scoping render hooks Some render hooks can be given a "scope", which allows them to only be output on a specific page or Livewire component. For instance, you might want to register a render hook for just 1 page. To do that, you can pass the class of the page or component as the second argument to `registerRenderHook()`: diff --git a/packages/widgets/resources/views/table-widget.blade.php b/packages/widgets/resources/views/table-widget.blade.php index bf15f9cd9b..06ba018d32 100644 --- a/packages/widgets/resources/views/table-widget.blade.php +++ b/packages/widgets/resources/views/table-widget.blade.php @@ -1,3 +1,7 @@ + {{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.before', scopes: static::class) }} + {{ $this->table }} + + {{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.after', scopes: static::class) }} From 188e272156c3109562ad2cd8859b6f5d2bb17066 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Mon, 18 Sep 2023 09:18:26 +0100 Subject: [PATCH 06/12] Apply suggestions from code review --- packages/support/docs/06-render-hooks.md | 4 ++-- packages/tables/resources/views/index.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index ba63e69778..8136f752b8 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -87,8 +87,8 @@ FilamentView::registerRenderHook( - `tables::toolbar.groups.after` - After the table [group](../tables/grouping) container, also [can be scoped](#scoping-render-hooks) to the table class - `tables::toolbar.search.before` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container, also [can be scoped](#scoping-render-hooks) to the table class - `tables::toolbar.search.after` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.column-toggle.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.column-toggle.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.toggle-column-trigger.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class +- `tables::toolbar.toggle-column-trigger.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class ## Scoping render hooks diff --git a/packages/tables/resources/views/index.blade.php b/packages/tables/resources/views/index.blade.php index d2801e8f52..5d55dcf170 100644 --- a/packages/tables/resources/views/index.blade.php +++ b/packages/tables/resources/views/index.blade.php @@ -246,7 +246,7 @@ /> @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.before', scopes: static::class) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.toggle-column-trigger.before', scopes: static::class) }} @if ($hasColumnToggleDropdown) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.column-toggle.after', scopes: static::class) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.toggle-column-trigger.after', scopes: static::class) }} @endif @endif From 4534955696a13bd1bd6475548995c37a3c9d1a65 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Mon, 18 Sep 2023 09:20:42 +0100 Subject: [PATCH 07/12] Update 06-render-hooks.md --- packages/support/docs/06-render-hooks.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index 8136f752b8..26febb0c92 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -79,16 +79,18 @@ FilamentView::registerRenderHook( ### Table Builder render hooks -- `tables::toolbar.start` - The start of the table toolbar, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.end` - The end of the table toolbar, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.reorder-trigger.before` - Before the table [reorder](../tables/advanced#reordering-records) trigger, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.reorder-trigger.after` - After the table [reorder](../tables/advanced#reordering-records) trigger, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.groups.before` - Before the table [group](../tables/grouping) container, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.groups.after` - After the table [group](../tables/grouping) container, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.search.before` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.search.after` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.toggle-column-trigger.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class -- `tables::toolbar.toggle-column-trigger.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger, also [can be scoped](#scoping-render-hooks) to the table class +All these render hooks [can be scoped](#scoping-render-hooks) to any table Livewire component class. When using the Panel Builder, these classes might be the List or Manage page of a resource, or a relation manager. Table widgets are also Livewire component classes. + +- `tables::toolbar.start` - The start of the table toolbar +- `tables::toolbar.end` - The end of the table toolbar +- `tables::toolbar.reorder-trigger.before` - Before the table [reorder](../tables/advanced#reordering-records) trigger +- `tables::toolbar.reorder-trigger.after` - After the table [reorder](../tables/advanced#reordering-records) trigger +- `tables::toolbar.groups.before` - Before the table [group](../tables/grouping) container +- `tables::toolbar.groups.after` - After the table [group](../tables/grouping) container +- `tables::toolbar.search.before` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.search.after` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.toggle-column-trigger.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger +- `tables::toolbar.toggle-column-trigger.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger ## Scoping render hooks From aa6619ca16a5a2aa3bde14fb9924396206e3bf38 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Mon, 18 Sep 2023 09:31:45 +0100 Subject: [PATCH 08/12] Update 06-render-hooks.md --- packages/support/docs/06-render-hooks.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index 26febb0c92..e9754740cf 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -81,16 +81,16 @@ FilamentView::registerRenderHook( All these render hooks [can be scoped](#scoping-render-hooks) to any table Livewire component class. When using the Panel Builder, these classes might be the List or Manage page of a resource, or a relation manager. Table widgets are also Livewire component classes. -- `tables::toolbar.start` - The start of the table toolbar -- `tables::toolbar.end` - The end of the table toolbar -- `tables::toolbar.reorder-trigger.before` - Before the table [reorder](../tables/advanced#reordering-records) trigger -- `tables::toolbar.reorder-trigger.after` - After the table [reorder](../tables/advanced#reordering-records) trigger -- `tables::toolbar.groups.before` - Before the table [group](../tables/grouping) container -- `tables::toolbar.groups.after` - After the table [group](../tables/grouping) container -- `tables::toolbar.search.before` - Before the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container -- `tables::toolbar.search.after` - After the table [search](../tables/getting-started#making-columns-sortable-and-searchable) container -- `tables::toolbar.toggle-column-trigger.before` - Before the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger -- `tables::toolbar.toggle-column-trigger.after` - After the table [toggled columns](../tables/columns/getting-started#toggling-column-visibility) trigger +- `tables::toolbar.end` - The end of the toolbar +- `tables::toolbar.grouping-selector.after` - After the [grouping](../tables/grouping) selector +- `tables::toolbar.grouping-selector.before` - Before the [grouping](../tables/grouping) selector +- `tables::toolbar.reorder-trigger.after` - After the [reorder](../tables/advanced#reordering-records) trigger +- `tables::toolbar.reorder-trigger.before` - Before the [reorder](../tables/advanced#reordering-records) trigger +- `tables::toolbar.search.after` - After the [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.search.before` - Before the [search](../tables/getting-started#making-columns-sortable-and-searchable) container +- `tables::toolbar.start` - The start of the toolbar +- `tables::toolbar.toggle-column-trigger.after` - After the [toggle columns](../tables/columns/getting-started#toggling-column-visibility) trigger +- `tables::toolbar.toggle-column-trigger.before` - Before the [toggle columns](../tables/columns/getting-started#toggling-column-visibility) trigger ## Scoping render hooks From 61413866ded67cd9e545b53877e0cf4d5c9f5b84 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Mon, 18 Sep 2023 09:32:29 +0100 Subject: [PATCH 09/12] Apply suggestions from code review --- packages/tables/resources/views/index.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tables/resources/views/index.blade.php b/packages/tables/resources/views/index.blade.php index 5d55dcf170..f6ec520088 100644 --- a/packages/tables/resources/views/index.blade.php +++ b/packages/tables/resources/views/index.blade.php @@ -206,7 +206,7 @@ /> @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.before', scopes: static::class) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.grouping-selector.before', scopes: static::class) }} @if (count($groups)) @endif - {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.groups.after', scopes: static::class) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.grouping-selector.after', scopes: static::class) }} @if ($isGlobalSearchVisible || $hasFiltersDropdown || $hasColumnToggleDropdown) From bb40df3c2194352b9ad2054b8ec0e3860356a647 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Mon, 18 Sep 2023 09:33:53 +0100 Subject: [PATCH 10/12] Update table-widget.blade.php --- packages/widgets/resources/views/table-widget.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/widgets/resources/views/table-widget.blade.php b/packages/widgets/resources/views/table-widget.blade.php index 06ba018d32..f2caa66d5a 100644 --- a/packages/widgets/resources/views/table-widget.blade.php +++ b/packages/widgets/resources/views/table-widget.blade.php @@ -1,7 +1,7 @@ - {{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.before', scopes: static::class) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.start', scopes: static::class) }} {{ $this->table }} - {{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.after', scopes: static::class) }} + {{ \Filament\Support\Facades\FilamentView::renderHook('widgets::table-widget.end', scopes: static::class) }} From f5ffb49bfe8a3a451b7283d1c8f1ae866e30905b Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Mon, 18 Sep 2023 09:34:37 +0100 Subject: [PATCH 11/12] Update 06-render-hooks.md --- packages/support/docs/06-render-hooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/support/docs/06-render-hooks.md b/packages/support/docs/06-render-hooks.md index 78f08fa8c5..f014346d70 100644 --- a/packages/support/docs/06-render-hooks.md +++ b/packages/support/docs/06-render-hooks.md @@ -79,8 +79,8 @@ FilamentView::registerRenderHook( ### Widgets render hooks -- `widgets::table-widget.after` - After the [table widget](../panels/dashboard#table-widgets), also [can be scoped](#scoping-render-hooks) to the table widget class -- `widgets::table-widget.before` - Before the [table widget](../panels/dashboard#table-widgets), also [can be scoped](#scoping-render-hooks) to the table widget class +- `widgets::table-widget.end` - End of the [table widget](../panels/dashboard#table-widgets), after the table itself, also [can be scoped](#scoping-render-hooks) to the table widget class +- `widgets::table-widget.start` - Start of the [table widget](../panels/dashboard#table-widgets), before the table itself, also [can be scoped](#scoping-render-hooks) to the table widget class ## Scoping render hooks From d3488cb4d2cb16f8921a56ac72c5fa72524946f0 Mon Sep 17 00:00:00 2001 From: danharrin Date: Mon, 18 Sep 2023 08:38:02 +0000 Subject: [PATCH 12/12] chore: fix code style --- packages/tables/resources/views/index.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tables/resources/views/index.blade.php b/packages/tables/resources/views/index.blade.php index b23151bc3f..01617c59d4 100644 --- a/packages/tables/resources/views/index.blade.php +++ b/packages/tables/resources/views/index.blade.php @@ -216,7 +216,7 @@ :trigger-action="$getGroupRecordsTriggerAction()" /> @endif - + {{ \Filament\Support\Facades\FilamentView::renderHook('tables::toolbar.grouping-selector.after', scopes: static::class) }}